Following are my steps:
Then(/^I clear default folder name$/, function () {
var d = new Date();
var n = d.getTime();
// var folderName= "Drawings"+Math.random()+'\n';
var folderName= "Drawings"+n+'\n';
var row = element.all(by.repeater('node in nodes.selectedNode.children track by node._id')).last();
var cells = row.all(by.tagName('input'));
return cells.map(function (elm) {
return elm.clear().then(function(){
return elm.sendKeys(folderName);
});
});
});
Then(/^I see folder updated notification$/, function () {
return element(by.xpath("//div[contains(@class,'notification-bottom-bar show')]")).getText().then(function(itemss) {
console.log(itemss);
return expect(itemss).to.have.string(folderName+ 'has been updated');
})
});
In this case how we need to pass folderName value from first step to next step. Similarly how we can pass variable values between scenarios.