The following commands are helpful to identify which test case is currently running, from your Action logic. This helps you to build conditional logic based on factors such as first test case, last test case, etc.
Commands related to current running test
Is first test case in the Run: Checks whether this is the first test case in the currently executing test job. Based on this condition, you may build logic specific to the first test case such as setup, etc. Returns 'true'/'false' and hence this command can be used in a conditional statement.
Note: When parallel execution is enabled for the job, multiple test cases may be running concurrently. This command returns 'true' only for the test case picked up first amongst those concurrent ones.
Is last test case in the Run: Checks whether this is the last test case in the currently executing test job. Based on this condition, you may build logic specific to the last test case such as tear-down, etc. Returns 'true'/'false' and can be used in a conditional statement.
Note: When parallel execution is enabled for the job, multiple test cases may be running concurrently. This command returns 'true' only for the test case picked up latest amongst those concurrent ones.
Is current test case failed: Checks whether the currently executing test case has failed. Even if one failure is encountered in the current test case by the time execution reaches this statement, this command returns true. It can be used in a conditional statement.
Get current running test case info: Returns information about the currently running test case.
- Test case name
- Scenario name
- Index: Currently running test case index (starts from 1). When running with parallel threads, this index represents the cumulative index amongst all the threads.
- Start time: Test case execution start time
Get test case counts in the current Run: Returns various test case counts in the current Run or job.
- Total: Total test cases in the current job.
- completed: Count of "completed" test cases. This is the sum of the pass and the fail status test cases.
- failed: Test-case counts so far completed with failure status in the current run.
- passed: Test-case counts so far completed with pass status in the current run.
- in-progress: Test-case counts that are currently in in-progress status. When running with parallel threads, this count could be more than 1.
- not-run: Count of the test cases which are yet to be executed.
Comments
0 comments
Please sign in to leave a comment.