diff options
Diffstat (limited to 'client/e2e/src/videos.e2e-spec.ts')
-rw-r--r-- | client/e2e/src/videos.e2e-spec.ts | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/client/e2e/src/videos.e2e-spec.ts b/client/e2e/src/videos.e2e-spec.ts new file mode 100644 index 000000000..4205fd7a4 --- /dev/null +++ b/client/e2e/src/videos.e2e-spec.ts | |||
@@ -0,0 +1,48 @@ | |||
1 | import { VideoWatchPage } from './po/video-watch.po' | ||
2 | import { VideoUploadPage } from './po/video-upload.po' | ||
3 | import { LoginPage } from './po/login.po' | ||
4 | import { browser } from 'protractor' | ||
5 | |||
6 | describe('Videos workflow', () => { | ||
7 | let videoWatchPage: VideoWatchPage | ||
8 | let pageUploadPage: VideoUploadPage | ||
9 | let loginPage: LoginPage | ||
10 | const videoName = new Date().getTime() + ' video' | ||
11 | |||
12 | beforeEach(() => { | ||
13 | videoWatchPage = new VideoWatchPage() | ||
14 | pageUploadPage = new VideoUploadPage() | ||
15 | loginPage = new LoginPage() | ||
16 | }) | ||
17 | |||
18 | it('Should log in', () => { | ||
19 | return loginPage.loginAsRootUser() | ||
20 | }) | ||
21 | |||
22 | it('Should upload a video', async () => { | ||
23 | pageUploadPage.navigateTo() | ||
24 | |||
25 | await pageUploadPage.uploadVideo() | ||
26 | return pageUploadPage.validSecondUploadStep(videoName) | ||
27 | }) | ||
28 | |||
29 | it('Should list the video', async () => { | ||
30 | await videoWatchPage.goOnRecentlyAdded() | ||
31 | |||
32 | const videoNames = videoWatchPage.getVideosListName() | ||
33 | expect(videoNames).toContain(videoName) | ||
34 | }) | ||
35 | |||
36 | it('Should go on video watch page', async () => { | ||
37 | await videoWatchPage.clickOnFirstVideoOfList() | ||
38 | |||
39 | return videoWatchPage.waitWatchVideoName(videoName) | ||
40 | }) | ||
41 | |||
42 | it('Should play the video', async () => { | ||
43 | await browser.sleep(4000) | ||
44 | |||
45 | await videoWatchPage.pauseVideo() | ||
46 | expect(videoWatchPage.getWatchVideoPlayerCurrentTime()).toBeGreaterThanOrEqual(2) | ||
47 | }) | ||
48 | }) | ||