Closed Bug 813561 Opened 12 years ago Closed 10 years ago

[B2G] Buttons under lockscreen are returning as visible

Categories

(Remote Protocol :: Marionette, defect)

x86_64
Windows 7
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: zcampbell, Assigned: automatedtester)

References

Details

(Keywords: pi-marionette-displayed, Whiteboard: [displayed])

The unlock buttons beneath the new SVG lockscreen swipe area are interpreted as displayed by Marionette/WebDriver logic.


-- Test case --
# Set device back to locked state
_unlock_button_locator = ('id', 'lockscreen-area-unlock')
unlock_button = self.marionette.find_element(_unlock_button_locator)
assert False == unlock_button.is_displayed()
since I am doing visibility bugs I'll take this one
Assignee: nobody → dburns
Is there any update on this? Is it still blocking bug 801898?
Design of the lock screen has changed since this bug was raised but I'll re-run the test case and update as appropriate.
This is still valid with the current lockscreen design.
*sigh*

its showing the body has as a height of 0.... which means Marionette thinks its doing the right thing... 

(Pdb) m.execute_script("return arguments[0].parentNode.parentNode.parentNode" ,[unlock_button]).size
{u'width': 320, u'height': 480}
(Pdb) m.execute_script("return arguments[0].parentNode.parentNode" ,[unlock_button]).size
{u'width': 320, u'height': 480}
(Pdb) m.execute_script("return arguments[0].parentNode" ,[unlock_button]).size
{u'width': 320, u'height': 101}
(Pdb) m.execute_script("return arguments[0]" ,[unlock_button]).size
{u'width': 160, u'height': 120}
(Pdb) m.execute_script("return arguments[0].parentNode.parentNode.parentNode" ,[unlock_button]).size
{u'width': 320, u'height': 480}
(Pdb) m.execute_script("return arguments[0].parentNode.parentNode.parentNode.parentNode" ,[unlock_button]).size
{u'width': 320, u'height': 480}
(Pdb) m.execute_script("return arguments[0].parentNode.parentNode.parentNode.parentNode" ,[unlock_button]).tag_name
u'div'
(Pdb) m.execute_script("return arguments[0].parentNode.parentNode.parentNode.parentNode.ParentNode" ,[unlock_button]).tag_name
*** AttributeError: 'NoneType' object has no attribute 'tag_name'
(Pdb) m.execute_script("return arguments[0].parentNode.parentNode.parentNode.parentNode" ,[unlock_button]).tag_name
u'div'
(Pdb) m.execute_script("return arguments[0].parentNode.parentNode.parentNode.parentNode.parentNode" ,[unlock_button]).tag_name
u'div'
(Pdb) m.execute_script("return arguments[0].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode" ,[unlock_button]).tag_name
u'body'
(Pdb) m.execute_script("return arguments[0].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode" ,[unlock_button]).size
{u'width': 320, u'height': 0}
(Pdb)
*sigh*

its showing the body has as a height of 0.... which means Marionette thinks its doing the right thing... 

(Pdb) m.execute_script("return arguments[0].parentNode.parentNode.parentNode" ,[unlock_button]).size
{u'width': 320, u'height': 480}
(Pdb) m.execute_script("return arguments[0].parentNode.parentNode" ,[unlock_button]).size
{u'width': 320, u'height': 480}
(Pdb) m.execute_script("return arguments[0].parentNode" ,[unlock_button]).size
{u'width': 320, u'height': 101}
(Pdb) m.execute_script("return arguments[0]" ,[unlock_button]).size
{u'width': 160, u'height': 120}
(Pdb) m.execute_script("return arguments[0].parentNode.parentNode.parentNode" ,[unlock_button]).size
{u'width': 320, u'height': 480}
(Pdb) m.execute_script("return arguments[0].parentNode.parentNode.parentNode.parentNode" ,[unlock_button]).size
{u'width': 320, u'height': 480}
(Pdb) m.execute_script("return arguments[0].parentNode.parentNode.parentNode.parentNode" ,[unlock_button]).tag_name
u'div'
(Pdb) m.execute_script("return arguments[0].parentNode.parentNode.parentNode.parentNode.ParentNode" ,[unlock_button]).tag_name
*** AttributeError: 'NoneType' object has no attribute 'tag_name'
(Pdb) m.execute_script("return arguments[0].parentNode.parentNode.parentNode.parentNode" ,[unlock_button]).tag_name
u'div'
(Pdb) m.execute_script("return arguments[0].parentNode.parentNode.parentNode.parentNode.parentNode" ,[unlock_button]).tag_name
u'div'
(Pdb) m.execute_script("return arguments[0].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode" ,[unlock_button]).tag_name
u'body'
(Pdb) m.execute_script("return arguments[0].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode" ,[unlock_button]).size
{u'width': 320, u'height': 0}
(Pdb)
Next steps: look at styles on the items to see when this is still visible and not hidden in the overflow
resetting owner in case people want it while away.
Assignee: dburns → nobody
Assignee: nobody → dburns
looking at this it appears that the buttons are visible iff the screen is on, when they are off then its not visible

