Home
Basics
Introduction Environment Setup Cypress Components First Test Running Tests Reports Element Identification GUI interaction Cypress Hooks Cypress Fixtures Integration with CI serversAdvanced
Page Object Model Custom Commands Intercepting Requests Backend Testing Interview Questions and AnswersBackend testing in Cypress
We can easily use Cypress to send the api requests and check responses.
describe('Softpost Test', function () {
it('Use fixture data', function (){
cy.request('https://jsonplaceholder.cypress.io/users')
.then((response) => {
cy.writeFile('cypress/fixtures/userdata.json', response.body)
})
cy.fixture('userdata').should((users) => {
expect(users[0].name).to.eq("Leanne Graham")
})
});
});
Web development and Automation testing
solutions delivered!!