Remote smoketest timeout (fixes #115159)

This commit is contained in:
Martin Aeschlimann
2021-01-27 15:43:59 +01:00
parent e4022fb0e2
commit 4bd2d367e7
4 changed files with 16 additions and 14 deletions

View File

@@ -282,14 +282,15 @@ export class Code {
await this.driver.exitApplication();
}
async waitForTextContent(selector: string, textContent?: string, accept?: (result: string) => boolean): Promise<string> {
async waitForTextContent(selector: string, textContent?: string, accept?: (result: string) => boolean, retryCount?: number): Promise<string> {
const windowId = await this.getActiveWindowId();
accept = accept || (result => textContent !== undefined ? textContent === result : !!result);
return await poll(
() => this.driver.getElements(windowId, selector).then(els => els.length > 0 ? Promise.resolve(els[0].textContent) : Promise.reject(new Error('Element not found for textContent'))),
s => accept!(typeof s === 'string' ? s : ''),
`get text content '${selector}'`
`get text content '${selector}'`,
retryCount
);
}