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'
19 beforeEach(async () => {
20 videoWatchPage = new VideoWatchPage(isMobileDevice(), isSafari())
21 loginPage = new LoginPage(isMobileDevice())
22 playerPage = new PlayerPage()
24 if (!isMobileDevice()) {
25 await browser.maximizeWindow()
29 it('Should log in', async () => {
30 return loginPage.loginOnPeerTube2()
33 it('Should play an internal webtorrent video', async () => {
34 await go(FIXTURE_URLS.INTERNAL_WEBTORRENT_VIDEO)
36 await videoWatchPage.waitWatchVideoName(internalVideoName)
37 await checkCorrectlyPlay(playerPage)
40 it('Should play an internal HLS video', async () => {
41 await go(FIXTURE_URLS.INTERNAL_HLS_VIDEO)
43 await videoWatchPage.waitWatchVideoName(internalVideoName)
44 await checkCorrectlyPlay(playerPage)
47 it('Should play an internal WebTorrent video in embed', async () => {
48 await go(FIXTURE_URLS.INTERNAL_EMBED_WEBTORRENT_VIDEO)
50 await videoWatchPage.waitEmbedForDisplayed()
51 await checkCorrectlyPlay(playerPage)
54 it('Should play an internal HLS video in embed', async () => {
55 await go(FIXTURE_URLS.INTERNAL_EMBED_HLS_VIDEO)
57 await videoWatchPage.waitEmbedForDisplayed()
58 await checkCorrectlyPlay(playerPage)