Sha256: 28d816303278d2aecde91971ea747fee13b151734e1569237fca1738a4ba5dc7

Contents?: true

Size: 1.48 KB

Versions: 14

Compression:

Stored size: 1.48 KB

Contents

# File: demo05.feature

Feature: Yet another example of: passing a Cucumber table into a macro-step
  As a Cuke user
  I want to pass many arguments to a macro-step
  So that I can use flexible and readable macros.


Scenario: Defining a macro to be used with multiple arguments in a table
  # The next step creates a macro(-step)
  # The syntax of the new macro-step is specified between double quotes.
  # The steps to execute when the macro is used/invoked are listed in the multiline triple quotes arguments.
  # The macro arguments are put between chevrons <...>.
  Given I define the step "* I [enter my profile as]:" to mean:
  """ 
  And I fill in "location" with "<location>"
  And I fill in "email" with "<email>"
  And I fill in "comment" with "<comment>"
  And I click "Save"
  """

Scenario: Using the macro we created above
  # Here the macro is invoked. Actual value for the argument are passed in a table argument.
  When I [enter my profile as]:
  |location|Nowhere-City|
  |email   |nobody@example.com |
  |comment |First comment line |
  |comment |Second comment line|
  |comment |Third comment line |

  # The next step verifies that the steps from the macro were effectively executed.
  Then I expect the following step trace:
  """
  And I fill in "location" with "Nowhere-City"
  And I fill in "email" with "nobody@example.com"
  And I fill in "comment" with "First comment line<br/>Second comment line<br/>Third comment line"
  And I click "Save"
  """

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
macros4cuke-0.5.17 features/3_macros_with_table_arguments/demo05.feature
macros4cuke-0.5.16 features/3_macros_with_table_arguments/demo05.feature
macros4cuke-0.5.15 features/3_macros_with_table_arguments/demo05.feature
macros4cuke-0.5.14 features/3_macros_with_table_arguments/demo05.feature
macros4cuke-0.5.13 features/3_macros_with_table_arguments/demo05.feature
macros4cuke-0.5.12 features/3_macros_with_table_arguments/demo05.feature
macros4cuke-0.5.11 features/3_macros_with_table_arguments/demo05.feature
macros4cuke-0.5.10 features/3_macros_with_table_arguments/demo05.feature
macros4cuke-0.5.09 features/3_macros_with_table_arguments/demo05.feature
macros4cuke-0.5.08 features/3_macros_with_table_arguments/demo05.feature
macros4cuke-0.5.07 features/3_macros_with_table_arguments/demo05.feature
macros4cuke-0.5.06 features/3_macros_with_table_arguments/demo05.feature
macros4cuke-0.5.03 features/3_macros_with_table_arguments/demo05.feature
macros4cuke-0.4.09 features/3_macros_with_table_arguments/demo05.feature