aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/e2e
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-01-23 14:23:19 +0100
committerChocobozzz <me@florianbigard.com>2020-01-23 14:59:44 +0100
commit44d4ee4fcb7cf8beebac73f85693c09919b91e66 (patch)
tree24b9867f2e0a5480cda3653ba00702779913fc88 /client/e2e
parent89566f77fd938cf8b0a617d5d2df4ca718242372 (diff)
downloadPeerTube-44d4ee4fcb7cf8beebac73f85693c09919b91e66.tar.gz
PeerTube-44d4ee4fcb7cf8beebac73f85693c09919b91e66.tar.zst
PeerTube-44d4ee4fcb7cf8beebac73f85693c09919b91e66.zip
Fix e2e tests
Diffstat (limited to 'client/e2e')
-rw-r--r--client/e2e/fixtures/video.mp4bin619469 -> 619477 bytes
-rw-r--r--client/e2e/src/po/app.po.ts21
-rw-r--r--client/e2e/src/videos.e2e-spec.ts9
3 files changed, 30 insertions, 0 deletions
diff --git a/client/e2e/fixtures/video.mp4 b/client/e2e/fixtures/video.mp4
index f9c9e2dd6..c9ba8fd04 100644
--- a/client/e2e/fixtures/video.mp4
+++ b/client/e2e/fixtures/video.mp4
Binary files differ
diff --git a/client/e2e/src/po/app.po.ts b/client/e2e/src/po/app.po.ts
new file mode 100644
index 000000000..a636e825f
--- /dev/null
+++ b/client/e2e/src/po/app.po.ts
@@ -0,0 +1,21 @@
1import { browser, by, element } from 'protractor'
2
3export class AppPage {
4
5 async closeWelcomeModal () {
6 const firstHandle = await browser.getWindowHandle()
7
8 if (await element(by.css('.configure-instance-button')).isPresent() === false) return
9
10 await element(by.css('.configure-instance-button')).click()
11
12 await browser.switchTo().window(firstHandle)
13
14 await browser.refresh()
15
16 await element(by.css('.form-group-checkbox')).click()
17 await element(by.css('.action-button-cancel')).click()
18
19 await browser.switchTo().window(firstHandle)
20 }
21}
diff --git a/client/e2e/src/videos.e2e-spec.ts b/client/e2e/src/videos.e2e-spec.ts
index 27706a506..075add531 100644
--- a/client/e2e/src/videos.e2e-spec.ts
+++ b/client/e2e/src/videos.e2e-spec.ts
@@ -4,6 +4,7 @@ import { LoginPage } from './po/login.po'
4import { browser } from 'protractor' 4import { browser } from 'protractor'
5import { VideoUpdatePage } from './po/video-update.po' 5import { VideoUpdatePage } from './po/video-update.po'
6import { MyAccountPage } from './po/my-account' 6import { MyAccountPage } from './po/my-account'
7import { AppPage } from './po/app.po'
7 8
8async function skipIfUploadNotSupported () { 9async function skipIfUploadNotSupported () {
9 if (await isMobileDevice() || await isSafari()) { 10 if (await isMobileDevice() || await isSafari()) {
@@ -30,6 +31,7 @@ describe('Videos workflow', () => {
30 let videoUpdatePage: VideoUpdatePage 31 let videoUpdatePage: VideoUpdatePage
31 let myAccountPage: MyAccountPage 32 let myAccountPage: MyAccountPage
32 let loginPage: LoginPage 33 let loginPage: LoginPage
34 let appPage: AppPage
33 35
34 let videoName = new Date().getTime() + ' video' 36 let videoName = new Date().getTime() + ' video'
35 const video2Name = new Date().getTime() + ' second video' 37 const video2Name = new Date().getTime() + ' second video'
@@ -42,6 +44,7 @@ describe('Videos workflow', () => {
42 videoUpdatePage = new VideoUpdatePage() 44 videoUpdatePage = new VideoUpdatePage()
43 myAccountPage = new MyAccountPage() 45 myAccountPage = new MyAccountPage()
44 loginPage = new LoginPage() 46 loginPage = new LoginPage()
47 appPage = new AppPage()
45 48
46 if (await isMobileDevice()) { 49 if (await isMobileDevice()) {
47 console.log('Mobile device detected.') 50 console.log('Mobile device detected.')
@@ -61,6 +64,12 @@ describe('Videos workflow', () => {
61 return loginPage.loginAsRootUser() 64 return loginPage.loginAsRootUser()
62 }) 65 })
63 66
67 it('Should close the welcome modal', async () => {
68 if (await skipIfUploadNotSupported()) return
69
70 await appPage.closeWelcomeModal()
71 })
72
64 it('Should upload a video', async () => { 73 it('Should upload a video', async () => {
65 if (await skipIfUploadNotSupported()) return 74 if (await skipIfUploadNotSupported()) return
66 75