Skip to content

Instantly share code, notes, and snippets.

View JohnMCrooks's full-sized avatar

John Crooks JohnMCrooks

  • onX Maps
  • Charleston, SC
View GitHub Profile
@JohnMCrooks
JohnMCrooks / CypressVideoAction.js
Last active April 27, 2020 19:45
Using Cypress.io, The goal is to let a video play to a certain point then continue with whatever the rest of the test script needs. Trying to figure out how how to use properties in combination with aliases appropriately.
letVideoPlayToXPercent(percent: number = 0.25, detectLoop?: boolean) {
cy.get(selectors.VIDEO_ELEMENTS)
.first()
.as('targetVideo')
.invoke('prop', 'currentTime')
.as('currentTime')
.get('@targetVideo')
.invoke('prop', 'duration')
.as('duration')
.then((duration) => {