]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Add live play tests
authorChocobozzz <me@florianbigard.com>
Fri, 24 Jun 2022 12:52:54 +0000 (14:52 +0200)
committerChocobozzz <me@florianbigard.com>
Fri, 24 Jun 2022 12:52:54 +0000 (14:52 +0200)
client/e2e/src/suites-all/live.e2e-spec.ts [new file with mode: 0644]
client/e2e/src/utils/urls.ts

diff --git a/client/e2e/src/suites-all/live.e2e-spec.ts b/client/e2e/src/suites-all/live.e2e-spec.ts
new file mode 100644 (file)
index 0000000..31ec119
--- /dev/null
@@ -0,0 +1,35 @@
+import { PlayerPage } from '../po/player.po'
+import { VideoWatchPage } from '../po/video-watch.po'
+import { FIXTURE_URLS, go, isMobileDevice, isSafari } from '../utils'
+
+describe('Live all workflow', () => {
+  let videoWatchPage: VideoWatchPage
+  let playerPage: PlayerPage
+
+  beforeEach(async () => {
+    videoWatchPage = new VideoWatchPage(isMobileDevice(), isSafari())
+    playerPage = new PlayerPage()
+
+    if (!isMobileDevice()) {
+      await browser.maximizeWindow()
+    }
+  })
+
+  it('Should go to the live page', async () => {
+    await go(FIXTURE_URLS.LIVE_VIDEO)
+
+    return videoWatchPage.waitWatchVideoName('E2E - Live')
+  })
+
+  it('Should play the live', async () => {
+    await playerPage.playAndPauseVideo(false, 45)
+    expect(await playerPage.getWatchVideoPlayerCurrentTime()).toBeGreaterThanOrEqual(45)
+  })
+
+  it('Should watch the associated live embed', async () => {
+    await videoWatchPage.goOnAssociatedEmbed()
+
+    await playerPage.playAndPauseVideo(false, 45)
+    expect(await playerPage.getWatchVideoPlayerCurrentTime()).toBeGreaterThanOrEqual(45)
+  })
+})
index 664c6593162867e17216bc2690a6e96ebb5d4c6a..e82ff1b2e2a7bebf04c61f7587a40fd565b55c96 100644 (file)
@@ -2,7 +2,9 @@ const FIXTURE_URLS = {
   WEBTORRENT_VIDEO: 'https://peertube2.cpy.re/w/122d093a-1ede-43bd-bd34-59d2931ffc5e',
 
   HLS_EMBED: 'https://peertube2.cpy.re/videos/embed/969bf103-7818-43b5-94a0-de159e13de50',
-  HLS_PLAYLIST_EMBED: 'https://peertube2.cpy.re/video-playlists/embed/73804a40-da9a-40c2-b1eb-2c6d9eec8f0a'
+  HLS_PLAYLIST_EMBED: 'https://peertube2.cpy.re/video-playlists/embed/73804a40-da9a-40c2-b1eb-2c6d9eec8f0a',
+
+  LIVE_VIDEO: 'https://peertube2.cpy.re/w/oBw6LwsMWWRkmXYfuYRpJd'
 }
 
 export {