Robot Framework test - Metadata Checking

As the goal “list”, the goal ‘check-metadata’ 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). Contrary to goal “list”, there is no JSON file generated at the end of a successful “check-metadata” goal.

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

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

‘check-metadata’ goal with Unicity checking

In addition to the normal syntax checking, you can insert the tf.metadata.check property after the goal “check-metadata” to check the unicity of each Metadata Key - Value pair.

mvn org.squashtest.ta.galaxia:squash-tf-robotframework-runner-maven-plugin:1.0.0-RELEASE:check-metadata -Dtf.metadata.check=[valueUnicity]

If there is any metadata Key-Value duplicate in the project(even if the syntax is OK), a FAILURE result will be obtained.

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

‘check-metadata’ goal with Unicity checking for specific Keys

You can even check the unicity of each metadata Key - Value pair with just some specific Keys by inserting the second property tf.metadata.check.key after the first one mentioned above.

mvn clean compile test-compile org.squashtest.ta.galaxia:squash-tf-junit-runner-maven-plugin:1.1.0-RELEASE:check-metadata -Dtf.metadata.check=[valueUnicity] -Dtf.metadata.check.keys=[xxx,yyy,zzz]

Important

In the bracket, the key list MUST be a string of characters composed by concatenation from 1 to n keys separated by commas: -Dtf.metadata.check.keys=[xxx,yyy,zzz]

If the list is surrounded by double quotes, spaces are allowed: -Dtf.metadata.check.keys=”[xxx, yyy, zzz]”

It is NOT allowed to have two commas without any key OR only spaces/tabulations between them. (ex: -Dtf.metadata.check.keys=”[xxx, ,yyy,,zzz]”)

Key list is NOT allowed to be either uninitiated or empty. (ex: -Dtf.metadata.check.keys= OR -Dtf.metadata.check.keys=[])

For each searched metadata key, if there is any metadata Key-Value duplicate in the project, a FAILURE result will be obtained.

Check-metadata with Unicity checking for specific Keys build FAILURE

Note

If searched metadata key(s) are not found in any Test files, a WARNING message will be raised in the console.

Missing Key