https://cypress.io logo
hi guys. I've an issue with our Cypress test. Ther...
# general-chat
m
hi guys. I've an issue with our Cypress test. There is a test that had been running flawlessly for weeks/months but have started to fail recently. Investigating a bit and turned out that a request header's origin field contains wrong value. Surprisingly the value is the same that is set a bit later as parameters for a cy.wait(). As a fix the header value is reset to a meaningful value. No browser, cypress version has changed. Do you have any idea?
Copy code
cy.intercept('POST', '**/token', (req) => {
      Cypress.log({ name: 'Origin of token request before update:', message: req.headers['Origin'] })
      Cypress.log({ name: 'Will set it to:', message: origin })
      req.headers['Origin'] = origin
    }).as('token')
  cy.visit(link)
  cy.wait('@reponseFromBackend', { timeout: 70000 })

https://cdn.discordapp.com/attachments/763114122065739818/1100352277161709618/image.png▾