Giter Site home page Giter Site logo

Cypress blocks my xhr request about cypress HOT 7 OPEN

nehbehl avatar nehbehl commented on June 14, 2024
Cypress blocks my xhr request

from cypress.

Comments (7)

KrzysztofWisniewskiAcc avatar KrzysztofWisniewskiAcc commented on June 14, 2024

Got very similar issue, want to intercept an xhr/fetch call after clicking an input (checkbox)

cy.intercept('https://someurl').as('interceptRequest');
cy.get('#popover-basic input').check(['kw-test-123']);
cy.wait('@interceptRequest');

Feels like a bug or I'm missing something, although I have lots of places where I was doing this likely, although it was never a checkbox.

I can see from the console 2 scenarios

  1. The request was done before the interception was triggered, although the 'wait' is placed right after the click call.
  2. The interception blocked loading resource loading (after clicking, the request didn't trigger until interception died out of timeout, tried different timeouts so it's not a time issue)

Also tried on various versions of cypress
Cypress 13.6.0 or 13.7.2
node v20.11.1
chrome 123.0.6312.123
windows 11

What I also notice and mb it's somehow related, that the function in tested application, which is triggered after the click, is an 'async' one

saveFavorites: async (listId, performSync = true) => {

from cypress.

jennifer-shehane avatar jennifer-shehane commented on June 14, 2024

Could you share some details on this request, like the headers?

from cypress.

nehbehl avatar nehbehl commented on June 14, 2024

Here are the header details, please assist to overcome this or understand the reason so that I can move ahead.

from cypress.

jennifer-shehane avatar jennifer-shehane commented on June 14, 2024

@nehbehl Are there no errors in the console? I haven't seen this blocked behavior before in Cypress, but it probably has something to do with your application not playing well with how we render within an iframe. Some policy you have set or something is resulting in it being blocked?

from cypress.

nehbehl avatar nehbehl commented on June 14, 2024

@jennifer-shehane I get this error in console , what next steps would you suggest to resolve it?
image

from cypress.

nehbehl avatar nehbehl commented on June 14, 2024

Hi @jennifer-shehane , I have shared all the available details from my side and the marked stage still shows 'needs information'. Please let me know what else is required from my end.

from cypress.

jennifer-shehane avatar jennifer-shehane commented on June 14, 2024

There's not much we can do without a way to reproduce it on our side. I did do some research into blocked requests and nothing really made sense in this case with what I know we're doing. It would require a deeper dive into the code with the problem.

from cypress.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.