]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/e2e/src/po/video-watch.po.ts
Use HLS by default if enabled
[github/Chocobozzz/PeerTube.git] / client / e2e / src / po / video-watch.po.ts
index 13f4ae94592618e04c7d1bd10703ec61e406d144..8369e14863a674606dd8d9911fe55f7e3fd310ca 100644 (file)
@@ -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, isMobileDevice: 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))
@@ -94,4 +97,8 @@ export class VideoWatchPage {
 
     return browser.get(url)
   }
+
+  async goOnP2PMediaLoaderEmbed () {
+    return browser.get('https://peertube2.cpy.re/videos/embed/4b997fc0-e106-42d9-bff9-ae9d64902bbb?mode=p2p-media-loader')
+  }
 }