COMAQA.BY Conf #2: "Codeception + PHP for QA Automation", Евгений Борисик, COMAQA.BY
Testing back-end: automation approach for manual QA
-
Upload
forge-events -
Category
Devices & Hardware
-
view
194 -
download
3
Transcript of Testing back-end: automation approach for manual QA
![Page 1: Testing back-end: automation approach for manual QA](https://reader035.fdocuments.net/reader035/viewer/2022070519/58ed47831a28abe35e8b456f/html5/thumbnails/1.jpg)
Testing back-end: automation approach
for manual QCAlyona Tudan
QA Engineer at N-iX
![Page 2: Testing back-end: automation approach for manual QA](https://reader035.fdocuments.net/reader035/viewer/2022070519/58ed47831a28abe35e8b456f/html5/thumbnails/2.jpg)
What
Mobile application (front-end) Server side (back-end)
![Page 3: Testing back-end: automation approach for manual QA](https://reader035.fdocuments.net/reader035/viewer/2022070519/58ed47831a28abe35e8b456f/html5/thumbnails/3.jpg)
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](https://reader035.fdocuments.net/reader035/viewer/2022070519/58ed47831a28abe35e8b456f/html5/thumbnails/4.jpg)
Why
![Page 5: Testing back-end: automation approach for manual QA](https://reader035.fdocuments.net/reader035/viewer/2022070519/58ed47831a28abe35e8b456f/html5/thumbnails/5.jpg)
Why
![Page 6: Testing back-end: automation approach for manual QA](https://reader035.fdocuments.net/reader035/viewer/2022070519/58ed47831a28abe35e8b456f/html5/thumbnails/6.jpg)
Why
![Page 7: Testing back-end: automation approach for manual QA](https://reader035.fdocuments.net/reader035/viewer/2022070519/58ed47831a28abe35e8b456f/html5/thumbnails/7.jpg)
Why
And much more…
![Page 8: Testing back-end: automation approach for manual QA](https://reader035.fdocuments.net/reader035/viewer/2022070519/58ed47831a28abe35e8b456f/html5/thumbnails/8.jpg)
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](https://reader035.fdocuments.net/reader035/viewer/2022070519/58ed47831a28abe35e8b456f/html5/thumbnails/9.jpg)
Schema
Login
Password
Back-end
Front-end
Request:
“Login”: “Login”,“Password”: “Password”
Response:
True
![Page 10: Testing back-end: automation approach for manual QA](https://reader035.fdocuments.net/reader035/viewer/2022070519/58ed47831a28abe35e8b456f/html5/thumbnails/10.jpg)
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](https://reader035.fdocuments.net/reader035/viewer/2022070519/58ed47831a28abe35e8b456f/html5/thumbnails/11.jpg)
How it looks
![Page 12: Testing back-end: automation approach for manual QA](https://reader035.fdocuments.net/reader035/viewer/2022070519/58ed47831a28abe35e8b456f/html5/thumbnails/12.jpg)
![Page 13: Testing back-end: automation approach for manual QA](https://reader035.fdocuments.net/reader035/viewer/2022070519/58ed47831a28abe35e8b456f/html5/thumbnails/13.jpg)
Input dataMain tab with test
cases
Tab of the test case with different
scenarios
![Page 14: Testing back-end: automation approach for manual QA](https://reader035.fdocuments.net/reader035/viewer/2022070519/58ed47831a28abe35e8b456f/html5/thumbnails/14.jpg)
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](https://reader035.fdocuments.net/reader035/viewer/2022070519/58ed47831a28abe35e8b456f/html5/thumbnails/15.jpg)
“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](https://reader035.fdocuments.net/reader035/viewer/2022070519/58ed47831a28abe35e8b456f/html5/thumbnails/16.jpg)
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](https://reader035.fdocuments.net/reader035/viewer/2022070519/58ed47831a28abe35e8b456f/html5/thumbnails/17.jpg)
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](https://reader035.fdocuments.net/reader035/viewer/2022070519/58ed47831a28abe35e8b456f/html5/thumbnails/18.jpg)
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](https://reader035.fdocuments.net/reader035/viewer/2022070519/58ed47831a28abe35e8b456f/html5/thumbnails/19.jpg)
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](https://reader035.fdocuments.net/reader035/viewer/2022070519/58ed47831a28abe35e8b456f/html5/thumbnails/20.jpg)
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](https://reader035.fdocuments.net/reader035/viewer/2022070519/58ed47831a28abe35e8b456f/html5/thumbnails/21.jpg)
Report
![Page 22: Testing back-end: automation approach for manual QA](https://reader035.fdocuments.net/reader035/viewer/2022070519/58ed47831a28abe35e8b456f/html5/thumbnails/22.jpg)
Conclusion
Time saving Running regression in 1 click Reports visibility Coverage Studying all the time Interest
Maintenance Merging troubles Review Studying all the time