aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/e2e/src/videos.e2e-spec.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-08-07 14:01:11 +0200
committerChocobozzz <me@florianbigard.com>2020-08-07 14:01:11 +0200
commitd5cefc1fa5b961b9c6f0efb60baf876b3f453658 (patch)
treec4595d75e2840e112f2ae13dac6a309d960dfab9 /client/e2e/src/videos.e2e-spec.ts
parent3efa3f4d3552719ceda0b5f243a8f3dc87b29535 (diff)
parent7f90579c04383ca883083548f40782352605d778 (diff)
downloadPeerTube-d5cefc1fa5b961b9c6f0efb60baf876b3f453658.tar.gz
PeerTube-d5cefc1fa5b961b9c6f0efb60baf876b3f453658.tar.zst
PeerTube-d5cefc1fa5b961b9c6f0efb60baf876b3f453658.zip
Merge branch 'feature/e2e' into develop
Diffstat (limited to 'client/e2e/src/videos.e2e-spec.ts')
-rw-r--r--client/e2e/src/videos.e2e-spec.ts57
1 files changed, 51 insertions, 6 deletions
diff --git a/client/e2e/src/videos.e2e-spec.ts b/client/e2e/src/videos.e2e-spec.ts
index bbc5f7da3..97d1b827c 100644
--- a/client/e2e/src/videos.e2e-spec.ts
+++ b/client/e2e/src/videos.e2e-spec.ts
@@ -2,6 +2,7 @@ import { browser } from 'protractor'
2import { AppPage } from './po/app.po' 2import { AppPage } from './po/app.po'
3import { LoginPage } from './po/login.po' 3import { LoginPage } from './po/login.po'
4import { MyAccountPage } from './po/my-account' 4import { MyAccountPage } from './po/my-account'
5import { PlayerPage } from './po/player.po'
5import { VideoUpdatePage } from './po/video-update.po' 6import { VideoUpdatePage } from './po/video-update.po'
6import { VideoUploadPage } from './po/video-upload.po' 7import { VideoUploadPage } from './po/video-upload.po'
7import { VideoWatchPage } from './po/video-watch.po' 8import { VideoWatchPage } from './po/video-watch.po'
@@ -23,6 +24,7 @@ describe('Videos workflow', () => {
23 let myAccountPage: MyAccountPage 24 let myAccountPage: MyAccountPage
24 let loginPage: LoginPage 25 let loginPage: LoginPage
25 let appPage: AppPage 26 let appPage: AppPage
27 let playerPage: PlayerPage
26 28
27 let videoName = new Date().getTime() + ' video' 29 let videoName = new Date().getTime() + ' video'
28 const video2Name = new Date().getTime() + ' second video' 30 const video2Name = new Date().getTime() + ' second video'
@@ -36,6 +38,7 @@ describe('Videos workflow', () => {
36 myAccountPage = new MyAccountPage() 38 myAccountPage = new MyAccountPage()
37 loginPage = new LoginPage() 39 loginPage = new LoginPage()
38 appPage = new AppPage() 40 appPage = new AppPage()
41 playerPage = new PlayerPage()
39 42
40 if (await isIOS()) { 43 if (await isIOS()) {
41 // iOS does not seem to work with protractor 44 // iOS does not seem to work with protractor
@@ -99,8 +102,8 @@ describe('Videos workflow', () => {
99 it('Should play the video', async () => { 102 it('Should play the video', async () => {
100 videoWatchUrl = await browser.getCurrentUrl() 103 videoWatchUrl = await browser.getCurrentUrl()
101 104
102 await videoWatchPage.playAndPauseVideo(true) 105 await playerPage.playAndPauseVideo(true)
103 expect(videoWatchPage.getWatchVideoPlayerCurrentTime()).toBeGreaterThanOrEqual(2) 106 expect(playerPage.getWatchVideoPlayerCurrentTime()).toBeGreaterThanOrEqual(2)
104 }) 107 })
105 108
106 it('Should watch the associated embed video', async () => { 109 it('Should watch the associated embed video', async () => {
@@ -108,8 +111,8 @@ describe('Videos workflow', () => {
108 111
109 await videoWatchPage.goOnAssociatedEmbed() 112 await videoWatchPage.goOnAssociatedEmbed()
110 113
111 await videoWatchPage.playAndPauseVideo(false) 114 await playerPage.playAndPauseVideo(false)
112 expect(videoWatchPage.getWatchVideoPlayerCurrentTime()).toBeGreaterThanOrEqual(2) 115 expect(playerPage.getWatchVideoPlayerCurrentTime()).toBeGreaterThanOrEqual(2)
113 116
114 await browser.waitForAngularEnabled(true) 117 await browser.waitForAngularEnabled(true)
115 }) 118 })
@@ -119,8 +122,8 @@ describe('Videos workflow', () => {
119 122
120 await videoWatchPage.goOnP2PMediaLoaderEmbed() 123 await videoWatchPage.goOnP2PMediaLoaderEmbed()
121 124
122 await videoWatchPage.playAndPauseVideo(false) 125 await playerPage.playAndPauseVideo(false)
123 expect(videoWatchPage.getWatchVideoPlayerCurrentTime()).toBeGreaterThanOrEqual(2) 126 expect(playerPage.getWatchVideoPlayerCurrentTime()).toBeGreaterThanOrEqual(2)
124 127
125 await browser.waitForAngularEnabled(true) 128 await browser.waitForAngularEnabled(true)
126 }) 129 })
@@ -178,12 +181,54 @@ describe('Videos workflow', () => {
178 181
179 await myAccountPage.playPlaylist() 182 await myAccountPage.playPlaylist()
180 183
184 await browser.waitForAngularEnabled(false)
185
181 await videoWatchPage.waitUntilVideoName(video2Name, 20000 * 1000) 186 await videoWatchPage.waitUntilVideoName(video2Name, 20000 * 1000)
187
188 await browser.waitForAngularEnabled(true)
189 })
190
191 it('Should watch the webtorrent playlist in the embed', async () => {
192 if (await skipIfUploadNotSupported()) return
193
194 const accessToken = await browser.executeScript(`return window.localStorage.getItem('access_token');`)
195 const refreshToken = await browser.executeScript(`return window.localStorage.getItem('refresh_token');`)
196
197 await browser.waitForAngularEnabled(false)
198
199 await myAccountPage.goOnAssociatedPlaylistEmbed()
200
201 await browser.executeScript(`window.localStorage.setItem('access_token', '${accessToken}');`)
202 await browser.executeScript(`window.localStorage.setItem('refresh_token', '${refreshToken}');`)
203 await browser.executeScript(`window.localStorage.setItem('token_type', 'Bearer');`)
204
205 await browser.refresh()
206
207 await playerPage.playVideo()
208
209 await playerPage.waitUntilPlaylistInfo('2/2')
210
211 await browser.waitForAngularEnabled(true)
212 })
213
214 it('Should watch the HLS playlist in the embed', async () => {
215 await browser.waitForAngularEnabled(false)
216
217 await videoWatchPage.goOnP2PMediaLoaderPlaylistEmbed()
218
219 await playerPage.playVideo()
220
221 await playerPage.waitUntilPlaylistInfo('2/2')
222
223 await browser.waitForAngularEnabled(true)
182 }) 224 })
183 225
184 it('Should delete the video 2', async () => { 226 it('Should delete the video 2', async () => {
185 if (await skipIfUploadNotSupported()) return 227 if (await skipIfUploadNotSupported()) return
186 228
229 // Go to the dev website
230 await browser.get(videoWatchUrl)
231
187 await myAccountPage.navigateToMyVideos() 232 await myAccountPage.navigateToMyVideos()
188 233
189 await myAccountPage.removeVideo(video2Name) 234 await myAccountPage.removeVideo(video2Name)