Closed Bug 1131712 Opened 9 years ago Closed 9 years ago

Calling find_element() should use constants from marionette.By instead of hard-coded values

Categories

(Testing :: Firefox UI Tests, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla38

People

(Reporter: whimboo, Assigned: ankit.goyal90, Mentored)

References

()

Details

(Whiteboard: [lang=py][good first bug])

Attachments

(1 file, 1 obsolete file)

Right now a lot of our tests and library modules in the firefox-ui-tests repository are using a hard-coded method identifier to retrieve elements. We should change that so that the By module as provided by Marionette is always used.

Before:
find_element('ID', ...)

After:
from marionette import By
[..]
find_element(By.ID

http://marionette-client.readthedocs.org/en/latest/reference.html#marionette

This does not only apply to ID but also all the other values which can be used here.
Henrik, I am working on it.
Flags: needinfo?(hskupin)
Awesome! Thanks for letting me know. I will mark you as assignee of the bug then!
Assignee: nobody → ankit.goyal90
Status: NEW → ASSIGNED
Flags: needinfo?(hskupin)
Comment on attachment 8563222 [details] [diff] [review]
Bug 1131712 - Calling find_element() should use constants from marionette.By instead of hard-coded values. r=whimboo

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

This patch looks fine to me, and you covered all the cases. There are only some minor things to update. With that done you will get my r+. Thanks!

For the future I would suggest that you better create a new pull request on the github repository, as uploading the patch directly to Bugzilla. By that you will get Travis CI test results a couple of minutes after. This is pretty helpful to see if your changes haven't regressed something. For a review request here on Bugzilla simply add a normal text attachment which contains the plain URL to the pull request.

::: firefox_puppeteer/tests/test_l10n.py
@@ +3,4 @@
>  # file, You can obtain one at http://mozilla.org/MPL/2.0/.
>  
>  from marionette.errors import MarionetteException
> +from marionette import By

Please move this line up so it comes before errors. Reason is that this is the global marionette module.

::: firefox_puppeteer/tests/test_places.py
@@ +3,4 @@
>  # file, You can obtain one at http://mozilla.org/MPL/2.0/.
>  
>  from firefox_ui_harness.testcase import FirefoxTestCase
> +from marionette import By

Imports of modules which have been installed via pip should come before imports of modules of the same repository.

::: firefox_puppeteer/ui/tabbar.py
@@ +3,4 @@
>  # You can obtain one at http://mozilla.org/MPL/2.0/.
>  
>  from marionette import (
> +    Wait, By

Please sort alphabetical.
Attachment #8563222 - Flags: review?(hskupin) → review-
I am not familiar with git, but would like to learn. Would you tell me the steps?
Flags: needinfo?(hskupin)
Best would be if you could join us on IRC. I don't want that this bug explodes with not-directly related conversations. THanks.
Flags: needinfo?(hskupin)
Attachment #8563999 - Flags: review?(hskupin) → review+
https://github.com/mozilla/firefox-ui-tests/commit/c3ffa4036bfc255f8437b74bbdb3c4d93806c217
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → Firefox 38
Hi Ankit, are you interested to work on something else? Please let me know and we can certainly find something for you.
Flags: needinfo?(ankit.goyal90)
Hi Henrik, I am caught into something. Won't be able to contribute for some time. I will tell you when I will be ready to work again.
Flags: needinfo?(ankit.goyal90)
Product: Mozilla QA → Testing
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: