<p>Cypress is designed for front-end end-to-end testing.  It is designed for testing a users interaction with your application and verifying that it works correctly (e.g. logging in with a valid username and password load the landing page).  Tools like this are designed to allow running in a headless mode which will let you run the tests in CI tool without loading a GUI.</p>

<p>Since it appears that your goal is to test the API interaction you are probably better off using a tool designed for that purpose.  Most API test tools allow you to send a request to your API and verify certain things about the response (i.e., response code, response headers, response bodies).</p>

<p>While using an end-to-end tool (like Cypress) will ultimately test your API, it will take longer to setup, run, and often be more brittle.  To use your above example, a tool like Cypress will require a script/test steps that log into your system, selecting multiple addresses for shipping, and verifying that everything displays properly.  A tool like Postman would just test that when you send a request to your FedEx API with a specific body and headers, you get the expected response, body, and headers back.  Setting up something like Postman will require a new tool, but will ultimately save time </p>

<p>Many of the API tools also provide a command line test runner and integrate with various CI tools (non-exhaustive list):</p>

<ol>
<li><a href="https://www.getpostman.com/" rel="nofollow noreferrer">Postman</a> - Free, relatively easy to setup, and includes an automated testing tool (<a href="https://learning.getpostman.com/docs/postman/collection_runs/command_line_integration_with_newman/" rel="nofollow noreferrer">newman</a>).</li>
<li><a href="https://smartbear.com/solutions/api-testing/" rel="nofollow noreferrer">SmartBear</a> - Commercial product that integrates with most CI tooling.</li>
<li><a href="https://github.com/rest-assured/rest-assured" rel="nofollow noreferrer">Rest-Assured</a> - Open source option for REST API testing.</li>
</ol>

CC BY-SA 4.0
2019-09-03T19:32:57.193Z
2019-09-04T14:12:38.377Z
2019-09-04T14:12:38.377Z
Wesley Rolnick
<p>I have a small team but a gigantic application. We don't have PHP unit testing, so we will be using Cypress as a baseline for quality. Everything will go through a CI/CD pipeline and use regression end to end to make sure we haven't broken any modules or projects. One example is a FedEx API for shipping and we have multiple addresses, using GUI testing will be too slow, so I wonder if using Cypress is okay for that task as opposed to put another system (Postman with CLI) in the pipeline running testing with dynamic data (multiple Postal Codes and addresses? )</p>

<continuous-integration><testing><regression>
Is Cypress ok for acceptance tests on APIs in a CI/CD pipeline?
Daniel Vianna
# Is Cypress ok for acceptance tests on APIs in a CI/CD pipeline?

(Asked by: username_0 on 2019-09-03)

I have a small team but a gigantic application. We don't have PHP unit testing, so we will be using Cypress as a baseline for quality. Everything will go through a CI/CD pipeline and use regression end to end to make sure we haven't broken any modules or projects. One example is a FedEx API for shipping and we have multiple addresses, using GUI testing will be too slow, so I wonder if using Cypress is okay for that task as opposed to put another system (Postman with CLI) in the pipeline running testing with dynamic data (multiple Postal Codes and addresses? )

**Tags:** continuous-integration, testing, regression


---

## 1 answers

### Answer by username_1 on 2019-09-03. Score: 2

Cypress is designed for front-end end-to-end testing. It is designed for testing a users interaction with your application and verifying that it works correctly (e.g. logging in with a valid username and password load the landing page). Tools like this are designed to allow running in a headless mode which will let you run the tests in CI tool without loading a GUI.

Since it appears that your goal is to test the API interaction you are probably better off using a tool designed for that purpose. Most API test tools allow you to send a request to your API and verify certain things about the response (i.e., response code, response headers, response bodies).

While using an end-to-end tool (like Cypress) will ultimately test your API, it will take longer to setup, run, and often be more brittle. To use your above example, a tool like Cypress will require a script/test steps that log into your system, selecting multiple addresses for shipping, and verifying that everything displays properly. A tool like Postman would just test that when you send a request to your FedEx API with a specific body and headers, you get the expected response, body, and headers back. Setting up something like Postman will require a new tool, but will ultimately save time

Many of the API tools also provide a command line test runner and integrate with various CI tools (non-exhaustive list):

1. [Postman](https://www.getpostman.com/) - Free, relatively easy to setup, and includes an automated testing tool ([newman](https://learning.getpostman.com/docs/postman/collection_runs/command_line_integration_with_newman/)).
2. [SmartBear](https://smartbear.com/solutions/api-testing/) - Commercial product that integrates with most CI tooling.
3. [Rest-Assured](https://github.com/rest-assured/rest-assured) - Open source option for REST API testing.


---

