Sha256: 04beb2e17794e4fd400d7e6f9cf9d84ce018816d65e508987f31ed5300fc0dbe

Contents?: true

Size: 1.93 KB

Versions: 45

Compression:

Stored size: 1.93 KB

Contents

# File: demo03.feature

Feature: Show the use of a basic macro with multiple arguments
  As a Cuke user
  So that I enjoy writing scenario.


Scenario: defining basic macro with multiple arguments
  # The next step creates a macro(-step)double quotes.
  # The steps to execute when the macro is used/invoked are listed in the multiline triple quotes arguments.
  # The macro-step arguments are put between chevrons <...>.
  Given I define the step "* I [enter my userid <userid> and password <password>]" to mean:
  """
  Given I landed in the homepage
  When I click "Sign in"
  And I fill in "Username" with "<userid>"
  And I fill in "Password" with "<password>"
  And I click "Submit"
  """

Scenario: Let's use the macro we created above
  # Here the macro is invoked. Actual value for the argument is put between double quotes.
  When I [enter my userid "guest" and password "unguessable"]

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

Scenario: A macro invoking another macro (YES, it's possible!)
  Given I define the step "* I [enter my credentials]" to mean:
  """
  # Notice that the next step is invoking the first macro above
  When I [enter my userid "guest" and password "unguessable"]
  """

  # Invoking our lastly-created macro
  When I [enter my credentials]

  # Check that the nested macro still works
  Then I expect the following step trace:
  """
Invoked step: ... I landed in the homepage
Invoked step: ... I click "Sign in"
Invoked step: ... I fill in "Username" with "guest"
Invoked step: ... I fill in "Password" with "unguessable"
Invoked step: ... I click "Submit"
  """

Version data entries

45 entries across 45 versions & 1 rubygems

Version Path
macros4cuke-0.4.07 features/demo03.feature
macros4cuke-0.4.06 features/demo03.feature
macros4cuke-0.4.05 features/demo03.feature
macros4cuke-0.4.04 features/demo03.feature
macros4cuke-0.4.03 features/demo03.feature
macros4cuke-0.4.02 features/demo03.feature
macros4cuke-0.4.01 features/demo03.feature
macros4cuke-0.4.00 features/demo03.feature
macros4cuke-0.3.42 features/demo03.feature
macros4cuke-0.3.41 features/demo03.feature
macros4cuke-0.3.40 features/demo03.feature
macros4cuke-0.3.39 features/demo03.feature
macros4cuke-0.3.38 features/demo03.feature
macros4cuke-0.3.37 features/demo03.feature
macros4cuke-0.3.35 features/demo03.feature
macros4cuke-0.3.34 features/demo03.feature
macros4cuke-0.3.32 features/demo03.feature
macros4cuke-0.3.30 features/demo03.feature
macros4cuke-0.3.29 features/demo03.feature
macros4cuke-0.3.28 features/demo03.feature