Closed
Bug 1434909
Opened 7 years ago
Closed 7 years ago
Remove dependency to rectangles.html in test_position.py
Categories
(Remote Protocol :: Marionette, enhancement, P3)
Tracking
(firefox60 fixed)
RESOLVED
FIXED
mozilla60
Tracking | Status | |
---|---|---|
firefox60 | --- | fixed |
People
(Reporter: whimboo, Assigned: bjorn.arnelid, Mentored)
References
Details
(Keywords: good-first-bug, Whiteboard: [lang=py])
User Story
For steps in how to get started please consult our documentation for new users: https://firefox-source-docs.mozilla.org/testing/marionette/marionette/NewContributors.html In the case of questions you can find us on IRC in the #ateam channel.
Attachments
(1 file)
The following test is using an external HTML testcase, which is simple enough to get integrated as data URL directly into the test. For Marionette unit tests we make use of the `inline` method. Here an example:
https://dxr.mozilla.org/mozilla-central/rev/a928be5dacc3b544e29c0612b3f8cda6447df802/testing/marionette/harness/marionette_harness/tests/unit/test_typing.py#14
The same method should be applied to the following test:
https://dxr.mozilla.org/mozilla-central/rev/default/testing/marionette/harness/marionette_harness/tests/unit/test_position.py
By adding as minimal necessary code from the following HTML testcase:
https://dxr.mozilla.org/mozilla-central/rev/default/testing/marionette/harness/marionette_harness/www/rectangles.html
The HTML testcase should be deleted afterward.
Assignee | ||
Comment 1•7 years ago
|
||
I would like to contribute to this bug. I will send a patch as soon as i have figured out what to do in mercurial.
Reporter | ||
Comment 2•7 years ago
|
||
Thanks. If you struggle don't hesitate to ask here on Bugzilla, or in #ateam on irc.mozilla.org.
Comment hidden (mozreview-request) |
Updated•7 years ago
|
Assignee: nobody → bjorn.arnelid
Status: NEW → ASSIGNED
Comment 4•7 years ago
|
||
mozreview-review |
Comment on attachment 8948974 [details]
Bug 1434909 - Remove dependency to rectangles.html in test_position.py
https://reviewboard.mozilla.org/r/218392/#review224172
Stealing this review.
::: testing/marionette/harness/marionette_harness/tests/unit/test_position.py:14
(Diff revision 1)
> -class TestPosition(MarionetteTestCase):
> +def inline_rectangle():
> + inline = """
> + <head>
Because this is only used once, can you create a function called
inline that takes a string as input, then move the multi-line string
into the test?
::: testing/marionette/harness/marionette_harness/tests/unit/test_position.py:18
(Diff revision 1)
>
> -class TestPosition(MarionetteTestCase):
> +def inline_rectangle():
> + inline = """
> + <head>
> + <title>Rectangles</title>
> + <style type="text/css">
type="text/css" is unnecessary.
::: testing/marionette/harness/marionette_harness/tests/unit/test_position.py:42
(Diff revision 1)
> + """
> + return "data:text/html;charset=utf-8,{}".format(urllib.quote(inline))
>
> +class TestPosition(MarionetteTestCase):
> def test_should_get_element_position_back(self):
> test_url = self.marionette.absolute_url('rectangles.html')
test_url is not used anymore.
::: testing/marionette/harness/marionette_harness/tests/unit/test_position.py:42
(Diff revision 1)
> + """
> + return "data:text/html;charset=utf-8,{}".format(urllib.quote(inline))
>
> +class TestPosition(MarionetteTestCase):
> def test_should_get_element_position_back(self):
> test_url = self.marionette.absolute_url('rectangles.html')
rectangles.html is only used in this test, which means the fixture
file can be removed.
Attachment #8948974 -
Flags: review-
Comment hidden (mozreview-request) |
Comment 6•7 years ago
|
||
mozreview-review |
Comment on attachment 8948974 [details]
Bug 1434909 - Remove dependency to rectangles.html in test_position.py
https://reviewboard.mozilla.org/r/218392/#review224186
Looks OK now, but triggered a try run to be sure: https://treeherder.mozilla.org/#/jobs?repo=try&revision=dd4aa813f342
Attachment #8948974 -
Flags: review+
Comment 7•7 years ago
|
||
Next time, please feel free to flag me with r?ato in the commit message.
Assignee | ||
Comment 8•7 years ago
|
||
I will remember to do that.
Pushed by atolfsen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/042448262514
Remove dependency to rectangles.html in test_position.py r=ato
Comment 10•7 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
status-firefox60:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla60
Updated•2 years ago
|
Product: Testing → Remote Protocol
You need to log in
before you can comment on or make changes to this bug.
Description
•