]>
Commit | Line | Data |
---|---|---|
1db86422 C |
1 | async 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 | ||
8 | async 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 | ||
25 | export { | |
a9bfa85d C |
26 | getCheckbox, |
27 | selectCustomSelect | |
6d210220 | 28 | } |