Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

verify number of times request was made in cypress

describe('some test', () => {
  beforeEach(() => {
    cy.intercept('GET', 'route_address', cy.spy().as('routeAlias'))
  })

  afterEach(() => {
    cy.get('@routeAlias').its('callCount').should('equal', 0)
  })

  it('test blocks', () => {...})
})
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #verify #number #times #request #cypress
ADD COMMENT
Topic
Name
1+3 =