Warewolf provides a robust framework for fine-grain testing of your resources. To maximize the value of your work and the time taken to change and grow your services, you can add testing to each service, in a simple, fast Test Editor.
Creating and Editing Tests
Tests are created and edited on the resource-specific Test Editor.
To access the Test Editor:
- In the Explorer, right-click the resource you want to manage tests for.
- In the context menu, select Test Editor and click Create New Test.
- An empty list will be returned as the screen below:
From this window, click on Create a new Test and select nodes to be tested with assert conditions, mock nodes like other services your service might also be making use of eg: database queries, etc.
- In the Test Name field on the right enter a Test Name.
- Select the account you would like the test to run as:
- Windows: The credentials of the person running the test will be used.
- User: A specified user account will be used. This is the recommended option.
- Public: Runs as an unauthenticated user.
- Supply the test Input values. These are the values you would like passed into your service.
- Supply the assert Output values. These are the values you are expecting to come out of the service.
- Supply the Error state after execution.
NOTE: If Error is selected, all other Asserts will be ignored.
- Click the Run button on the test tile.
- If the test has not been saved, it will be automatically saved at this point.
- When the test is finished executing:
a. The test result will be shown on the test tile.b. The debug information for the test run will be shown in the debug Output Window.
- Clicking the Main Menu Save button will save all your tests.
- You can duplicate a test by pressing the Duplicate button after the Test Name.
- To ignore a test and not have it runnable, select the active check on the test tile.
- To delete a test, first ignore the test as seen above and then click the delete icon.
- Clicking Run All runs all the tests in Parallel.
Create a test from Debug Output
After you have debugged [F6] your service and you want to quickly make a test covering the outputs your service just produced.
- Create a new Test by clicking on the test symbol as illustrated below:
You can execute tests in 2 ways:
- From inside Warewolf: In the Explorer, open the Test Editor and click Run ALL
- Or externally:
- To run all the tests for a resource, add the .tests extension to it. e.g. “http://localhost:3142/secure/Hello World.tests”
- To run all the tests for a folder, add the .tests extension to it. e.g. “http://localhost:3142/Examples/Dice Roll Example.tests”
- To run a specific test for a resource, add the .tests extension to it, followed by a forward slash and the test name e.g. “http://localhost:3142/secure/Hello World.tests/Valid Input”
To execute and create tests, you will need View and Execute permission on the resource.
Test has passed
Test has failed
The test needs to run. A change has occurred on the test since the last run or it has never been run
The test is invalid and needs attention. Something has changed on the service that makes this test invalid