List implemented Robot Framework tests

This Mojo enables one to list as a Json file the available implemented tests. In order to do so one only needs to run the following command :

mvn org.squashtest.ta.galaxia:squash-tf-robotframework-runner-maven-plugin:1.0.0-RELEASE:list

The command is structured as follows

  • mvn : launch Maven
  • org.squashtest.ta.galaxia:squash-tf-robotframework-runner-maven-plugin:1.0.0-RELEASE:list : the actual listing Mojo provided by the Squash TF Robot Framework Runner. It lists all Robot Framework test present in the project.

Note

This listing doesn’t list only “.robot” file but also tests cases inside the .robot file.

‘list’ goal with Metadata

If there are Metadata in the current test project, the goal ‘list’ searches and checks if all metadata respect the conventions for writing and using Squash TF metadata (See Metadata in Robot Framework Runner for more information about Metadata syntax conventions).

The goal will check through the project and collect all the metadata error(s).

If there are any error, the build will fail and a list of the incorrect metadata will be displayed. Otherwise, a SUCCESS result will be obtained.

The test suite and test case names are also displayed with the incorrect metadata.

../_images/metadata-error-list-example.png

Listing test JSON report with Metadata

If the build is successful, the generated report (JSON file) will contain the metadata associated with each of the test scripts.

{
    "timestamp": "2019-12-11T16:45:40.259+0000",
    "name": "tests",
    "contents": [
        {
            "name": "Main",
            "contents": [
                {
                    "name": "Standard Case",
                    "metadata": {
                        "TC_UID": [
                            "598621846"
                        ],
                        "linked-TC": [
                            "444555552",
                            "465454603",
                            "481289439"
                        ],
                        "metadataWithOneValue": [
                            "12345"
                        ]
                    },
                    "contents": null
                },
                {
                    "name": "Special Char",
                    "metadata": {},
                    "contents": null
                },
                {
                    "name": "No Last Name",
                    "metadata": {},
                    "contents": null
                },
                {
                    "name": "No First Name",
                    "metadata": {},
                    "contents": null
                }
            ]
        }
    ]
}

Note

To ignore thoroughly Metadata during the listing process as well as in the report, insert tf.disableMetadata property after the goal “list”.

mvn org.squashtest.ta.galaxia:squash-tf-robotframework-runner-maven-plugin:1.0.0-RELEASE:list -Dtf.disableMetadata=true