aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/e2e/src/po/admin-config.po.ts
blob: a1518478189ed069241987d50311403cbb0ff08d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import { browserSleep, go } from '../utils'

export class AdminConfigPage {

  async navigateTo (tab: 'instance-homepage' | 'basic-configuration' | 'instance-information') {
    const waitTitles = {
      'instance-homepage': 'INSTANCE HOMEPAGE',
      'basic-configuration': 'APPEARANCE',
      'instance-information': 'INSTANCE'
    }

    await go('/admin/config/edit-custom#' + tab)

    await $('.inner-form-title=' + waitTitles[tab]).waitForDisplayed()
  }

  updateNSFWSetting (newValue: 'do_not_list' | 'blur' | 'display') {
    return $('#instanceDefaultNSFWPolicy').selectByAttribute('value', newValue)
  }

  updateHomepage (newValue: string) {
    return $('#instanceCustomHomepageContent').setValue(newValue)
  }

  async save () {
    await $('input[type=submit]').click()
    await browserSleep(200)
  }
}