Jasmine量角器:使用grep选项运行时测试用例失败
我在jasmine/Digrator中创建了几个测试用例。当我使用Jasmine量角器:使用grep选项运行时测试用例失败,jasmine,protractor,Jasmine,Protractor,我在jasmine/Digrator中创建了几个测试用例。当我使用 protractor conf.js 所有测试用例都成功运行并通过 但是当我使用 protractor conf.js --grep="dummytag3" 然后执行所选测试用例,但失败。我发现很奇怪,为什么一个测试用例可能会在没有标记的情况下失败并通过 规格js 'use strict'; var HomePage = require('./pages/homePage.js'); var BusPage = requi
protractor conf.js
所有测试用例都成功运行并通过
但是当我使用
protractor conf.js --grep="dummytag3"
然后执行所选测试用例,但失败。我发现很奇怪,为什么一个测试用例可能会在没有标记的情况下失败并通过
规格js
'use strict';
var HomePage = require('./pages/homePage.js');
var BusPage = require('./pages/busPage.js');
describe('Login cases' , function() {
var homePage= new HomePage();
it('Login without username & password @dummytag3' , function() {
homePage.mainLoginButtonClick();
homePage.popupLoginButtonClick();
expect(homePage.errMsgUsername).toEqual('Please enter valid Email or Mobile Number');
});
});
主页.js
'use strict';
var HomePage = function () {
browser.get('https://www.mobikwik.com');
browser.driver.manage().window().maximize();
};
HomePage.prototype = Object.create({}, {
//Login
mainLoginButton: { get: function () { return element(by.id('qa-mbkLogin')); }},
mainLoginButtonClick: { value: function () { this.mainLoginButton.click(); }},
popupLoginButton: { get: function () { return element(by.xpath('//*[@id="loginInfo"]/div[3]/p/button')); }},
popupLoginButtonClick: { value: function () { this.popupLoginButton.click(); }},
errMsgUsername: { get: function () { return element(by.xpath('//*[@id="loginInfo"]/div[1]/span')).getText(); }},
});
module.exports = HomePage;
错误:
Error: Error while waiting for Protractor to sync with the page: "window.anular is undefined. This could be either because this is a non-angular page or ecause your test involves client-side navigation, which can interfere with Protactor's bootstrapping. See http://git.io/v4gXM for details"
你在哪里做browser.get?你能在测试开始前尝试添加吗
browser.waitForAngularEnabled(true)
添加了homePage.js的代码,从那里获取browser.get。你尝试过我上面的建议吗?是的,它没有解决我的问题。我添加了这是homePage.js,在browser.get之后