Многоразовый Когда и Затем этап - PullRequest
0 голосов
/ 23 апреля 2019

У меня есть два сценария, которые выглядят следующим образом:

scenario("The message does not contain a valid JSON structure") {
  Given("the message is in XML format")
  When("the message gets validated")
  Then("it should appear in the error pool")
  succeed
}

scenario("The message is empty") {
  Given("the message is {}")
  When("the message gets validated")
  Then("it should appear in the error pool")
  succeed
} 

Как видите, этапы When и Then в обоих сценариях одинаковы.
Вопрос в том,Можно ли определить When и Then один раз и использовать несколько раз?Как переменная в программе.

...