diff options
author | Chocobozzz <me@florianbigard.com> | 2022-06-21 09:09:46 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-06-21 10:49:54 +0200 |
commit | 1db86422eb516acd23550f30536de4ebd8f0daea (patch) | |
tree | 909c01cf3f5903ba5d44f182d4988586ad8650c1 /client/e2e/src/suites-local | |
parent | 2b621ac0ebe83693bba6354b3482a03ba58143e7 (diff) | |
download | PeerTube-1db86422eb516acd23550f30536de4ebd8f0daea.tar.gz PeerTube-1db86422eb516acd23550f30536de4ebd8f0daea.tar.zst PeerTube-1db86422eb516acd23550f30536de4ebd8f0daea.zip |
Add E2E tests for signup
Diffstat (limited to 'client/e2e/src/suites-local')
-rw-r--r-- | client/e2e/src/suites-local/plugins.e2e-spec.ts | 2 | ||||
-rw-r--r-- | client/e2e/src/suites-local/signup.e2e-spec.ts | 87 |
2 files changed, 88 insertions, 1 deletions
diff --git a/client/e2e/src/suites-local/plugins.e2e-spec.ts b/client/e2e/src/suites-local/plugins.e2e-spec.ts index 411f1d217..a32ba1044 100644 --- a/client/e2e/src/suites-local/plugins.e2e-spec.ts +++ b/client/e2e/src/suites-local/plugins.e2e-spec.ts | |||
@@ -34,7 +34,7 @@ describe('Plugins', () => { | |||
34 | it('Should install hello world plugin', async () => { | 34 | it('Should install hello world plugin', async () => { |
35 | await loginPage.loginAsRootUser() | 35 | await loginPage.loginAsRootUser() |
36 | 36 | ||
37 | await adminPluginPage.navigateToSearch() | 37 | await adminPluginPage.navigateToPluginSearch() |
38 | await adminPluginPage.search('hello-world') | 38 | await adminPluginPage.search('hello-world') |
39 | await adminPluginPage.installHelloWorld() | 39 | await adminPluginPage.installHelloWorld() |
40 | await browser.refresh() | 40 | await browser.refresh() |
diff --git a/client/e2e/src/suites-local/signup.e2e-spec.ts b/client/e2e/src/suites-local/signup.e2e-spec.ts new file mode 100644 index 000000000..0f6d7a0e6 --- /dev/null +++ b/client/e2e/src/suites-local/signup.e2e-spec.ts | |||
@@ -0,0 +1,87 @@ | |||
1 | import { AdminConfigPage } from '../po/admin-config.po' | ||
2 | import { LoginPage } from '../po/login.po' | ||
3 | import { SignupPage } from '../po/signup.po' | ||
4 | import { waitServerUp } from '../utils' | ||
5 | |||
6 | describe('Signup', () => { | ||
7 | let loginPage: LoginPage | ||
8 | let adminConfigPage: AdminConfigPage | ||
9 | let signupPage: SignupPage | ||
10 | |||
11 | before(async () => { | ||
12 | await waitServerUp() | ||
13 | }) | ||
14 | |||
15 | beforeEach(async () => { | ||
16 | loginPage = new LoginPage() | ||
17 | adminConfigPage = new AdminConfigPage() | ||
18 | signupPage = new SignupPage() | ||
19 | |||
20 | await browser.maximizeWindow() | ||
21 | }) | ||
22 | |||
23 | it('Should disable signup', async () => { | ||
24 | await loginPage.loginAsRootUser() | ||
25 | |||
26 | await adminConfigPage.navigateTo('basic-configuration') | ||
27 | await adminConfigPage.toggleSignup() | ||
28 | |||
29 | await adminConfigPage.save() | ||
30 | |||
31 | await loginPage.logout() | ||
32 | await browser.refresh() | ||
33 | |||
34 | expect(signupPage.getRegisterMenuButton()).not.toBeDisplayed() | ||
35 | }) | ||
36 | |||
37 | it('Should enable signup', async () => { | ||
38 | await loginPage.loginAsRootUser() | ||
39 | |||
40 | await adminConfigPage.navigateTo('basic-configuration') | ||
41 | await adminConfigPage.toggleSignup() | ||
42 | |||
43 | await adminConfigPage.save() | ||
44 | |||
45 | await loginPage.logout() | ||
46 | await browser.refresh() | ||
47 | |||
48 | expect(signupPage.getRegisterMenuButton()).toBeDisplayed() | ||
49 | }) | ||
50 | |||
51 | it('Should go on signup page', async function () { | ||
52 | await signupPage.clickOnRegisterInMenu() | ||
53 | }) | ||
54 | |||
55 | it('Should validate the first step (about page)', async function () { | ||
56 | await signupPage.validateStep() | ||
57 | }) | ||
58 | |||
59 | it('Should validate the second step (terms)', async function () { | ||
60 | await signupPage.checkTerms() | ||
61 | await signupPage.validateStep() | ||
62 | }) | ||
63 | |||
64 | it('Should validate the third step (account)', async function () { | ||
65 | await signupPage.fillAccountStep({ | ||
66 | displayName: 'user 1', | ||
67 | username: 'user_1', | ||
68 | email: 'user_1@example.com', | ||
69 | password: 'my_super_password' | ||
70 | }) | ||
71 | |||
72 | await signupPage.validateStep() | ||
73 | }) | ||
74 | |||
75 | it('Should validate the third step (channel)', async function () { | ||
76 | await signupPage.fillChannelStep({ | ||
77 | displayName: 'user 1 channel', | ||
78 | name: 'user_1_channel' | ||
79 | }) | ||
80 | |||
81 | await signupPage.validateStep() | ||
82 | }) | ||
83 | |||
84 | it('Should be logged in', async function () { | ||
85 | await loginPage.ensureIsLoggedInAs('user 1') | ||
86 | }) | ||
87 | }) | ||