Closed Bug 872561 Opened 11 years ago Closed 11 years ago

[B2G][1.0.1] Cannot send_keys to input element/element is is_displayed=False

Categories

(Remote Protocol :: Marionette, defect)

Other
Gonk (Firefox OS)
defect
Not set
major

Tracking

(firefox22 wontfix, firefox23 wontfix, firefox24 fixed, b2g18 fixed, b2g18-v1.0.0 wontfix, b2g18-v1.0.1 fixed)

RESOLVED FIXED
mozilla24
Tracking Status
firefox22 --- wontfix
firefox23 --- wontfix
firefox24 --- fixed
b2g18 --- fixed
b2g18-v1.0.0 --- wontfix
b2g18-v1.0.1 --- fixed

People

(Reporter: zcampbell, Assigned: automatedtester)

References

Details

Attachments

(2 files, 5 obsolete files)

Attached image screenshot
On v1.0.1 this input element wider than the width of the Persona frame is inaccessible by Marionette.

The element is "is_displayed() = True" but when attempting to send_keys Marionette is raising an ElementNotVisibleException

This is slightly complicated by a rendering difference between v1.0.1 and v1-train... On v1-train on the same HTML the input element is within the width of the frame and Marionette can interact with it.

------------
TEST-START test_marketplace_purchase_app_wifi.py
test_marketplace_purchase_app_wifi (test_marketplace_purchase_app_wifi.TestMarketplacePurchaseAppWifi) ... 
size: {u'width': 276.45001220703125, u'height': 44}
location: {u'y': 108.75, u'x': 20}
displayed: True

ERROR

======================================================================
ERROR: test_marketplace_purchase_app_wifi (test_marketplace_purchase_app_wifi.TestMarketplacePurchaseAppWifi)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/zacdev/Mozilla/gaia-ui-tests/gaiatest/tests/marketplace/test_marketplace_purchase_app_wifi.py", line 40, in test_marketplace_purchase_app_wifi
    persona.login(self.user.email, self.user.password)
  File "/home/zacdev/Mozilla/gaia-ui-tests/gaiatest/apps/persona/app.py", line 40, in login
    login.type_create_password(password)
  File "/home/zacdev/Mozilla/gaia-ui-tests/gaiatest/apps/persona/regions/login.py", line 60, in type_create_password
    password_field.send_keys(value)
  File "/home/zacdev/.virtualenvs/gaia-ui-27/local/lib/python2.7/site-packages/marionette_client-0.5.27-py2.7.egg/marionette/marionette.py", line 71, in send_keys
    return self.marionette._send_message('sendKeysToElement', 'ok', element=self.id, value=typing)
  File "/home/zacdev/.virtualenvs/gaia-ui-27/local/lib/python2.7/site-packages/marionette_client-0.5.27-py2.7.egg/marionette/marionette.py", line 344, in _send_message
    self._handle_error(response)
  File "/home/zacdev/.virtualenvs/gaia-ui-27/local/lib/python2.7/site-packages/marionette_client-0.5.27-py2.7.egg/marionette/marionette.py", line 371, in _handle_error
    raise ElementNotVisibleException(message=message, status=status, stacktrace=stacktrace)
TEST-UNEXPECTED-FAIL | test_marketplace_purchase_app_wifi.py TestMarketplacePurchaseAppWifi.test_marketplace_purchase_app_wifi | ElementNotVisibleException: Element is not visible
----------------------------------------------------------------------
Ran 1 test in 88.658s
NB I have not provided a test case because it is likely to be lost upon the resolution of this Persona issue:
https://github.com/mozilla/browserid/issues/3409

AutomatedTester is debugging this in the meantime.
Blocks: 865232
I have loosened the elementInView to check if any of the points are in view and if the corners are are out of view but the center is in view lets say its in view.

Mobile try: https://tbpl.mozilla.org/?tree=Try&rev=3d3aee7c88e3
Desktop try: https://tbpl.mozilla.org/?tree=Try&rev=09097e1464fc
Assignee: nobody → dburns
Attachment #750997 - Flags: review?(mdas)
Comment on attachment 750997 [details] [diff] [review]
loosen elementInView and check centre if in view

There was a mobile failure so will check before setting review again
Attachment #750997 - Flags: review?(mdas)
I cant reproduce the mobile try failure so trying again 

https://tbpl.mozilla.org/?tree=Try&rev=3174c9edf307
wow.. my first go was waaaaay off

this looks better so try links below

mobile 
https://tbpl.mozilla.org/?tree=Try&rev=1f4011528224

desktop
https://tbpl.mozilla.org/?tree=Try&rev=77279ac24030
Attachment #750997 - Attachment is obsolete: true
Attachment #753793 - Flags: review?(mdas)
Attachment #753793 - Attachment is obsolete: true
Attachment #753793 - Flags: review?(mdas)
Attachment #753831 - Flags: review?(mdas)
In addition to offline comments about finding the center, I think this patch may only be checking the top left and bottom right corners, but not the top right/bottom left?
adding top right/bottom left since I hadnt thought it necessary so new try

https://tbpl.mozilla.org/?tree=Try&rev=304df4a153f2
https://tbpl.mozilla.org/?tree=Try&rev=eac7c9a83d49
Attachment #753831 - Attachment is obsolete: true
Attachment #753831 - Flags: review?(mdas)
Attachment #753932 - Flags: review?(mdas)
Comment on attachment 753932 [details] [diff] [review]
loosen elementInView and check centre if in view

Review of attachment 753932 [details] [diff] [review]:
-----------------------------------------------------------------

This patch doesn't contain the new changes :(
remote:   https://tbpl.mozilla.org/?tree=Try&rev=eac7c9a83d49
☁  mozilla-inbound  hg qref -m "Bug 872561 - Loosening the elementInView and also checking the centre of the element is in view; r=mdas"
☁  mozilla-inbound  google django-cronjob
☁  mozilla-inbound

Spot the missing step....

sorry!
Attachment #753932 - Attachment is obsolete: true
Attachment #753932 - Flags: review?(mdas)
Attachment #754155 - Flags: review?(mdas)
Comment on attachment 754155 [details] [diff] [review]
loosen elementInView and check centre if in view

Review of attachment 754155 [details] [diff] [review]:
-----------------------------------------------------------------

::: testing/marionette/marionette-listener.js
@@ +801,5 @@
> +            rect.left >= curWindow.pageXOffset &&
> +            rect.left <= (curWindow.pageXOffset + curWindow.innerWidth)) ||
> +           /* Center of the element is in view if element larger than viewport */
> +           (((rect.top + (rect.height/2)) <= curWindow.pageYOffset) &&
> +            ((rect/top + (rect.height/2)) <= (curWindow.pageYOffset + curWindow.innerHeight)) &&

should be:

 ((rect.top + (rect.height/2)) >= (curWindow.pageYOffset + curWindow.innerHeight)) &&

@@ +803,5 @@
> +           /* Center of the element is in view if element larger than viewport */
> +           (((rect.top + (rect.height/2)) <= curWindow.pageYOffset) &&
> +            ((rect/top + (rect.height/2)) <= (curWindow.pageYOffset + curWindow.innerHeight)) &&
> +            (rect.left+ (rect.width/2)) <= curWindow.pageXOffset &&
> +           ((rect.left + (rect.width/2)) <= (curWindow.pageXOffset + curWindow.innerWidth)))

and

((rect.left + (rect.width/2)) >= (curWindow.pageXOffset + curWindow.innerWidth)))
Attachment #754155 - Flags: review?(mdas) → review-
Attachment #754552 - Flags: review?(mdas) → review+
https://hg.mozilla.org/mozilla-central/rev/44bda40fd2b7
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
We need to land this in v1.0.1 and mozilla-b2g18 for test harness updates, with
a=test-only
Keywords: checkin-needed
Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: