We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8119246 commit b7e65b3Copy full SHA for b7e65b3
examples/stubbing-spying__intercept/cypress/integration/spy-on-fetch-spec.js
@@ -35,6 +35,21 @@ describe('intercept', () => {
35
// there should be three users displayed on the page
36
cy.get('.user').should('have.length', 3)
37
})
38
+
39
+ it('checks the status code', () => {
40
+ cy.intercept('/users').as('users')
41
+ cy.get('#load-five-users').click()
42
+ cy.wait('@users').its('response').then((response) => {
43
+ expect(response).to.include({
44
+ statusCode: 200,
45
+ statusMessage: 'OK',
46
+ })
47
48
+ // or check every property separately
49
+ expect(response).property('statusCode').to.equal(200)
50
+ expect(response).property('body').to.have.length(5)
51
52
53
54
55
context('uses query', () => {
0 commit comments