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