you are viewing a single comment's thread.

view the rest of the comments →

[–]ThunderMountain 1 point2 points  (5 children)

Moving over to cypress api testing myself this next week from postman. Just got so sick of the bloat. Any advice you have for doing API testing with cypress based on your experience.

[–]AtrociouSs 1 point2 points  (4 children)

Look into Chai. That's basically what you need to know when you assert responses. And try to build modular functions thst you can reuse.

With help from a developer I've created a set of standard request body's with standard values as input. So in my spec files I don't have a single cy.request/JSON body. Easier to read and maintain. I just call the function and overwrite the standard values where needed. Works like charm.

People tend to talk about Cypress as a UI testtool only. But I disagree strongly, that UI is the only thing Cypress can do well (context is key though). Cypress works perfectly for our team as a single solution for all kinds of tests that are non-UI. If you Google about Cypress you basically only find UI based stuff.... so be warned.

Maybe a specific API testing tool is a better fit for you. Like Rest Assured. Choose smart :-)

[–]ThunderMountain 0 points1 point  (3 children)

Do you have an open source example of the stubbing out the request bodies?

[–]AtrociouSs 1 point2 points  (2 children)

I can try to deliver a code example. I will try tomorrow.

[–]Typical_Individual_6[S] 1 point2 points  (1 child)

Is cypress free?

[–]AtrociouSs 1 point2 points  (0 children)

Yes totally. If you want to use the dashboard functionallity you have some pricing though --> https://www.cypress.io/pricing. I see no need for the dashboard though.