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

RESOLVED FIXED in Firefox 24

Status

Testing
Marionette
--
major
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: zac, Assigned: automatedtester)

Tracking

unspecified
mozilla24
Other
Gonk (Firefox OS)
Points:
---

Firefox Tracking Flags

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

Details

Attachments

(2 attachments, 5 obsolete attachments)

(Reporter)

Description

5 years ago
Created attachment 749899 [details]
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
(Reporter)

Comment 1

5 years ago
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.
(Reporter)

Updated

5 years ago
Blocks: 865232
(Assignee)

Comment 2

5 years ago
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)

Comment 3

5 years ago
Created attachment 750997 [details] [diff] [review]
loosen elementInView and check centre if in view
Assignee: nobody → dburns
Attachment #750997 - Flags: review?(mdas)
(Assignee)

Comment 4

5 years ago
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)
(Assignee)

Comment 5

5 years ago
I cant reproduce the mobile try failure so trying again 

https://tbpl.mozilla.org/?tree=Try&rev=3174c9edf307
(Assignee)

Comment 6

5 years ago
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
(Assignee)

Comment 7

5 years ago
Created attachment 753793 [details] [diff] [review]
loosen elementInView and check centre if in view
Attachment #750997 - Attachment is obsolete: true
Attachment #753793 - Flags: review?(mdas)
(Assignee)

Comment 9

5 years ago
Created attachment 753831 [details] [diff] [review]
loosen elementInView and check centre if in view
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?
(Assignee)

Comment 11

5 years ago
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
(Assignee)

Comment 12

5 years ago
Created attachment 753932 [details] [diff] [review]
loosen elementInView and check centre if in view
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 :(
(Assignee)

Comment 14

5 years ago
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!
(Assignee)

Comment 15

5 years ago
Created attachment 754155 [details] [diff] [review]
loosen elementInView and check centre if in view
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-
(Assignee)

Comment 17

5 years ago
Created attachment 754552 [details] [diff] [review]
loosen elementInView and check centre if in view correcting calculation and cleaning nits I spotted
Attachment #754155 - Attachment is obsolete: true
Attachment #754552 - Flags: review?(mdas)
Attachment #754552 - Flags: review?(mdas) → review+
https://hg.mozilla.org/mozilla-central/rev/44bda40fd2b7
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
(Assignee)

Comment 20

5 years ago
We need to land this in v1.0.1 and mozilla-b2g18 for test harness updates, with
a=test-only
Keywords: checkin-needed
https://hg.mozilla.org/releases/mozilla-b2g18/rev/e71666dea332
https://hg.mozilla.org/releases/mozilla-b2g18_v1_0_1/rev/f0f4522ba846
status-b2g18: --- → fixed
status-b2g18-v1.0.0: --- → wontfix
status-b2g18-v1.0.1: --- → fixed
status-firefox22: --- → wontfix
status-firefox23: --- → wontfix
status-firefox24: --- → fixed
Keywords: checkin-needed
You need to log in before you can comment on or make changes to this bug.