Closed Bug 1127819 Opened 11 years ago Closed 9 years ago

Ensure that returned element classes for chrome elements is DOMElement and not HTMLElement

Categories

(Testing :: Firefox UI Tests, defect)

Version 2
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: whimboo, Unassigned)

References

Details

Right now all the elements we work with are of type HTMLElement, because they are returned that way by Marionette. Sadly we cannot make use of this class because we need several enhancements added. Therefore the DOMElement class in the puppeteer package exists: https://github.com/mozilla/firefox-ui-tests/blob/master/firefox_puppeteer/__init__.py#L76 So what is the best way that methods like find_element() and others would return DOMElement instead? Chris, what would your proposal be?
Flags: needinfo?(cmanchester)
Looking at the implementation of DOMElement, I don't know how much we're getting out of it (although it saves us the inaccuracy of working with XUL and passing around things called "HTMLElement"). I think "calling super" on the inner HTMLElement instance might solve this particular problem (in DOMElement): def find_element(self, strategy, target): el = self.inner.find_element(strategy, target) return DOMElement(el)
Flags: needinfo?(cmanchester)
Is there a way to subclass from the marionette client, and make it so that when we are in chrome scope DOMElement instances are getting returned when calling methods like find_element? So that would be totally transparent to the tests then.
(In reply to Henrik Skupin (:whimboo) from comment #2) > Is there a way to subclass from the marionette client, and make it so that > when we are in chrome scope DOMElement instances are getting returned when > calling methods like find_element? So that would be totally transparent to > the tests then. I'd recommend against subclassing marionette, but we could expose something like Puppeteer.find_element() that makes this transparent. I don't really see that this solves a fundamental problem for us right now, we can use Marionette.find_element and create DOMElements from that as needed without too much hassle.
Product: Mozilla QA → Testing
We will leave the classes as supported by Marionette. Also because we want to merge the Firefox ui tests with basic Marionette tests.
Status: NEW → RESOLVED
Closed: 9 years ago
QA Contact: hskupin
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.