diff options
author | Chocobozzz <me@florianbigard.com> | 2021-12-15 15:58:10 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-12-16 10:08:55 +0100 |
commit | a9bfa85d2cdf13670aaced740da5b493fbeddfce (patch) | |
tree | 3781c9218d4cc7786b6589365c0efbed2151703d /client/e2e/src/utils | |
parent | c77fdc605b3ccc1ab6890f889d8200fbe9372949 (diff) | |
download | PeerTube-a9bfa85d2cdf13670aaced740da5b493fbeddfce.tar.gz PeerTube-a9bfa85d2cdf13670aaced740da5b493fbeddfce.tar.zst PeerTube-a9bfa85d2cdf13670aaced740da5b493fbeddfce.zip |
Add ability for admins to set default p2p policy
Diffstat (limited to 'client/e2e/src/utils')
-rw-r--r-- | client/e2e/src/utils/elements.ts | 21 | ||||
-rw-r--r-- | client/e2e/src/utils/hooks.ts | 3 |
2 files changed, 21 insertions, 3 deletions
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 @@ | |||
1 | function clickOnCheckbox (name: string) { | 1 | function getCheckbox (name: string) { |
2 | return $(`my-peertube-checkbox[inputname=${name}] label`).click() | 2 | return $(`my-peertube-checkbox[inputname=${name}] label`) |
3 | } | ||
4 | |||
5 | async function selectCustomSelect (id: string, valueLabel: string) { | ||
6 | await $(`[formcontrolname=${id}] .ng-arrow-wrapper`).click() | ||
7 | |||
8 | const option = await $$(`[formcontrolname=${id}] .ng-option`).filter(async o => { | ||
9 | const text = await o.getText() | ||
10 | |||
11 | return text.trimStart().startsWith(valueLabel) | ||
12 | }).then(options => options[0]) | ||
13 | |||
14 | await option.waitForDisplayed() | ||
15 | |||
16 | return option.click() | ||
3 | } | 17 | } |
4 | 18 | ||
5 | export { | 19 | export { |
6 | clickOnCheckbox | 20 | getCheckbox, |
21 | selectCustomSelect | ||
7 | } | 22 | } |
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) { | |||
55 | comments_enabled: false, | 55 | comments_enabled: false, |
56 | privacy: 4, | 56 | privacy: 4, |
57 | licence: 4 | 57 | licence: 4 |
58 | }, | ||
59 | p2p: { | ||
60 | enabled: false | ||
58 | } | 61 | } |
59 | } | 62 | } |
60 | } | 63 | } |