aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/e2e/src/po
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-05-13 10:15:31 +0200
committerChocobozzz <me@florianbigard.com>2020-05-13 10:15:31 +0200
commit0845e480d25a644661cb4e0eed366719289ebc37 (patch)
treea7c0669a7c511a9c9000734d15ec9f6810be4869 /client/e2e/src/po
parent943fddfbbe5b3c04620b230d606bfd0f8a58f3ff (diff)
downloadPeerTube-0845e480d25a644661cb4e0eed366719289ebc37.tar.gz
PeerTube-0845e480d25a644661cb4e0eed366719289ebc37.tar.zst
PeerTube-0845e480d25a644661cb4e0eed366719289ebc37.zip
Cleanup E2E tests
Diffstat (limited to 'client/e2e/src/po')
-rw-r--r--client/e2e/src/po/video-watch.po.ts13
1 files changed, 7 insertions, 6 deletions
diff --git a/client/e2e/src/po/video-watch.po.ts b/client/e2e/src/po/video-watch.po.ts
index bcfceefbc..35ec773af 100644
--- a/client/e2e/src/po/video-watch.po.ts
+++ b/client/e2e/src/po/video-watch.po.ts
@@ -1,5 +1,5 @@
1import { browser, by, element, ElementFinder, ExpectedConditions } from 'protractor' 1import { browser, by, element, ElementFinder, ExpectedConditions } from 'protractor'
2import { browserSleep } from '../utils' 2import { browserSleep, isIOS, isMobileDevice } from '../utils'
3 3
4export class VideoWatchPage { 4export class VideoWatchPage {
5 async goOnVideosList (isMobileDevice: boolean, isSafari: boolean) { 5 async goOnVideosList (isMobileDevice: boolean, isSafari: boolean) {
@@ -48,22 +48,23 @@ export class VideoWatchPage {
48 return this.getVideoNameElement().getText() 48 return this.getVideoNameElement().getText()
49 } 49 }
50 50
51 async playAndPauseVideo (isAutoplay: boolean, isMobileDevice: boolean) { 51 async playAndPauseVideo (isAutoplay: boolean) {
52 if (isAutoplay === false) { 52 // Autoplay is disabled on iOS
53 if (isAutoplay === false || await isIOS()) {
53 const playButton = element(by.css('.vjs-big-play-button')) 54 const playButton = element(by.css('.vjs-big-play-button'))
54 await browser.wait(browser.ExpectedConditions.elementToBeClickable(playButton)) 55 await browser.wait(browser.ExpectedConditions.elementToBeClickable(playButton))
55 await playButton.click() 56 await playButton.click()
56 } 57 }
57 58
58 await browserSleep(1000) 59 await browserSleep(2000)
59 await browser.wait(browser.ExpectedConditions.invisibilityOf(element(by.css('.vjs-loading-spinner')))) 60 await browser.wait(browser.ExpectedConditions.invisibilityOf(element(by.css('.vjs-loading-spinner'))))
60 61
61 const videojsEl = element(by.css('div.video-js')) 62 const videojsEl = element(by.css('div.video-js'))
62 await browser.wait(browser.ExpectedConditions.elementToBeClickable(videojsEl)) 63 await browser.wait(browser.ExpectedConditions.elementToBeClickable(videojsEl))
63 64
64 // On Android, we need to click twice on "play" (BrowserStack particularity) 65 // On Android, we need to click twice on "play" (BrowserStack particularity)
65 if (isMobileDevice) { 66 if (await isMobileDevice()) {
66 await browserSleep(3000) 67 await browserSleep(5000)
67 68
68 await videojsEl.click() 69 await videojsEl.click()
69 } 70 }