From f74832ce17503b99ee11a193ad03b8585f5651cb Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 5 Mar 2021 10:26:10 +0100 Subject: [PATCH] Fix local e2e tests --- client/e2e/local-protractor.conf.js | 2 +- client/e2e/src/po/app.po.ts | 2 ++ client/e2e/src/po/player.po.ts | 9 ++++----- client/e2e/src/videos.e2e-spec.ts | 1 + 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/client/e2e/local-protractor.conf.js b/client/e2e/local-protractor.conf.js index 6120dab8c..5080f2528 100644 --- a/client/e2e/local-protractor.conf.js +++ b/client/e2e/local-protractor.conf.js @@ -38,7 +38,7 @@ exports.config = { } ], - // maxSessions: 1, + maxSessions: 1, baseUrl: 'http://localhost:3000/', framework: 'jasmine', jasmineNodeOpts: { diff --git a/client/e2e/src/po/app.po.ts b/client/e2e/src/po/app.po.ts index 4954880ef..3ed65399e 100644 --- a/client/e2e/src/po/app.po.ts +++ b/client/e2e/src/po/app.po.ts @@ -9,6 +9,8 @@ export class AppPage { await element(by.css('.configure-instance-button')).click() + await browser.sleep(5000) + await browser.switchTo().window(firstHandle) } } diff --git a/client/e2e/src/po/player.po.ts b/client/e2e/src/po/player.po.ts index 48e61dfea..cb148a003 100644 --- a/client/e2e/src/po/player.po.ts +++ b/client/e2e/src/po/player.po.ts @@ -3,11 +3,10 @@ import { browserSleep, isIOS, isMobileDevice, isSafari } from '../utils' export class PlayerPage { - getWatchVideoPlayerCurrentTime () { - return element(by.css('.video-js .vjs-current-time-display')) - .getText() - .then((t: string) => t.split(':')[1]) - .then(seconds => parseInt(seconds, 10)) + async getWatchVideoPlayerCurrentTime () { + const elem = element(by.css('video')) + + return elem.getAttribute('currentTime') } waitUntilPlaylistInfo (text: string) { diff --git a/client/e2e/src/videos.e2e-spec.ts b/client/e2e/src/videos.e2e-spec.ts index 4fccdf1b6..cb7926258 100644 --- a/client/e2e/src/videos.e2e-spec.ts +++ b/client/e2e/src/videos.e2e-spec.ts @@ -158,6 +158,7 @@ describe('Videos workflow', () => { await videoWatchPage.createPlaylist(playlistName) await videoWatchPage.saveToPlaylist(playlistName) + await browser.sleep(5000) await videoUploadPage.navigateTo()