From a9bfa85d2cdf13670aaced740da5b493fbeddfce Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 15 Dec 2021 15:58:10 +0100 Subject: Add ability for admins to set default p2p policy --- client/e2e/src/utils/elements.ts | 21 ++++++++++++++++++--- client/e2e/src/utils/hooks.ts | 3 +++ 2 files changed, 21 insertions(+), 3 deletions(-) (limited to 'client/e2e/src/utils') diff --git a/client/e2e/src/utils/elements.ts b/client/e2e/src/utils/elements.ts index cadc46cce..315718879 100644 --- a/client/e2e/src/utils/elements.ts +++ b/client/e2e/src/utils/elements.ts @@ -1,7 +1,22 @@ -function clickOnCheckbox (name: string) { - return $(`my-peertube-checkbox[inputname=${name}] label`).click() +function getCheckbox (name: string) { + return $(`my-peertube-checkbox[inputname=${name}] label`) +} + +async function selectCustomSelect (id: string, valueLabel: string) { + await $(`[formcontrolname=${id}] .ng-arrow-wrapper`).click() + + const option = await $$(`[formcontrolname=${id}] .ng-option`).filter(async o => { + const text = await o.getText() + + return text.trimStart().startsWith(valueLabel) + }).then(options => options[0]) + + await option.waitForDisplayed() + + return option.click() } export { - clickOnCheckbox + getCheckbox, + selectCustomSelect } diff --git a/client/e2e/src/utils/hooks.ts b/client/e2e/src/utils/hooks.ts index e42c6a5d8..2f3d10fe3 100644 --- a/client/e2e/src/utils/hooks.ts +++ b/client/e2e/src/utils/hooks.ts @@ -55,6 +55,9 @@ function buildConfig (suiteFile: string = undefined) { comments_enabled: false, privacy: 4, licence: 4 + }, + p2p: { + enabled: false } } } -- cgit v1.2.3