Closed
Bug 617427
Opened 15 years ago
Closed 15 years ago
add Selector option to elementslib to get elements by CSS selector
Categories
(Testing Graveyard :: Mozmill, defect)
Testing Graveyard
Mozmill
Tracking
(Not tracked)
VERIFIED
FIXED
People
(Reporter: harth, Assigned: harth)
Details
(Whiteboard: [mozmill-doc-needed][mozmill-1.5.2+])
Attachments
(1 file)
2.90 KB,
patch
|
cmtalbert
:
review+
|
Details | Diff | Splinter Review |
I personally find CSS selectors much easier to use than XPath queries for e.g. getting an element with a class name.
We should add a Selector API to the elementslib as an option for fetching elements that works like:
var tab = new elementslib.Selector(controller.window.document, ".tab");
var tab1 = tab.getNode();
var tab4 = tab.getNode(3); // get the fourth node that matches the selector
Assignee | ||
Comment 1•15 years ago
|
||
Assignee: nobody → fayearthur+bugs
Comment 2•15 years ago
|
||
Please also check the implementation we have in nodeCollector:
http://hg.mozilla.org/qa/mozmill-tests/file/default/shared-modules/dom-utils.js#l487
It's a bit different but also covers filtering of properties and anonymous nodes.
Assignee | ||
Comment 3•15 years ago
|
||
(In reply to comment #2)
> Please also check the implementation we have in nodeCollector:
>
> http://hg.mozilla.org/qa/mozmill-tests/file/default/shared-modules/dom-utils.js#l487
>
> It's a bit different but also covers filtering of properties and anonymous
> nodes.
This is good stuff, but I don't think it needs to be in the Selector API, I'd rather it just be a simple proxy for querySelectorAll() and mirror CSS selectors. The XPath option can handle anon elements.
We could work in the future on a better, unified way of fetching elements, but I think we should get this in for right now.
Assignee | ||
Updated•15 years ago
|
Attachment #495939 -
Flags: review?(ctalbert)
Comment 4•15 years ago
|
||
(In reply to comment #3)
> We could work in the future on a better, unified way of fetching elements, but
> I think we should get this in for right now.
Yes, that's why the nodeCollector has been created and will be further improved. It was just another info as we have talked during this weeks meeting.
Comment on attachment 495939 [details] [diff] [review]
add elementslib.Selector()
This looks good. Can I get a test with this patch? Then you'll be good to go.
r+ with test.
Attachment #495939 -
Flags: review?(ctalbert) → review+
Assignee | ||
Comment 6•15 years ago
|
||
1.5.2:
https://github.com/mozautomation/mozmill/commit/97ab8bb9fb823c353450fa2ca1f46547388cdd1e
master:
https://github.com/mozautomation/mozmill/commit/b35f434698bf99e28891db52e45fdb61c00ab8f9
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Comment 7•14 years ago
|
||
Verified fixed for chrome and content elements. We also have to document this feature on MDN.
Status: RESOLVED → VERIFIED
Whiteboard: [mozmill-doc-needed][mozmill-1.5.2+]
Comment 8•14 years ago
|
||
Heather, can we please get this feature documented? It's kinda important for us now.
https://developer.mozilla.org/en/Mozmill/Mozmill_Elements_Library_Object
Updated•14 years ago
|
Flags: in-testsuite?
Updated•14 years ago
|
Flags: in-testsuite? → in-testsuite+
Comment 9•14 years ago
|
||
Ping Heather. Would be nice to get this documented. People want to use this method but don't have any documentation available. Thanks.
Updated•9 years ago
|
Product: Testing → Testing Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•