Code Monkey home page Code Monkey logo

Comments (9)

NoriSte avatar NoriSte commented on August 30, 2024 1

You're right, I hadn't realized it until now... well, how waitUntil works:

  1. it runs the checkFunction
  2. if the result is falsy, it waits (through cy.wait)
  3. return to step nĀ°1 25 times (by default, it's the result of 5000/200, the default timeout, and the default interval)

Then, what happens when two waitUntil calls are nested

  1. parent: it runs the checkFunction
    1.1. child: it runs the checkFunction
    1.2. child: if the result is falsy, it waits (through cy.wait)
    1.3. child: return to step nĀ°1.1 25 times
  2. parent: if the result is falsy, it waits (through cy.wait)
  3. return to step nĀ°1 25 times

so the parent waitUntil call will retry 25 times (by default) but every time the child waitUntil call runs 25 retries, completely breaking the concept of "time" of the parent call.

I'm going to add this note to the README, thanks a lot for the dedication @JonahKK!!!!!! ā¤ļø

from cypress-wait-until.

NoriSte avatar NoriSte commented on August 30, 2024

Hi @JonahKK
Thanks for asking, could you share a minimal repository to play with, please?
Thanks
Stefano

from cypress-wait-until.

NoriSte avatar NoriSte commented on August 30, 2024

Nested cy.waitUntil calls should work as expected šŸ˜‰

from cypress-wait-until.

NoriSte avatar NoriSte commented on August 30, 2024

@JonahKK, up šŸ˜‰

from cypress-wait-until.

JonahKK avatar JonahKK commented on August 30, 2024

@NoriSte Sorry about the delay, had a lot on my mind recently. I will try to prepare the example this week.

from cypress-wait-until.

NoriSte avatar NoriSte commented on August 30, 2024

Perfect, thanks!!! I appreciate it šŸ˜Š

from cypress-wait-until.

JonahKK avatar JonahKK commented on August 30, 2024

I have been experimenting with the different setups, trying to reproduce the exact error I've been describing, yet without luck. Obviously I cannot share code from work.
All I have observed was that waitUntil nested inside of another wait can take a lot of time, before the timeout happens. It might work as expected, yet with default timeouts (5 seconds) it takes over 60 seconds to fail!
image
Maybe I was experiencing this extended wait time, that made me think there is an error - I use bigger timeouts in my production code.

from cypress-wait-until.

NoriSte avatar NoriSte commented on August 30, 2024

Thanks for the feedback @JonahKK!! šŸ˜Š

All I have observed was that waitUntil nested inside of another wait can take a lot of time, before the timeout happens. It might work as expected, yet with default timeouts (5 seconds) it takes over 60 seconds to fail!

Could you share a repo with this example, please? I didn't notice it in my tests šŸ¤”

from cypress-wait-until.

JonahKK avatar JonahKK commented on August 30, 2024

Please check the https://github.com/JonahKK/cypress-test-tiny/tree/wait-until. Just open the Cypress runner and launch the spec. The test should timeout after 70 seconds (unless you will be lucky and have a match in the wait šŸ˜‰)

from cypress-wait-until.

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.