21
Agile testing for web API with Postman Presented by Anthony Todisco © All rights reserved

Agile testing for web API with Postman · 2018-10-23 · Rest-assured test • First choice for most people • Java Domain Specific Language (DSL) for test • Support response parsing

  • Upload
    others

  • View
    12

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Agile testing for web API with Postman · 2018-10-23 · Rest-assured test • First choice for most people • Java Domain Specific Language (DSL) for test • Support response parsing

Agile testing for web API with PostmanPresented by Anthony Todisco

© All rights reserved

Page 2: Agile testing for web API with Postman · 2018-10-23 · Rest-assured test • First choice for most people • Java Domain Specific Language (DSL) for test • Support response parsing

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

Page 3: Agile testing for web API with Postman · 2018-10-23 · Rest-assured test • First choice for most people • Java Domain Specific Language (DSL) for test • Support response parsing

API and Agile

• Growth in the number of API

• Importance of time to market

© All rights reserved

User Conference onAdvanced Automated Testing

Page 4: Agile testing for web API with Postman · 2018-10-23 · Rest-assured test • First choice for most people • Java Domain Specific Language (DSL) for test • Support response parsing

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

Page 5: Agile testing for web API with Postman · 2018-10-23 · Rest-assured test • First choice for most people • Java Domain Specific Language (DSL) for test • Support response parsing

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?

Page 6: Agile testing for web API with Postman · 2018-10-23 · Rest-assured test • First choice for most people • Java Domain Specific Language (DSL) for test • Support response parsing

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

Page 7: Agile testing for web API with Postman · 2018-10-23 · Rest-assured test • First choice for most people • Java Domain Specific Language (DSL) for test • Support response parsing

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

Page 8: Agile testing for web API with Postman · 2018-10-23 · Rest-assured test • First choice for most people • Java Domain Specific Language (DSL) for test • Support response parsing

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

Page 9: Agile testing for web API with Postman · 2018-10-23 · Rest-assured test • First choice for most people • Java Domain Specific Language (DSL) for test • Support response parsing

© All rights reserved

User Conference onAdvanced Automated Testing

Page 10: Agile testing for web API with Postman · 2018-10-23 · Rest-assured test • First choice for most people • Java Domain Specific Language (DSL) for test • Support response parsing

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

Page 11: Agile testing for web API with Postman · 2018-10-23 · Rest-assured test • First choice for most people • Java Domain Specific Language (DSL) for test • Support response parsing

Postman

© All rights reserved

User Conference onAdvanced Automated Testing

Page 12: Agile testing for web API with Postman · 2018-10-23 · Rest-assured test • First choice for most people • Java Domain Specific Language (DSL) for test • Support response parsing

Postman

© All rights reserved

User Conference onAdvanced Automated Testing

Page 13: Agile testing for web API with Postman · 2018-10-23 · Rest-assured test • First choice for most people • Java Domain Specific Language (DSL) for test • Support response parsing

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

Page 14: Agile testing for web API with Postman · 2018-10-23 · Rest-assured test • First choice for most people • Java Domain Specific Language (DSL) for test • Support response parsing

Our journey with Postman: Combine

© All rights reserved

User Conference onAdvanced Automated Testing

Combine them

Page 15: Agile testing for web API with Postman · 2018-10-23 · Rest-assured test • First choice for most people • Java Domain Specific Language (DSL) for test • Support response parsing

Our journey with Postman: BDD

© All rights reserved

User Conference onAdvanced Automated Testing

Page 16: Agile testing for web API with Postman · 2018-10-23 · Rest-assured test • First choice for most people • Java Domain Specific Language (DSL) for test • Support response parsing

Our journey with Postman: BDD

© All rights reserved

User Conference onAdvanced Automated Testing

Page 17: Agile testing for web API with Postman · 2018-10-23 · Rest-assured test • First choice for most people • Java Domain Specific Language (DSL) for test • Support response parsing

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

Page 18: Agile testing for web API with Postman · 2018-10-23 · Rest-assured test • First choice for most people • Java Domain Specific Language (DSL) for test • Support response parsing

Our journey with Postman: Replication

• Use the collection structure at your advantage

© All rights reserved

User Conference onAdvanced Automated Testing

Page 19: Agile testing for web API with Postman · 2018-10-23 · Rest-assured test • First choice for most people • Java Domain Specific Language (DSL) for test • Support response parsing

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

Page 20: Agile testing for web API with Postman · 2018-10-23 · Rest-assured test • First choice for most people • Java Domain Specific Language (DSL) for test • Support response parsing

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

Page 21: Agile testing for web API with Postman · 2018-10-23 · Rest-assured test • First choice for most people • Java Domain Specific Language (DSL) for test • Support response parsing

Thank youAny questions?

© All rights reserved