diff options
author | Chocobozzz <me@florianbigard.com> | 2022-10-28 11:19:54 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-10-28 15:22:40 +0200 |
commit | 814e9e07ba65446af8446dbbd2f0d70c85fd1b33 (patch) | |
tree | 9c1f130d4a773208c5bdf33ec942be060e3c3ad2 /client/e2e/src/suites-local | |
parent | 672e185bf3004b46552c227483ffd2802ebf6844 (diff) | |
download | PeerTube-814e9e07ba65446af8446dbbd2f0d70c85fd1b33.tar.gz PeerTube-814e9e07ba65446af8446dbbd2f0d70c85fd1b33.tar.zst PeerTube-814e9e07ba65446af8446dbbd2f0d70c85fd1b33.zip |
Improve E2E tests
Add tests for private video static endpoints
Fix tests for local firefox
Diffstat (limited to 'client/e2e/src/suites-local')
5 files changed, 18 insertions, 14 deletions
diff --git a/client/e2e/src/suites-local/custom-server-defaults.e2e-spec.ts b/client/e2e/src/suites-local/custom-server-defaults.e2e-spec.ts index e060d382f..71840d707 100644 --- a/client/e2e/src/suites-local/custom-server-defaults.e2e-spec.ts +++ b/client/e2e/src/suites-local/custom-server-defaults.e2e-spec.ts | |||
@@ -11,7 +11,7 @@ describe('Custom server defaults', () => { | |||
11 | before(async () => { | 11 | before(async () => { |
12 | await waitServerUp() | 12 | await waitServerUp() |
13 | 13 | ||
14 | loginPage = new LoginPage() | 14 | loginPage = new LoginPage(isMobileDevice()) |
15 | videoUploadPage = new VideoUploadPage() | 15 | videoUploadPage = new VideoUploadPage() |
16 | videoWatchPage = new VideoWatchPage(isMobileDevice(), isSafari()) | 16 | videoWatchPage = new VideoWatchPage(isMobileDevice(), isSafari()) |
17 | 17 | ||
@@ -25,7 +25,7 @@ describe('Custom server defaults', () => { | |||
25 | 25 | ||
26 | it('Should upload a video with custom default values', async function () { | 26 | it('Should upload a video with custom default values', async function () { |
27 | await videoUploadPage.navigateTo() | 27 | await videoUploadPage.navigateTo() |
28 | await videoUploadPage.uploadVideo() | 28 | await videoUploadPage.uploadVideo('video.mp4') |
29 | await videoUploadPage.validSecondUploadStep('video') | 29 | await videoUploadPage.validSecondUploadStep('video') |
30 | 30 | ||
31 | await videoWatchPage.waitWatchVideoName('video') | 31 | await videoWatchPage.waitWatchVideoName('video') |
@@ -60,7 +60,7 @@ describe('Custom server defaults', () => { | |||
60 | before(async () => { | 60 | before(async () => { |
61 | await loginPage.loginAsRootUser() | 61 | await loginPage.loginAsRootUser() |
62 | await videoUploadPage.navigateTo() | 62 | await videoUploadPage.navigateTo() |
63 | await videoUploadPage.uploadVideo() | 63 | await videoUploadPage.uploadVideo('video2.mp4') |
64 | await videoUploadPage.setAsPublic() | 64 | await videoUploadPage.setAsPublic() |
65 | await videoUploadPage.validSecondUploadStep('video') | 65 | await videoUploadPage.validSecondUploadStep('video') |
66 | 66 | ||
diff --git a/client/e2e/src/suites-local/plugins.e2e-spec.ts b/client/e2e/src/suites-local/plugins.e2e-spec.ts index a32ba1044..363c7f836 100644 --- a/client/e2e/src/suites-local/plugins.e2e-spec.ts +++ b/client/e2e/src/suites-local/plugins.e2e-spec.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { AdminPluginPage } from '../po/admin-plugin.po' | 1 | import { AdminPluginPage } from '../po/admin-plugin.po' |
2 | import { LoginPage } from '../po/login.po' | 2 | import { LoginPage } from '../po/login.po' |
3 | import { VideoUploadPage } from '../po/video-upload.po' | 3 | import { VideoUploadPage } from '../po/video-upload.po' |
4 | import { getCheckbox, waitServerUp } from '../utils' | 4 | import { getCheckbox, isMobileDevice, waitServerUp } from '../utils' |
5 | 5 | ||
6 | describe('Plugins', () => { | 6 | describe('Plugins', () => { |
7 | let videoUploadPage: VideoUploadPage | 7 | let videoUploadPage: VideoUploadPage |
@@ -24,7 +24,7 @@ describe('Plugins', () => { | |||
24 | }) | 24 | }) |
25 | 25 | ||
26 | beforeEach(async () => { | 26 | beforeEach(async () => { |
27 | loginPage = new LoginPage() | 27 | loginPage = new LoginPage(isMobileDevice()) |
28 | videoUploadPage = new VideoUploadPage() | 28 | videoUploadPage = new VideoUploadPage() |
29 | adminPluginPage = new AdminPluginPage() | 29 | adminPluginPage = new AdminPluginPage() |
30 | 30 | ||
@@ -42,7 +42,7 @@ describe('Plugins', () => { | |||
42 | 42 | ||
43 | it('Should have checkbox in video edit page', async () => { | 43 | it('Should have checkbox in video edit page', async () => { |
44 | await videoUploadPage.navigateTo() | 44 | await videoUploadPage.navigateTo() |
45 | await videoUploadPage.uploadVideo() | 45 | await videoUploadPage.uploadVideo('video.mp4') |
46 | 46 | ||
47 | await $('span=Super field 4 in main tab').waitForDisplayed() | 47 | await $('span=Super field 4 in main tab').waitForDisplayed() |
48 | 48 | ||
@@ -54,6 +54,8 @@ describe('Plugins', () => { | |||
54 | 54 | ||
55 | it('Should check the checkbox and be able to submit the video', async function () { | 55 | it('Should check the checkbox and be able to submit the video', async function () { |
56 | const checkbox = await getPluginCheckbox() | 56 | const checkbox = await getPluginCheckbox() |
57 | |||
58 | await checkbox.waitForClickable() | ||
57 | await checkbox.click() | 59 | await checkbox.click() |
58 | 60 | ||
59 | await expectSubmitState({ disabled: false }) | 61 | await expectSubmitState({ disabled: false }) |
@@ -61,6 +63,8 @@ describe('Plugins', () => { | |||
61 | 63 | ||
62 | it('Should uncheck the checkbox and not be able to submit the video', async function () { | 64 | it('Should uncheck the checkbox and not be able to submit the video', async function () { |
63 | const checkbox = await getPluginCheckbox() | 65 | const checkbox = await getPluginCheckbox() |
66 | |||
67 | await checkbox.waitForClickable() | ||
64 | await checkbox.click() | 68 | await checkbox.click() |
65 | 69 | ||
66 | await expectSubmitState({ disabled: true }) | 70 | await expectSubmitState({ disabled: true }) |
diff --git a/client/e2e/src/suites-local/signup.e2e-spec.ts b/client/e2e/src/suites-local/signup.e2e-spec.ts index 0f6d7a0e6..4eed3eefe 100644 --- a/client/e2e/src/suites-local/signup.e2e-spec.ts +++ b/client/e2e/src/suites-local/signup.e2e-spec.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { AdminConfigPage } from '../po/admin-config.po' | 1 | import { AdminConfigPage } from '../po/admin-config.po' |
2 | import { LoginPage } from '../po/login.po' | 2 | import { LoginPage } from '../po/login.po' |
3 | import { SignupPage } from '../po/signup.po' | 3 | import { SignupPage } from '../po/signup.po' |
4 | import { waitServerUp } from '../utils' | 4 | import { isMobileDevice, waitServerUp } from '../utils' |
5 | 5 | ||
6 | describe('Signup', () => { | 6 | describe('Signup', () => { |
7 | let loginPage: LoginPage | 7 | let loginPage: LoginPage |
@@ -13,7 +13,7 @@ describe('Signup', () => { | |||
13 | }) | 13 | }) |
14 | 14 | ||
15 | beforeEach(async () => { | 15 | beforeEach(async () => { |
16 | loginPage = new LoginPage() | 16 | loginPage = new LoginPage(isMobileDevice()) |
17 | adminConfigPage = new AdminConfigPage() | 17 | adminConfigPage = new AdminConfigPage() |
18 | signupPage = new SignupPage() | 18 | signupPage = new SignupPage() |
19 | 19 | ||
diff --git a/client/e2e/src/suites-local/user-settings.e2e-spec.ts b/client/e2e/src/suites-local/user-settings.e2e-spec.ts index b87501cd1..3e982d26f 100644 --- a/client/e2e/src/suites-local/user-settings.e2e-spec.ts +++ b/client/e2e/src/suites-local/user-settings.e2e-spec.ts | |||
@@ -15,7 +15,7 @@ describe('User settings', () => { | |||
15 | before(async () => { | 15 | before(async () => { |
16 | await waitServerUp() | 16 | await waitServerUp() |
17 | 17 | ||
18 | loginPage = new LoginPage() | 18 | loginPage = new LoginPage(isMobileDevice()) |
19 | videoUploadPage = new VideoUploadPage() | 19 | videoUploadPage = new VideoUploadPage() |
20 | videoWatchPage = new VideoWatchPage(isMobileDevice(), isSafari()) | 20 | videoWatchPage = new VideoWatchPage(isMobileDevice(), isSafari()) |
21 | myAccountPage = new MyAccountPage() | 21 | myAccountPage = new MyAccountPage() |
@@ -43,7 +43,7 @@ describe('User settings', () => { | |||
43 | before(async () => { | 43 | before(async () => { |
44 | await loginPage.loginAsRootUser() | 44 | await loginPage.loginAsRootUser() |
45 | await videoUploadPage.navigateTo() | 45 | await videoUploadPage.navigateTo() |
46 | await videoUploadPage.uploadVideo() | 46 | await videoUploadPage.uploadVideo('video.mp4') |
47 | await videoUploadPage.validSecondUploadStep('video') | 47 | await videoUploadPage.validSecondUploadStep('video') |
48 | 48 | ||
49 | await videoWatchPage.waitWatchVideoName('video') | 49 | await videoWatchPage.waitWatchVideoName('video') |
diff --git a/client/e2e/src/suites-local/videos-list.e2e-spec.ts b/client/e2e/src/suites-local/videos-list.e2e-spec.ts index ce57261b9..8264308f2 100644 --- a/client/e2e/src/suites-local/videos-list.e2e-spec.ts +++ b/client/e2e/src/suites-local/videos-list.e2e-spec.ts | |||
@@ -106,7 +106,7 @@ describe('Videos list', () => { | |||
106 | beforeEach(async () => { | 106 | beforeEach(async () => { |
107 | videoListPage = new VideoListPage(isMobileDevice(), isSafari()) | 107 | videoListPage = new VideoListPage(isMobileDevice(), isSafari()) |
108 | adminConfigPage = new AdminConfigPage() | 108 | adminConfigPage = new AdminConfigPage() |
109 | loginPage = new LoginPage() | 109 | loginPage = new LoginPage(isMobileDevice()) |
110 | videoUploadPage = new VideoUploadPage() | 110 | videoUploadPage = new VideoUploadPage() |
111 | myAccountPage = new MyAccountPage() | 111 | myAccountPage = new MyAccountPage() |
112 | videoSearchPage = new VideoSearchPage() | 112 | videoSearchPage = new VideoSearchPage() |
@@ -128,12 +128,12 @@ describe('Videos list', () => { | |||
128 | 128 | ||
129 | it('Should upload 2 videos (NSFW and classic videos)', async () => { | 129 | it('Should upload 2 videos (NSFW and classic videos)', async () => { |
130 | await videoUploadPage.navigateTo() | 130 | await videoUploadPage.navigateTo() |
131 | await videoUploadPage.uploadVideo() | 131 | await videoUploadPage.uploadVideo('video.mp4') |
132 | await videoUploadPage.setAsNSFW() | 132 | await videoUploadPage.setAsNSFW() |
133 | await videoUploadPage.validSecondUploadStep(nsfwVideo) | 133 | await videoUploadPage.validSecondUploadStep(nsfwVideo) |
134 | 134 | ||
135 | await videoUploadPage.navigateTo() | 135 | await videoUploadPage.navigateTo() |
136 | await videoUploadPage.uploadVideo() | 136 | await videoUploadPage.uploadVideo('video2.mp4') |
137 | await videoUploadPage.validSecondUploadStep(normalVideo) | 137 | await videoUploadPage.validSecondUploadStep(normalVideo) |
138 | }) | 138 | }) |
139 | 139 | ||
@@ -205,7 +205,7 @@ describe('Videos list', () => { | |||
205 | it('Should have default video values', async function () { | 205 | it('Should have default video values', async function () { |
206 | await loginPage.loginAsRootUser() | 206 | await loginPage.loginAsRootUser() |
207 | await videoUploadPage.navigateTo() | 207 | await videoUploadPage.navigateTo() |
208 | await videoUploadPage.uploadVideo() | 208 | await videoUploadPage.uploadVideo('video3.mp4') |
209 | await videoUploadPage.validSecondUploadStep('video') | 209 | await videoUploadPage.validSecondUploadStep('video') |
210 | 210 | ||
211 | await videoWatchPage.waitWatchVideoName('video') | 211 | await videoWatchPage.waitWatchVideoName('video') |