【发布时间】:2018-07-11 17:17:49
【问题描述】:
我正在使用 Protractor 和 CucumberJS 实施 E2E 测试。我面临的问题是它只执行第一步并等到它超时。仅在使用页面对象时才会出现此问题。
这是我的功能文件:
场景:验证添加事件权重 鉴于添加优先计划 并添加事件权重类型 用户创建事件 然后应该正确显示事件权重。
页面对象文件:
var createincidentpage = function(){
this.priorityAdd = function(userdetail, callback) {
browser.ignoreSyncronization = true;
incidentSection.click()
.then(function(){
return PPPage.click();
}).then(function(){
browser.switchtTo().frame(0);
return newElement.click();
}).then(fucntion(){
return newppname.sendkeys("xyz");
}).then(function(){
return fromDatePicker.click();
}).then(function(){
return gotoTodayElement.click();
}).then(function(){
return editableOk.Click();
}).then(function(){
return toDatePicker.click();
}).then(function(){
return selDateinMOnth.click();
}).then(function(){
SubmitButton.click();
return callback();
});
};
module.exports = new createincidentpage();
我的步骤文件:
var createincidentpage = require ('../pages/createincidentpage.js');
Given('priority program add' , function (callback) {
createincidentpage.priorityAdd(function callback(){
callback();
}):
});
【问题讨论】:
标签: protractor pageobjects cucumberjs