X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fe2e%2Fsrc%2Fpo%2Fvideo-watch.po.ts;h=5f61d566883b1bd7c7a1e4e46347acbda2083e57;hb=1600235a2f4e30c5d4e7d4342d1c299845decc60;hp=5bb7e5694163a945b2c8fa80e1423258c78000a0;hpb=b528582df28f20ec7481d3c73d16b4291fe9c7e7;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 5bb7e5694..5f61d5668 100644 --- a/client/e2e/src/po/video-watch.po.ts +++ b/client/e2e/src/po/video-watch.po.ts @@ -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,7 +44,7 @@ export class VideoWatchPage { .then(seconds => parseInt(seconds, 10)) } - async pauseVideo (isAutoplay: 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)) @@ -54,6 +57,12 @@ export class VideoWatchPage { 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() @@ -88,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') + } }