Giter VIP home page Giter VIP logo

Comments (7)

mmun avatar mmun commented on July 17, 2024

I like this. I'd suggest making the API this.waitFor({ selector: ... }) or even just this.wait({ selector: ... }) as we will probably want to wait on other things in the future, e.g. ajax, routing, etc.

We could also do this.waitForSelector if we want to continue supporting the context argument...

from rfcs.

kellyselden avatar kellyselden commented on July 17, 2024

@mmun You could also do type sniffing, if arg is string else treat as object, but that makes the API a bit fragile.

from rfcs.

stefanpenner avatar stefanpenner commented on July 17, 2024

this type of sniffing (in our tests are work at-least) often result in quite brittle tests. Largely, because now a failure isn't attached to the action triggering, rather a lengthy timeout of sorts.

Maybe i just have PTSD, and it is ok when used in some scenarios, but I just felt i should mention my experience.

from rfcs.

rwjblue avatar rwjblue commented on July 17, 2024

I also wanted to mention that 'this.wait' is almost certainly going to be provided by the new testing harness proposed in another RFC.

from rfcs.

kgish avatar kgish commented on July 17, 2024

Would recommend also including an additional timeout parameter in msecs.

from rfcs.

kgish avatar kgish commented on July 17, 2024

Also of interest:
http://discuss.emberjs.com/t/waituntil-async-helper-feedback/9444

from rfcs.

rwjblue avatar rwjblue commented on July 17, 2024

waitFor (and waitUntil) is a public API since around Ember 3.0. Thanks for this discussion, it absolutely influenced that implementation.

from rfcs.

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.