-
Notifications
You must be signed in to change notification settings - Fork 16
How to write Service Test using codeless
Julio Zevallos edited this page Jun 14, 2019
·
6 revisions
- Setup a root folder named suites in example_usage which contains all the .xlsx test suite files (API, UI or a hybrid), including new ones you would write yourself.
- Create a new .xlsx file in example_usage
ExampleFileName: "demo_ui.xlsx"
.
ExampleTestSuiteFilePath: project_directory/codeless_skeleton/suites/demo_ui.xlsx
.
- Create a config sheet in the .xlsx file that was created in the step 1. Config sheets MUST use the preface "c-" .
Example UI config sheet name : "c-demo"
.
key | value | comments |
---|---|---|
logging.details.enabled | TRUE | |
webdriver.parentTunnel | ||
webdriver.tunnelIdentifier |
- In this sheet, the user can start writing out the test steps desired for this test case, using the Framework Suite Keywords.
- Create a new sheet in the same suite file that was created in step 1. TestCase sheets MUST use the preface "t-"
Example UI TestCase sheet name : "t-test1"
. - Test suites must have at least one TestCase sheet, but can have as many as needed.
This sheet defines five common columns that are used by the framework to load it appropriately.
An example of a TestCase sheet can be found in the example_usage/suites directory.
- Step column
- Required.
- Short description of the test step. Can be any text value.
- Action column
- Required.
- Codeless Framework keyword.
- Defines action the Codeless Framework will take for this test case step.
- Target column
- Required for click, sendKeys and serviceCall actions.
- Input column
- Required for config, navigate, sendKeys and serviceCall actions.
- Variable text field depending on action selected.
- Override column
- Optional in most cases. Required in some cases with API service calls. (serviceCall action).
- Variable text field depending on action selected.
- Assertions for service steps are made here. Example of assertions in overrides can be: assert::RESPONSECODE::isEqualTo::200. All keywords to assert are:
- RESPONSECODE
- RESPONSETIME
- BODYSTRING
- HEADER
- JSONPATH
- XMLPATH
Example Service test sheet name : "t-test1"
.
Step | Action | Target | Input | Overrides |
---|---|---|---|---|
config setup | config | |||
POST call to customer api | serviceCall | customer.api.v1.create | POST | body::string::{"name":"etp","salary":"123456789","age":"100"} |
GET call from customer api | serviceCall | customer.api.v1.employee.{id} | GET | path::id::123 |
This section describes how you can write SOAP service tests in you codeless test sheet.
Example UI test sheet name : "t-test1"
.
Step | Action | Target | Input | Overrides | Overrides |
---|---|---|---|---|---|
config setup | config | ||||
Activate request | serviceCall | dsg.activateSubscriber.{{host1}} | POST | activateRequest | assert::XMLPATH::channelId::isEqualTo::METROv2 |
Step and Action column value for SOAP test step has same definition as REST Service and UI test steps.
- Target column: Target column has three dot(.) separated values. First part, "dsg" describes service folder under you model directory which has you wsdl file and request files. Then second part "activateSubscriber" defines SOAPAction header value. The third part "{{host1}}" describes host or endpoint for your SOAP service call. Requirement for this SOAP service call step to be successful, you have to save or define your wsdl file under your service folder which is "dsg" if we take above example. You also have to name the wsdl file as follow "wsdlFile.wsdl". The last part of your Target column definition is "{{host1}}". As we state above this is an endpoint definition for SOAP Service call. The framework will try to find value for host1 key in your dataSheet definations. you have to define a host1 key and endpoint value in data sheet. Please don't use {{host}} as your endpoint. host is a default value used for any kind of service call.
- Override column_1: This column is where you define request file used for your SOAP service call. your request file should be saved under dsg folder as .txt file with your wsdl File. The First override column should have you request file and the second should define you assertions.
- Overrides column_2: On second Override column for SOAP service call you need to define your assertions for service call response.