diff options
author | Chocobozzz <me@florianbigard.com> | 2021-12-22 18:02:36 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-12-29 10:10:01 +0100 |
commit | 3c065fe3b3e1385d59ad1980251d14b712648155 (patch) | |
tree | f5f7f1b428b8155a735014304e2d45b9ed92fe07 /client/e2e/src/po | |
parent | 61cc1c03bf6f12af7c1b2e2a7d2fdaa563c37b59 (diff) | |
download | PeerTube-3c065fe3b3e1385d59ad1980251d14b712648155.tar.gz PeerTube-3c065fe3b3e1385d59ad1980251d14b712648155.tar.zst PeerTube-3c065fe3b3e1385d59ad1980251d14b712648155.zip |
Enhance plugin video fields
Add video form tab selection
Add ability to display an error
Diffstat (limited to 'client/e2e/src/po')
-rw-r--r-- | client/e2e/src/po/admin-plugin.po.ts | 31 | ||||
-rw-r--r-- | client/e2e/src/po/anonymous-settings.po.ts | 2 | ||||
-rw-r--r-- | client/e2e/src/po/my-account.po.ts | 2 | ||||
-rw-r--r-- | client/e2e/src/po/video-upload.po.ts | 21 |
4 files changed, 48 insertions, 8 deletions
diff --git a/client/e2e/src/po/admin-plugin.po.ts b/client/e2e/src/po/admin-plugin.po.ts new file mode 100644 index 000000000..6a3f3cf28 --- /dev/null +++ b/client/e2e/src/po/admin-plugin.po.ts | |||
@@ -0,0 +1,31 @@ | |||
1 | import { browserSleep, go } from '../utils' | ||
2 | |||
3 | export class AdminPluginPage { | ||
4 | |||
5 | async navigateToSearch () { | ||
6 | await go('/admin/plugins/search') | ||
7 | |||
8 | await $('my-plugin-search').waitForDisplayed() | ||
9 | } | ||
10 | |||
11 | async search (name: string) { | ||
12 | const input = $('.search-bar input') | ||
13 | await input.waitForDisplayed() | ||
14 | await input.clearValue() | ||
15 | await input.setValue(name) | ||
16 | |||
17 | await browserSleep(1000) | ||
18 | } | ||
19 | |||
20 | async installHelloWorld () { | ||
21 | $('.plugin-name=hello-world').waitForDisplayed() | ||
22 | |||
23 | await $('.card-body my-button[icon=cloud-download]').click() | ||
24 | |||
25 | const submitModalButton = $('.modal-content input[type=submit]') | ||
26 | await submitModalButton.waitForClickable() | ||
27 | await submitModalButton.click() | ||
28 | |||
29 | await $('.card-body my-edit-button').waitForDisplayed() | ||
30 | } | ||
31 | } | ||
diff --git a/client/e2e/src/po/anonymous-settings.po.ts b/client/e2e/src/po/anonymous-settings.po.ts index 180d371fa..21216a8f2 100644 --- a/client/e2e/src/po/anonymous-settings.po.ts +++ b/client/e2e/src/po/anonymous-settings.po.ts | |||
@@ -13,7 +13,7 @@ export class AnonymousSettingsPage { | |||
13 | } | 13 | } |
14 | 14 | ||
15 | async clickOnP2PCheckbox () { | 15 | async clickOnP2PCheckbox () { |
16 | const p2p = getCheckbox('p2pEnabled') | 16 | const p2p = await getCheckbox('p2pEnabled') |
17 | await p2p.waitForClickable() | 17 | await p2p.waitForClickable() |
18 | 18 | ||
19 | await p2p.click() | 19 | await p2p.click() |
diff --git a/client/e2e/src/po/my-account.po.ts b/client/e2e/src/po/my-account.po.ts index 13a764e87..20dafbf06 100644 --- a/client/e2e/src/po/my-account.po.ts +++ b/client/e2e/src/po/my-account.po.ts | |||
@@ -31,7 +31,7 @@ export class MyAccountPage { | |||
31 | } | 31 | } |
32 | 32 | ||
33 | async clickOnP2PCheckbox () { | 33 | async clickOnP2PCheckbox () { |
34 | const p2p = getCheckbox('p2pEnabled') | 34 | const p2p = await getCheckbox('p2pEnabled') |
35 | 35 | ||
36 | await p2p.waitForClickable() | 36 | await p2p.waitForClickable() |
37 | await p2p.scrollIntoView(false) // Avoid issues with fixed header on firefox | 37 | await p2p.scrollIntoView(false) // Avoid issues with fixed header on firefox |
diff --git a/client/e2e/src/po/video-upload.po.ts b/client/e2e/src/po/video-upload.po.ts index 2206b56c3..38395ea2f 100644 --- a/client/e2e/src/po/video-upload.po.ts +++ b/client/e2e/src/po/video-upload.po.ts | |||
@@ -3,7 +3,10 @@ import { getCheckbox, selectCustomSelect } from '../utils' | |||
3 | 3 | ||
4 | export class VideoUploadPage { | 4 | export class VideoUploadPage { |
5 | async navigateTo () { | 5 | async navigateTo () { |
6 | await $('.header .publish-button').click() | 6 | const publishButton = await $('.header .publish-button') |
7 | |||
8 | await publishButton.waitForClickable() | ||
9 | await publishButton.click() | ||
7 | 10 | ||
8 | await $('.upload-video-container').waitForDisplayed() | 11 | await $('.upload-video-container').waitForDisplayed() |
9 | } | 12 | } |
@@ -24,15 +27,17 @@ export class VideoUploadPage { | |||
24 | 27 | ||
25 | // Wait for the upload to finish | 28 | // Wait for the upload to finish |
26 | await browser.waitUntil(async () => { | 29 | await browser.waitUntil(async () => { |
27 | const actionButton = this.getSecondStepSubmitButton().$('.action-button') | 30 | const warning = await $('=Publish will be available when upload is finished').isDisplayed() |
31 | const progress = await $('.progress-bar=100%').isDisplayed() | ||
28 | 32 | ||
29 | const klass = await actionButton.getAttribute('class') | 33 | return !warning && progress |
30 | return !klass.includes('disabled') | ||
31 | }) | 34 | }) |
32 | } | 35 | } |
33 | 36 | ||
34 | setAsNSFW () { | 37 | async setAsNSFW () { |
35 | return getCheckbox('nsfw').click() | 38 | const checkbox = await getCheckbox('nsfw') |
39 | |||
40 | return checkbox.click() | ||
36 | } | 41 | } |
37 | 42 | ||
38 | async validSecondUploadStep (videoName: string) { | 43 | async validSecondUploadStep (videoName: string) { |
@@ -51,6 +56,10 @@ export class VideoUploadPage { | |||
51 | return selectCustomSelect('privacy', 'Public') | 56 | return selectCustomSelect('privacy', 'Public') |
52 | } | 57 | } |
53 | 58 | ||
59 | setAsPrivate () { | ||
60 | return selectCustomSelect('privacy', 'Private') | ||
61 | } | ||
62 | |||
54 | private getSecondStepSubmitButton () { | 63 | private getSecondStepSubmitButton () { |
55 | return $('.submit-container my-button') | 64 | return $('.submit-container my-button') |
56 | } | 65 | } |