本文整理汇总了TypeScript中protractor.browser.driver.getCurrentUrl方法的典型用法代码示例。如果您正苦于以下问题:TypeScript browser.driver.getCurrentUrl方法的具体用法?TypeScript browser.driver.getCurrentUrl怎么用?TypeScript browser.driver.getCurrentUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类protractor.browser.driver
的用法示例。
在下文中一共展示了browser.driver.getCurrentUrl方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: resolve
this.createRetroButton().click().then(() => {
workaround.wait();
browser.driver.getCurrentUrl().then((url: string) => {
const boardId = boardName.replace(' ', '-');
if (url.endsWith(`/team/${boardId}`)) {
resolve(boardId);
} else {
resolve('failed to navigate to team page');
}
});
});
示例2: myBeforeAll
export async function myBeforeAll() {
await browser.get('/');
browser.ignoreSynchronization = true;
await browser.sleep(500);
if (!await browser.executeScript('return window.localStorage.getItem("access_token")')) {
if((await browser.driver.getCurrentUrl()).includes('/auth')) await browser.get('/auth');
await browser.sleep(500);
await waitRenderElement('.auth0-lock-submit');
await browser.sleep(500);
await browser.findElement(by.css("input[name=email]")).sendKeys('teste-professor-1@logoseducacao.com.br');
await browser.sleep(500);// espera fim do preencimento
await browser.findElement(by.css("input[type=password]")).sendKeys('professor');
await browser.sleep(500);// espera fim do preencimento
await browser.findElement(by.css('.auth0-lock-submit')).click();
await browser.sleep(500);
await browser.driver.wait(async () => (await browser.driver.getCurrentUrl()).includes('class-daily'),30*1000);
}
}
示例3:
return browser.driver.wait(() => {
return browser.driver.getCurrentUrl().then((url) => {
return /setup/.test(url);
});
}, 10000);
示例4:
await browser.driver.wait(async () => (await browser.driver.getCurrentUrl()).includes('class-daily'),30*1000);
示例5: expect
page.createRandomBoard('team name').then((boardId) => {
expect(browser.driver.getCurrentUrl()).toContain(`/team/${boardId}`);
});
示例6:
await browser.driver.wait(async () => (await browser.driver.getCurrentUrl()).includes(url));
示例7: expect
page.signInButton().click().then(() => {
workaround.wait();
expect(browser.driver.getCurrentUrl()).toContain(`/team/${boardName}`);
});