]>
Commit | Line | Data |
---|---|---|
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 | const wrapper = $(`[formcontrolname=${id}] .ng-arrow-wrapper`) | |
10 | ||
11 | await wrapper.waitForClickable() | |
12 | await wrapper.click() | |
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() | |
23 | } | |
24 | ||
25 | export { | |
26 | getCheckbox, | |
27 | selectCustomSelect | |
28 | } |