X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fe2e%2Fsrc%2Fpo%2Fvideo-watch.po.ts;h=5f61d566883b1bd7c7a1e4e46347acbda2083e57;hb=1600235a2f4e30c5d4e7d4342d1c299845decc60;hp=ec3d16c3b2b2b309aee36beccc3c5c6afd8d8187;hpb=1fad099d72584ae54701603729339a3cd1cf0d52;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/e2e/src/po/video-watch.po.ts b/client/e2e/src/po/video-watch.po.ts index ec3d16c3b..5f61d5668 100644 --- a/client/e2e/src/po/video-watch.po.ts +++ b/client/e2e/src/po/video-watch.po.ts @@ -1,4 +1,4 @@ -import { by, element, browser } from 'protractor' +import { browser, by, element } from 'protractor' export class VideoWatchPage { async goOnVideosList (isMobileDevice: boolean, isSafari: boolean) { @@ -23,11 +23,14 @@ export class VideoWatchPage { getVideosListName () { return element.all(by.css('.videos .video-miniature .video-miniature-name')) .getText() - .then((texts: any) => texts.map(t => t.trim())) + .then((texts: any) => texts.map((t: any) => t.trim())) } - waitWatchVideoName (videoName: string, isSafari: boolean) { - const elem = element(by.css('.video-info .video-info-name')) + waitWatchVideoName (videoName: string, isMobileDevice: boolean, isSafari: boolean) { + // On mobile we display the first node, on desktop the second + const index = isMobileDevice ? 0 : 1 + + const elem = element.all(by.css('.video-info .video-info-name')).get(index) if (isSafari) return browser.sleep(5000) @@ -41,24 +44,25 @@ export class VideoWatchPage { .then(seconds => parseInt(seconds, 10)) } - async pauseVideo (isAutoplay: boolean, isDesktopSafari: boolean) { + async playAndPauseVideo (isAutoplay: boolean, isMobileDevice: boolean) { if (isAutoplay === false) { const playButton = element(by.css('.vjs-big-play-button')) await browser.wait(browser.ExpectedConditions.elementToBeClickable(playButton)) await playButton.click() } - // if (isDesktopSafari === true) { - // await browser.sleep(1000) - // await element(by.css('.vjs-play-control')).click() - // } - await browser.sleep(1000) await browser.wait(browser.ExpectedConditions.invisibilityOf(element(by.css('.vjs-loading-spinner')))) const videojsEl = element(by.css('div.video-js')) await browser.wait(browser.ExpectedConditions.elementToBeClickable(videojsEl)) + // On Android, we need to click twice on "play" (BrowserStack particularity) + if (isMobileDevice) { + await browser.sleep(3000) + await videojsEl.click() + } + await browser.sleep(7000) return videojsEl.click() @@ -93,4 +97,8 @@ export class VideoWatchPage { return browser.get(url) } + + async goOnP2PMediaLoaderEmbed () { + return browser.get('https://peertube2.cpy.re/videos/embed/969bf103-7818-43b5-94a0-de159e13de50?mode=p2p-media-loader') + } }