Last Comment Bug 845805 - Add a By class to the marionette python bindings
: Add a By class to the marionette python bindings
Status: RESOLVED FIXED
[good first bug][mentor=automatedtest...
:
Product: Testing
Classification: Components
Component: Marionette (show other bugs)
: unspecified
: All All
: -- enhancement (vote)
: mozilla25
Assigned To: Florin Strugariu [:Bebe]
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-02-27 06:02 PST by Florin Strugariu [:Bebe]
Modified: 2013-07-10 11:25 PDT (History)
6 users (show)
ryanvm: in‑testsuite+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
Patch v1.0 (917 bytes, patch)
2013-02-27 07:09 PST, Florin Strugariu [:Bebe]
no flags Details | Diff | Review
Parch version 1.1 (5.46 KB, patch)
2013-03-05 02:02 PST, Florin Strugariu [:Bebe]
dburns: review-
Details | Diff | Review
patch for Bug 845805 - Add a By class to the marionette python bindings (18.06 KB, patch)
2013-07-04 04:35 PDT, Florin Strugariu [:Bebe]
no flags Details | Diff | Review
Bug 845805 - Add a By class to the marionette python bindings (19.12 KB, patch)
2013-07-04 04:45 PDT, Florin Strugariu [:Bebe]
dburns: review+
Details | Diff | Review

Description Florin Strugariu [:Bebe] 2013-02-27 06:02:18 PST
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.
Comment 1 David Burns :automatedtester 2013-02-27 06:06:29 PST
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.
Comment 2 Florin Strugariu [:Bebe] 2013-02-27 07:09:33 PST
Created attachment 718997 [details] [diff] [review]
Patch v1.0

I added the requested class
Comment 3 David Burns :automatedtester 2013-02-27 08:43:25 PST
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
Comment 4 Jonathan Griffin (:jgriffin) 2013-02-27 09:15:06 PST
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 Karl Dubost 2013-03-01 05:27:58 PST
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"
Comment 6 Florin Strugariu [:Bebe] 2013-03-01 06:16:46 PST
Sorry for this mistake guys I will update my patch.
Comment 7 Florin Strugariu [:Bebe] 2013-03-01 06:19:37 PST
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.
Comment 8 David Burns :automatedtester 2013-03-04 06:12:23 PST
: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
Comment 9 Florin Strugariu [:Bebe] 2013-03-05 02:02:19 PST
Created attachment 721133 [details] [diff] [review]
Parch version 1.1

I updated the license and modified the tests
Comment 10 David Burns :automatedtester 2013-03-18 08:36:46 PDT
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.
Comment 11 Florin Strugariu [:Bebe] 2013-07-04 04:35:06 PDT
Created attachment 771285 [details] [diff] [review]
patch for Bug 845805 - Add a By class to the marionette python bindings
Comment 12 Florin Strugariu [:Bebe] 2013-07-04 04:45:55 PDT
Created attachment 771289 [details] [diff] [review]
Bug 845805 - Add a By class to the marionette python bindings
Comment 14 David Burns :automatedtester 2013-07-09 07:58:57 PDT
landed in https://hg.mozilla.org/integration/mozilla-inbound/rev/a75301db9899
Comment 15 Ryan VanderMeulen [:RyanVM] 2013-07-10 11:25:11 PDT
https://hg.mozilla.org/mozilla-central/rev/a75301db9899

Note You need to log in before you can comment on or make changes to this bug.