Closed Bug 1208625 Opened 4 years ago Closed 4 years ago
_broadcast _switch _locator since it's a gaia-switch now
https://github.com/mozilla-b2g/gaia/blob/master/tests/python/gaia-ui-tests/gaiatest/apps/settings/regions/message.py#L17 is now gaia-switch. Using this locator will cause a failure.
Attachment #8666196 - Flags: review?(martijn.martijn)
Comment on attachment 8666196 [details] [review] [gaia] npark-mozilla:1208625 > mozilla-b2g:master I'm fine with the change if this works. I'm surprised you didn't have to update the code at: http://mxr.mozilla.org/gaia/source/tests/python/gaia-ui-tests/gaiatest/apps/settings/regions/message.py#53 Apparently, GaiaBinaryControl works for input and gaia-switch? I'm already lost when I have to use GaiaBinaryControl, HtmlBinaryControl or InvisibleHtmlBinaryControl. Perhaps we could get some example html code for the different cases in a comment at: http://mxr.mozilla.org/gaia/source/tests/python/gaia-ui-tests/gaiatest/form_controls/binarycontrol.py ?
Attachment #8666196 - Flags: review?(martijn.martijn) → review+
Actually I was surprised as well when I saw this was working. It looks like anything below gaia-switch is not visible to marionette, probably because of the shadow DOM issue. Maybe jlorenzo is the best person to ask for the example (I'm sure the example already exists in our code). ni?ing him.
I also double checked that I can enable/disable the switch too at the gaia-switch level. awesome.
I haven't checked it until now, but the workaround we defined in GaiaBinaryControl also works with a standard HTML checkbox. In this case, maybe we can remove the class called `HtmlBinaryControl`. It'd make the code simpler, we'd only need 2 classes (`BinaryControl` and `InvisibleHtmlBinaryControl`) instead of 4. BinaryControl will implement `is_checked()` the way shown at  and InvisibleHtmlBinaryControl will handle the case where the element to tap is not the same as the element which holds the checked value, like we have at some place in the settings app. What do you guys think?  https://github.com/mozilla-b2g/gaia/blob/master/tests/python/gaia-ui-tests/gaiatest/form_controls/binarycontrol.py#L40  https://github.com/mozilla-b2g/gaia/blob/master/tests/python/gaia-ui-tests/gaiatest/apps/settings/app.py#L106
I'm all for it to make the code simpler. I think some comment that explains what these controls stand for, would also be nice.
That sounds good to me as well.
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.