When constructing test logic, there may be instances where you need to retrieve details about the ongoing test job, the environment in which it's running, and the status of a specific test case at any given moment.
Here is a valuable set of commands to assist you in acquiring this information within your Action logic.
Note: You can copy and paste any commands mentioned in this article into the Help Center for detailed guidance.
Information about the Current Test Job
Command: Get Current Test Job Info
What information you can fetch:
- Job ID: ID of the executing job
- Start time: The time at which the execution has started (e.g. Thu 11 Jul, 2024, 09:02:15 PM (America/Chicago))
- Elapsed Execution time (in seconds)
- Test Case Count: You can find various counts such as completed test case count, pass count, failed count, in-progress count, not-run count, total count, etc.
- Project Name: Name of the project in which the job is executing.
- App Environment: The Application Environment against which the test is executing.
Information about the Currently Running Test Case
Command: Get Current running Test Case Info
What information you can fetch:
- Test case name: Name of the test case
- Scenario name: Name of the Scenario to which the current test case belongs.
- Start time: The time at which the current test case started executing (e.g. Thu 11 Jul, 2024, 09:02:15 PM (America/Chicago))
- Elapsed execution time: Number of seconds the current test case has been executing.
- Test case index: Index (serial order) of the currently running test case in the whole job.
- Custom field value: Value of a given custom field of the test case, or the parent Scenario.
Other useful Commands to enquire about the current test case
- Is Application Environment: Returns 'true', or 'false' depending on the Application Environment where the test is running.
- Is current test case failed: Returns 'true' if the currently running test case has experienced an error already.
- Is first test case in the Job: Returns 'true' if the currently running test case is the first one in the job.
- Is last test case in the Job: Returns 'true' if the currently running test case is the last one in the job.
- Is Execution Parameter Value: Returns 'true' if the value of an Execution Parameter matches the expected value.
- Is Browser Type: Returns 'true' if the test is executing on a browser of the expected type.
- Is mobile platform: Returns 'true' if the test is running on iOS, or Android as expected.
- Get mobile device name: Returns the name of the mobile device.
Note: When checking for the App Environment, you may pass multiple expected values using the "regex" option. In the example below, the condition checks if the test is running either on Staging, or Prod environment.
Similar capability is available when checking for the Execution Parameter value against a set of expected values.
Comments
0 comments
Please sign in to leave a comment.