Closed Bug 941727 Opened 11 years ago Closed 11 years ago

Fix up test_unlock_to_camera

Categories

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

Other
Gonk (Firefox OS)
defect

Tracking

(b2g-v1.2 fixed)

RESOLVED FIXED
Tracking Status
b2g-v1.2 --- fixed

People

(Reporter: zcampbell, Assigned: AndreiH)

Details

Attachments

(2 files)

This test is failing after a change to the lockscreen yesterday.

The functionality seems to be working fine.

However it is now running into a Marionette limitation in that Marionette cannot judge the visibility of the frames properly.

I think we should change this entirely to use `switch_to_displayed_app()` and be sure that the Camera app comes to the fore after unlocking to camera.
test_lockscreen_unlock_to_camera.py
##### Before Unlock to Camera #####
(Pdb) ls = self.marionette.find_element('id', 'lockscreen')
(Pdb) lsic = self.marionette.find_element('id', 'lockscreen-icon-container')
(Pdb) ls.location
{u'y': 0, u'x': 0}
(Pdb) lsic.location
{u'y': 379, u'x': 0}
##### After Unlock to Camera #####
(Pdb) ls.location
{u'y': 0, u'x': 0}
(Pdb) lsic.location
{u'y': 0, u'x': 0}


test_lockscreen_unlock_to_camera_with_passcode.py
##### Before Unlock to Camera #####
(Pdb) ls = self.marionette.find_element('id', 'lockscreen')
(Pdb) lsic = self.marionette.find_element('id', 'lockscreen-icon-container')
(Pdb) ls.location
{u'y': 0, u'x': 0}
(Pdb) lsic.location
{u'y': 379, u'x': 0}
##### After Unlock to Camera #####
(Pdb) ls.location
{u'y': -240, u'x': -160}
(Pdb) lsic.location
{u'y': 518, u'x': -160}
Base on comment 2, the gaiatest/apps/lockscreen/app.py Line 51 doesn't work without passcode.

def wait_for_lockscreen_not_visible(self):
    self.wait_for_condition(lambda m: not self.marionette.find_element(*self._lockscreen_locator).location['x'] == 0, message="Lockscreen still visible after unlock")
So yeah we don't really want to use that style of code anymore. 

We want to remove any check that the lockscreen has moved and we can replace it with checking that camera is the displayed app.

So something like:

# after slide to unlock
self.wait_for_condition(lambda m: self.apps.displayed_app == camera.name)

This will make sure the camera is in the foreground.

We could then check the window.Lockscreen.locked javascript to check whether b2G thinks it is unlocked or not.
Assignee: nobody → andrei.hutusoru
Pointer to Github pull-request
Attachment #8336743 - Flags: review?(zcampbell)
Attachment #8336743 - Flags: review?(viorela.ioia)
Attachment #8336743 - Flags: review?(trifandreialin)
Attachment #8336743 - Flags: review?(florin.strugariu)
I filed this bug about how we can't get the camera as the active app:
https://bugzilla.mozilla.org/show_bug.cgi?id=942230
Comment on attachment 8336743 [details]
Pointer to Github pull request: https://github.com/mozilla-b2g/gaia/pull/13950

r+ tests work nicely.
Not the solution wanted but it is good enough for now.
Attachment #8336743 - Flags: review?(zcampbell)
Attachment #8336743 - Flags: review?(viorela.ioia)
Attachment #8336743 - Flags: review?(trifandreialin)
Attachment #8336743 - Flags: review?(florin.strugariu)
Attachment #8336743 - Flags: review+
Pointer to Github pull-request
Attachment #8337698 - Flags: review?(viorela.ioia)
Attachment #8337698 - Flags: review?(trifandreialin)
Attachment #8337698 - Flags: review?(florin.strugariu)
Comment on attachment 8337698 [details]
Pointer to Github pull request: https://github.com/mozilla-b2g/gaia/pull/14013

Test works nice. Just update the link.
Attachment #8337698 - Flags: review?(viorela.ioia) → review+
Comment on attachment 8337698 [details]
Pointer to Github pull request: https://github.com/mozilla-b2g/gaia/pull/14013

except for the nit all looks ok
Attachment #8337698 - Flags: review?(florin.strugariu) → review+
Attachment #8337698 - Flags: review?(trifandreialin) → review+
Attachment #8337698 - Flags: review?(bob.silverberg)
https://github.com/mozilla-b2g/gaia/commit/b2733c5f18af45b78462a90e3002c67680a0b9cd
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Attachment #8337698 - Flags: review?(bob.silverberg)
When a commit lands on v1.2, please specify that in the comment (the branch) and please update the status-b2g-v1.2 flag to "fixed".
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: