Closed Bug 1204665 Opened 9 years ago Closed 8 years ago

Remove workaround for bug 1061698, use python shadow DOM API

Categories

(Firefox OS Graveyard :: Gaia::UI Tests, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: martijn.martijn, Unassigned)

References

()

Details

Attachments

(1 file)

In bug 1194224, there was an API created to access shadow DOM elements:
+    def switch_to_shadow_root(self, host=None):
+        """Switch the current context to the specified host's Shadow DOM.
+        Subsequent commands will operate in the context of the specified Shadow
+        DOM, if applicable.
+
+        :param host: A reference to the host element containing Shadow DOM.
+            This can be an ``HTMLElement``. If you call
+            ``switch_to_shadow_root`` without an argument, it will switch to the
+            parent Shadow DOM or the top-level frame.
+        """

Usage:
+        self.host = self.marionette.find_element("id", "host")
+        self.marionette.switch_to_shadow_root(self.host)
+        self.button = self.marionette.find_element("id", "button")


More examples, explanation here: 
https://github.com/mozilla/gecko-dev/commit/75c928c716a6e26162e42623db0cb60ccccf9c71#diff-413c9c7257267b3d931005d4dcdaaa84

We have bugs mentioned about them here, we should rewrite those instances:
http://mxr.mozilla.org/gaia/search?string=bug%2B1061698
http://mxr.mozilla.org/gaia/search?string=Bug%2B1061698

Note bug 1203456, I think it would be better to do bug 1203456 first. We could then just convert everything to use this HTMLHeader/GaiaHeader and use switch_to_shadow_root from there.
Depends on: 1203456
Just to be clear, currently no new marionette-client version has been released that contains this new feature.
Assignee: nobody → martijn.martijn
Comment on attachment 8680591 [details] [review]
[gaia] mwargers:1204665 > mozilla-b2g:master

I tested this on test_add_to_new_contact_from_messages.py, test_add_to_an_existing_contact_from_messages.py and on all the contacts tests and they all pass.
Attachment #8680591 - Flags: review?(npark)
Attachment #8680591 - Flags: review?(jlorenzo)
Comment on attachment 8680591 [details] [review]
[gaia] mwargers:1204665 > mozilla-b2g:master

LGTM
Attachment #8680591 - Flags: review?(npark) → review+
Comment on attachment 8680591 [details] [review]
[gaia] mwargers:1204665 > mozilla-b2g:master

The GaiaHeader gets more and more rock solid. That's awesome!
Attachment #8680591 - Flags: review?(jlorenzo) → review+
Assignee: martijn.martijn → nobody
Marking WONTFIX, sorry for the bug spam. If somebody still wants to work on this, please file a new bug for it.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: