Sha256: d3d537b3e49ce80483cbd522d6bfda588cec5b1076277f9ff807a7f547b243a2

Contents?: true

Size: 1.67 KB

Versions: 15

Compression:

Stored size: 1.67 KB

Contents

# File: demo02.feature

Feature: Define and use a macro taking one argument
  As a Cuke user
  I want to pass data to macro-steps
  So that I can use them in more varied situations.
  


Scenario: Defining a macro-step with one argument (userid)
  # The next step creates a macro(-step)
  # The syntax of the new macro-step to create is specified between the double quotes.
  # The steps to execute when the macro is used/invoked are listed in the multiline triple quotes arguments.
  # The macro argument is put between chevrons <...>.
  Given I define the step "* I [log in as <userid>]" to mean:
  """
  Given I landed in the homepage
  When I click "Sign in"
  # The next step uses the macro-step argument <userid>
  And I fill in "Username" with "<userid>"
  And I fill in "Password" with "unguessable"
  And I click "Submit"
  """

Scenario: Use the macro created above pass it a user id
  # Here the macro is invoked. Actual value for the argument is put between double quotes.
  When I [log in as "guest"]

  # The next step verifies that the steps from the macro were effectively executed.
  Then I expect the following step trace:
  """
  Given I landed in the homepage
  When I click "Sign in"
  And I fill in "Username" with "guest"
  And I fill in "Password" with "unguessable"
  And I click "Submit"
  """
  
  
Scenario: Use the macro with another user id
  When I [log in as "me-again"]

  # The next step verifies that the steps from the macro were effectively executed.
  Then I expect the following step trace:
  """
  Given I landed in the homepage
  When I click "Sign in"
  And I fill in "Username" with "me-again"
  And I fill in "Password" with "unguessable"
  And I click "Submit"
  """

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
macros4cuke-0.5.18 features/2_macros_with_arguments/demo02.feature
macros4cuke-0.5.17 features/2_macros_with_arguments/demo02.feature
macros4cuke-0.5.16 features/2_macros_with_arguments/demo02.feature
macros4cuke-0.5.15 features/2_macros_with_arguments/demo02.feature
macros4cuke-0.5.14 features/2_macros_with_arguments/demo02.feature
macros4cuke-0.5.13 features/2_macros_with_arguments/demo02.feature
macros4cuke-0.5.12 features/2_macros_with_arguments/demo02.feature
macros4cuke-0.5.11 features/2_macros_with_arguments/demo02.feature
macros4cuke-0.5.10 features/2_macros_with_arguments/demo02.feature
macros4cuke-0.5.09 features/2_macros_with_arguments/demo02.feature
macros4cuke-0.5.08 features/2_macros_with_arguments/demo02.feature
macros4cuke-0.5.07 features/2_macros_with_arguments/demo02.feature
macros4cuke-0.5.06 features/2_macros_with_arguments/demo02.feature
macros4cuke-0.5.03 features/2_macros_with_arguments/demo02.feature
macros4cuke-0.4.09 features/2_macros_with_arguments/demo02.feature