本文整理匯總了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}`);
});