Skip to content

cucumber

cucumber5/execute@v1

Process ‘execute’ action for Cucumber 5 and up.

execute action have a mandatory test input defining the test(s) to execute:

- uses: cucumber5/execute@v1
  with:
    test: full/path/to/cucumberProject#src/test/java/features/sample.feature#feature_name#scenario

test has four components:

  • full/path/to/cucumberProject: the path of the directory containing the pom.xml file.
  • src/test/java/features/sample.feature: the path of the Cucumber test file (.feature file), this path is relative to the previous directory.
  • feature_name: feature name as specified in the Cucumber test file.
  • scenario: scenario name as specified in the Cucumber test file.

feature_name and scenario are optional, they may be empty.
They will not be used by the provider driving the test: the whole .feature file will be executed.
However, these additional elements are used by publishers to extract and report the execution status of only the targeted feature or scenario.
(feature_name could seem as useless given the fact that there can be only one feature in a .feature file, but it is required because of a technical limitation: the name of .feature file is absent from the report, only the feature name is present.)

Old versions of the orchestrator (up to 3.7.0 included) only supported the following test syntax:

- uses: cucumber5/execute@v1
  with:
    test: cucumberProject/src/test/java/features/sample.feature#feature_name#scenario

That old syntax is still accepted, but it has been deprecated because not applicable if the pom.xml file is not at the root of the Git repository (this is typically the case for multi-projects Git repositories).

execute action will attach the JUnit report as report.xml and the HTML report as html-report.tar.

Inputs

  • test (required)

    the datasource to use

cucumber/execute@v1

Process ‘execute’ action.

execute action have a mandatory test input defining the test(s) to execute:

- uses: cucumber/execute@v1
  with:
    test: full/path/to/cucumberProject#src/test/java/features/sample.feature#feature_name#scenario

test has four components:

  • full/path/to/cucumberProject: the path of the directory containing the pom.xml file.
  • src/test/java/features/sample.feature: the path of the Cucumber test file (.feature file), this path is relative to the previous directory.
  • feature_name: feature name as specified in the Cucumber test file.
  • scenario: scenario name as specified in the Cucumber test file.

feature_name and scenario are optional, they may be empty.
They will not be used by the provider driving the test: the whole .feature file will be executed.
However, these additional elements are used by publishers to extract and report the execution status of only the targeted feature or scenario.
(feature_name could seem as useless given the fact that there can be only one feature in a .feature file, but it is required because of a technical limitation: the name of .feature file is absent from the report, only the feature name is present.)

Old versions of the orchestrator (up to 3.7.0 included) only supported the following test syntax:

- uses: cucumber/execute@v1
  with:
    test: cucumberProject/src/test/java/features/sample.feature#feature_name#scenario

That old syntax is still accepted, but it has been deprecated because not applicable if the pom.xml file is not at the root of the Git repository (this is typically the case for multi-projects Git repositories).

execute action will attach the JUnit report as report.xml and the HTML report as html-report.tar.

Inputs

  • test (required)

    the datasource to use

cucumber5/params@v1

Process ‘params’ action for Cucumber 5+.

params action have mandatory data and format inputs:

- uses: cucumber5/params@v1
  with:
    data:
      global:
        key1: value1
        key2: value2
      test:
        key1: value3
        key3: value4
    format: format

format must so far be SQUASHTM_FORMAT (tm.squashtest.org/params@v1).

data can have two keys:

  • global for defining global parameters
  • test for defining test parameters

Inputs

  • data (required)

    the data to use for the automated test

  • format (required)

    the format to use for the automated test data

cucumber/params@v1

Process ‘params’ action.

params action have mandatory data and format inputs:

- uses: cucumber/params@v1
  with:
    data:
      global:
        key1: value1
        key2: value2
      test:
        key1: value3
        key3: value4
   format: format

format must so far be SQUASHTM_FORMAT (tm.squashtest.org/params@v1).

data can have two keys:

  • global for defining global parameters
  • test for defining test parameters

Inputs

  • data (required)

    the data to use for the automated test

  • format (required)

    the format to use for the automated test data

cucumber5/cucumber@v1

Process ‘cucumber5’ action for Cucumber v5.0.0 and up.

- uses: cucumber5/cucumber@v1
  with:
    test: full/path/to/cucumberProject#src/test/java/features/sample.feature#MyFeature#Selected scenario name
    tag: tag1
    tags: "@tag1 and @tag2"
    reporters:
      - junit
      - html
    extra-options: "-Dcucumber.ansi-colors.disabled=true"

test has four components:

  • full/path/to/cucumberProject: the path of the directory containing the pom.xml file.
  • src/test/java/features/sample.feature: the path of the Cucumber test file (.feature file), this path is relative to the previous directory.
  • MyFeature: feature name as specified in the Cucumber test file.
  • Selected scenario name: scenario name as specified in the Cucumber test file.

