]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/e2e/src/po/admin-config.po.ts
Translated using Weblate (Dutch)
[github/Chocobozzz/PeerTube.git] / client / e2e / src / po / admin-config.po.ts
CommitLineData
1db86422 1import { getCheckbox, go } from '../utils'
6d210220
C
2
3export class AdminConfigPage {
4
5 async navigateTo (tab: 'instance-homepage' | 'basic-configuration' | 'instance-information') {
6 const waitTitles = {
7 'instance-homepage': 'INSTANCE HOMEPAGE',
8 'basic-configuration': 'APPEARANCE',
9 'instance-information': 'INSTANCE'
10 }
11
12 await go('/admin/config/edit-custom#' + tab)
13
14 await $('.inner-form-title=' + waitTitles[tab]).waitForDisplayed()
15 }
16
814e9e07
C
17 async updateNSFWSetting (newValue: 'do_not_list' | 'blur' | 'display') {
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)
6d210220
C
25 }
26
27 updateHomepage (newValue: string) {
28 return $('#instanceCustomHomepageContent').setValue(newValue)
29 }
30
1db86422
C
31 async toggleSignup () {
32 const checkbox = await getCheckbox('signupEnabled')
814e9e07
C
33
34 await checkbox.waitForClickable()
1db86422
C
35 await checkbox.click()
36 }
37
6d210220 38 async save () {
1db86422 39 const button = $('input[type=submit]')
814e9e07
C
40
41 await button.waitForClickable()
1db86422 42 await button.click()
6d210220
C
43 }
44}