1 import { LoginPage } from '../po/login.po'
2 import { PlayerPage } from '../po/player.po'
3 import { VideoWatchPage } from '../po/video-watch.po'
4 import { FIXTURE_URLS, go, isMobileDevice, isSafari } from '../utils'
6 async function checkCorrectlyPlay (playerPage: PlayerPage) {
7 await playerPage.playAndPauseVideo(false, 2)
9 expect(await playerPage.getWatchVideoPlayerCurrentTime()).toBeGreaterThanOrEqual(2)
12 describe('Private videos all workflow', () => {
13 let videoWatchPage: VideoWatchPage
14 let loginPage: LoginPage
15 let playerPage: PlayerPage
17 const internalVideoName = 'Internal E2E test'
18 const internalHLSOnlyVideoName = 'Internal E2E test - HLS only'
20 beforeEach(async () => {
21 videoWatchPage = new VideoWatchPage(isMobileDevice(), isSafari())
22 loginPage = new LoginPage(isMobileDevice())
23 playerPage = new PlayerPage()
25 if (!isMobileDevice()) {
26 await browser.maximizeWindow()
30 it('Should log in', async () => {
31 return loginPage.loginOnPeerTube2()
34 it('Should play an internal webtorrent video', async () => {
35 await go(FIXTURE_URLS.INTERNAL_WEBTORRENT_VIDEO)
37 await videoWatchPage.waitWatchVideoName(internalVideoName)
38 await checkCorrectlyPlay(playerPage)
41 it('Should play an internal HLS video', async () => {
42 await go(FIXTURE_URLS.INTERNAL_HLS_VIDEO)
44 await videoWatchPage.waitWatchVideoName(internalVideoName)
45 await checkCorrectlyPlay(playerPage)
48 it('Should play an internal HLS only video', async () => {
49 await go(FIXTURE_URLS.INTERNAL_HLS_ONLY_VIDEO)
51 await videoWatchPage.waitWatchVideoName(internalHLSOnlyVideoName)
52 await checkCorrectlyPlay(playerPage)
55 it('Should play an internal WebTorrent video in embed', async () => {
56 await go(FIXTURE_URLS.INTERNAL_EMBED_WEBTORRENT_VIDEO)
58 await videoWatchPage.waitEmbedForDisplayed()
59 await checkCorrectlyPlay(playerPage)
62 it('Should play an internal HLS video in embed', async () => {
63 await go(FIXTURE_URLS.INTERNAL_EMBED_HLS_VIDEO)
65 await videoWatchPage.waitEmbedForDisplayed()
66 await checkCorrectlyPlay(playerPage)
69 it('Should play an internal HLS only video in embed', async () => {
70 await go(FIXTURE_URLS.INTERNAL_EMBED_HLS_ONLY_VIDEO)
72 await videoWatchPage.waitEmbedForDisplayed()
73 await checkCorrectlyPlay(playerPage)