X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fe2e%2Fsrc%2Fpo%2Fadmin-config.po.ts;h=3cf9b17d9b1ff5ad0be6df4e9be1d845a66f1766;hb=a41b944398af03ad7594380ad1cb7a978f6417cb;hp=6d48a0fd73d26059ce876669a98c9d4d6af7678e;hpb=4e56f0fff12ab9840574e7a27277fc78b195b3e2;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/e2e/src/po/admin-config.po.ts b/client/e2e/src/po/admin-config.po.ts index 6d48a0fd7..3cf9b17d9 100644 --- a/client/e2e/src/po/admin-config.po.ts +++ b/client/e2e/src/po/admin-config.po.ts @@ -1,4 +1,4 @@ -import { getCheckbox, go } from '../utils' +import { browserSleep, getCheckbox, go, isCheckboxSelected } from '../utils' export class AdminConfigPage { @@ -8,27 +8,58 @@ export class AdminConfigPage { '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) + async updateNSFWSetting (newValue: 'do_not_list' | 'blur' | 'display') { + const elem = $('#instanceDefaultNSFWPolicy') + + await elem.waitForDisplayed() + await elem.scrollIntoView({ block: 'center' }) // Avoid issues with fixed header + await elem.waitForClickable() + + return elem.selectByAttribute('value', newValue) } updateHomepage (newValue: string) { return $('#instanceCustomHomepageContent').setValue(newValue) } - async toggleSignup () { + async toggleSignup (enabled: boolean) { + if (await isCheckboxSelected('signupEnabled') === enabled) return + const checkbox = await getCheckbox('signupEnabled') + + await checkbox.waitForClickable() + await checkbox.click() + } + + async toggleSignupApproval (required: boolean) { + if (await isCheckboxSelected('signupRequiresApproval') === required) return + + const checkbox = await getCheckbox('signupRequiresApproval') + + await checkbox.waitForClickable() + await checkbox.click() + } + + async toggleSignupEmailVerification (required: boolean) { + if (await isCheckboxSelected('signupRequiresEmailVerification') === required) return + + const checkbox = await getCheckbox('signupRequiresEmailVerification') + + await checkbox.waitForClickable() await checkbox.click() } async save () { const button = $('input[type=submit]') + + await button.waitForClickable() await button.click() + + await browserSleep(1000) } }