diff options
author | Chocobozzz <me@florianbigard.com> | 2022-10-28 11:19:54 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-10-28 15:22:40 +0200 |
commit | 814e9e07ba65446af8446dbbd2f0d70c85fd1b33 (patch) | |
tree | 9c1f130d4a773208c5bdf33ec942be060e3c3ad2 /client/e2e/src/suites-all/private-videos.e2e-spec.ts | |
parent | 672e185bf3004b46552c227483ffd2802ebf6844 (diff) | |
download | PeerTube-814e9e07ba65446af8446dbbd2f0d70c85fd1b33.tar.gz PeerTube-814e9e07ba65446af8446dbbd2f0d70c85fd1b33.tar.zst PeerTube-814e9e07ba65446af8446dbbd2f0d70c85fd1b33.zip |
Improve E2E tests
Add tests for private video static endpoints
Fix tests for local firefox
Diffstat (limited to 'client/e2e/src/suites-all/private-videos.e2e-spec.ts')
-rw-r--r-- | client/e2e/src/suites-all/private-videos.e2e-spec.ts | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/client/e2e/src/suites-all/private-videos.e2e-spec.ts b/client/e2e/src/suites-all/private-videos.e2e-spec.ts new file mode 100644 index 000000000..db3554659 --- /dev/null +++ b/client/e2e/src/suites-all/private-videos.e2e-spec.ts | |||
@@ -0,0 +1,60 @@ | |||
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 | }) | ||