Reputation: 1
I need to pass value from one step to another step in step definition files in cucumber with Protractor Typescript Generic Example:
When('the user enters the value {string}', function() {
//code written to enter the value
})
Then('the user has entered the value')
{
// I need the value entered in the previous step to be validated here
}
Upvotes: 0
Views: 778
Reputation: 13722
let inputText = ''
When('the user enters the value {string}', function(string) {
inputText = string
//code written to enter the value
})
Then('the user has entered the value', function() {
expect().to.xxx(inputText)
// I need the value entered in the previous step to be validated here
})
Upvotes: 1