Update README to reflect WIP
This commit is contained in:
15
test/browser/BrowserCommands.ts
Normal file
15
test/browser/BrowserCommands.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { browser } from '@wdio/globals';
|
||||
|
||||
export enum DocumentReadyState {
|
||||
Loading = 'Loading',
|
||||
Interactive = 'Interactive',
|
||||
Completed = 'Completed'
|
||||
}
|
||||
|
||||
export async function waitUntilDocumentReadyState(waitForReadyState: DocumentReadyState): Promise<void> {
|
||||
await browser.waitUntil(() => browser.execute(`document.readyState === "${DocumentReadyState[waitForReadyState]}"`) as Promise<boolean>, {
|
||||
timeout: 10000,
|
||||
timeoutMsg: `Document did not have a readyState of [${waitForReadyState}] after [10] seconds`,
|
||||
interval: 1000
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user