Closed Bug 1208625 Opened 4 years ago Closed 4 years ago

update _cell_broadcast_switch_locator since it's a gaia-switch now

Categories

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

ARM
Gonk (Firefox OS)
defect
Not set

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: njpark, Assigned: njpark)

Details

Attachments

(1 file)

Assignee: nobody → npark
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.
Flags: needinfo?(jlorenzo)
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[1] 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 [1] 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[2].

What do you guys think?

[1] https://github.com/mozilla-b2g/gaia/blob/master/tests/python/gaia-ui-tests/gaiatest/form_controls/binarycontrol.py#L40
[2] https://github.com/mozilla-b2g/gaia/blob/master/tests/python/gaia-ui-tests/gaiatest/apps/settings/app.py#L106
Flags: needinfo?(jlorenzo)
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.
Merged:
https://github.com/mozilla-b2g/gaia/commit/4c0a6d4e8501368db8e5d6029a41db985ef1252a
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.