qaf-support-ws

November 4, 2022 ยท View on GitHub

License Maven Central GitHub tag javadoc

qaf-support-ws

Support project that provides ready to use steps for webservices Features:

FeatureAttributeDetails
Test-AuthoringIndustry Standard
CodedJava (TestNG, Junit)
BDDQAF-BDD, Gherkin
Keyword drivenXML,CSV,EXCEL
Step-Creation
JavaY (any Java IDE can be used)
BDDEcipse QAF BDD editor, QAS
Keyword drivenQAS
IDE supportYEclipse, IntelliJ, Net-beans, QAS
Data-drivenYXML, CSV, JSON, DB, Excel
ReportingXMLIndustry Standard โ€“ TestNG and Junit
HTMLTestNG, Junit, QAF(json) detailed reporting
Language-SupportYJava, Goovy
ProgrammingY Full programming control
Test-Data
parameterY
RandomY
LocaleY
Multiple Env supportY
OrchestrationYUI and API test Orchestration
Test-ManagementYSupports easy integration with all test management tools
Build toolsIndustry StandardANT+IVY, Maven,Gradle
Request validation
XMLxml path validation
JSONjson path validation
SchemaY
Run-configurationYTestNG XML (all features)
Parallel execution
SOAP supportY
REST supportY

To start with

  1. Create QAF Project
  2. add dependency
    <dependency org="com.qmetry" name="qaf-support-ws" rev="latest.integration" />
    
    
  3. Create web-service call repository having all your calls in following format in .wsc or .properties file
    #format
    #my.ws.call = {'headers':<json map of key-val pair>,'endpoint':'/myservice-endPoint','baseUrl':'${env.baseurl}','method':'<method GET|POST|PUT|DELETE>','query-parameters':<json map of key-val pair>,'form-parameters':<json map of key-val pair>,'body':'<request-body>'}
    get.sample.call={'headers':{},'endPoint':'/myservice-endpoint','baseUrl':'${env.baseurl}','method':'GET','query-parameters':{'param1':'val1','param2':'val2'},'form-parameters':{},'body':''}
    
    
    
  4. Create bdd
Scenario: <scenario name>

   When user requests '${get.sample.call}'
   Then response should have status code '<status code>'
  [And response should have '<expectedvalue1>' at '<jsonpath1>'
   And response should have '<expectedvalue2>' at '<jsonpath2>'
     :
     :
  ]  
  1. Run your test

Refer ready to use steps for validation. Here you can find Example Projet.

Authorization

This dependency provides few well known Authentication support as well.

  1. Basic authentication, requires below properties.
rest.client.impl=com.qmetry.qaf.automation.ws.client.BasicAuthWsClient
rest.client.basic.auth.username=<USERNAME>
rest.client.basic.auth.password=<PASSWORD>
  1. Digest type authentication, requires below properties.
rest.client.impl=com.qmetry.qaf.automation.ws.client.DigestAuthWsClient
rest.client.digest.auth.username=<USERNAME>
rest.client.digest.auth.password=<PASSWORD>
  1. OAuth type authentication,requires below properties.
rest.client.impl=com.qmetry.qaf.automation.ws.client.OAuthWsClient
rest.client.oauth.auth.access_token=<ACCESS_TOKEN>
rest.client.oauth.auth.client_id=<CLIENT_ID>
rest.client.oauth.auth.client_secret=<CLIENT_SECRET>
rest.client.oauth.auth.refresh_token=<REFRESH_TOKEN>
rest.client.oauth.auth.username=<USERNAME>
rest.client.oauth.auth.password=<PASSWORD>
rest.client.oauth.auth.authentication_server_url=<AUTHENTICATION_SERVER_URL>
rest.client.oauth.auth.resource_server_url=<RESOURCE_SERVER_URL>
rest.client.oauth.auth.grant_type=<GRANT_TYPE>
  1. NTLM authentication,requires below properties.
rest.client.impl=com.qmetry.qaf.automation.ws.client.NTLMAuthClient
ntlm.user=<USERNAME>
ntlm.password=PASSWORD
ntlm.workstation=<WORKSTATION>
ntlm.domain=<DOMAIN>
  1. Hawk authentication,requires below properties
rest.client.impl=com.qmetry.qaf.automation.ws.client.HawkAuthWsClient
rest.client.hawk.auth.keyId=<HAWK_KEY_ID>
rest.client.hawk.auth.key=<HAWK_KEY>