custom$$
custom$$
を使用すると、browser.addLocatorStrategy
を使用して宣言されたカスタム戦略を使用できます。カスタムセレクタ戦略の詳細については、セレクタのドキュメントを参照してください。
使用法
$(selector).custom$$(strategyName, strategyArguments)
パラメーター
名前 | 型 | 詳細 |
---|---|---|
strategyName | 文字列 | |
strategyArguments | param |
例
example.js
it('should get all the plugin wrapper buttons', async () => {
await browser.url('https://webdriverio.dokyumento.jp')
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
})