本文整理汇总了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');
});