Closed Bug 813583 Opened 12 years ago Closed 10 years ago

[B2G] Homescreen iframe not interpreted as visible

Categories

(Remote Protocol :: Marionette, defect)

x86_64
Windows 7
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: zcampbell, Assigned: automatedtester)

References

Details

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

The homescreen iframe is not being seen as visible from the top level frame by Marionette.

May also be true for other iframes but this is the only one I have checked thus far.

--- Test Case ----
# Manual step: kill all apps
# go to top level frame
self.marionette.switch_to_frame()
# Homescreen iframe locator
_homescreen_frame_locator = ('css selector', 'iframe.homescreen')
# visibility of frame will return False
print self.marionette.find_element(_homescreen_frame_locator).is_displayed()
It would appear that the parent element of the iframe has a height of 0


>>> home.is_displayed()
False
>>> m.execute_script("return window.getComputedStyle(arguments[0]).getPropertyValue('display')" ,[home])
u'block'
>>> m.execute_script("return window.getComputedStyle(arguments[0].parentNode).getPropertyValue('display')" ,[home])
u'block'
>>> m.execute_script("return window.getComputedStyle(arguments[0].parentNode).getPropertyValue('overflow')" ,[home])
u'hidden'
>>> parent = m.execute_script("return arguments[0].parentNode" ,[home])
>>> parent.size
{u'width': 320, u'height': 0}


So realistically it would appear that the visibility algorithm is correct.
Zac/David, are we saying this is either a Gaia or test issue?
:stephend

My gut says this is a test issue but I would need to look more into it. Since the part of the frame has a height of 0 it cant be seen.
Any update on this? What tests are affected by this bug, and could we propose an alternative solution for them?
I don't think this is blocking a test (we at least have already come up with an alternative solution for it) but it was just raised as a marionette anomaly.

I updated the test case.

I guess this is something to do with observing a child frame from the top level frame (note first step in the test case). AutomatedTEster once explained to me that marionette can't traverse up and down iframes.  (Example of that, lock the screen, switch to the homescren iframe and check its displayed state, it will == True, despite the lockscreen being active.)


-- Updated Test Case --
self.marionette.switch_to_frame()

# Homescreen iframe locator
_homescreen_frame_locator = ('css selector', 'div.homescreen iframe')
# visibility of frame will return False
hs_frame = self.marionette.find_element(*_homescreen_frame_locator)
print hs_frame.size
print hs_frame.location
print hs_frame.is_displayed()
I will look at this again after all the changes but if the element has a height of 0 then we need to work out the magic that the gaia devs are using for it to still be visible with it has no height
Thanks. No longer showing 0 for the height.
Here is the output for the comment #5 test case:

{u'width': 320, u'height': 460}
{u'y': 20, u'x': 0}
False
I will look at it, iirc it was a parent that had a height of 0
I had a test that just started things for me and then hit a debugger. When I try see if it is visible it is now showing that it is.

(Pdb) _homescreen_frame_locator = ('css selector', 'iframe.homescreen')
(Pdb) self.marionette.switch_to_frame()
True
(Pdb) _homescreen_frame_locator = ('css selector', 'div.homescreen iframe')
(Pdb) home = self.marionette.find_element(*_homescreen_frame_locator)
(Pdb) home.is_displayed()
True
(Pdb)
resetting assignee in case someone wants to do this before I get back
Assignee: dburns → nobody
I think I have worked out the problem here:

If you run the test case after a fresh reboot or stop/start b2g it will interpret displayed=True.

If you start an app, eg Contacts app, then run the test script, then the element will be displayed=False.

In the test case I am also using the typical GaiaTestCase setUp (unlocking the screen and killing all running apps, etc) but I have omitted it for brevity.
Blocks: 865232
Assignee: nobody → dburns
This appears to be suffering from the same issue as 813583
bug 813583 even
Whiteboard: [displayed]
Not sure if the algo changed or the new homescreen resolved this but hs frame is now resolved displayed or not.

Generally we also coded tests not to come up against this either.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → WORKSFORME
Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.