Converting a Test Suite to a Library

A test suite can be converted into a library, so that the same test suite can be used in multiple tests. The library includes all tests and options.

Select PurchaseOrderExample and select Use as Library from the context menu.
Enter the name of the library and click OK.

The PurchaseOrderExample test suite has been added as a test library to project PState in the Regression Test Tool. In test suite Dev Tests it is used as a library now and can't be changed anymore. All changes have to be done in the library now.

Using the Library in Multiple Test Suites

In addition to test suite Dev Tests, create a new test suite QA Tests as shown below. Both test suites will perform the same purchase order tests.

Select test suite QA Tests and select Include Library from the context menu.
Select the library PurchaseOderExample and click OK.
PurchaseOrderExample is included as a library into test suite QA Tests. Both test suites QA Tests and Dev Tests now deliver the same result.

Overwriting Options in the Library

Now, the QA tests should not go to localhost but to another Bridge, e.g. a QA server.

This can be achieved by adding options to test suite QA Tests.
Add Start Bridge Service options.
Enter the divergent connection data and remove all other options you don't want to overwrite.
Click OK to replace the options in the selected tests, in this case Start PurchaseOrderExample.

The <startservice> options have been added to the test suite. Add Stop Bridge Service options, too.

Look at the Test Action tab of the preferences of the test Start PurchaseOrderExample.

You can't change these preferences as the test is coming from a library. Nevertheless, the options got applied: see the connection data displayed in italics. This indicates, that the data is coming from options.

Next, you need to overwrite the connection data in the test cases, too.

Add options of option type Send a request to the Bridge.

Enter the divergent host and remove all other options you don't want to overwrite.
Click OK to replace the options in the selected tests, in this case all SOAP calls.

You now have the Dev Tests running on localhost, and the QA Tests running on another host with the service that was deployed there. Both are using the same tests from library PurchaseOrderExample.

Adding an Additional Test to the Library

Now you have your tests running on two Bridges, you may want to automatically deploy the service to these Bridges. To do this, you have to add a deploy test to library PurchaseOrderExample.

  • No labels