aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/e2e/src/po
diff options
context:
space:
mode:
Diffstat (limited to 'client/e2e/src/po')
-rw-r--r--client/e2e/src/po/anonymous-settings.po.ts21
-rw-r--r--client/e2e/src/po/my-account.po.ts (renamed from client/e2e/src/po/my-account.ts)17
-rw-r--r--client/e2e/src/po/video-upload.po.ts8
-rw-r--r--client/e2e/src/po/video-watch.po.ts13
4 files changed, 55 insertions, 4 deletions
diff --git a/client/e2e/src/po/anonymous-settings.po.ts b/client/e2e/src/po/anonymous-settings.po.ts
new file mode 100644
index 000000000..180d371fa
--- /dev/null
+++ b/client/e2e/src/po/anonymous-settings.po.ts
@@ -0,0 +1,21 @@
1import { getCheckbox } from '../utils'
2
3export class AnonymousSettingsPage {
4
5 async openSettings () {
6 const link = await $$('.menu-link').filter(async i => {
7 return await i.getText() === 'My settings'
8 }).then(links => links[0])
9
10 await link.click()
11
12 await $('my-user-video-settings').waitForDisplayed()
13 }
14
15 async clickOnP2PCheckbox () {
16 const p2p = getCheckbox('p2pEnabled')
17 await p2p.waitForClickable()
18
19 await p2p.click()
20 }
21}
diff --git a/client/e2e/src/po/my-account.ts b/client/e2e/src/po/my-account.po.ts
index b51614fd9..13a764e87 100644
--- a/client/e2e/src/po/my-account.ts
+++ b/client/e2e/src/po/my-account.po.ts
@@ -1,4 +1,4 @@
1import { go } from '../utils' 1import { getCheckbox, go } from '../utils'
2 2
3export class MyAccountPage { 3export class MyAccountPage {
4 4
@@ -27,6 +27,21 @@ export class MyAccountPage {
27 await nsfw.scrollIntoView(false) // Avoid issues with fixed header on firefox 27 await nsfw.scrollIntoView(false) // Avoid issues with fixed header on firefox
28 await nsfw.selectByAttribute('value', newValue) 28 await nsfw.selectByAttribute('value', newValue)
29 29
30 await this.submitVideoSettings()
31 }
32
33 async clickOnP2PCheckbox () {
34 const p2p = getCheckbox('p2pEnabled')
35
36 await p2p.waitForClickable()
37 await p2p.scrollIntoView(false) // Avoid issues with fixed header on firefox
38
39 await p2p.click()
40
41 await this.submitVideoSettings()
42 }
43
44 private async submitVideoSettings () {
30 const submit = $('my-user-video-settings input[type=submit]') 45 const submit = $('my-user-video-settings input[type=submit]')
31 await submit.scrollIntoView(false) 46 await submit.scrollIntoView(false)
32 await submit.click() 47 await submit.click()
diff --git a/client/e2e/src/po/video-upload.po.ts b/client/e2e/src/po/video-upload.po.ts
index dd437c390..2206b56c3 100644
--- a/client/e2e/src/po/video-upload.po.ts
+++ b/client/e2e/src/po/video-upload.po.ts
@@ -1,5 +1,5 @@
1import { join } from 'path' 1import { join } from 'path'
2import { clickOnCheckbox } from '../utils' 2import { getCheckbox, selectCustomSelect } from '../utils'
3 3
4export class VideoUploadPage { 4export class VideoUploadPage {
5 async navigateTo () { 5 async navigateTo () {
@@ -32,7 +32,7 @@ export class VideoUploadPage {
32 } 32 }
33 33
34 setAsNSFW () { 34 setAsNSFW () {
35 return clickOnCheckbox('nsfw') 35 return getCheckbox('nsfw').click()
36 } 36 }
37 37
38 async validSecondUploadStep (videoName: string) { 38 async validSecondUploadStep (videoName: string) {
@@ -47,6 +47,10 @@ export class VideoUploadPage {
47 }) 47 })
48 } 48 }
49 49
50 setAsPublic () {
51 return selectCustomSelect('privacy', 'Public')
52 }
53
50 private getSecondStepSubmitButton () { 54 private getSecondStepSubmitButton () {
51 return $('.submit-container my-button') 55 return $('.submit-container my-button')
52 } 56 }
diff --git a/client/e2e/src/po/video-watch.po.ts b/client/e2e/src/po/video-watch.po.ts
index 1406c971a..cecda3a8b 100644
--- a/client/e2e/src/po/video-watch.po.ts
+++ b/client/e2e/src/po/video-watch.po.ts
@@ -39,12 +39,23 @@ export class VideoWatchPage {
39 return $('my-video-comment-add').isExisting() 39 return $('my-video-comment-add').isExisting()
40 } 40 }
41 41
42 isPrivacyWarningDisplayed () {
43 return $('my-privacy-concerns').isDisplayed()
44 }
45
42 async goOnAssociatedEmbed () { 46 async goOnAssociatedEmbed () {
43 let url = await browser.getUrl() 47 let url = await browser.getUrl()
44 url = url.replace('/w/', '/videos/embed/') 48 url = url.replace('/w/', '/videos/embed/')
45 url = url.replace(':3333', ':9001') 49 url = url.replace(':3333', ':9001')
46 50
47 return go(url) 51 await go(url)
52 await $('.vjs-big-play-button').waitForDisplayed()
53 }
54
55 async isEmbedWarningDisplayed () {
56 const text = await $('.vjs-dock-description').getText()
57
58 return !!text.trim()
48 } 59 }
49 60
50 goOnP2PMediaLoaderEmbed () { 61 goOnP2PMediaLoaderEmbed () {