Your automated test framework Record Query step needs to find the second approver for a request item. What series of steps will enable you to find the second approver and approve the request item?
There is no out-of-box ATF test that explains how to search for the second approver, impersonate that approver, open the approval form, and approve the RITM.
The general steps are not difficult, but you need an example of each step:
- Get RITM record using Req ID associated with the RITM
- Validate the record to ensure that RITM exist and the stage is approval
- Get the sysapprover_approval record using RITM ID from step A
- Impersonate the approver
- Open the approval form using Approval ID from step C
This example will be built on the first 6 steps of the out-of-box test named Search and Open Catalog Item.
This KB adds or update 7 more steps to ensure that each approver that you want to use is opening his own approval record and updating the state to approved.
The ATF images below show the progression of test steps.
The original out-of-box 'Search and Open Catalog Item' looked like this for the catalog item 'Apple iPhone 5'.
For that catalog item above 'Apple iPhone 5', please note that before proceeding, if you want to actually execute this specific test, you would need to add a second approver to the workflow stage for the catalog item, so that the steps below will succeed when you search for the second approver. This KB does not cover the addition of a second approver to the workflow stage.
Your own catalog item has that second approved, and it's more expedient to modify your own test by adding the steps below to your test, rather than to create and debug this example of an ATF test for a two-approval catalog item.
Here are the steps to add to your test, or to the out-of-box 'Search and Open Catalog Item' test:
Step 7 Record Query - to get RITM record using Req ID from step 6
Step 8 Record Validation - to ensure that RITM exist and the stage is approval
Step 9 Record Query - To get sysapprover_approval record using RITM ID from step 7
10 Impersonate - impersonate (second) approver to validate
11 Open the existing form - To open approval form using Approval ID from step 9
12 Set Field Values - You can set the state to Approved
13 UI action button - Click Update button to save the form
After 13, remove steps 14 to 19 from out-of-box test named 'Search and Open Catalog Item'. Just put a checkbox next to each step to delete and click the Delete option in the dropdown at the bottom of the list.
The final test looks like this. Your test would appear similar.
The test steps above explain how to search for the second approver, impersonate that approver, open the approval form, and approve the RITM.