Run Automated Tests

Create tests using the FPP Unit tests configuration

You are recommended to use this option to avoid conflicts with the location of your inputs.

To generate tests from the FPP Unit tests configuration
  1. Open the FPP Unit tests configuration window and click Generate new test.
Fig. 45: Generate new test.

Fig. 45: Generate new test.

  1. In the window that opens provide enter the script, pricing data, and document, as in the following figure:
Fig. 46: Unit Test Generator.

Fig. 46: Unit Test Generator.

You can select multiple documents for your test executions.

  1. Click Generate test. A file named tutorial_IRS_test<XXX> is created in the test folder. <XXX> is an integer that is incremented with each new test.

  2. Select the new test file using the whitelist option and click Run. You get the following results:

Fig. 47: Test results.

Fig. 47: Test results.

Create tests using the FPP Launch configuration

To generate tests from the FPP Launch configuration
  1. Select the fpp-library_tutorial_IRS_2Dates_5Scenarios script configuration and click Export as test.
Fig. 48: Export script configuration as test file.

Fig. 48: Export script configuration as test file.

Make sure to fetch the document and pricing data from the location specified in the FPP unit test.

  1. Select the folder where you want to save the new test file. For example: /src/test/resources/tests.
  2. Click Select. A file named tutorial_IRS_2Dates_5Scenario_testXXX is created in the test folder. XXX is an integer that is incremented with each new test.
Fig. 49: Path for the new test file.

Fig. 49: Path for the new test file.

  1. Select the new test file using the whitelist option and click Run. The following results are obtained:
Fig. 50: Test results.

Fig. 50: Test results.

Because you used the same input for both tests, you obtained the same results using the FPP Unit tests configuration and the FPP Launch configuration.

Warning when generating tests from the FPP Launch configuration

When generated from the FPP Launch configuration, the test will contain only the document and pricing data file name. This means that if your input files are not in the default location specified in the FPP Unit tests configuration, the test will fail because it will not find the files.

There are two options available to solve this:

  • Either edit the test file and complete the input.
  • Or use the FPP Unit Tests Configuration instead.