custom$$
Команда customs$$
позволяет использовать пользовательскую стратегию, объявленную с помощью browser.addLocatorStrategy
.
Подробнее о пользовательских стратегиях селекторов читайте в документации по селекторам.
Использование
$(selector).custom$$(strategyName, strategyArguments)
Параметры
Имя | Тип | Подробности |
---|---|---|
strategyName | string | |
strategyArguments | * |
Пример
example.js
it('should get all the plugin wrapper buttons', async () => {
await browser.url('https://webdriver.io')
await browser.addLocatorStrategy('myStrat', (selector) => {
return document.querySelectorAll(selector)
})
const pluginRowBlock = await browser.custom$('myStrat', '.pluginRowBlock')
const pluginWrapper = await pluginRowBlock.custom$$('myStrat', '.pluginWrapper')
console.log(pluginWrapper.length) // 4
})
Возвращает
- <WebdriverIO.ElementArray>