custom$$
Il customs$$
ti permette di utilizzare una strategia personalizzata dichiarata usando browser.addLocatorStrategy
.
Leggi di più sulle strategie di selezione personalizzate nella documentazione dei Selettori.
Utilizzo
$(selector).custom$$(strategyName, strategyArguments)
Parametri
Nome | Tipo | Dettagli |
---|---|---|
strategyName | string | |
strategyArguments | * |
Esempio
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
})
Restituisce
- <WebdriverIO.ElementArray>