I want to try an example like this one API Testing with Cypress - DEV Community cypress test with API calls inside. No sure if this is always possible event if the URL is not changing ?
I’m new to API and cypress, so it could be a silly question, or not possible combination in this case.
I want to try an API test (also using cypress)
steps I want to make after login
click into “create job”
click into “post job ad”
fill all the data (a new window will be displayed after that)
check if it’s added correctly
My question how to translate this into API and the URL is not changing always the same, so when I put it in postman I can’t map things together
I think what you are calling is a regular URL (in postman) and not the API.
The URL doesn’t need to change in order to call API’s, 1 page can contain multiple API’s.
Do you have a swagger-file from the application that you are testing?
If you go to DevTools and the network tab, you can also see the API’s popping up.
Mark made a short video about how to copy api’s from the devtools to Postman by copying it as bash (cmd) & importing it into postman. But I can’t seem to find it. So help me out here @mwinteringham XD
I don’t think there will be an API for the 1. click into “create job” & 2. click into “post job ad” unless it will generate some sequence code. (I think they are just buttons that bring you to a different page?)
So what you want to test through the API is more something like:
Login to the app
fill all the data (a new window will be displayed after that)
In the network tab, you’ll find all kinds of requests, even images.
It sometimes takes a bit to find the right one, most of the times API’s actually have the name “api” in them.
So you can filter on “api” … but it’s not always the case