Skip to content

Commit

Permalink
Improve reliability
Browse files Browse the repository at this point in the history
  • Loading branch information
compulim committed Nov 1, 2019
1 parent d36f386 commit 0a002e5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 13 additions & 1 deletion __tests__/video.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,25 @@ test('video', async () => {

await pageObjects.switchToYouTubeIFRAME();

// Play the video
await clickButton(driver, By.css('button[aria-label="Play"]'));

// Wait until the video complete buffered and start playing
await driver.sleep(5000);

// Pause the video
await clickButton(driver, By.css('button[aria-label="Pause (k)"]'));

// Rewind for 10 seconds
await driver
.actions()
.sendKeys('j')
.perform();

// Hide the spinner animation
await driver.executeScript(() => document.querySelector('.ytp-spinner').remove());

// Wait for YouTube play/pause button animation to complete
// Wait for YouTube play/pause/rewind animation to complete
await driver.sleep(1000);

const base64PNG = await driver.takeScreenshot();
Expand Down

0 comments on commit 0a002e5

Please sign in to comment.