1 async function getCheckbox (name: string) {
2 const input = $(`my-peertube-checkbox input[id=${name}]`)
3 await input.waitForExist()
5 return input.parentElement()
8 function isCheckboxSelected (name: string) {
9 return $(`input[id=${name}]`).isSelected()
12 async function selectCustomSelect (id: string, valueLabel: string) {
13 const wrapper = $(`[formcontrolname=${id}] .ng-arrow-wrapper`)
15 await wrapper.waitForClickable()
18 const option = await $$(`[formcontrolname=${id}] .ng-option`).filter(async o => {
19 const text = await o.getText()
21 return text.trimStart().startsWith(valueLabel)
22 }).then(options => options[0])
24 await option.waitForDisplayed()
29 async function findParentElement (
30 el: WebdriverIO.Element,
31 finder: (el: WebdriverIO.Element) => Promise<boolean>
33 if (await finder(el) === true) return el
35 return findParentElement(await el.parentElement(), finder)