Get tagged automated tests associated with an application module

This flow demonstrates how to get a list of automated tests that are associated with an application module (product area) and have a specific tag.

Note: tests are a technical preview. Until made public, send an HPECLIENTTYPE header with the value: HPE_REST_API_TECH_PREVIEW in your requests.

Areas: Automated tests, User tags, Application modules (product areas) 

Entity relationship diagram

We need to access the following entities for this flow, and understand the relationships between these entities.

Entity Relationships in this flow Description of relationship Reference / relationship fields
Test   The test entity represents various types of tests, including manual, Gherkin, and automated. subtype
Automated Test Test The automated test is a subtype of the test entity. type
Product Area An automated test can be associated with 0 or more application modules (product areas). product_areas
User Tags An automated test can be associated with 0 or more user-defined tags. user_tags

Back to top

Flow

Let's create the REST API calls step-by-step.

  1. We can start by listing all the automated tests in the workspace.

    GET .../api/shared_spaces/<shared_space_id>/workspaces/1002/automated_tests

  2. Let's build our query_clause.

    This query has two sets of criteria: The user tags and the application modules(product areas). We will separate each set with a semi-colon (;), which represents the And operator.

    In this step, we are only interested in automated tests that have a user-defined tag called security. We use the name field of the tag to check for a match.

    GET .../api/shared_spaces/<shared_space_id>/workspaces/1002/automated_tests?query="user_tags EQ {name EQ ^security^}"

  3. We also want to query for application modules (product areas) that relate to messaging. We use the asterisk (*) wildcard to indicate that we only want to list those automated tests (with a security tag) in all appliation modules that start with Messag. This includes application modules that start with message, messaging, and messaged.

    GET .../api/shared_spaces/<shared_space_id>/workspaces/1002/automated_tests?query="user_tags EQ {name EQ ^security^};product_areas EQ {name EQ ^Messag*^}"

The complete REST API call for this part of the flow is: 

GET .../api/shared_spaces/<shared_space_id>/workspaces/1002/automated_tests?query="user_tags EQ {name EQ ^security^};product_areas EQ {name EQ ^Messag*^}"

Back to top

See also: