aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/e2e/src/po/signup.po.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-06-21 09:09:46 +0200
committerChocobozzz <me@florianbigard.com>2022-06-21 10:49:54 +0200
commit1db86422eb516acd23550f30536de4ebd8f0daea (patch)
tree909c01cf3f5903ba5d44f182d4988586ad8650c1 /client/e2e/src/po/signup.po.ts
parent2b621ac0ebe83693bba6354b3482a03ba58143e7 (diff)
downloadPeerTube-1db86422eb516acd23550f30536de4ebd8f0daea.tar.gz
PeerTube-1db86422eb516acd23550f30536de4ebd8f0daea.tar.zst
PeerTube-1db86422eb516acd23550f30536de4ebd8f0daea.zip
Add E2E tests for signup
Diffstat (limited to 'client/e2e/src/po/signup.po.ts')
-rw-r--r--client/e2e/src/po/signup.po.ts64
1 files changed, 64 insertions, 0 deletions
diff --git a/client/e2e/src/po/signup.po.ts b/client/e2e/src/po/signup.po.ts
new file mode 100644
index 000000000..ef36dbcc4
--- /dev/null
+++ b/client/e2e/src/po/signup.po.ts
@@ -0,0 +1,64 @@
1import { getCheckbox } from '../utils'
2
3export class SignupPage {
4
5 getRegisterMenuButton () {
6 return $('.create-account-button')
7 }
8
9 async clickOnRegisterInMenu () {
10 const button = this.getRegisterMenuButton()
11
12 await button.waitForDisplayed()
13 await button.click()
14 }
15
16 async validateStep () {
17 const next = $('button[type=submit]')
18
19 await next.waitForClickable()
20 await next.click()
21 }
22
23 async checkTerms () {
24 const terms = await getCheckbox('terms')
25
26 return terms.click()
27 }
28
29 async fillAccountStep (options: {
30 displayName: string
31 username: string
32 email: string
33 password: string
34 }) {
35 if (options.displayName) {
36 await $('#displayName').setValue(options.displayName)
37 }
38
39 if (options.username) {
40 await $('#username').setValue(options.username)
41 }
42
43 if (options.email) {
44 await $('#email').setValue(options.email)
45 }
46
47 if (options.password) {
48 await $('#password').setValue(options.password)
49 }
50 }
51
52 async fillChannelStep (options: {
53 displayName: string
54 name: string
55 }) {
56 if (options.displayName) {
57 await $('#displayName').setValue(options.displayName)
58 }
59
60 if (options.name) {
61 await $('#name').setValue(options.name)
62 }
63 }
64}