本文整理汇总了TypeScript中protractor.browser.driver.wait方法的典型用法代码示例。如果您正苦于以下问题:TypeScript browser.driver.wait方法的具体用法?TypeScript browser.driver.wait怎么用?TypeScript browser.driver.wait使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类protractor.browser.driver
的用法示例。
在下文中一共展示了browser.driver.wait方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: insereDadosGoogle
async insereDadosGoogle() {
let inputEmail = 'input#identifierId';
await browser.driver.wait(async () => await $(inputEmail).isPresent() && await $('.CwaK9 span.RveJvd.snByac').isPresent(), 30 * 1000);
await browser.driver.findElement(by.css(inputEmail)).sendKeys('teste-professor-1@logoseducacao.com.br'+ protractor.Key.ENTER );
await browser.sleep(1000);
let inputPass = 'input[name=password]'
await browser.driver.wait(() => $(inputPass).isPresent(), 30 * 1000);
await browser.driver.findElement(by.css(inputPass)).sendKeys('professor123#'+ protractor.Key.ENTER);
await browser.sleep(1000);
await browser.driver.wait(async () => (await browser.driver.getCurrentUrl()).includes('class-daily'),30*1000);
}
示例2:
button.click().then(() => {
return browser.driver.wait(() => {
return body.getAttribute('class').then(value => {
return value === themeDefault;
});
}, 10000);
});
示例3: it
it('should redirect from / to setup', () => {
browser.get('/');
return browser.driver.wait(() => {
return browser.driver.getCurrentUrl().then((url) => {
return /setup/.test(url);
});
}, 10000);
});
示例4: beforeEach
beforeEach(async () => {
await browser.get('/');
return browser.driver.wait(function () {
let until = protractor.ExpectedConditions;
let elem = element(by.css('sd-home'));
browser.wait(until.visibilityOf(elem), 10000);
return elem;
});
});
示例5: constructor
constructor(filePath: string) {
this.wrapped = browser.driver
.wait(() => fs.existsSync(filePath))
.then(() => {
const graphString = fs.readFileSync(filePath, {encoding: 'utf8'});
const graph = JSON.parse(graphString);
return graph.elements;
});
}
示例6: 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);
}
}
示例7: waitForFileToExist
export function waitForFileToExist(filePath: string) {
return browser.driver.wait(() => { return fs.existsSync(filePath); }, 30000);
}
示例8:
.then(() => {
return browser.driver.wait(() => {
return fs.existsSync(__dirname + '/../downloads/' + cardName.split('@')[0] + '.card');
}, Constants.shortWait);
})
示例9: navigateTo
export async function navigateTo(url: string) {
await browser.get(url);
await browser.driver.wait(async () => (await browser.driver.getCurrentUrl()).includes(url));
}