diff options
author | Chocobozzz <me@florianbigard.com> | 2023-01-19 09:30:05 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2023-01-19 13:53:40 +0100 |
commit | 5bdfa604f102a5e51b5152457cd1a16d79177e26 (patch) | |
tree | 878c04cbd3c452c7b45aa39e19abd38bfe691063 /client/e2e/src/po/admin-registration.po.ts | |
parent | 9589907c89d29a6c0acd52c8cb789af9f93ce9af (diff) | |
download | PeerTube-5bdfa604f102a5e51b5152457cd1a16d79177e26.tar.gz PeerTube-5bdfa604f102a5e51b5152457cd1a16d79177e26.tar.zst PeerTube-5bdfa604f102a5e51b5152457cd1a16d79177e26.zip |
Add E2E client tests for signup approval
Diffstat (limited to 'client/e2e/src/po/admin-registration.po.ts')
-rw-r--r-- | client/e2e/src/po/admin-registration.po.ts | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/client/e2e/src/po/admin-registration.po.ts b/client/e2e/src/po/admin-registration.po.ts new file mode 100644 index 000000000..85234654d --- /dev/null +++ b/client/e2e/src/po/admin-registration.po.ts | |||
@@ -0,0 +1,35 @@ | |||
1 | import { browserSleep, findParentElement, go } from '../utils' | ||
2 | |||
3 | export class AdminRegistrationPage { | ||
4 | |||
5 | async navigateToRegistratonsList () { | ||
6 | await go('/admin/moderation/registrations/list') | ||
7 | |||
8 | await $('my-registration-list').waitForDisplayed() | ||
9 | } | ||
10 | |||
11 | async accept (username: string, moderationResponse: string) { | ||
12 | const usernameEl = await $('*=' + username) | ||
13 | await usernameEl.waitForDisplayed() | ||
14 | |||
15 | const tr = await findParentElement(usernameEl, async el => await el.getTagName() === 'tr') | ||
16 | |||
17 | await tr.$('.action-cell .dropdown-root').click() | ||
18 | |||
19 | const accept = await $('span*=Accept this registration') | ||
20 | await accept.waitForClickable() | ||
21 | await accept.click() | ||
22 | |||
23 | const moderationResponseTextarea = await $('#moderationResponse') | ||
24 | await moderationResponseTextarea.waitForDisplayed() | ||
25 | |||
26 | await moderationResponseTextarea.setValue(moderationResponse) | ||
27 | |||
28 | const submitButton = $('.modal-footer input[type=submit]') | ||
29 | await submitButton.waitForClickable() | ||
30 | await submitButton.click() | ||
31 | |||
32 | await browserSleep(1000) | ||
33 | } | ||
34 | |||
35 | } | ||