Closed Bug 968741 Opened 7 years ago Closed 6 years ago

Update test_create_new_alarm to wait for the alarm to trigger

Categories

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

Other
Gonk (Firefox OS)
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: zcampbell, Assigned: viorela)

References

Details

Attachments

(1 file, 1 obsolete file)

This may be difficult or not worth it but let's try anyway..

To create parity with the manual smoke tests, update test_create_new_alarm.py to wait for the alarm to trigger.

After creating the alarm, kill the Clock app and wait for the alarm alert.

Update the test's name to suit.

Be very wary of any race condition between the trigger time of the alarm and the current time passing (which might mean the alarm would not trigger for 23hr 59 minutes). 

If you run into problems that mean the test code is too difficult,fragile or causes the test to take too long to run then please push back on this task.

This may be blocked by:
https://bugzilla.mozilla.org/show_bug.cgi?id=946130

Similarly using actions might be slow or unreliable so investigate other ways to set the alarm's time if need be.
Assignee: nobody → viorela.ioia
I've been investigating this bug and I have an idea. As we can't change the alarm time, I thought that we might change the time on the device.
After we set the alarm, we set the device time to be some seconds less than the current time. We can do that by using the set_time method from data_layer. Then we open Clock app, we disable the alarm and re-enable it. That way we will get the message that our alarm is set for less than a minute. 
The next step would be to close the Clock app and wait for the alarm to be triggered.
I'm not sure if this is a good way of modifying the test, as we need to add some extra steps.   
What do you think, Zac?
Flags: needinfo?(zcampbell)
Good thinking Viorela. It sounds like you'll need to be very careful with the timing. Possibly turn off nitz (automatic time update) during the setUp and then some very thorough intermittent testing!

Can you do a proof of concept and make sure it works on both desktopb2g and device? If it doesn't work on desktopb2g it might be a blocker.
Flags: needinfo?(zcampbell)
Depends on: 946130
Depends on: 947317
No longer depends on: 946130
Attachment #8420953 - Flags: review?(zcampbell)
Duplicate of this bug: 944436
Comment on attachment 8420953 [details] [review]
Github Pr: https://github.com/mozilla-b2g/gaia/pull/16826

r-, some changes to make
Attachment #8420953 - Flags: review?(zcampbell) → review-
Viorela, can you try work on this again?
Flags: needinfo?(viorela.ioia)
I updated the test, but it will fail at the end, because we still blocked by Bug 947317
Attachment #8420953 - Attachment is obsolete: true
Attachment #8475122 - Flags: review?(zcampbell)
Attachment #8475122 - Flags: review?(florin.strugariu)
Flags: needinfo?(viorela.ioia)
Comment on attachment 8475122 [details] [review]
Link to Github pull-request: https://github.com/mozilla-b2g/gaia/pull/23036/files

The code looks good but I have some concerns
Attachment #8475122 - Flags: review?(florin.strugariu) → review-
Comment on attachment 8475122 [details] [review]
Link to Github pull-request: https://github.com/mozilla-b2g/gaia/pull/23036/files

I didn't run it so only f-, but I tihnk we should be sure we're setting the minutes reliably.
Attachment #8475122 - Flags: review?(zcampbell) → feedback-
Viorela any updates on this issue?
Flags: needinfo?(viorela.ioia)
The PR is updated, but the test will fail at the end, because of Bug 947317. After closing the alarm frame, no code is executed.
Flags: needinfo?(viorela.ioia)
QA Whiteboard: [fxosqa-auto-backlog+]
QA Whiteboard: [fxosqa-auto-backlog+] → [fxosqa-auto-backlog+][fxosqa-auto-s4]
QA Whiteboard: [fxosqa-auto-backlog+][fxosqa-auto-s4] → [fxosqa-auto-s4]
Comment on attachment 8475122 [details] [review]
Link to Github pull-request: https://github.com/mozilla-b2g/gaia/pull/23036/files

I updated the PR. The test is working as expected on device, but it is skipped on desktopb2g, as we cannot set the time.

I started an adhoc here: http://jenkins1.qa.scl3.mozilla.com/job/flame-kk.ui.adhoc/340/console

Please take a look over the changes. Thanks!
Attachment #8475122 - Attachment description: Link to Github pull-request: https://github.com/mozilla-b2g/gaia/pull/23036 → Link to Github pull-request: https://github.com/mozilla-b2g/gaia/pull/23036/files
Attachment #8475122 - Flags: review?(zcampbell)
Attachment #8475122 - Flags: review?(robert.chira)
Attachment #8475122 - Flags: review?(florin.strugariu)
Attachment #8475122 - Flags: review-
Comment on attachment 8475122 [details] [review]
Link to Github pull-request: https://github.com/mozilla-b2g/gaia/pull/23036/files

It runs well but just needs the wait updated ;) ;)
Attachment #8475122 - Flags: review?(zcampbell) → review-
Comment on attachment 8475122 [details] [review]
Link to Github pull-request: https://github.com/mozilla-b2g/gaia/pull/23036/files

waits are updated
Attachment #8475122 - Flags: review- → review?(zcampbell)
Attachment #8475122 - Flags: review?(robert.chira) → review+
Comment on attachment 8475122 [details] [review]
Link to Github pull-request: https://github.com/mozilla-b2g/gaia/pull/23036/files

New waits are good! R+
Attachment #8475122 - Flags: review?(zcampbell) → review+
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Attachment #8475122 - Flags: review?(florin.strugariu) → review+
You need to log in before you can comment on or make changes to this bug.