diff options
Diffstat (limited to 'client/e2e')
21 files changed, 181 insertions, 37 deletions
diff --git a/client/e2e/browserstack.err b/client/e2e/browserstack.err new file mode 100644 index 000000000..a6e141486 --- /dev/null +++ b/client/e2e/browserstack.err | |||
@@ -0,0 +1 @@ | |||
[object Object] \ No newline at end of file | |||
diff --git a/client/e2e/fixtures/video2.mp4 b/client/e2e/fixtures/video2.mp4 new file mode 100644 index 000000000..e4e6773ef --- /dev/null +++ b/client/e2e/fixtures/video2.mp4 | |||
Binary files differ | |||
diff --git a/client/e2e/fixtures/video3.mp4 b/client/e2e/fixtures/video3.mp4 new file mode 100644 index 000000000..e7a1c12e4 --- /dev/null +++ b/client/e2e/fixtures/video3.mp4 | |||
Binary files differ | |||
diff --git a/client/e2e/src/po/admin-config.po.ts b/client/e2e/src/po/admin-config.po.ts index 6d48a0fd7..27957a71f 100644 --- a/client/e2e/src/po/admin-config.po.ts +++ b/client/e2e/src/po/admin-config.po.ts | |||
@@ -14,8 +14,14 @@ export class AdminConfigPage { | |||
14 | await $('.inner-form-title=' + waitTitles[tab]).waitForDisplayed() | 14 | await $('.inner-form-title=' + waitTitles[tab]).waitForDisplayed() |
15 | } | 15 | } |
16 | 16 | ||
17 | updateNSFWSetting (newValue: 'do_not_list' | 'blur' | 'display') { | 17 | async updateNSFWSetting (newValue: 'do_not_list' | 'blur' | 'display') { |
18 | return $('#instanceDefaultNSFWPolicy').selectByAttribute('value', newValue) | 18 | const elem = $('#instanceDefaultNSFWPolicy') |
19 | |||
20 | await elem.waitForDisplayed() | ||
21 | await elem.scrollIntoView(false) // Avoid issues with fixed header on firefox | ||
22 | await elem.waitForClickable() | ||
23 | |||
24 | return elem.selectByAttribute('value', newValue) | ||
19 | } | 25 | } |
20 | 26 | ||
21 | updateHomepage (newValue: string) { | 27 | updateHomepage (newValue: string) { |
@@ -24,11 +30,15 @@ export class AdminConfigPage { | |||
24 | 30 | ||
25 | async toggleSignup () { | 31 | async toggleSignup () { |
26 | const checkbox = await getCheckbox('signupEnabled') | 32 | const checkbox = await getCheckbox('signupEnabled') |
33 | |||
34 | await checkbox.waitForClickable() | ||
27 | await checkbox.click() | 35 | await checkbox.click() |
28 | } | 36 | } |
29 | 37 | ||
30 | async save () { | 38 | async save () { |
31 | const button = $('input[type=submit]') | 39 | const button = $('input[type=submit]') |
40 | |||
41 | await button.waitForClickable() | ||
32 | await button.click() | 42 | await button.click() |
33 | } | 43 | } |
34 | } | 44 | } |
diff --git a/client/e2e/src/po/login.po.ts b/client/e2e/src/po/login.po.ts index 2c4561b7d..91bf46e30 100644 --- a/client/e2e/src/po/login.po.ts +++ b/client/e2e/src/po/login.po.ts | |||
@@ -2,31 +2,61 @@ import { go } from '../utils' | |||
2 | 2 | ||
3 | export class LoginPage { | 3 | export class LoginPage { |
4 | 4 | ||
5 | async loginAsRootUser () { | 5 | constructor (private isMobileDevice: boolean) { |
6 | await go('/login') | 6 | |
7 | } | ||
8 | |||
9 | async login (username: string, password: string, url = '/login') { | ||
10 | await go(url) | ||
7 | 11 | ||
12 | await browser.execute(`window.localStorage.setItem('no_account_setup_warning_modal', 'true')`) | ||
8 | await browser.execute(`window.localStorage.setItem('no_instance_config_warning_modal', 'true')`) | 13 | await browser.execute(`window.localStorage.setItem('no_instance_config_warning_modal', 'true')`) |
9 | await browser.execute(`window.localStorage.setItem('no_welcome_modal', 'true')`) | 14 | await browser.execute(`window.localStorage.setItem('no_welcome_modal', 'true')`) |
10 | 15 | ||
11 | await $('input#username').setValue('root') | 16 | await $('input#username').setValue(username) |
12 | await $('input#password').setValue('test' + this.getSuffix()) | 17 | await $('input#password').setValue(password) |
13 | 18 | ||
14 | await browser.pause(1000) | 19 | await browser.pause(1000) |
15 | 20 | ||
16 | await $('form input[type=submit]').click() | 21 | await $('form input[type=submit]').click() |
17 | 22 | ||
18 | await this.ensureIsLoggedInAs('root') | 23 | const menuToggle = $('.top-left-block span[role=button]') |
24 | |||
25 | if (this.isMobileDevice) { | ||
26 | await browser.pause(1000) | ||
27 | |||
28 | await menuToggle.click() | ||
29 | } | ||
30 | |||
31 | await this.ensureIsLoggedInAs(username) | ||
32 | |||
33 | if (this.isMobileDevice) { | ||
34 | await menuToggle.click() | ||
35 | } | ||
36 | } | ||
37 | |||
38 | async loginAsRootUser () { | ||
39 | return this.login('root', 'test' + this.getSuffix()) | ||
40 | } | ||
41 | |||
42 | loginOnPeerTube2 () { | ||
43 | return this.login('e2e', process.env.PEERTUBE2_E2E_PASSWORD, 'https://peertube2.cpy.re/login') | ||
19 | } | 44 | } |
20 | 45 | ||
21 | async logout () { | 46 | async logout () { |
22 | await $('.logged-in-more').click() | 47 | const loggedInMore = $('.logged-in-more') |
48 | |||
49 | await loggedInMore.waitForClickable() | ||
50 | await loggedInMore.click() | ||
23 | 51 | ||
24 | const logout = () => $('.dropdown-item*=Log out') | 52 | const logout = $('.dropdown-item*=Log out') |
25 | 53 | ||
26 | await logout().waitForDisplayed() | 54 | await logout.waitForClickable() |
27 | await logout().click() | 55 | await logout.click() |
28 | 56 | ||
29 | await $('.login-buttons-block').waitForDisplayed() | 57 | await browser.waitUntil(() => { |
58 | return $('.login-buttons-block, my-error-page a[href="/login"]').isDisplayed() | ||
59 | }) | ||
30 | } | 60 | } |
31 | 61 | ||
32 | async ensureIsLoggedInAs (displayName: string) { | 62 | async ensureIsLoggedInAs (displayName: string) { |
diff --git a/client/e2e/src/po/my-account.po.ts b/client/e2e/src/po/my-account.po.ts index 8d5d878ce..222dbb569 100644 --- a/client/e2e/src/po/my-account.po.ts +++ b/client/e2e/src/po/my-account.po.ts | |||
@@ -25,6 +25,8 @@ export class MyAccountPage { | |||
25 | 25 | ||
26 | await nsfw.waitForDisplayed() | 26 | await nsfw.waitForDisplayed() |
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.waitForClickable() | ||
29 | |||
28 | await nsfw.selectByAttribute('value', newValue) | 30 | await nsfw.selectByAttribute('value', newValue) |
29 | 31 | ||
30 | await this.submitVideoSettings() | 32 | await this.submitVideoSettings() |
@@ -43,6 +45,8 @@ export class MyAccountPage { | |||
43 | 45 | ||
44 | private async submitVideoSettings () { | 46 | private async submitVideoSettings () { |
45 | const submit = $('my-user-video-settings input[type=submit]') | 47 | const submit = $('my-user-video-settings input[type=submit]') |
48 | |||
49 | await submit.waitForClickable() | ||
46 | await submit.scrollIntoView(false) | 50 | await submit.scrollIntoView(false) |
47 | await submit.click() | 51 | await submit.click() |
48 | } | 52 | } |
diff --git a/client/e2e/src/po/signup.po.ts b/client/e2e/src/po/signup.po.ts index ef36dbcc4..7a17198cc 100644 --- a/client/e2e/src/po/signup.po.ts +++ b/client/e2e/src/po/signup.po.ts | |||
@@ -9,7 +9,7 @@ export class SignupPage { | |||
9 | async clickOnRegisterInMenu () { | 9 | async clickOnRegisterInMenu () { |
10 | const button = this.getRegisterMenuButton() | 10 | const button = this.getRegisterMenuButton() |
11 | 11 | ||
12 | await button.waitForDisplayed() | 12 | await button.waitForClickable() |
13 | await button.click() | 13 | await button.click() |
14 | } | 14 | } |
15 | 15 | ||
@@ -22,6 +22,7 @@ export class SignupPage { | |||
22 | 22 | ||
23 | async checkTerms () { | 23 | async checkTerms () { |
24 | const terms = await getCheckbox('terms') | 24 | const terms = await getCheckbox('terms') |
25 | await terms.waitForClickable() | ||
25 | 26 | ||
26 | return terms.click() | 27 | return terms.click() |
27 | } | 28 | } |
diff --git a/client/e2e/src/po/video-upload.po.ts b/client/e2e/src/po/video-upload.po.ts index 8605139c9..7e7989763 100644 --- a/client/e2e/src/po/video-upload.po.ts +++ b/client/e2e/src/po/video-upload.po.ts | |||
@@ -11,8 +11,8 @@ export class VideoUploadPage { | |||
11 | await $('.upload-video-container').waitForDisplayed() | 11 | await $('.upload-video-container').waitForDisplayed() |
12 | } | 12 | } |
13 | 13 | ||
14 | async uploadVideo () { | 14 | async uploadVideo (fixtureName: 'video.mp4' | 'video2.mp4' | 'video3.mp4') { |
15 | const fileToUpload = join(__dirname, '../../fixtures/video.mp4') | 15 | const fileToUpload = join(__dirname, '../../fixtures/' + fixtureName) |
16 | const fileInputSelector = '.upload-video-container input[type=file]' | 16 | const fileInputSelector = '.upload-video-container input[type=file]' |
17 | const parentFileInput = '.upload-video-container .button-file' | 17 | const parentFileInput = '.upload-video-container .button-file' |
18 | 18 | ||
@@ -36,6 +36,7 @@ export class VideoUploadPage { | |||
36 | 36 | ||
37 | async setAsNSFW () { | 37 | async setAsNSFW () { |
38 | const checkbox = await getCheckbox('nsfw') | 38 | const checkbox = await getCheckbox('nsfw') |
39 | await checkbox.waitForClickable() | ||
39 | 40 | ||
40 | return checkbox.click() | 41 | return checkbox.click() |
41 | } | 42 | } |
@@ -45,7 +46,10 @@ export class VideoUploadPage { | |||
45 | await nameInput.clearValue() | 46 | await nameInput.clearValue() |
46 | await nameInput.setValue(videoName) | 47 | await nameInput.setValue(videoName) |
47 | 48 | ||
48 | await this.getSecondStepSubmitButton().click() | 49 | const button = this.getSecondStepSubmitButton() |
50 | await button.waitForClickable() | ||
51 | |||
52 | await button.click() | ||
49 | 53 | ||
50 | return browser.waitUntil(async () => { | 54 | return browser.waitUntil(async () => { |
51 | return (await browser.getUrl()).includes('/w/') | 55 | return (await browser.getUrl()).includes('/w/') |
diff --git a/client/e2e/src/po/video-watch.po.ts b/client/e2e/src/po/video-watch.po.ts index 65bf21837..982c90908 100644 --- a/client/e2e/src/po/video-watch.po.ts +++ b/client/e2e/src/po/video-watch.po.ts | |||
@@ -49,7 +49,11 @@ export class VideoWatchPage { | |||
49 | url = url.replace(':3333', ':9001') | 49 | url = url.replace(':3333', ':9001') |
50 | 50 | ||
51 | await go(url) | 51 | await go(url) |
52 | await $('.vjs-big-play-button').waitForDisplayed() | 52 | await this.waitEmbedForDisplayed() |
53 | } | ||
54 | |||
55 | waitEmbedForDisplayed () { | ||
56 | return $('.vjs-big-play-button').waitForDisplayed() | ||
53 | } | 57 | } |
54 | 58 | ||
55 | isEmbedWarningDisplayed () { | 59 | isEmbedWarningDisplayed () { |
diff --git a/client/e2e/src/suites-all/private-videos.e2e-spec.ts b/client/e2e/src/suites-all/private-videos.e2e-spec.ts new file mode 100644 index 000000000..db3554659 --- /dev/null +++ b/client/e2e/src/suites-all/private-videos.e2e-spec.ts | |||
@@ -0,0 +1,60 @@ | |||
1 | import { LoginPage } from '../po/login.po' | ||
2 | import { PlayerPage } from '../po/player.po' | ||
3 | import { VideoWatchPage } from '../po/video-watch.po' | ||
4 | import { FIXTURE_URLS, go, isMobileDevice, isSafari } from '../utils' | ||
5 | |||
6 | async function checkCorrectlyPlay (playerPage: PlayerPage) { | ||
7 | await playerPage.playAndPauseVideo(false, 2) | ||
8 | |||
9 | expect(await playerPage.getWatchVideoPlayerCurrentTime()).toBeGreaterThanOrEqual(2) | ||
10 | } | ||
11 | |||
12 | describe('Private videos all workflow', () => { | ||
13 | let videoWatchPage: VideoWatchPage | ||
14 | let loginPage: LoginPage | ||
15 | let playerPage: PlayerPage | ||
16 | |||
17 | const internalVideoName = 'Internal E2E test' | ||
18 | |||
19 | beforeEach(async () => { | ||
20 | videoWatchPage = new VideoWatchPage(isMobileDevice(), isSafari()) | ||
21 | loginPage = new LoginPage(isMobileDevice()) | ||
22 | playerPage = new PlayerPage() | ||
23 | |||
24 | if (!isMobileDevice()) { | ||
25 | await browser.maximizeWindow() | ||
26 | } | ||
27 | }) | ||
28 | |||
29 | it('Should log in', async () => { | ||
30 | return loginPage.loginOnPeerTube2() | ||
31 | }) | ||
32 | |||
33 | it('Should play an internal webtorrent video', async () => { | ||
34 | await go(FIXTURE_URLS.INTERNAL_WEBTORRENT_VIDEO) | ||
35 | |||
36 | await videoWatchPage.waitWatchVideoName(internalVideoName) | ||
37 | await checkCorrectlyPlay(playerPage) | ||
38 | }) | ||
39 | |||
40 | it('Should play an internal HLS video', async () => { | ||
41 | await go(FIXTURE_URLS.INTERNAL_HLS_VIDEO) | ||
42 | |||
43 | await videoWatchPage.waitWatchVideoName(internalVideoName) | ||
44 | await checkCorrectlyPlay(playerPage) | ||
45 | }) | ||
46 | |||
47 | it('Should play an internal WebTorrent video in embed', async () => { | ||
48 | await go(FIXTURE_URLS.INTERNAL_EMBED_WEBTORRENT_VIDEO) | ||
49 | |||
50 | await videoWatchPage.waitEmbedForDisplayed() | ||
51 | await checkCorrectlyPlay(playerPage) | ||
52 | }) | ||
53 | |||
54 | it('Should play an internal HLS video in embed', async () => { | ||
55 | await go(FIXTURE_URLS.INTERNAL_EMBED_HLS_VIDEO) | ||
56 | |||
57 | await videoWatchPage.waitEmbedForDisplayed() | ||
58 | await checkCorrectlyPlay(playerPage) | ||
59 | }) | ||
60 | }) | ||
diff --git a/client/e2e/src/suites-all/videos.e2e-spec.ts b/client/e2e/src/suites-all/videos.e2e-spec.ts index b3a87c8e2..997d58884 100644 --- a/client/e2e/src/suites-all/videos.e2e-spec.ts +++ b/client/e2e/src/suites-all/videos.e2e-spec.ts | |||
@@ -49,7 +49,7 @@ describe('Videos all workflow', () => { | |||
49 | videoUploadPage = new VideoUploadPage() | 49 | videoUploadPage = new VideoUploadPage() |
50 | videoUpdatePage = new VideoUpdatePage() | 50 | videoUpdatePage = new VideoUpdatePage() |
51 | myAccountPage = new MyAccountPage() | 51 | myAccountPage = new MyAccountPage() |
52 | loginPage = new LoginPage() | 52 | loginPage = new LoginPage(isMobileDevice()) |
53 | playerPage = new PlayerPage() | 53 | playerPage = new PlayerPage() |
54 | videoListPage = new VideoListPage(isMobileDevice(), isSafari()) | 54 | videoListPage = new VideoListPage(isMobileDevice(), isSafari()) |
55 | 55 | ||
@@ -72,7 +72,7 @@ describe('Videos all workflow', () => { | |||
72 | 72 | ||
73 | await videoUploadPage.navigateTo() | 73 | await videoUploadPage.navigateTo() |
74 | 74 | ||
75 | await videoUploadPage.uploadVideo() | 75 | await videoUploadPage.uploadVideo('video.mp4') |
76 | return videoUploadPage.validSecondUploadStep(videoName) | 76 | return videoUploadPage.validSecondUploadStep(videoName) |
77 | }) | 77 | }) |
78 | 78 | ||
@@ -147,7 +147,7 @@ describe('Videos all workflow', () => { | |||
147 | 147 | ||
148 | await videoUploadPage.navigateTo() | 148 | await videoUploadPage.navigateTo() |
149 | 149 | ||
150 | await videoUploadPage.uploadVideo() | 150 | await videoUploadPage.uploadVideo('video2.mp4') |
151 | await videoUploadPage.validSecondUploadStep(video2Name) | 151 | await videoUploadPage.validSecondUploadStep(video2Name) |
152 | 152 | ||
153 | await videoWatchPage.clickOnSave() | 153 | await videoWatchPage.clickOnSave() |
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') |
diff --git a/client/e2e/src/utils/elements.ts b/client/e2e/src/utils/elements.ts index 9d6cfe673..b0ddd5a65 100644 --- a/client/e2e/src/utils/elements.ts +++ b/client/e2e/src/utils/elements.ts | |||
@@ -6,7 +6,10 @@ async function getCheckbox (name: string) { | |||
6 | } | 6 | } |
7 | 7 | ||
8 | async function selectCustomSelect (id: string, valueLabel: string) { | 8 | async function selectCustomSelect (id: string, valueLabel: string) { |
9 | await $(`[formcontrolname=${id}] .ng-arrow-wrapper`).click() | 9 | const wrapper = $(`[formcontrolname=${id}] .ng-arrow-wrapper`) |
10 | |||
11 | await wrapper.waitForClickable() | ||
12 | await wrapper.click() | ||
10 | 13 | ||
11 | const option = await $$(`[formcontrolname=${id}] .ng-option`).filter(async o => { | 14 | const option = await $$(`[formcontrolname=${id}] .ng-option`).filter(async o => { |
12 | const text = await o.getText() | 15 | const text = await o.getText() |
diff --git a/client/e2e/src/utils/hooks.ts b/client/e2e/src/utils/hooks.ts index e139d8183..889cf1d86 100644 --- a/client/e2e/src/utils/hooks.ts +++ b/client/e2e/src/utils/hooks.ts | |||
@@ -68,5 +68,13 @@ function buildConfig (suiteFile: string = undefined) { | |||
68 | } | 68 | } |
69 | } | 69 | } |
70 | 70 | ||
71 | if (filename === 'signup.e2e-spec.ts') { | ||
72 | return { | ||
73 | signup: { | ||
74 | enabled: true | ||
75 | } | ||
76 | } | ||
77 | } | ||
78 | |||
71 | return {} | 79 | return {} |
72 | } | 80 | } |
diff --git a/client/e2e/src/utils/urls.ts b/client/e2e/src/utils/urls.ts index e82ff1b2e..a1c8283b5 100644 --- a/client/e2e/src/utils/urls.ts +++ b/client/e2e/src/utils/urls.ts | |||
@@ -1,4 +1,9 @@ | |||
1 | const FIXTURE_URLS = { | 1 | const FIXTURE_URLS = { |
2 | INTERNAL_WEBTORRENT_VIDEO: 'https://peertube2.cpy.re/w/pwfz7NizSdPD4mJcbbmNwa?mode=webtorrent', | ||
3 | INTERNAL_HLS_VIDEO: 'https://peertube2.cpy.re/w/pwfz7NizSdPD4mJcbbmNwa', | ||
4 | INTERNAL_EMBED_WEBTORRENT_VIDEO: 'https://peertube2.cpy.re/videos/embed/pwfz7NizSdPD4mJcbbmNwa?mode=webtorrent', | ||
5 | INTERNAL_EMBED_HLS_VIDEO: 'https://peertube2.cpy.re/videos/embed/pwfz7NizSdPD4mJcbbmNwa', | ||
6 | |||
2 | WEBTORRENT_VIDEO: 'https://peertube2.cpy.re/w/122d093a-1ede-43bd-bd34-59d2931ffc5e', | 7 | WEBTORRENT_VIDEO: 'https://peertube2.cpy.re/w/122d093a-1ede-43bd-bd34-59d2931ffc5e', |
3 | 8 | ||
4 | HLS_EMBED: 'https://peertube2.cpy.re/videos/embed/969bf103-7818-43b5-94a0-de159e13de50', | 9 | HLS_EMBED: 'https://peertube2.cpy.re/videos/embed/969bf103-7818-43b5-94a0-de159e13de50', |
diff --git a/client/e2e/wdio.local-test.conf.ts b/client/e2e/wdio.local-test.conf.ts index 5389ebcf0..ca0bb5bfe 100644 --- a/client/e2e/wdio.local-test.conf.ts +++ b/client/e2e/wdio.local-test.conf.ts | |||
@@ -26,9 +26,18 @@ module.exports = { | |||
26 | prefs | 26 | prefs |
27 | } | 27 | } |
28 | } | 28 | } |
29 | // { | ||
30 | // browserName: 'firefox', | ||
31 | // 'moz:firefoxOptions': { | ||
32 | // binary: '/usr/bin/firefox-developer-edition', | ||
33 | // args: [ '--headless', '--window-size=1280,1024' ], | ||
34 | |||
35 | // prefs | ||
36 | // } | ||
37 | // } | ||
29 | ], | 38 | ], |
30 | 39 | ||
31 | services: [ 'chromedriver' ], | 40 | services: [ 'chromedriver', 'geckodriver' ], |
32 | 41 | ||
33 | beforeSession: beforeLocalSession, | 42 | beforeSession: beforeLocalSession, |
34 | beforeSuite: beforeLocalSuite, | 43 | beforeSuite: beforeLocalSuite, |
diff --git a/client/e2e/wdio.main.conf.ts b/client/e2e/wdio.main.conf.ts index 29afdbdc0..0a10ee9ca 100644 --- a/client/e2e/wdio.main.conf.ts +++ b/client/e2e/wdio.main.conf.ts | |||
@@ -98,7 +98,8 @@ export const config = { | |||
98 | // See the full list at http://mochajs.org/ | 98 | // See the full list at http://mochajs.org/ |
99 | mochaOpts: { | 99 | mochaOpts: { |
100 | ui: 'bdd', | 100 | ui: 'bdd', |
101 | timeout: 60000 | 101 | timeout: 60000, |
102 | bail: true | ||
102 | }, | 103 | }, |
103 | 104 | ||
104 | autoCompileOpts: { | 105 | autoCompileOpts: { |