`find` and `findAll` should allow for finding elements outside the root
See original GitHub issueWhen dealing with addons like ember-pikaday
or ember-wormhole
, it can be useful to allow for locating an element outside the root element of the test.
My proposal would be to allow a second parameter, like qunit-dom
, that allows you to override the “root element” to search.
If this is something you’d be interested in supporting, I’m happy to make a PR for it!
Note: I’m not suggesting we add the root-override behavior to all helpers; it’s easy enough to, for example, compose two together if you need to click something outside the root:
const button = await find('.some-button', document.body);
await click(button);
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:5 (2 by maintainers)
Top Results From Across the Web
How to use lxml to find an element by text? - Stack Overflow
Right. find / findAll are simplified methods which do not allow all kinds of XPath. With the current version of lxml, xpath accepts ......
Read more >Finding web elements - Selenium
One solution is to locate an element with a unique attribute that is an ancestor of the desired element and not an ancestor...
Read more >xml.etree.ElementTree — The ElementTree XML API ...
Therefore, the example first collects all matching elements with root.findall() , and only then iterates over the list of matches. Our XML now...
Read more >find | Cypress Documentation
Get the descendent DOM elements of a specific selector. The querying behavior of this command matches exactly how .find() works in jQuery. Syntax...
Read more >How To Find HTML Elements Using Cypress Locators
In this Cypress tutorial, we will learn to use Cypress locators to access WebElements in the DOM for realizing Cypress automation tests.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hmm, why is a change needed here? What would adding a context parameter provide that “using the platform” doesn’t?
Although this was closed I’d like to provide a reason why by default the test helpers should be scoped to the testing container, is that QUnit is working in parallel execution: https://twitter.com/trentmwillis/status/1050519960689115136
Having test selectors scoped to the testing containers puts us on a good position to have several test containers running different tests at the same time, each one triggering events and performing assertions on their own app.