In a test spec, I need to click a button on a web page, and wait for the new page completely loaded.
emailEl.sendKeys(\'jack\');
passwordEl.sendKeys(\'123pwd
In this case, you can used:
Page Object:
waitForURLContain(urlExpected: string, timeout: number) {
try {
const condition = browser.ExpectedConditions;
browser.wait(condition.urlContains(urlExpected), timeout);
} catch (e) {
console.error('URL not contain text.', e);
};
}
Page Test:
page.waitForURLContain('abc#/efg', 30000);