RESTful API Testing using Postman, Newman, and Jenkins

17
| HELLO, REAL WORLD. Include Automated Restful API Testing with your CI using Postman, Newman, and Jenkins Elise Carmichael

Transcript of RESTful API Testing using Postman, Newman, and Jenkins

Page 1: RESTful API Testing using Postman, Newman, and Jenkins

| HELLO, REAL WORLD.

Include Automated Restful API Testing with your CI usingPostman, Newman, and Jenkins

Elise Carmichael

Page 2: RESTful API Testing using Postman, Newman, and Jenkins

| HELLO, REAL WORLD.

Elise Carmichael

Vice President of Quality

QASymphony

Page 3: RESTful API Testing using Postman, Newman, and Jenkins

Agenda

• There are so many types of testing, why focus on API?

• Why use Postman, Newman, and Jenkins?

• How to write tests in Postman

• How to use Newman to execute Postman tests from a commandline

• How to include your tests in Jenkins

• Note: Focusing on REST

Page 4: RESTful API Testing using Postman, Newman, and Jenkins

• Security

• Security

• Security

• Security

• Security

• Security

Why API Testing?

Page 5: RESTful API Testing using Postman, Newman, and Jenkins

• Quick tests to write, run, quick feedback in CI jobs

• Reusability for performance testing

• Put some basic scenarios into your production monitoring system to be aware of outages before your customers

Why API Testing?

Page 6: RESTful API Testing using Postman, Newman, and Jenkins

INSERT PHOTO ON TOP

• We use Postman at QA Symphony for our REST API tests.

• It’s

• Free

• Very Popular

• Easy to use

• Works well with CI

Postmanhttps://www.getpostman.com/

Page 7: RESTful API Testing using Postman, Newman, and Jenkins

INSERT PHOTO ON TOP

• We use Newman to integrate API tests into CI at QA Symphony

• It’s

• Free

• Works seamlessly with Postman

• Executes tests from the command line so that they can be included in CI

Newmanhttps://www.getpostman.com/docs/postman/collection_runs/command_line_integration_with_newman

Page 8: RESTful API Testing using Postman, Newman, and Jenkins

Jenkinshttps://jenkins.io/

• Jenkins is one of several tools we use at QA Symphony to assist with Continuous Integration

• It’s

• Free

• Popular

• Very, very flexible with many plugins (even qTest has one!)

Page 9: RESTful API Testing using Postman, Newman, and Jenkins

INSERT PHOTO ON TOP

Postman Examples

1. Read Some API Documentation (let’s use qTest’s API)

2. Make a call1. Login & Create Test Case

3. Test the call1. Verify Status Code

2. Verify Speed

3. Verify Response

Page 10: RESTful API Testing using Postman, Newman, and Jenkins

INSERT PHOTO ON TOP

Postman Examples (continued)

1. Set up variables (to use/store in the next call)

2. Check for a security flaw1. Same verifications

3. Runner GUI

4. Download a collection

5. Download the environment (staging/dev)

Page 11: RESTful API Testing using Postman, Newman, and Jenkins

INSERT PHOTO ON TOP

Newman Example

1. Let’s test that same collection from the commandline

Page 12: RESTful API Testing using Postman, Newman, and Jenkins

INSERT PHOTO ON TOP

Jenkins Example

1. Simple shell to execute newman

2. Use script to upload test results to qTest, just to show the full cycle if we wanted to not just include API testing in our CI, but to have a documented, easy to read record of what was tested

Page 13: RESTful API Testing using Postman, Newman, and Jenkins

I just showed you one example of a tool set that you could use, but there are countless others!

Other Options!

Page 14: RESTful API Testing using Postman, Newman, and Jenkins

| HELLO, REAL WORLD.

Test Early; Test Often!

Page 15: RESTful API Testing using Postman, Newman, and Jenkins

Thank You!Elise Carmichael

[email protected]

Q&A

Page 16: RESTful API Testing using Postman, Newman, and Jenkins

| HELLO, REAL WORLD.

Quality Jam LondonOctober 11, 2017 – http://qualityjam.net/uk/

Email [email protected] to be entered to win a free ticket

Page 17: RESTful API Testing using Postman, Newman, and Jenkins

| HELLO, REAL WORLD.

Quality Jam LondonOctober 11, 2017 – The Brewery, London

Email [email protected] to be entered to win a free ticket