Closed Bug 1182522 Opened 9 years ago Closed 9 years ago

[Aries] Wait(self.marionette).until(lambda m: grippy.location['y'] == utility_tray.size['height']) is never satisfied

Categories

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

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(b2g-master affected)

RESOLVED FIXED
Tracking Status
b2g-master --- affected

People

(Reporter: jlorenzo, Assigned: jlorenzo)

References

Details

Attachments

(1 file)

It failed 2/2 times with the same error. I'm not sure why, at the moment.

> TEST-START | test_cost_control_data_alert_mobile.py TestCostControlDataAlertMobile.test_cost_control_data_alert_mobile
> TEST-UNEXPECTED-ERROR | test_cost_control_data_alert_mobile.py TestCostControlDataAlertMobile.test_cost_control_data_alert_mobile | TimeoutException: TimeoutException: Timed out after 30.1 seconds
> 
> 
> Traceback (most recent call last):
>   File "/home/jlorenzo/git/gaia/tests/python/gaia-ui-tests/.env/lib/python2.7/site-packages/marionette_client-0.16-py2.7.egg/marionette/marionette_test.py", line 296, in run
>    testMethod()
>  File "/home/jlorenzo/git/gaia/tests/python/gaia-ui-tests/gaiatest/tests/functional/cost_control/test_cost_control_data_alert_mobile.py", line 57, in test_cost_control_data_alert_mobile
>     utility_tray.wait_for_notification_container_displayed()
>   File "/home/jlorenzo/git/gaia/tests/python/gaia-ui-tests/gaiatest/apps/system/regions/utility_tray.py", line 26, in wait_for_notification_container_displayed
>     Wait(self.marionette).until(lambda m: grippy.location['y'] == utility_tray.size['height'])
>   File "/home/jlorenzo/git/gaia/tests/python/gaia-ui-tests/.env/lib/python2.7/site-packages/marionette_driver-0.9-py2.7.egg/marionette_driver/wait.py", line 143, in until
>     cause=last_exc)
> TEST-INFO took 125889ms
Assignee: nobody → jlorenzo
I found the cause of the issue.

The Aries is too fast compared to the Flame. On Aries, The "data alert" notification appears right after the HTML page is loaded. On Flame, you have to wait about 15 seconds to see this notification to appear.
Comment on attachment 8657124 [details] [review]
[gaia] JohanLorenzo:bug-1182522 > mozilla-b2g:master

I did some refactor in the test, because some locators were not defined in Page classes.

I also started 1 thing that I'd like to discuss with you: I created a class that represents a Switch. I see 2 advantages here:
1. All the workarounds regarding is_custom_element_checked can be defined outside of the base class[1]. So the base doesn't become a place to put all our workarounds.
2. We have a standard way to enable and disable the switches. So we won't have each time the same discussion about "toggle+asserts vs enable/disable". And if one day we decided to use one strategy instead of another, we can ask our IDEs to change the name of 1 function, instead of (manually?) finding every occurrence of a toggle.

What do you guys think?

[1] https://github.com/mozilla-b2g/gaia/pull/31698/files#diff-fb3796a8e84bea6a5e7e9259e4c05694R14
Attachment #8657124 - Flags: review?(npark)
Attachment #8657124 - Flags: review?(martijn.martijn)
Made some comments, and mostly what I'm curious about is whether we can use this for both gaia-switch and switch.  if so, that'd be great.
We can do it by creating a subclass. See the details in the PR.
(In reply to Johan Lorenzo [:jlorenzo] (QA) from comment #3)

Sounds like a wonderful idea!
It seems to me this could also be used for gaia-radio and gaia-checkbox, so perhaps don't limit it to switch/gaia-switch only?
Comment on attachment 8657124 [details] [review]
[gaia] JohanLorenzo:bug-1182522 > mozilla-b2g:master

I'm only able to test on my Flame tomorrow (here in the outskirts of the Netherlands, the SIM data connection doesn't work).
I'm worried about the system.wait_for_notification_toaster_displayed() calls you added.
I don't remember anymore, but I think I tried a similar thing and I got failures on the Flame at that time, because this notification would appear at random times, during browser page load or far later then expected.
You might want to check that it's stable on the Flame.
Attachment #8657124 - Flags: review?(martijn.martijn) → review+
(In reply to Johan Lorenzo [:jlorenzo] (QA) from comment #1)
> I found the cause of the issue.
> 
> The Aries is too fast compared to the Flame. On Aries, The "data alert"
> notification appears right after the HTML page is loaded. On Flame, you have
> to wait about 15 seconds to see this notification to appear.

I don't understand, why does this cause the failure you mentioned in comment 0?
If the "data alert" notification appears right asway, wouldn't wait_for_notification_container_displayed() be working right away then?
Depends on: 1202388
(In reply to Martijn Wargers [:mwargers] (QA) from comment #8)
> If the "data alert" notification appears right asway, wouldn't
> wait_for_notification_container_displayed() be working right away then?

You're right. I changed the PR accordingly.

I also put all the work regarding the switches in bug 1202388. This test can be fixed without the refactor.
No longer depends on: 1202388
Comment on attachment 8657124 [details] [review]
[gaia] JohanLorenzo:bug-1182522 > mozilla-b2g:master

Passed locally for me, lgtm
Attachment #8657124 - Flags: review?(npark) → review+
Merged in master at https://github.com/mozilla-b2g/gaia/commit/65102bb1206b3d14e00d9971d87a346caeb3c4f5
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: