本文整理匯總了TypeScript中protractor/globals.browser類的典型用法代碼示例。如果您正苦於以下問題:TypeScript browser類的具體用法?TypeScript browser怎麽用?TypeScript browser使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了browser類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1:
return this.getIconButton(name, '.fa-pencil').click().then(() =>{
let url = browser.getCurrentUrl();
browser.sleep(500);
return this.closePane('.main.close-button').then(() => {
return url;
});
});
示例2: function
return browser.wait(() => {
this.pressSubmitButton();
return browser.wait(ExpectedConditions.alertIsPresent(), 5000).then(
browser.switchTo().alert().then(
// use alert.accept instead of alert.dismiss which results in a browser crash
function(alert) { alert.accept(); return true; },
function() { return false; }
)
);
});
示例3: it
it('should wait on async function in conditional', async function() : Promise<any> {
browser.get('http://www.angularjs.org');
let todoList = element.all(by.repeater('todo in todoList.todos'));
if ((await todoList.count()) > 1) {
expect(todoList.get(1).getText()).toEqual('build an angular app');
}
});
示例4: expect
submitEditCourseBtn.click().then(function() {
browser.waitForAngular();
//The last course should have changed its name
var editedCourse = element.all(by.className('course-title')).last();
expect(editedCourse.getText()).toEqual('[EDITED]');
});
示例5: changeURL
export function changeURL(url: string) {
return browser.get(url).then(() => {
return browser.getCurrentUrl().then((newURL) => {
return newURL;
})
})
}
示例6: element
return element(by.css('.metron-dialog .btn-primary')).click().then(() => {
browser.sleep(1000);
return element(by.css('.alert .close')).click().then(() => {
return waitForStalenessOf(element(by.cssContainingText('td', name))).then(() =>{
return true;
});
})
});
示例7: it
it('should automatically write down the fullname', () => {
po_welcome.setFirstname('Rob');
po_welcome.setLastname('Eisenberg');
// For now there is a timing issue with the binding.
// Until resolved we will use a short sleep to overcome the issue.
browser.sleep(200);
expect(po_welcome.getFullname()).toBe('ROB EISENBERG');
});