]>
Commit | Line | Data |
---|---|---|
814e9e07 C |
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' | |
5 | ||
6 | async function checkCorrectlyPlay (playerPage: PlayerPage) { | |
7 | await playerPage.playAndPauseVideo(false, 2) | |
8 | ||
9 | expect(await playerPage.getWatchVideoPlayerCurrentTime()).toBeGreaterThanOrEqual(2) | |
10 | } | |
11 | ||
12 | describe('Private videos all workflow', () => { | |
13 | let videoWatchPage: VideoWatchPage | |
14 | let loginPage: LoginPage | |
15 | let playerPage: PlayerPage | |
16 | ||
17 | const internalVideoName = 'Internal E2E test' | |
18 | ||
19 | beforeEach(async () => { | |
20 | videoWatchPage = new VideoWatchPage(isMobileDevice(), isSafari()) | |
21 | loginPage = new LoginPage(isMobileDevice()) | |
22 | playerPage = new PlayerPage() | |
23 | ||
24 | if (!isMobileDevice()) { | |
25 | await browser.maximizeWindow() | |
26 | } | |
27 | }) | |
28 | ||
29 | it('Should log in', async () => { | |
30 | return loginPage.loginOnPeerTube2() | |
31 | }) | |
32 | ||
33 | it('Should play an internal webtorrent video', async () => { | |
34 | await go(FIXTURE_URLS.INTERNAL_WEBTORRENT_VIDEO) | |
35 | ||
36 | await videoWatchPage.waitWatchVideoName(internalVideoName) | |
37 | await checkCorrectlyPlay(playerPage) | |
38 | }) | |
39 | ||
40 | it('Should play an internal HLS video', async () => { | |
41 | await go(FIXTURE_URLS.INTERNAL_HLS_VIDEO) | |
42 | ||
43 | await videoWatchPage.waitWatchVideoName(internalVideoName) | |
44 | await checkCorrectlyPlay(playerPage) | |
45 | }) | |
46 | ||
47 | it('Should play an internal WebTorrent video in embed', async () => { | |
48 | await go(FIXTURE_URLS.INTERNAL_EMBED_WEBTORRENT_VIDEO) | |
49 | ||
50 | await videoWatchPage.waitEmbedForDisplayed() | |
51 | await checkCorrectlyPlay(playerPage) | |
52 | }) | |
53 | ||
54 | it('Should play an internal HLS video in embed', async () => { | |
55 | await go(FIXTURE_URLS.INTERNAL_EMBED_HLS_VIDEO) | |
56 | ||
57 | await videoWatchPage.waitEmbedForDisplayed() | |
58 | await checkCorrectlyPlay(playerPage) | |
59 | }) | |
60 | }) |