All Questions
Tagged with web-api-testing cypress
46 questions
1
vote
2
answers
87
views
How to store specific data set from JSON response body?
I am trying to learn cypress then come across a topic in validating json response body but did not discuss on how to store it in a variable. I would like to know how to store specific data set in a ...
4
votes
2
answers
1k
views
Cypress TypeError : Cannot read properties of undefined (reading 'then')
I have this function below :- checkStatusCode
I check if a response is OK then I try to return a value and based on that I try to visit the URL (ex:- if response status is 200)
checkStatusCode(href) ...
0
votes
1
answer
2k
views
How to change baseURL during tests in cypress-io/github-actions [closed]
I'm trying to run my Cypress tests using Github Actions. I have everything set up but I have a problem with baseURL variable which is set during GitubActions process and then passed to Cypress. In my ...
0
votes
1
answer
452
views
Unable to get object value from response body in cypress [closed]
I am a beginner to Cypress and I am trying to get hands-on in API Testing for Cypress.
I am trying a very basic GET response from the following URL:
https://automationexercise.com/api/productsList
I ...
1
vote
2
answers
334
views
How to verify that one of the api calls has been made in Cypress?
I think the answer must be pretty simple but i can't find it...
How to verify that one of the calls has been made?
cy.intercept('GET', '/api/v1/url1').as('call1');
cy.intercept('PUT', '/api/v1/url2')....
-2
votes
2
answers
658
views
Cypress: Is there any way we can substitute fixture fields with data generated in test case in order to generate dynamic payload (Tried existing sol) [duplicate]
I am a newbie in Cypress. I want to know if there is any way to generate a dynamic payload by substituting values of JSON file with the values generated programmatically in cypress test. Something we ...
1
vote
1
answer
730
views
Handle DELETE request in Cypress API Test
I have some confusion about API automation testing in Cypress. If we use a real database to handle the DELETE request without mocking data, How to test with the same data set to run the tests again or ...
0
votes
1
answer
146
views
JavaScript API Response - if clause for 'null' response
Can someone assist, please, in following case:
Have a .json response with person's data where, that person can or can not be assigned to some project.
Below is part of response where person is not ...
0
votes
1
answer
64
views
Install Cypress for API Automation Testing [closed]
I am new to Cypress and trying to use it for API testing. Currently, I am using Cypress for UI automation and installed it in the client directory.
Now I have a confusion, If I am going to use Cypress ...
0
votes
2
answers
543
views
Cypress: How to get elements from a variable with HTML?
I'm currently working on API testing. The API that I'm testing is returning an HTML body. How do I get an element from the response body? If I visit the link, it returns an iframe and I cannot access ...
1
vote
1
answer
477
views
I can't access response body Cypress Api Testing
I want to automate the api using Cypress, but I can't access the response body.
Use this path cy.log(JSON.stringify(response.body.payload[0]
Api Response
Code
context('GET /Auth', () => {
...
1
vote
0
answers
173
views
Firebase authentication with Cypress
I'm having issues with creating a custom command in Cypress that will allow my user to log in programatically rather than through the UI. I have pulled a lot of this from a tutorial and perhaps it is ...
1
vote
0
answers
324
views
Avoid 406 error when using GET method in API testing with Cypress
I would like to test the api of an application, I've got a token from the developer, but I'm getting an error 'cy.request() failed on:
https://******************************
The response we received ...
3
votes
2
answers
111
views
Global variable is not updated
My test is querying a JSON and put value to 'text' variable,
but when trying to use the variable I'm getting an error:
cy.type() cannot accept an empty string. You need to actually type something
...
0
votes
1
answer
916
views
Get data from array in JSON API object in Cypress [closed]
Relative newbie to Cypress and JSON data. I have an api online that I can access. The api has data similar to this:
{"record":[{"account":"acount_1","team":&...