fix accept fn for waitForTextContent (#16449)

This commit is contained in:
Lucy Zhang
2021-07-27 09:15:35 -07:00
committed by GitHub
parent 2e9eff7ffc
commit 24349885d3

View File

@@ -302,7 +302,7 @@ export class Code {
// {{SQL CARBON EDIT}} Print out found element
const element = await poll(
() => this.driver.getElements(windowId, selector).then(els => els.length > 0 ? Promise.resolve(els[0]) : Promise.reject(new Error('Element not found for textContent'))),
s => accept!(typeof s === 'string' ? s : ''),
s => accept!(typeof s.textContent === 'string' ? s.textContent : ''),
`get text content '${selector}'`,
retryCount
);