【发布时间】:2018-08-31 19:23:54
【问题描述】:
将 Angular 5 与量角器结合使用。
等待浏览器 url 更改以查看用户是否登录然后登陆内部仪表板页面时遇到问题。
规格:
fdescribe('Suite 1', function() {
it('should login and land on the dashboard page', function() {
// Arrange
browser.ignoreSynchronization = true;
const baseUrl = 'confidentialUrl';
const email = 'email';
const password = 'password';
// Act
browser.get(baseUrl);
element(by.id('username')).sendKeys(email);
element(by.id('password')).sendKeys(password);
element(by.css('.submit-btn')).click();
// Assert
browser.wait(5000);
const currentUrl = browser.getCurrentUrl();
expect(currentUrl).toEqual('confidentialUrl/dashboard');
});
执行“量角器 conf.js”时出现错误:
失败:等待条件必须是类似 Promise 的对象、函数或 条件对象
【问题讨论】:
-
因为你关闭了同步,你需要自己解决promise。
标签: angular selenium protractor