Closed Bug 1204888 Opened 9 years ago Closed 9 years ago

Replace displayed_app.name usage with .manifestURL or wait_to_be_displayed/wait_to_not_be_displayed

Categories

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

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: martijn.martijn, Assigned: manel)

References

()

Details

Attachments

(2 files, 1 obsolete file)

There are still various places where there is usage of displayed_app.name in our Gaia UI tests. They should be changed to use .manifestURL or in cases of usage of Wait(), it should be changed to wait_to_be_displayed/wait_to_not_be_displayed.
Manel, would you like to work on this?
Flags: needinfo?(manel.rhaiem92)
Manel confirmed on irc that she would like to work on this. Thanks Manel!
Assignee: nobody → manel.rhaiem92
Flags: needinfo?(manel.rhaiem92)
Attachment #8661667 - Attachment is obsolete: true
I tried all the test we have changed here, almost of them work expect: test_ftu_skip_tour.py and test_ftu_skip_tour_desktopb2g.py , I got this error: TEST-UNEXPECTED-ERROR | test_ftu_skip_tour_desktopb2g.py TestFtu.test_ftu_skip_tour_for_desktop | TimeoutException: TimeoutException: Timed out after 30.1 seconds Traceback (most recent call last): File "/home/mermi/gaia/tests/python/gaia-ui-tests/.env/local/lib/python2.7/site-packages/marionette_client-0.17-py2.7.egg/marionette/marionette_test.py", line 296, in run testMethod() File "/home/mermi/gaia/tests/python/gaia-ui-tests/gaiatest/tests/functional/ftu/test_ftu_skip_tour_desktopb2g.py", line 26, in test_ftu_skip_tour_for_desktop self.ftu.tap_next_to_wifi_section() File "/home/mermi/gaia/tests/python/gaia-ui-tests/gaiatest/apps/ftu/app.py", line 149, in tap_next_to_wifi_section Wait(self.marionette).until(expected.element_displayed(*self._section_wifi_locator)) File "/home/mermi/gaia/tests/python/gaia-ui-tests/.env/local/lib/python2.7/site-packages/marionette_driver-0.13-py2.7.egg/marionette_driver/wait.py", line 143, in until cause=last_exc) TEST-INFO took 106359ms And for this file test_sms_auto_save_draft.py: if foundpath == filepath: TEST-UNEXPECTED-ERROR | test_sms_auto_save_draft.py TestSmsAutoSaveDrafts.test_sms_auto_save_draft | AttributeError: 'Thread' object has no attribute 'tap' Traceback (most recent call last): File "/home/mermi/gaia/tests/python/gaia-ui-tests/.env/local/lib/python2.7/site-packages/marionette_client-0.17-py2.7.egg/marionette/marionette_test.py", line 296, in run testMethod() File "/home/mermi/gaia/tests/python/gaia-ui-tests/gaiatest/tests/functional/messages/test_sms_auto_save_draft.py", line 54, in test_sms_auto_save_draft new_message = messages.draft_threads[0].tap() TEST-INFO took 124562ms I guess this error is not related to this bug or what we have changed in the PR
Flags: needinfo?(martijn.martijn)
Attachment #8661655 - Flags: review?(martijn.martijn)
test_ftu_skip_tour_desktopb2g.py is disabled, so likely to not work: http://mxr.mozilla.org/gaia/source/tests/python/gaia-ui-tests/gaiatest/tests/functional/ftu/manifest.ini#16 test_sms_auto_save_draft.py is a known failure, I just checked in a fix for that. test_ftu_skip_tour.py I don't know, I'll try that one out.
Flags: needinfo?(martijn.martijn)
Comment on attachment 8661655 [details] [gaia] mermi:bug1204888 > mozilla-b2g:master One small issue, but I think this looks good! I started a smoketest adhoc job here: http://jenkins1.qa.scl3.mozilla.com/view/Mozilla%20Lab/job/flame-kk.ui.adhoc/891/ This includes test_ftu_tour.py, so we can see if it fails there, but I doubt your failure had anything to do with the pull request.
Attachment #8661655 - Flags: review?(martijn.martijn) → review+
From http://jenkins1.qa.scl3.mozilla.com/view/Mozilla%20Lab/job/flame-kk.ui.adhoc/891/ : There in one failure in test_IMAP_email_notification.py: Traceback (most recent call last): File "/var/jenkins/2/workspace/flame-kk.ui.adhoc/.env/local/lib/python2.7/site-packages/marionette_client-0.17-py2.7.egg/marionette/marionette_test.py", line 296, in run testMethod() File "/var/jenkins/2/workspace/flame-kk.ui.adhoc/tests/python/gaia-ui-tests/gaiatest/tests/functional/email/test_IMAP_email_notification.py", line 65, in test_IMAP_email_notification email.wait_to_be_displayed() File "/var/jenkins/2/workspace/flame-kk.ui.adhoc/tests/python/gaia-ui-tests/gaiatest/apps/base.py", line 123, in wait_to_be_displayed Wait(self.marionette).until(lambda m: self.apps.displayed_app.manifest_url == self.manifest_url) File "/var/jenkins/2/workspace/flame-kk.ui.adhoc/.env/local/lib/python2.7/site-packages/marionette_driver-0.13-py2.7.egg/marionette_driver/wait.py", line 143, in until cause=last_exc) TimeoutException: TimeoutException: Timed out after 20.1 seconds I don't know why that happens. You should investigate this. At that point, just before the wait_to_be_displayed() call, can you put this: import time time.sleep(3) print(self.app.displayed_app.manifest_url)
Ok, I just tested: print(self.apps.displayed_app.manifest_url) gives: app://email.gaiamobile.org/manifest.webapp print(email.manifest_url) gives: app://reademail.gaiamobile.org/manifest.webapp It looks like that comes from here: http://mxr.mozilla.org/gaia/source/tests/python/gaia-ui-tests/gaiatest/apps/email/regions/read_email.py#10 I think that file needs to have a manifest_url defined that returns 'app://email.gaiamobile.org/manifest.webapp' as result, then everything should work fine here.
Attached image 2015-09-18-22-04-54.png (deleted) —
I ran the test after adding the definition of manifest_url in red_email.py, and I get the same problem : Traceback (most recent call last): File "/home/mermi/gaia/tests/python/gaia-ui-tests/.env/local/lib/python2.7/site-packages/marionette_client-0.17-py2.7.egg/marionette/marionette_test.py", line 296, in run testMethod() File "/home/mermi/gaia/tests/python/gaia-ui-tests/gaiatest/tests/functional/email/test_IMAP_email_notification.py", line 35, in test_IMAP_email_notification self.environment.email['smtp']) File "/home/mermi/gaia/tests/python/gaia-ui-tests/gaiatest/apps/email/app.py", line 88, in setup_IMAP_email setup.tap_next() File "/home/mermi/gaia/tests/python/gaia-ui-tests/gaiatest/apps/email/regions/setup.py", line 171, in tap_next expected.element_present(*self._account_prefs_section_locator)) File "/home/mermi/gaia/tests/python/gaia-ui-tests/.env/local/lib/python2.7/site-packages/marionette_driver-0.13-py2.7.egg/marionette_driver/wait.py", line 143, in until cause=last_exc) TEST-INFO took 125712ms
Flags: needinfo?(martijn.martijn)
Yes, I know, somehow this account doesn't work for you. It's unrelated to your pull request. You could try with your own IMAP acount if you have one. Otherwise, you can just update the pull request with the change I suggested in comment 9 and then I'll test it. You also need to ask review from somebody else. I would suggest No-Jun.
Flags: needinfo?(martijn.martijn)
Attachment #8661655 - Flags: review?(npark)
Comment on attachment 8661655 [details] [gaia] mermi:bug1204888 > mozilla-b2g:master LGTM
Attachment #8661655 - Flags: review?(npark) → review+
I just tried the latest updated pull request and test_IMAP_email_notification.py now is passing with this. For the rest, the smoketests looked fine the last time, so I've merged this: https://github.com/mozilla-b2g/gaia/commit/d4de80b5a20cbca2bf5e00ec375348ae04c0b215 Thanks again, Manel!
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
I just filed bug 1207098 as a follow-up bug on what needs to be done.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: