本文整理汇总了TypeScript中protractor/globals.browser.driver类的典型用法代码示例。如果您正苦于以下问题:TypeScript browser.driver类的具体用法?TypeScript browser.driver怎么用?TypeScript browser.driver使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了browser.driver类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: expect
btn.click().then(function() {
page.waitUntilElementPresent('#course-details-modal');
// Find form elements
var entryTitleField = browser.driver.findElement(by.css('input#inputTitle'));
var entryCommentField = browser.driver.findElement(by.css('textarea#inputComment'));
// Fill input fields
entryTitleField.sendKeys('New testing entry title');
entryCommentField.sendKeys('New testing entry comment');
// Ensure fields contain what has been entered
expect(entryTitleField.getAttribute('value')).toEqual('New testing entry title');
expect(entryCommentField.getAttribute('value')).toEqual('New testing entry comment');
// Send new entry
browser.driver.findElement(by.css('#post-modal-btn')).then(function(sendButton) {
sendButton.click().then(function() {
browser.waitForAngular();
page.waitUntilElementNotVisible('#course-details-modal');
// Get and check the title of last entry
var entries = element.all(by.css('li.entry-title div div a'));
expect(entries.last().getText()).toContain('New testing entry title');
});
});
});
开发者ID:pabloFuente,项目名称:full-teaching,代码行数:26,代码来源:app.e2e-spec.ts
示例2: it
it('should log in', () => {
// Check browser url (root)
expect(browser.driver.getCurrentUrl()).toMatch('/');
// Find form elements (login modal is already opened)
var userNameField = browser.driver.findElement(by.id('email'));
var userPassField = browser.driver.findElement(by.id('password'));
// Fill input fields
userNameField.sendKeys(userEmail);
userPassField.sendKeys(userPass);
// Ensure fields contain what has been entered
expect(userNameField.getAttribute('value')).toEqual(userEmail);
expect(userPassField.getAttribute('value')).toEqual(userPass);
browser.driver.findElement(by.id('log-in-btn')).then(function(loginBtn) {
// Click to log in - waiting for Angular as it is manually bootstrapped.
loginBtn.click().then(function() {
browser.waitForAngular();
// Browser url must have changed to the dashboard route
expect(browser.driver.getCurrentUrl()).toMatch('/courses');
});
});
});
开发者ID:pabloFuente,项目名称:full-teaching,代码行数:27,代码来源:app.e2e-spec.ts
示例3: expect
enrollmentPage.getAllWindowHandles().then((handles) => {
// parentHandle = handles[0];
var popUpHandle = handles[0];
// Change to new handle
browser.driver.switchTo().window(popUpHandle);
var popUpHandleFinal = browser.driver.getWindowHandle();
expect(popUpHandleFinal).toEqual(popUpHandle);
});
开发者ID:nader-magdy,项目名称:ExchangeSimulator,代码行数:10,代码来源:new-enrollment.spec.ts
注:本文中的protractor/globals.browser.driver类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论