Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GPC] Suite Generator #45

Open
szikszail opened this issue Jan 29, 2021 · 1 comment
Open

[GPC] Suite Generator #45

szikszail opened this issue Jan 29, 2021 · 1 comment

Comments

@szikszail
Copy link
Collaborator

szikszail commented Jan 29, 2021

Summary

The precompiler would separate elements of a feature file into different ones based on a specific tag and its value, i.e., generating suites.

Use cases

Scenarios are marked with @suite(X) tags, where X can be smoke, regression or sanity, indicating in which test suite (by purpose) the scenario is executed. A scenario can have multiple of such tags, but at least one.

To clarify, separate folders might be generated containing feature files and elements matching the given suite tag.

Example

Take the following (example) feature file:

# src/login.feature
Feature: Login

  @suite(sanity) @suite(smoke) @suite(regression)
  Scenario: Login pass
    Given the login page is opened
    When the username is typed
    And the password is typed
    And the login button is clicked
    Then the user should be logged in

  @suite(smoke) @suite(regression)
  Scenario: Login fail
    Given the login page is opened
    When the username is typed
    And the wrong password is typed
    And the login button is clicked
    Then the error should be visible
    And the user should not be logged in

Running the precompiler would result in the following feature files:

# dist/suite-sanity/login.feature
Feature: Login

  @suite(sanity)
  Scenario: Login pass
    Given the login page is opened
    When the username is typed
    And the password is typed
    And the login button is clicked
    Then the user should be logged in
# dist/suite-smoke/login.feature
Feature: Login

  @suite(smoke)
  Scenario: Login pass
    Given the login page is opened
    When the username is typed
    And the password is typed
    And the login button is clicked
    Then the user should be logged in

  @suite(smoke)
  Scenario: Login fail
    Given the login page is opened
    When the username is typed
    And the wrong password is typed
    And the login button is clicked
    Then the error should be visible
    And the user should not be logged in
# dist/suite-regression/login.feature
Feature: Login

  @suite(regression)
  Scenario: Login pass
    Given the login page is opened
    When the username is typed
    And the password is typed
    And the login button is clicked
    Then the user should be logged in

  @suite(regression)
  Scenario: Login fail
    Given the login page is opened
    When the username is typed
    And the wrong password is typed
    And the login button is clicked
    Then the error should be visible
    And the user should not be logged in

Options/Variants

  • Separating feature files either into folders or feature files.
  • Keeping/Removing suite tags from the result.
  • Considering a default tag for an element where it is missing.

Additional context

@szikszail szikszail changed the title gpc-suite-generator [GPC] Suite Generator Feb 2, 2022
@szikszail
Copy link
Collaborator Author

@gherking/gherking, please review this issue and propose any change/improvement.

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

No branches or pull requests

1 participant