]>
Commit | Line | Data |
---|---|---|
a9bfa85d C |
1 | function getCheckbox (name: string) { |
2 | return $(`my-peertube-checkbox[inputname=${name}] label`) | |
3 | } | |
4 | ||
5 | async 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() | |
6d210220 C |
17 | } |
18 | ||
19 | export { | |
a9bfa85d C |
20 | getCheckbox, |
21 | selectCustomSelect | |
6d210220 | 22 | } |