]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/e2e/src/utils/elements.ts
Merge branch 'release/4.2.0' into develop
[github/Chocobozzz/PeerTube.git] / client / e2e / src / utils / elements.ts
1 async function getCheckbox (name: string) {
2 const input = $(`my-peertube-checkbox input[id=${name}]`)
3 await input.waitForExist()
4
5 return input.parentElement()
6 }
7
8 async function selectCustomSelect (id: string, valueLabel: string) {
9 await $(`[formcontrolname=${id}] .ng-arrow-wrapper`).click()
10
11 const option = await $$(`[formcontrolname=${id}] .ng-option`).filter(async o => {
12 const text = await o.getText()
13
14 return text.trimStart().startsWith(valueLabel)
15 }).then(options => options[0])
16
17 await option.waitForDisplayed()
18
19 return option.click()
20 }
21
22 export {
23 getCheckbox,
24 selectCustomSelect
25 }