MyFeature and Selected scenario name are optional, they may be empty.
They will not be used by the provider driving the test: the whole .feature file will be executed.
However, these additional elements are used by publishers to extract and report the execution status of only the targeted feature or scenario.
(MyFeature could seem as useless given the fact that there can be only one feature in a .feature file, but it is required because of a technical limitation: the name of .feature file is absent from the report, only the feature name is present.)

Old versions of the orchestrator (up to 3.7.0 included) only supported the following test syntax:

- uses: cucumber5/cucumber@v1
  with:
    test: cucumberProject/src/test/java/features/sample.feature#MyFeature#Selected scenario name
    tag: tag1
    tags: "@tag1 and @tag2"
    reporters:
      - junit
      - html
    extra-options: "-Dcucumber.ansi-colors.disabled=true"

That old syntax is still accepted, but it has been deprecated because not applicable if the pom.xml file is not at the root of the Git repository (this is typically the case for multi-projects Git repositories).

The tag field is optional, allowing to target one or many specific tagged scenarios or dataset within the .feature file. Please note that the tag value must not include the initial @ character.

Since Cucumber 5.7.0 (see the details in the changelog), the allowed format supports tag expressions, which can target scenarios in a more specific way.

To use this feature, you can fill the tags field using following sample formats:

  • "@tag1 @tag2": will execute scenarios tagged by @tag1 or @tag2.
  • "@tag1 and @tag2": will execute scenarios tagged by both @tag1 and @tag2.
  • "@tag1 and not @tag2": will execute scenarios tagged by @tag1 but not @tag2.
  • "not (@tag1 or @tag2)": will execute scenarios tagged by neither @tag1 nor @tag2.

Double quotes are mandatory.

For more details about Cucumber tag expressions, please read the tag chapter in the Cucumber documentation.

Please note that tag and tags fields cannot coexist, thus using both of them in the same job will return an error.

There is a list of 2 available reporters for your test reports:

  • JUnit (noted junit, attached as report.xml)
  • HTML (noted html, attached as html-report.tar)

Any, all, or none of the 2 reporters can be added to the list of desired generated reports. Note that without the JUnit reporter cucumber test result will not appear in Allure reports.

The extra-options tag is optional too, allowing to specify additional content and parameters to Cucumber.

Since the cucumber.options package is deprecated since Cucumber 5, there is now a list of supported properties you can find on the Options chapter of the Cucumber documentation. To properly add an option within the extra-options tag, use the syntax below:

  • -Dcucumber.[module].[param]=[value]

Module is optional as in -Dcucumber.glue=com.example.glue but can be mandatory as in -Dcucumber.ansi-colors.disabled=true

Please note that we use several properties within our implementation, thus we do not recommend adding them in your extra options:

  • cucumber.filter.tags (used in the tag option)
  • cucumber.plugin (used in the reporters list)
  • cucumber.features (used in the test option)

Inputs

  • test (required)

    the datasource to use

  • tag (optional)

    targets a specific tagged scenario or dataset

  • reporters (optional)

    the desired reports

  • extra-options (optional)

    additional parameters to pass to Cucumber

cucumber/cucumber@v1

Process ‘cucumber’ action for Cucumber versions up to 5.

- uses: cucumber/cucumber@v1
  with:
    test: full/path/to/cucumberProject#src/test/java/features/sample.feature##
    tag: tag1
    reporters:
    - junit
    - html
    extra-options: extra

test has four components:

  • full/path/to/cucumberProject: the path of the directory containing the pom.xml file.
  • src/test/java/features/sample.feature: the path of the Cucumber test file (.feature file), this path is relative to the previous directory.
  • feature_name: feature name as specified in the Cucumber test file (an empty string in this case).
  • scenario: scenario name as specified in the Cucumber test file (an empty string in this case, all scenarios are executed).

Old versions of the orchestrator (up to 3.7.0 included) only supported the following test syntax:

- uses: cucumber/cucumber@v1
  with:
    test: cucumberProject/src/test/java/features/sample.feature
    tag: tag1
    reporters:
    - junit
    - html
    extra-options: extra

That old syntax is still accepted, but it has been deprecated because not applicable if the pom.xml file is not at the root of the Git repository (this is typically the case for multi-projects Git repositories).

tag is optional, allowing to target a specific tagged scenario or dataset in the .feature file. Please note that the tag value must not include the initial @ character.

extra-options is optional too, allowing to specify additional content for the cucumber.options property.

Any, all, or none of the 2 reporters can be added to the list of desired generated reports.

cucumber action will attach the JUnit report as report.xml and the HTML report as html-report.tar.

Inputs

  • test (required)

    the datasource to use

  • tag (optional)

    target a specific tagged scenario or dataset

  • reporters (optional)

    the desired reports

  • extra-options (optional)

    additional parameters to pass to Cucumber