Closed
Bug 1097032
Opened 10 years ago
Closed 9 years ago
Add test for expected.elements_present when there are no elements found
Categories
(Remote Protocol :: Marionette, defect)
Remote Protocol
Marionette
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla36
People
(Reporter: Bebe, Assigned: davehunt)
References
Details
Attachments
(1 file, 1 obsolete file)
marionette.expected.elements_present should return False of there are no elements present on the page. Instead it returns the result of the default result of the find_elements if there are no results on the page: a blank list.'[]' See the docs: Returns: list of web elements once they are located, or False http://marionette-client.readthedocs.org/en/latest/#marionette.expected.elements_present see
Assignee | ||
Comment 1•10 years ago
|
||
The wait condition expects the condition to not False (but a boolean) or None, so an empty list will return early. There's also a missing test here.
Assignee | ||
Comment 2•10 years ago
|
||
Comment 3•10 years ago
|
||
Why would we expect a boolean type as a return value to this? An empty list, [], is a value that evaluates to false. So unless you're doing explicit type checking (which you shouldn't) in your test, when is this a problem?
Flags: needinfo?(dave.hunt)
Assignee | ||
Comment 4•10 years ago
|
||
(In reply to Andreas Tolfsen (:ato) from comment #3) > Why would we expect a boolean type as a return value to this? An empty > list, [], is a value that evaluates to false. So unless you're doing > explicit type checking (which you shouldn't) in your test, when is this a > problem? The explicit type checking is happening in the Wait class: http://hg.mozilla.org/mozilla-central/file/default/testing/marionette/client/marionette/wait.py#l128 :)
Flags: needinfo?(dave.hunt)
Comment 5•10 years ago
|
||
(In reply to Dave Hunt (:davehunt) from comment #4) > (In reply to Andreas Tolfsen (:ato) from comment #3) > > Why would we expect a boolean type as a return value to this? An empty > > list, [], is a value that evaluates to false. So unless you're doing > > explicit type checking (which you shouldn't) in your test, when is this a > > problem? > > The explicit type checking is happening in the Wait class: > http://hg.mozilla.org/mozilla-central/file/default/testing/marionette/client/ > marionette/wait.py#l128 :) Hm. Is that a reasonable assumption still?
Comment 7•9 years ago
|
||
(In reply to David Burns :automatedtester from comment #6) > assuming C5 was a question for you :) We discussed this on IRC and :davehunt filed bug 1103956 about removing the type check. Fingers crossed we can get rid of it. :davehunt, should that bug be a dependency for this one, or do you want to land this patch as it is?
Flags: needinfo?(dave.hunt)
Assignee | ||
Comment 9•9 years ago
|
||
We don't need this fix if bug 1103956 sticks, however there is a missing test this patch adds. I've added the dependency and will update the patch and bug summary once it's unblocked.
Depends on: 1103956
Flags: needinfo?(dave.hunt)
Assignee | ||
Updated•9 years ago
|
Summary: marionette.expected.elements_present is returning a blank list if there are no elements present → Add test for expected.elements_present when there are no elements found
Assignee | ||
Comment 10•9 years ago
|
||
Attachment #8521380 -
Attachment is obsolete: true
Attachment #8521380 -
Flags: review?(ato)
Attachment #8528643 -
Flags: review?(ato)
Updated•9 years ago
|
Attachment #8528643 -
Flags: review?(ato) → review+
Assignee | ||
Updated•9 years ago
|
Keywords: checkin-needed
Comment 11•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/b6e09893ea97
Flags: in-testsuite+
Keywords: checkin-needed
Comment 12•9 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/b6e09893ea97
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
Updated•1 year ago
|
Product: Testing → Remote Protocol
You need to log in
before you can comment on or make changes to this bug.
Description
•