Aller au contenu

agilitest

agilitest/agilitest@v1

Run an Agilitest test suite.

Agilitest function has a mandatory test input and some optional parameters.
It may also include Agilitest environment variables defined in the ATS script.

The path to ATS script is relative to the step's working directory. If not specified, this is the job's working directory, in which case it must include the repository name.

In most cases, this path should be:

repositoryName/src/main/ats/otherDir/testCase.ats

See below the default values of each optional parameter and how to include environment variables:

- uses: agilitest/agilitest@v1
  with:
    test: agilitestProject/path/to/ats/script/testCase.ats
    test_parameters:
      atsSuiteDescription: Squash generated testsuite
      visualReport: 2
      atsLogLevel: all
    environment_variables:
      key1: value1
      key2: value2

Examples

This first example runs the bar.ats ATS script located in a foo directory with default values for all test parameters and no environment variables:

- uses: agilitest/agilitest@v1
  with:
    test: agilitestProject/src/main/ats/foo/bar.ats

This second example runs the bar.ats ATS script located at the root of all scripts, with default value for atsLogLevel, the highest quality setting for the visual report, and a custom description for the test suite. It also defines the value of the variable my_env_var used in the script.

- uses: agilitest/agilitest@v1
  with:
    test: agilitestProject/src/main/ats/bar.ats
    test_parameters:
      atsSuiteDescription: MyTestSuite
      visualReport: 4
    environment_variables:
      my_env_var: 42

Inputs

The function has the following inputs:

  • test (required)

    The ATS script to use.

  • test_parameters (optional)

    A set of parameters at the test suite level. If a parameter is not specified its value is given the default value. If a parameter is specified, a custom value must be given.

  • atsSuiteDescription (optional)

    A custom description of the test suite, visible in reports. Default value is Squash generated testsuite.

  • visualReport (optional)

    The quality of the visual report. Possible values are 1, 2, 3, or 4 in order of quality and size. Default value is 2.

  • atsLogLevel (optional)

    Level of reporting. Possible values from least to most verbose are silent, error, info, warning, and all. Default value is all.

  • reportsDirectory (optional)

    Where to put reports, relative to the project. Defaults to target/ats-output.

  • environment_variables (optional)

    A set of key-value to feed variables in the script.

Reports

The function generates the following reports:
(* is a wildcard matching any character string.)

  • *TEST-<ats_script>.xml

    Surefire (XML).

    <ats_script> is the name of an ATS script.

  • *ats-reports.tar

    TAR archive.

    Contains all files present in the target folder, excluding the junitreports and ats-output subfolders.

agilitest/execute@v1

An execute function for use by generators. Runs a test suite or a test case in a test suite.

Example

- uses: agilitest/execute@v1
  with:
    test: agilitestProject/path/to/ats/script/testCase.ats

The path to ATS script is relative to the step's working directory. If not specified, this is the job's working directory, in which case it must include the repository name.

In most cases this path should be:

repositoryName/src/main/ats/otherDir/testCase.ats

Example

- uses: agilitest/execute@v1
  with:
    test: foobar

Inputs

The function has the following inputs:

  • test (required)

    The test suite (and, optionally, the test case) to execute.

    It is of the form:

    {datasource}[#{testcase}]
    

Reports

The function generates the following reports:
(* is a wildcard matching any character string.)

  • *TEST-<ats_script>.xml

    Surefire (XML).

    <ats_script> is the name of an ATS script.

  • *ats-reports.tar

    TAR archive.

    Contains all files present in the target folder, excluding the junitreports and ats-output subfolders.

agilitest/params@v1

A params function for use by generators.

params function has mandatory data and format inputs:

- uses: agilitest/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

The function has the following inputs:

  • data (required)

    The data to use for the automated test.

  • format (required)

    The format to use for the automated test data.

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

actions/prepare-inception@v1

Preload the inception environment with data.

prepare-inception function has a mandatory input per file it prepares.

In the case of Agilitest:

Example

- uses: actions/prepare-inception@v1
  with:
    TEST-<ats_script>.xml: ${{ resources.files.xml }}
    ats-reports.tar: ${{ resources.files.tar }}

Inputs

The function has the following inputs:

  • TEST-<ats_script>.xml (required)

    Surefire (XML), this report is the one used to determinate the test status (success/failure).

    <ats_script> is the name of an ATS script, for example: TEST-my_ats_script.xml.

  • ats-reports.tar (optional)

    TAR archive.