Передача значений в разные шаги в Cucumber в Protractor - PullRequest
0 голосов
/ 26 марта 2019

Мне нужно передать значение от одного шага к другому шагу в файлах определения шага в огурце с помощью Protractor Typescript Общий пример:

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
}

1 Ответ

0 голосов
/ 27 марта 2019
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
})
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...