aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/e2e/src/utils/elements.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/e2e/src/utils/elements.ts')
-rw-r--r--client/e2e/src/utils/elements.ts21
1 files changed, 18 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 @@
1function clickOnCheckbox (name: string) { 1function getCheckbox (name: string) {
2 return $(`my-peertube-checkbox[inputname=${name}] label`).click() 2 return $(`my-peertube-checkbox[inputname=${name}] label`)
3}
4
5async 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
5export { 19export {
6 clickOnCheckbox 20 getCheckbox,
21 selectCustomSelect
7} 22}