23
Testing back-end: automation approach for manual QC Alyona Tudan QA Engineer at N-iX

Testing back-end: automation approach for manual QA

Embed Size (px)

Citation preview

Page 1: Testing back-end: automation approach for manual QA

Testing back-end: automation approach

for manual QCAlyona Tudan

QA Engineer at N-iX

Page 2: Testing back-end: automation approach for manual QA

What

Mobile application (front-end) Server side (back-end)

Page 3: Testing back-end: automation approach for manual QA

When

Time from summer 2015 Back-end: from 3 web-services to nearly 40 Front-end: from built-in option to standalone app

Page 4: Testing back-end: automation approach for manual QA

Why

Page 5: Testing back-end: automation approach for manual QA

Why

Page 6: Testing back-end: automation approach for manual QA

Why

Page 7: Testing back-end: automation approach for manual QA

Why

And much more…

Page 8: Testing back-end: automation approach for manual QA

Solution

Automation framework

Soap UI

Input data

Report

DDT Environment handling Resources handling Positive & negative

scenarios Assertions for every step Detailed reports CI Database checking

Page 9: Testing back-end: automation approach for manual QA

Schema

Login

Password

Back-end

Front-end

Request:

“Login”: “Login”,“Password”: “Password”

Response:

True

Page 10: Testing back-end: automation approach for manual QA

Challenges for manual QC

Writing down test suits with user journeys Full coverage of web-services Writing down asserting using groovy Scripting using groovy

Page 11: Testing back-end: automation approach for manual QA

How it looks

Page 12: Testing back-end: automation approach for manual QA
Page 13: Testing back-end: automation approach for manual QA

Input dataMain tab with test

cases

Tab of the test case with different

scenarios

Page 14: Testing back-end: automation approach for manual QA

Using variables

Using properties instead of exact values:

“ValueOfRequest”: “1234” (or “test”) “ValueOfRequest”: “${#TestCase#value}”

Page 15: Testing back-end: automation approach for manual QA

“Try” for possibility of empty variablesTry {

ID == null}

catch (Exception) {throw new RuntimeException ("There should be registered user");

}

Page 16: Testing back-end: automation approach for manual QA

Replacing text in request

def caseList = context.testCase.testSuite.getTestCaseList() caseList.each

{ def testStepList = it.getTestStepList();

testStepList.each {eachTestStep -> if(eachTestStep instanceof com.eviware.soapui.impl.wsdl.teststeps.RestTestRequestStep){RestRequest request = eachTestStep.getHttpRequest();

def result = request.getRequestContent().replaceAll(“test", “NewTest"); request.setRequestContent(result) } } }

Page 17: Testing back-end: automation approach for manual QA

Turning on exact steps

def suitList = context.testCase.testSuite.project.getTestSuiteList()String env = context.testCase.testSuite.project.getPropertyValue("environment");suitList.each

{def caseList = it.getTestCaseList()caseList.each

{def testStepList = it.getTestStepList();

   testStepList.each {

Page 18: Testing back-end: automation approach for manual QA

Turning on exact steps

if (env.equals ("PROXY")) {

  if (it.name.equals( “LoginTest")){

  it.setDisabled(true) }if (it.name.equals( “LoginProxy")){

  it.setDisabled(false)  }

log.info "Done PROXY"}

if (env.equals ("TEST")) {

  if (it.name.equals( "LoginTest"))

{  it.setDisabled(false)  }

if (it.name.equals("LoginProxy"))

{  it.setDisabled(true)  }

 log.info "Done TEST"}

DO not forget to close previous brackets }}}

Page 19: Testing back-end: automation approach for manual QA

Using loops

for(int i =0; i < 20; i++){def condition = context.testCase.getPropertyValue("Status");def code = context.testCase.getPropertyValue("Code");

if (code == "30") { break }else{testRunner.runTestStepByName("Delay") testRunner.runTestStepByName("GetCode")testRunner.runTestStepByName("JDBC: Check status")}}

Page 20: Testing back-end: automation approach for manual QA

One more loop for empty value

def condition = context.testCase.getPropertyValue("Id");

for (int i =0; i < 2; i++){ if (condition != ""){break}else{ testRunner.runTestStepByName("Delay") testRunner.runTestStepByName(“GetId")}}

Page 21: Testing back-end: automation approach for manual QA

Report

Page 22: Testing back-end: automation approach for manual QA

Conclusion

Time saving Running regression in 1 click Reports visibility Coverage Studying all the time Interest

Maintenance Merging troubles Review Studying all the time

Page 23: Testing back-end: automation approach for manual QA

Questions, ideas, feedback

Email: [email protected] Facebook: ymkocv Speakerdeck: ymkocv