diff options
author | Chocobozzz <me@florianbigard.com> | 2021-09-02 08:57:59 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-09-02 09:07:42 +0200 |
commit | 12d6b873cd4c5eb8c4fd298885e0c7fa6deb3756 (patch) | |
tree | 1abc21b305242e1d5bacefc99c2352b34396a5ab /client/e2e/src/po/player.po.ts | |
parent | 6527eb0ccf823b5eac547c90066d3bd693094b2c (diff) | |
download | PeerTube-12d6b873cd4c5eb8c4fd298885e0c7fa6deb3756.tar.gz PeerTube-12d6b873cd4c5eb8c4fd298885e0c7fa6deb3756.tar.zst PeerTube-12d6b873cd4c5eb8c4fd298885e0c7fa6deb3756.zip |
Improve e2e workflow and add doc
Diffstat (limited to 'client/e2e/src/po/player.po.ts')
-rw-r--r-- | client/e2e/src/po/player.po.ts | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/client/e2e/src/po/player.po.ts b/client/e2e/src/po/player.po.ts index 9d6e21009..372e8ab20 100644 --- a/client/e2e/src/po/player.po.ts +++ b/client/e2e/src/po/player.po.ts | |||
@@ -5,13 +5,12 @@ export class PlayerPage { | |||
5 | getWatchVideoPlayerCurrentTime () { | 5 | getWatchVideoPlayerCurrentTime () { |
6 | const elem = $('video') | 6 | const elem = $('video') |
7 | 7 | ||
8 | if (isIOS()) { | 8 | const p = isIOS() |
9 | return elem.getAttribute('currentTime') | 9 | ? elem.getAttribute('currentTime') |
10 | .then(t => parseInt(t, 10)) | 10 | : elem.getProperty('currentTime') |
11 | .then(t => Math.round(t)) | ||
12 | } | ||
13 | 11 | ||
14 | return elem.getProperty('currentTime') | 12 | return p.then(t => parseInt(t + '', 10)) |
13 | .then(t => Math.ceil(t)) | ||
15 | } | 14 | } |
16 | 15 | ||
17 | waitUntilPlaylistInfo (text: string, maxTime: number) { | 16 | waitUntilPlaylistInfo (text: string, maxTime: number) { |
@@ -26,7 +25,7 @@ export class PlayerPage { | |||
26 | }) | 25 | }) |
27 | } | 26 | } |
28 | 27 | ||
29 | async playAndPauseVideo (isAutoplay: boolean) { | 28 | async playAndPauseVideo (isAutoplay: boolean, waitUntilSec: number) { |
30 | const videojsElem = () => $('div.video-js') | 29 | const videojsElem = () => $('div.video-js') |
31 | 30 | ||
32 | await videojsElem().waitForExist() | 31 | await videojsElem().waitForExist() |
@@ -43,10 +42,8 @@ export class PlayerPage { | |||
43 | await browserSleep(2000) | 42 | await browserSleep(2000) |
44 | 43 | ||
45 | await browser.waitUntil(async () => { | 44 | await browser.waitUntil(async () => { |
46 | return !await $('.vjs-loading-spinner').isDisplayedInViewport() | 45 | return (await this.getWatchVideoPlayerCurrentTime()) >= 2 |
47 | }, { timeout: 20 * 1000 }) | 46 | }) |
48 | |||
49 | await browserSleep(4000) | ||
50 | 47 | ||
51 | await videojsElem().click() | 48 | await videojsElem().click() |
52 | } | 49 | } |