Upload
others
View
12
Download
0
Embed Size (px)
Citation preview
Agile testing for web API with PostmanPresented by Anthony Todisco
© All rights reserved
Agenda
• API and Agile
• API testing
• Rest-assured
• Postman
• Our journey with Postman
• Key takeaway
• Q&A
© All rights reserved
User Conference onAdvanced Automated Testing
API and Agile
• Growth in the number of API
• Importance of time to market
© All rights reserved
User Conference onAdvanced Automated Testing
API and Agile
• Agile methodology to produce quick results
• But UI testing is currently:• too slow
• Not adapted to Agile
© All rights reserved
User Conference onAdvanced Automated Testing
API and tests• Test automation is the key
• Multiple possibilities for test automation
© All rights reserved
User Conference onAdvanced Automated Testing
Which one to choose?
Rest-assured test• First choice for most people
• Java Domain Specific Language (DSL) for test
• Support response parsing (XML and JSON)
• BDD Syntax:• Easy reading• Maintainable
• Source code and tests in the same project
© All rights reserved
User Conference onAdvanced Automated Testing
Rest-assured test• No report need another unit test framework
• What if your code is not Java ?
• If your QAs are not developers ?
© All rights reserved
User Conference onAdvanced Automated Testing
Postman
• A UI tool for API testing
• Good for:• Exploratory tests
• Functional and automated tests
• Easy to use
• Support response parsing (XML and JSON)
• Define the concept of collection for a group of requests
© All rights reserved
User Conference onAdvanced Automated Testing
© All rights reserved
User Conference onAdvanced Automated Testing
Postman
• CLI (Newman) that integrates greatly with Jenkins
• CLI, XML and HTML reports
• Support SOAP call
• Basic Javascript testing with boolean
© All rights reserved
User Conference onAdvanced Automated Testing
Postman
© All rights reserved
User Conference onAdvanced Automated Testing
Postman
© All rights reserved
User Conference onAdvanced Automated Testing
Our journey with Postman: Split
© All rights reserved
User Conference onAdvanced Automated Testing
488000 lines
1830 lines
500 lines
2100 lines
Less than 4000 lines
Our journey with Postman: Combine
© All rights reserved
User Conference onAdvanced Automated Testing
Combine them
Our journey with Postman: BDD
© All rights reserved
User Conference onAdvanced Automated Testing
Our journey with Postman: BDD
© All rights reserved
User Conference onAdvanced Automated Testing
Our journey with Postman: Replication• Saved re-usable functions into Postman environment
© All rights reserved
User Conference onAdvanced Automated Testing
510 lines on every request
5 lines on every collection
Our journey with Postman: Replication
• Use the collection structure at your advantage
© All rights reserved
User Conference onAdvanced Automated Testing
Our journey with Postman: Feedbacks
© All rights reserved
User Conference onAdvanced Automated Testing
80 %
Easiness
Better communication
Reduction of file size (after splitting)
30 %
Between developers, QAs and PO with BDD
Using BDD and re-used function
Time reduction on develop/review per US
Key takeaway
• Simple yet powerful tool
• Use small collections to share work
• Integration of Newman with Jenkins
• Avoid duplicate code by using environment
• Use Collection structure to your advantage
© All rights reserved
User Conference onAdvanced Automated Testing
Thank youAny questions?
© All rights reserved