summaryrefslogtreecommitdiffstats
path: root/testing/marionette/puppeteer/firefox/firefox_puppeteer/puppeteer.py
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /testing/marionette/puppeteer/firefox/firefox_puppeteer/puppeteer.py
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'testing/marionette/puppeteer/firefox/firefox_puppeteer/puppeteer.py')
-rw-r--r--testing/marionette/puppeteer/firefox/firefox_puppeteer/puppeteer.py84
1 files changed, 84 insertions, 0 deletions
diff --git a/testing/marionette/puppeteer/firefox/firefox_puppeteer/puppeteer.py b/testing/marionette/puppeteer/firefox/firefox_puppeteer/puppeteer.py
new file mode 100644
index 000000000..1894a414b
--- /dev/null
+++ b/testing/marionette/puppeteer/firefox/firefox_puppeteer/puppeteer.py
@@ -0,0 +1,84 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this file,
+# You can obtain one at http://mozilla.org/MPL/2.0/.
+
+from decorators import use_class_as_property
+
+
+class Puppeteer(object):
+ """The puppeteer class is used to expose additional API and UI libraries.
+
+ Each library can be referenced by its puppeteer name as a member of a
+ Puppeteer instance. For example, the `current_window` member of the
+ `Browser` class can be accessed via `puppeteer.browser.current_window`.
+ """
+
+ def __init__(self, marionette):
+ self._marionette = marionette
+
+ @property
+ def marionette(self):
+ return self._marionette
+
+ @use_class_as_property('api.appinfo.AppInfo')
+ def appinfo(self):
+ """
+ Provides access to members of the appinfo api.
+
+ See the :class:`~api.appinfo.AppInfo` reference.
+ """
+
+ @use_class_as_property('api.keys.Keys')
+ def keys(self):
+ """
+ Provides a definition of control keys to use with keyboard shortcuts.
+ For example, keys.CONTROL or keys.ALT.
+ See the :class:`~api.keys.Keys` reference.
+ """
+
+ @use_class_as_property('api.places.Places')
+ def places(self):
+ """Provides low-level access to several bookmark and history related actions.
+
+ See the :class:`~api.places.Places` reference.
+ """
+
+ @use_class_as_property('api.utils.Utils')
+ def utils(self):
+ """Provides an api for interacting with utility actions.
+
+ See the :class:`~api.utils.Utils` reference.
+ """
+
+ @property
+ def platform(self):
+ """Returns the lowercased platform name.
+
+ :returns: Platform name
+ """
+ return self.marionette.session_capabilities['platformName']
+
+ @use_class_as_property('api.prefs.Preferences')
+ def prefs(self):
+ """
+ Provides an api for setting and inspecting preferences, as see in
+ about:config.
+
+ See the :class:`~api.prefs.Preferences` reference.
+ """
+
+ @use_class_as_property('api.security.Security')
+ def security(self):
+ """
+ Provides an api for accessing security related properties and helpers.
+
+ See the :class:`~api.security.Security` reference.
+ """
+
+ @use_class_as_property('ui.windows.Windows')
+ def windows(self):
+ """
+ Provides shortcuts to the top-level windows.
+
+ See the :class:`~ui.window.Windows` reference.
+ """