Я пытаюсь понять Огурец, достаточно, чтобы я мог выделить пользовательские истории и позволить бизнес-эксперту написать их.
Если у меня есть Фон (версия 1), общее предварительное условие, почему все мои Сценарии получают ошибки, говорящие мне: «Совпадение определений с несколькими шагами», разве точка Фон не является общей для всех? ?
Если у меня разные данные заданные (версия 1), то не следует ли следующее, когда это разрешает одно и то же действие, основанное на разных стартовых позициях? Опять же, когда вызывает "Соответствие определений нескольких шагов"
Вот мой файл функций. В идеале я хочу версию 1, это то, как бизнес-эксперт пишет их, отдельные, удобные для чтения, но единственный способ заставить это работать без ошибок "Multiple step Definition Matchs" - это версия 2, где каждый вариант должен быть комбинацией,более сложный, труднее для чтения.
Почему я не могу использовать Фон с более чем 1 сценарием?
Эти принудительные изменения пахнут, так что я делаю неправильно, что я пропустил? Я нашел сотни простых примеров, но мне кажется, что мне не хватает какого-то руководящего принципа корнишона. Чего мне не хватает?
Feature: Help
When users says help
"As a user
I want the bot to understand me when I ask for help,
In order that I get some guidance, or some idea what to do next"
# Version 1
Background:
Given the user is in conversation with the bot
*// above line causes error*
Scenario: No topic
Given there is no topic
When the user says help
*// above line causes error*
Then the bot responds with a sorry, regretful message
And then asks if the user would like to see a list of available features
Scenario: A valid topic
Given there is a valid topic
When the user says help
*// above line causes error*
Then the bot responds with a confirmation message
And then asks if the user would like to see a list of topic features
# Version 2
# Scenario: All
# Given the user is in conversation with the bot
# When the user says help and there is no topic
# Then the bot responds with a sorry, regretful message
# And then asks if the user would like to see a list of available features
# When the user says help and there is a valid topic
# Then the bot responds with a confirmation message
# And then asks if the user would like to see a list of topic features
Failures:
1) Scenario: No topic # features/help.feature:10
✖ Given the user is in conversation with the bot
Multiple step definitions match:
the user is in conversation with the bot - tests/feature_definitions/help_definition.js:4
the user is in conversation with the bot - tests/feature_definitions/help_definition.js:21
- Given there is no topic # tests/feature_definitions/help_definition.js:7
✖ When the user says help
Multiple step definitions match:
the user says help - tests/feature_definitions/help_definition.js:10
the user says help - tests/feature_definitions/help_definition.js:27
- Then the bot responds with a sorry, regretful message # tests/feature_definitions/help_definition.js:13
- And then asks if the user would like to see a list of available features # tests/feature_definitions/help_definition.js:16
2) Scenario: A valid topic # features/help.feature:16
✖ Given the user is in conversation with the bot
Multiple step definitions match:
the user is in conversation with the bot - tests/feature_definitions/help_definition.js:4
the user is in conversation with the bot - tests/feature_definitions/help_definition.js:21
- Given there is a valid topic # tests/feature_definitions/help_definition.js:24
✖ When the user says help
Multiple step definitions match:
the user says help - tests/feature_definitions/help_definition.js:10
the user says help - tests/feature_definitions/help_definition.js:27
- Then the bot responds with a confirmation message # tests/feature_definitions/help_definition.js:30
- And then asks if the user would like to see a list of topic features # tests/feature_definitions/help_definition.js:33