Add a By class to the marionette python bindings

RESOLVED FIXED in mozilla25

Status

Testing
Marionette
--
enhancement
RESOLVED FIXED
5 years ago
4 years ago

People

(Reporter: Bebe, Assigned: Bebe)

Tracking

unspecified
mozilla25
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

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

Attachments

(1 attachment, 3 obsolete attachments)

(Assignee)

Description

5 years ago
It would be nice to have access to a By class similar to the one found in the Selenium Python bindings.

Selenium class:
http://selenium.googlecode.com/svn/trunk/docs/api/py/_modules/selenium/webdriver/common/by.html#By

This class will abstract all the selector types and will help us write locators in a more elegant and easy way.
Whiteboard: [good first bug][mentor=automatedtester][lang=py]
If we add a class to http://mxr.mozilla.org/mozilla-central/source/testing/marionette/client/marionette/ then we should be able to do this. The class just removes the potential issue with people putting their own strings in.
(Assignee)

Updated

5 years ago
Assignee: nobody → florin.strugariu
(Assignee)

Comment 2

5 years ago
Created attachment 718997 [details] [diff] [review]
Patch v1.0

I added the requested class
Attachment #718997 - Flags: review?(dburns)
This looks ok, can you update some of the tests so I can push this to try for you and see if it works when being referenced from other files
I don't think we can take a copyrighted file, reproduce it exactly, but change the license header to ours.  If we want this file, we should just copy it exactly (including license notices) from upstream.

Comment 5

5 years ago
Agreed with Jonathan terms 3 of Apache License for Distribution.

"You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works"
(Assignee)

Comment 6

5 years ago
Sorry for this mistake guys I will update my patch.
(Assignee)

Comment 7

5 years ago
I took a better look at the binding sand I found https://hg.mozilla.org/integration/mozilla-inbound/file/9a8d04f67e39/testing/marionette/client/marionette/marionette.py#l21

What I'm asking is implemented in the HTMLElement and used in https://hg.mozilla.org/integration/mozilla-inbound/file/9a8d04f67e39/testing/marionette/client/marionette/test_protocol.py#l46

I think this is a bad implementation because you would get access to all the methods in that class witch are not usable.
:bebe

Please create the file, according to feed back above. 


(In reply to Florin Strugariu [:Bebe] from comment #7)

> What I'm asking is implemented in the HTMLElement and used in
> https://hg.mozilla.org/integration/mozilla-inbound/file/9a8d04f67e39/testing/
> marionette/client/marionette/test_protocol.py#l46

I think a better implementation is with a By too since HTMLElement.ID is ambiguous. Is it the mechanism to find or is it the elements ID. Please copy the Selenium file, licence and all, and update some tests so that we know that the egg is packaging them properly
(Assignee)

Comment 9

5 years ago
Created attachment 721133 [details] [diff] [review]
Parch version 1.1

I updated the license and modified the tests
Attachment #718997 - Attachment is obsolete: true
Attachment #718997 - Flags: review?(dburns)
Attachment #721133 - Flags: review?
Attachment #721133 - Flags: review? → review?(dburns)
Comment on attachment 721133 [details] [diff] [review]
Parch version 1.1

> 
> class By(object):
>     ID = "id"
>     XPATH = "xpath"
>     LINK_TEXT = "link text"
>     PARTIAL_LINK_TEXT = "partial link text"
>     NAME = "name"


Please can we add the values and not just the top five. Also can you please update a few other test files, 2 files of your choosing.
Attachment #721133 - Flags: review?(dburns) → review-
(Assignee)

Comment 11

4 years ago
Created attachment 771285 [details] [diff] [review]
patch for Bug 845805 - Add a By class to the marionette python bindings
Attachment #771285 - Flags: review?(dburns)
(Assignee)

Updated

4 years ago
Attachment #721133 - Attachment is obsolete: true
(Assignee)

Updated

4 years ago
Attachment #771285 - Flags: review?(dburns)
(Assignee)

Comment 12

4 years ago
Created attachment 771289 [details] [diff] [review]
Bug 845805 - Add a By class to the marionette python bindings
Attachment #771285 - Attachment is obsolete: true
Attachment #771289 - Flags: review?(dburns)
pushed to try

https://tbpl.mozilla.org/?tree=Try&rev=637e7dcc5ff2
https://tbpl.mozilla.org/?tree=Try&rev=8a7aa0342814
Attachment #771289 - Flags: review?(dburns) → review+
landed in https://hg.mozilla.org/integration/mozilla-inbound/rev/a75301db9899
https://hg.mozilla.org/mozilla-central/rev/a75301db9899
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla25
You need to log in before you can comment on or make changes to this bug.