Огурец не читает данные из схемы сценария

У меня есть следующий план сценария

 Background:
   Given customer is in hot or not page

 Scenario Outline: Hot article
  And customer enters <name>
  And submits
  And customer clicks thumbs up
  Then ensure the TBD

 Examples:
  | name |
  |  Elliot |
  |  Florian |

и следующая реализация шага -

@And("customer enters <name>")
public void customer_enters_name(String name) throws Throwable {
    // Express the Regexp above with the code you wish you had
    Thread.sleep(10000);
}

Но когда я выполняю тест, я получаю следующую ошибку:

Вы можете реализовать недостающие шаги с помощью приведенных ниже фрагментов:

@Given("^customer enters Elliot$")
public void customer_enters_Elliot() throws Throwable {
  // Express the Regexp above with the code you wish you had
  throw new PendingException();
}

@Given("^customer enters Florian$")
 public void customer_enters_Florian() throws Throwable {
  // Express the Regexp above with the code you wish you had
  throw new PendingException();
}

Я неправильно реализовал тестовые шаги?


person Tarun    schedule 12.03.2014    source источник
comment
Попробуйте ‹имя› (в кавычках) вместо ‹имя›   -  person Bala    schedule 13.03.2014
comment
это работает, не могли бы вы пометить свой комментарий как ответ, и я приму его :)   -  person Tarun    schedule 13.03.2014


Ответы (2)


Вместо

 Scenario Outline: ...
  And customer enters <name>
  ...

Сделайте это (обратите внимание на двойные кавычки)

 Scenario Outline: ...
  And customer enters "<name>"
  ...
person Bala    schedule 13.03.2014

Просто добавлю: та же ошибка возникает, когда в классе бегуна мы помещаем неправильный пакет класса шага

@CucumberOptions(glue = {"com.wrongpackage.step"})
public class TestRunner{

}

Должен присутствовать класс Step и упаковка должна быть правильной.

person Vaibs    schedule 29.04.2016