Create a decorator to facilitate the use of switch_to_shadow_root()

RESOLVED WONTFIX

Status

RESOLVED WONTFIX
3 years ago
6 months ago

People

(Reporter: jlorenzo, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

3 years ago
There's likely a way to prevent one person to forget about the shadow_root switching. We can define a python decorator, this way: 
```py
@WebComponent
class MyWebComponent(Widget):
    def do_something_inside_the_shadow_dom(self):
         # no call to switch_to_shadow_root at all
         self.marionette.find_element(...)
         # and so on
```

and the decorator would be defined, likely this way:

```py
class WebComponent(decorator):
    # for each function of the class decorated:
    #    before the function is called => switch to the root_element
    #    after => switch back to the original context
```

Comment 1

6 months ago
Firefox OS is not being worked on
Status: NEW → RESOLVED
Last Resolved: 6 months ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.