Skip to content

[POC] Multiple Background Examples support#3

Open
dpakach wants to merge 9 commits intomasterfrom
background-outline-tags
Open

[POC] Multiple Background Examples support#3
dpakach wants to merge 9 commits intomasterfrom
background-outline-tags

Conversation

@dpakach
Copy link
Copy Markdown

@dpakach dpakach commented Feb 21, 2020

Add support for multiple background examples in a feature.

For eg.

Feature: Users sync

  Background:
    Given these users have been created with default attributes and without skeleton files:
    | username |
    | user0    |
    | user1    |

    Examples:
      | ocs-api-version | ocs-status-code |
      | 1               | 100             |

    @OCSv2
    Examples:
      | ocs-api-version | ocs-status-code |
      | 2               | 200             |

  Scenario Outline: Trying to sync a user when there is no external user backend
    Given using OCS API version "<ocs-api-version>"
    When the administrator tries to sync user "user0" using the OCS API
    Then the HTTP status code should be "200"
    And the OCS status code should be "<ocs-status-code>"
    And the OCS status message should be ""

  @TestAlsoOnExternalUserBackend
  Scenario Outline: Trying to sync a user as another user which does not exist
    Given using OCS API version "<ocs-api-version>"
    When user "user20" tries to sync user "user1" using the OCS API
    Then the HTTP status code should be "401"
    And the OCS status code should be "997"
    And the OCS status message should be "Unauthorised"

In this above example, running without any tags will just run both outlines with both tables from the background.

But if we run with tag @OCSv2 then both outlines will run with only the second table from the background.

@dpakach dpakach requested a review from a team February 25, 2020 05:48
@dpakach dpakach self-assigned this Feb 25, 2020
@dpakach dpakach added the enhancement New feature or request label Feb 25, 2020
Copy link
Copy Markdown

@jasson99 jasson99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Talank
Copy link
Copy Markdown

Talank commented Feb 26, 2020

LGTM 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants