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
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();
});
});
The text was updated successfully, but these errors were encountered:
*** Cucumber : 4.2.0
*** Protractor cucumber framework : 4.2.0
// My page file:
createIncpage = function (){
module.exports = new createIncpage ();
Step file like below:
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();
});
});
The text was updated successfully, but these errors were encountered: