You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Protractor + Cucumber + Page Object Model - Test steps shows passed without execution #1478
var chai = require('chai');
var expect = chai.expect;
var createIncpage = require ('../pages/createIncidentPage.js');
var {Before, After, Given, When, Then} = require ('cucumber');
// Style:1 : without callback
Given('user in incident view' , function (){
return createIncpage.selIncidentView();
});
//Style 2: with callback
Given('user in incident view' , function (callback){
return createIncpage.selIncidentView(function callback(){
callback();
});
});
//Style #3 : using await
Given('user in incident view' , function (){
await createIncpage.selIncidentView();
});
Both the ways are not working, the style#1, gives test results without execution and style#2 doesnot go to the next step.
Style#3 gives me error unexpected token at createIncpage.selIncidentView();
Can somebody please help what am i doing wrong. how do i achieve synchronization
Also, if i remove the page file & write everything in step file it works fine.
like below:
//Step file without page object:
Given('user in incident view' , function (callback){
browser.ignoreSynchronization = true;
incidentSection.click().then(function(){
return openInc.click();
}).then(function(){
browser.switchTo().frame(0);
return callback();
});
});
Activity
gireeshpunathil commentedon Jul 15, 2019
@gitautomateudemy - is this still outstanding?
gireeshpunathil commentedon Oct 30, 2019
inactive, closing. feel free to reopen if this is still outstanding