When screen on

(Pdb) m.execute_script('return window.getComputedStyle(arguments[0]).getPropertyValue("visibility")', unlock_button])
u'visible'

When screen is off
(Pdb) m.execute_script('return window.getComputedStyle(arguments[0]).getPropertyValue("visibility")', unlock_button])
u'hidden'

This means that if you do with the screen off will pass

# Set device back to locked state
_unlock_button_locator = ('id', 'lockscreen-area-unlock')
unlock_button = self.marionette.find_element(_unlock_button_locator)
assert False == unlock_button.is_displayed()
:Zac can you check that I have validated this correctly
I validated that they are still 'displayed' when the screen is on but I don't understand what the significance of them being displayed False when the screen is off.

We never run with the screen off - the GaiaTestCase setUp always switches the screen on and sets the screen timeout to 'Never' so this is pretty unlikely to occur.
totally misunderstood the bug... silly me...
Nice to know it detects the screen off :)
so... let me tell you the story of a soothsayer called AutomatedTester that predicted this day in http://www.theautomatedtester.co.uk/blog/2013/could-css3-be-making-sites-that-are-not-testable.html

It appears that we have animations at play here that are using CSS transforms to move the element. The class, that causes the animation, is attached via javascript during a touch and then removed (this is why I was missing it, I was looking for the obvious.


The downside is that this will require a lot of work to the Selenium atoms, which we use and they suffer the same problem, to be able to handle this scenario correctly
Re-tested and still valid
Blocks: 865232
It appears that the screen element is being overlayed so according to the current algorithm it is visible because the overlay isn't part of the tree that is searched.

see debug info below

TEST-START test_cards.py
test_that_app_can_be_launched_from_cards_view (test_cards.TestSpace) ... > /home/davidburns/gaia-ui-tests/gaiatest/tests/test_cards.py(44)test_that_app_can_be_launched_from_cards_view()
-> _unlock_button_locator = ('id', 'lockscreen-area-unlock')
(Pdb) n
> /home/davidburns/gaia-ui-tests/gaiatest/tests/test_cards.py(45)test_that_app_can_be_launched_from_cards_view()
-> unlock_button = self.marionette.find_element(*_unlock_button_locator)
(Pdb) n
> /home/davidburns/gaia-ui-tests/gaiatest/tests/test_cards.py(74)test_that_app_can_be_launched_from_cards_view()
-> '''
(Pdb) unlock_button.location
{u'y': 380, u'x': 160}
(Pdb) point = m.execute_script('return window.wrappedJSObject.document.elementFromPoint(160, 380);')
*** NameError: name 'm' is not defined
(Pdb) m=self.marionette

##### Unlock Button isnt visible on the screen
(Pdb) point = m.execute_script('return window.wrappedJSObject.document.elementFromPoint(160, 380);')
(Pdb) point.id == unlock_button.id
False

##### Unlock Button is visible
(Pdb) point2 = m.execute_script('return window.wrappedJSObject.document.elementFromPoint(160, 380);')
(Pdb) point2.id == unlock_button.id
True
(Pdb)
Whiteboard: [displayed]
We don't even have this lockscreen anymore, it'd be very difficult to debug.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → WONTFIX
Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.