aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/e2e/src/videos.e2e-spec.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-05-17 10:55:01 +0200
committerChocobozzz <me@florianbigard.com>2018-05-17 15:20:21 +0200
commit5f92c4dc5f08094548be9d23080dd3ca75741c65 (patch)
treea5fd5e2e7f46b28817733afc3cd1a3afcdab0c3a /client/e2e/src/videos.e2e-spec.ts
parent74af5a8361f4ccb460001706ce249d50c747f361 (diff)
downloadPeerTube-5f92c4dc5f08094548be9d23080dd3ca75741c65.tar.gz
PeerTube-5f92c4dc5f08094548be9d23080dd3ca75741c65.tar.zst
PeerTube-5f92c4dc5f08094548be9d23080dd3ca75741c65.zip
Add videos e2e tests
Diffstat (limited to 'client/e2e/src/videos.e2e-spec.ts')
-rw-r--r--client/e2e/src/videos.e2e-spec.ts48
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 @@
1import { VideoWatchPage } from './po/video-watch.po'
2import { VideoUploadPage } from './po/video-upload.po'
3import { LoginPage } from './po/login.po'
4import { browser } from 'protractor'
5
6describe('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})