Test modeling sheet structure
The input excel should be structured as following worksheets,
- Base_Config: Contains global configs that are required for the test.
- Test_Suites: Logical grouping of similar test scenarios.
- Test_Scenarios: Contains the actual scenarios to be tested. This could make use of one or more APIs defined in the TestApi_Definitions.
- Test_Api_Wrappers: Contains the list of test wrappers for available API definitions. This allows customizing an API definition by passing Restel Variables.
- Test_Api_Definitions: Contains the list of Services API definitions for the Rest Application which needs to test.
Base_Config:
Base_config sheet, should contain the basic necessary information on the Rest Application which needs to be tested . In the sheets the headers are sectioned in Rows . Each Row first Cell will be a header.
Below Table shows the list of headers, description, format and examples for better understanding.
Header Name | Description | Format | Mandatory | Examples |
---|---|---|---|---|
app_name | Name to the Rest Application which needs to be Tested. | String | Optional | PetStore Test Application |
base_url | The URL of the Rest Application which needs to test, should be in the format <protocol>://<host>:<port>/<base_path> | String | Mandatory | <https://petstore.swagger.io/v2> |
default_headers | Default headers which will be added to each of the RestAPI request headers which need to be tested. Should be Json format . | Json | Optional | {"Content-Type":"application/json","Accept":"application/json"} |
Test_Suite:
Represents the list of suites that are part of the test.
Header Name | Description | Format | Mandatory | Examples |
---|---|---|---|---|
suite_unique_name | Name of the Test Suite should be unique. Duplicate names should not exist. | String | Mandatory | user_service_suite |
suite_description | Description about the Test suite | String | Optional | Suite to evaluate a positive flow of user_service. |
depends_on | Sometimes other Test Suite needs to execute first before the current Test Suite. Name of the Test Suite from suite_unique_name which it depends on. | Comma Separated String | Optional | user_registration_suite,user_validation_suite |
suite_params | Parameters thats need to be passed into the Test Suite APIs | Json | Optional | {"user":"John"} |
suite_enable | To enable or disable invocations of APIs for the current suite. Default : TRUE. | Boolean | Optional | TRUE |
Test_Scenarios:
This represents the logical grouping of similar scenarios.
Header Name | Description | Format | Mandatory | Examples |
---|---|---|---|---|
scenario_unique_name | Name of the Test Suite Execution. Should be unique. Duplicate names should not exist. | String | Mandatory | get_user_exec |
scenario_description | The "description" of the test scenario to communicate the details to the users and to be logged in the report. | String | Optional | Scenario to test if the user fetch fails after deletion. |
test_suite | The "suite_unique_name" field value read from the Test_Suite sheets. Need to define that the test execution belongs to which test suite. Eg: user_service_suite. This test suite execution belongs to a test suite with suite_unique_name as ‘user_service_suite’. | String | Mandatory | user_service_suite |
test_apis | Comma seperated values of the wrapper/APIs to be executed, in order. "case_unique_name" field value from test_definition sheet or "test_api_wrapper_name" field from Test_Api_Wrappers sheet. | String | Mandatory | get_user |
depends_on | Sometimes other Test Scenario Execution should be invoked before current Test Suite Execution. Name of the case_unique_name which should execute first before executing the current Test Suite Execution. | Comma separated String | Optional | create_user_exec |
test_execution_params | Parameters to be included to the current Test suite execution | Json | Optional | {"user_name" : "vivek"} |
test_execution_enable | To enable or disable invocations of test suite execution . Default : TRUE. | Boolean | Optional | TRUE |
Test_Api_Wrappers :
Optional sheet. This represents test wrappers for APIs that can utilise Restel variables when being called and tested. Intended to pass API specific parameters and avoid duplicating APIs. The columns and the meaning of the columns in the sheet is as below,
Header Name | Description | format | Mandatory | Example |
---|---|---|---|---|
test_api_wrapper_name | Name of the Test Wrapper. Should be unique, duplicates should not exist. | String | Mandatory | read_entry_500 |
test_api_wrapper_description | Description about the test wrapper. | String | Optional | User retrieval failed |
test_api_wrapper_parameters | Test specific parameters that can be used within the wrapped test. | String | Optional | { "expected_read_status_code": "500", "read_expected_response":{"message":"Cannot read properties of null (reading '_id')"} } |
test_api_name | Name of the test being wrapped. Must match exactly one test name (api_unique_name) defined in Test_Api_Definitions sheet. | String | Mandatory | read_entry |
Test_Api_Definitions :
This represents rudimentary APIs that will be called and tested. The columns and the meaning of the columns in the sheet is as below,
Header Name | Description | format | Mandatory | Example |
---|---|---|---|---|
api_unique_name | Name of the Test Case Definition. Should be unique, duplicate names should not exist. | String | Mandatory | create_user |
depends_on | Sometimes other Test_definitions need to be executed before executing the current Test_definition. Includes another case_unique_name which needs to be executed first. | Comma separated strings | optional | get_user,login_user |
api_description | Description about the Test_definition | String | optional | API for fetching the information of all users. |
request_url | Endpoint of the Rest API. Supports Restel variables. | String | Mandatory | /user |
request_method | Endpoint Http Method. Should be one of HTTP Methods | String | Mandatory | POST |
request_headers | Endpoint Http Request Headers | Json | Optional | {"Content-Type":"application/json","Accept":"application/json"} |
request_query_params | Query parameters for this endpoint | Json | Optional | {"user:"Tom","index":2} |
request_body_params | Endpoint Body parameters. Format can be json or String. Provide the appropriate Content-Type in the request_headers. Supports Restel variables. | Json / String | Optional | {"id": 1,"email": "noreply@gmail.com","phone": "99999999999"} |
request_pre_call_hook | Middlewares on request before api call like authentications, etc. | Json | optional | {} |
request_post_call_hook | Middlewares on request after api call like writing response to file,etc | Json | optional | {} |
expected_response | The API call response body to be expected, Will evaluate expected response body with the actual api call response body. Should provide the appropriate response content-type in the response headers. Supports Restel variables. | Json/String | Optional | { "id": 1,"email": "noreply@gmail.com","phone": "99999999999"} |
expected_response_matcher | Evaluation technique names. Will evaluate the api response body with expected_response body. Should be one of the enums [NOOP_MATCHER,EXACT_MATCHER,PARTIAL_MATCHER] | Enum of [NOOP_MATCHER,EXACT_MATCHER,PARTIAL_MATCHER] | Mandatory | EXACT_MATCHER |
expected_header | The API call response headers to be expected.Will evaluate expected response header with the actual api call response header. | Json | Optional | {"Content-Type":"application/json","Server":"Jetty"} |
expected_header_matcher | Evaluation technique names. Will evaluate the api response header with expected_response header. should be one of the enums [NOOP_MATCHER,EXACT_MATCHER,PARTIAL_MATCHER] | Enum of [NOOP_MATCHER,EXACT_MATCHER,PARTIAL_MATCHER] | Mandatory | NOOP_MATCHER |
accepted_status_code | To validate/check if the api call status code is within the one of the accepted_status_code. Should be one or list of status codes. Supports Restel variables. | Comma separated values | Mandatory | 201 |
Tags | Can give tags to Test_Definition. | Comma separated String | Optional | UserService |