Use uploaded test cases with test data expressions

You can upload Tosca on-prem test assets to Tosca Cloud. This includes test cases that reference test data you store in Tosca Server Test Data Service repositories (opens in new tab).

In this topic, you'll learn what happens to test data expressions during the upload and what to do with test cases that include them.

What happens during the upload

The behavior we describe here only applies to new uploads. Tosca Cloud doesn't change expressions in existing test cases, even if those test cases are previous uploads from Tosca on-prem. You need to update those test cases manually or upload them again.

During the upload, Tosca Cloud updates test data expressions to the Tosca Cloud syntax:

Note that the logic is the same for both expressions: {TDM[<name of something>][<column name>]}. When Tosca Cloud encounters this expression in a test case, it first checks whether an alias with that name exists. Then, whether a data set with that name exists.

This means that if you have an alias with the same name as a data set, Tosca Cloud will return the alias data, even if you mean to use the data set with that name. We recommend that you give each alias a unique name and not the same name as a data set.

Limitations for nested test data

Tosca Server Test Data Service supports nested data in columns: {TDS[<name>.<column parent>.<column child>]}

Tosca Cloud doesn't support nested data in columns. During the upload, it changes the expression to {TDM[<name>][<column parent.column child>]}, so you have the correct syntax to start with. However, the test case still won't work because Tosca Cloud can't fetch the data.

What to do after the upload

Once you've uploaded your test cases, this is what you need to do next: 

  • Upload your test data. Tosca Cloud updates test data expressions during the upload, but these expressions still reference data you store in your Tosca Server Test Data Service repository. For your tests to work, you must get the test data into Tosca Cloud.

  • Change all test cases that create an alias with the same name as an existing data set. Make sure these test cases create an alias with a unique name instead. Otherwise, Tosca Cloud may return unexpected test data, as we mentioned in What happens during the upload.

Limitations for nested test data

Tosca Cloud doesn't support nested data in columns. To keep your tests working after the upload, you need to do the following: 

  • Change the data structure in your data sets.

  • Adapt all affected test cases in Tosca Cloud.

What's next

If you also need to upload other Test Data Service resources, check out these topics: