From 79f2d9d1f32004f656837f2506ebd3a4b0d79684 Mon Sep 17 00:00:00 2001 From: David Burns Date: Tue, 9 Dec 2014 20:33:03 +0000 Subject: [PATCH] Bug 1107336: Move marionette code for driving the browser out of the runner; r=jgriffin --HG-- rename : testing/marionette/client/marionette/application_cache.py => testing/marionette/driver/marionette_driver/application_cache.py rename : testing/marionette/client/marionette/by.py => testing/marionette/driver/marionette_driver/by.py rename : testing/marionette/client/marionette/date_time_value.py => testing/marionette/driver/marionette_driver/date_time_value.py rename : testing/marionette/client/marionette/decorators.py => testing/marionette/driver/marionette_driver/decorators.py rename : testing/marionette/client/marionette/errors.py => testing/marionette/driver/marionette_driver/errors.py rename : testing/marionette/client/marionette/expected.py => testing/marionette/driver/marionette_driver/expected.py rename : testing/marionette/client/marionette/geckoinstance.py => testing/marionette/driver/marionette_driver/geckoinstance.py rename : testing/marionette/client/marionette/gestures.py => testing/marionette/driver/marionette_driver/gestures.py rename : testing/marionette/client/marionette/keys.py => testing/marionette/driver/marionette_driver/keys.py rename : testing/marionette/client/marionette/marionette.py => testing/marionette/driver/marionette_driver/marionette.py rename : testing/marionette/client/marionette/selection.py => testing/marionette/driver/marionette_driver/selection.py rename : testing/marionette/client/marionette/wait.py => testing/marionette/driver/marionette_driver/wait.py extra : rebase_source : 4fa2501172cc1dedf20e2f236b32fe3bbfc30b4f --- testing/config/marionette_requirements.txt | 1 + .../client/marionette/marionette_test.py | 9 ++++--- .../client/marionette/runner/base.py | 2 +- .../driver/marionette_driver/__init__.py | 3 +++ .../marionette_driver}/application_cache.py | 0 .../marionette_driver}/by.py | 0 .../marionette_driver}/date_time_value.py | 0 .../marionette_driver}/decorators.py | 0 .../marionette_driver}/errors.py | 0 .../marionette_driver}/expected.py | 0 .../marionette_driver}/geckoinstance.py | 0 .../marionette_driver}/gestures.py | 0 .../marionette_driver}/keys.py | 0 .../marionette_driver}/marionette.py | 0 .../marionette_driver}/selection.py | 0 .../marionette_driver}/wait.py | 0 testing/marionette/driver/requirements.txt | 1 + testing/marionette/driver/setup.py | 27 +++++++++++++++++++ 18 files changed, 38 insertions(+), 5 deletions(-) create mode 100644 testing/marionette/driver/marionette_driver/__init__.py rename testing/marionette/{client/marionette => driver/marionette_driver}/application_cache.py (100%) rename testing/marionette/{client/marionette => driver/marionette_driver}/by.py (100%) rename testing/marionette/{client/marionette => driver/marionette_driver}/date_time_value.py (100%) rename testing/marionette/{client/marionette => driver/marionette_driver}/decorators.py (100%) rename testing/marionette/{client/marionette => driver/marionette_driver}/errors.py (100%) rename testing/marionette/{client/marionette => driver/marionette_driver}/expected.py (100%) rename testing/marionette/{client/marionette => driver/marionette_driver}/geckoinstance.py (100%) rename testing/marionette/{client/marionette => driver/marionette_driver}/gestures.py (100%) rename testing/marionette/{client/marionette => driver/marionette_driver}/keys.py (100%) rename testing/marionette/{client/marionette => driver/marionette_driver}/marionette.py (100%) rename testing/marionette/{client/marionette => driver/marionette_driver}/selection.py (100%) rename testing/marionette/{client/marionette => driver/marionette_driver}/wait.py (100%) create mode 100644 testing/marionette/driver/requirements.txt create mode 100644 testing/marionette/driver/setup.py diff --git a/testing/config/marionette_requirements.txt b/testing/config/marionette_requirements.txt index 186360841e52..ab683343728d 100644 --- a/testing/config/marionette_requirements.txt +++ b/testing/config/marionette_requirements.txt @@ -1,3 +1,4 @@ -r mozbase_requirements.txt ../marionette/transport +../marionette/driver ../marionette diff --git a/testing/marionette/client/marionette/marionette_test.py b/testing/marionette/client/marionette/marionette_test.py index cd45db52a8b9..80356a4f81d0 100644 --- a/testing/marionette/client/marionette/marionette_test.py +++ b/testing/marionette/client/marionette/marionette_test.py @@ -14,7 +14,8 @@ import unittest import weakref import warnings -from errors import ( + +from marionette_driver.errors import ( ErrorCodes, MarionetteException, InstallGeckoError, TimeoutException, InvalidResponseException, JavascriptException, NoSuchElementException, XPathLookupException, NoSuchWindowException, StaleElementException, ScriptTimeoutException, ElementNotVisibleException, @@ -22,10 +23,10 @@ from errors import ( InvalidCookieDomainException, UnableToSetCookieException, InvalidSelectorException, MoveTargetOutOfBoundsException, FrameSendNotInitializedError, FrameSendFailureError ) -from marionette import Marionette +from marionette_driver.marionette import Marionette from mozlog.structured.structuredlog import get_default_logger -from wait import Wait -from expected import element_present, element_not_present +from marionette_driver.wait import Wait +from marionette_driver.expected import element_present, element_not_present class SkipTest(Exception): diff --git a/testing/marionette/client/marionette/runner/base.py b/testing/marionette/client/marionette/runner/base.py index fd1e56fdb528..ae4aa453d203 100644 --- a/testing/marionette/client/marionette/runner/base.py +++ b/testing/marionette/client/marionette/runner/base.py @@ -17,7 +17,7 @@ import unittest import xml.dom.minidom as dom from manifestparser import TestManifest -from marionette import Marionette +from marionette_driver.marionette import Marionette from mixins.b2g import B2GTestResultMixin, get_b2g_pid, get_dm from mozhttpd import MozHttpd from mozlog.structured.structuredlog import get_default_logger diff --git a/testing/marionette/driver/marionette_driver/__init__.py b/testing/marionette/driver/marionette_driver/__init__.py new file mode 100644 index 000000000000..aff2e13acace --- /dev/null +++ b/testing/marionette/driver/marionette_driver/__init__.py @@ -0,0 +1,3 @@ +from marionette_driver import ( errors, by, decorators, expected, geckoinstance, + gestures, keys, marionette, selection, wait, + application_cache, date_time_value ) \ No newline at end of file diff --git a/testing/marionette/client/marionette/application_cache.py b/testing/marionette/driver/marionette_driver/application_cache.py similarity index 100% rename from testing/marionette/client/marionette/application_cache.py rename to testing/marionette/driver/marionette_driver/application_cache.py diff --git a/testing/marionette/client/marionette/by.py b/testing/marionette/driver/marionette_driver/by.py similarity index 100% rename from testing/marionette/client/marionette/by.py rename to testing/marionette/driver/marionette_driver/by.py diff --git a/testing/marionette/client/marionette/date_time_value.py b/testing/marionette/driver/marionette_driver/date_time_value.py similarity index 100% rename from testing/marionette/client/marionette/date_time_value.py rename to testing/marionette/driver/marionette_driver/date_time_value.py diff --git a/testing/marionette/client/marionette/decorators.py b/testing/marionette/driver/marionette_driver/decorators.py similarity index 100% rename from testing/marionette/client/marionette/decorators.py rename to testing/marionette/driver/marionette_driver/decorators.py diff --git a/testing/marionette/client/marionette/errors.py b/testing/marionette/driver/marionette_driver/errors.py similarity index 100% rename from testing/marionette/client/marionette/errors.py rename to testing/marionette/driver/marionette_driver/errors.py diff --git a/testing/marionette/client/marionette/expected.py b/testing/marionette/driver/marionette_driver/expected.py similarity index 100% rename from testing/marionette/client/marionette/expected.py rename to testing/marionette/driver/marionette_driver/expected.py diff --git a/testing/marionette/client/marionette/geckoinstance.py b/testing/marionette/driver/marionette_driver/geckoinstance.py similarity index 100% rename from testing/marionette/client/marionette/geckoinstance.py rename to testing/marionette/driver/marionette_driver/geckoinstance.py diff --git a/testing/marionette/client/marionette/gestures.py b/testing/marionette/driver/marionette_driver/gestures.py similarity index 100% rename from testing/marionette/client/marionette/gestures.py rename to testing/marionette/driver/marionette_driver/gestures.py diff --git a/testing/marionette/client/marionette/keys.py b/testing/marionette/driver/marionette_driver/keys.py similarity index 100% rename from testing/marionette/client/marionette/keys.py rename to testing/marionette/driver/marionette_driver/keys.py diff --git a/testing/marionette/client/marionette/marionette.py b/testing/marionette/driver/marionette_driver/marionette.py similarity index 100% rename from testing/marionette/client/marionette/marionette.py rename to testing/marionette/driver/marionette_driver/marionette.py diff --git a/testing/marionette/client/marionette/selection.py b/testing/marionette/driver/marionette_driver/selection.py similarity index 100% rename from testing/marionette/client/marionette/selection.py rename to testing/marionette/driver/marionette_driver/selection.py diff --git a/testing/marionette/client/marionette/wait.py b/testing/marionette/driver/marionette_driver/wait.py similarity index 100% rename from testing/marionette/client/marionette/wait.py rename to testing/marionette/driver/marionette_driver/wait.py diff --git a/testing/marionette/driver/requirements.txt b/testing/marionette/driver/requirements.txt new file mode 100644 index 000000000000..4259e1971495 --- /dev/null +++ b/testing/marionette/driver/requirements.txt @@ -0,0 +1 @@ +marionette-transport == 0.4 \ No newline at end of file diff --git a/testing/marionette/driver/setup.py b/testing/marionette/driver/setup.py new file mode 100644 index 000000000000..bd544e676658 --- /dev/null +++ b/testing/marionette/driver/setup.py @@ -0,0 +1,27 @@ +import os +from setuptools import setup, find_packages +import sys + +version = '0.1.0' + +# dependencies +with open('requirements.txt') as f: + deps = f.read().splitlines() + +setup(name='marionette_driver', + version=version, + description="Marionette Driver", + long_description='See http://marionette-driver.readthedocs.org/', + classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers + keywords='mozilla', + author='Auto-tools', + author_email='tools-marionette@lists.mozilla.org', + url='https://wiki.mozilla.org/Auto-tools/Projects/Marionette', + license='MPL', + packages=find_packages(), + #package_data={'marionette_driver': ['touch/*.js']}, + include_package_data=True, + zip_safe=False, + install_requires=deps, + ) +