]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/e2e/src/utils/elements.ts
Implement signup approval in client
[github/Chocobozzz/PeerTube.git] / client / e2e / src / utils / elements.ts
CommitLineData
1db86422
C
1async function getCheckbox (name: string) {
2 const input = $(`my-peertube-checkbox input[id=${name}]`)
3 await input.waitForExist()
4
5 return input.parentElement()
a9bfa85d
C
6}
7
8async function selectCustomSelect (id: string, valueLabel: string) {
814e9e07
C
9 const wrapper = $(`[formcontrolname=${id}] .ng-arrow-wrapper`)
10
11 await wrapper.waitForClickable()
12 await wrapper.click()
a9bfa85d
C
13
14 const option = await $$(`[formcontrolname=${id}] .ng-option`).filter(async o => {
15 const text = await o.getText()
16
17 return text.trimStart().startsWith(valueLabel)
18 }).then(options => options[0])
19
20 await option.waitForDisplayed()
21
22 return option.click()
6d210220
C
23}
24
25export {
a9bfa85d
C
26 getCheckbox,
27 selectCustomSelect
6d210220 28}