本文整理汇总了Python中marionette.MarionetteTestCase.setUp方法的典型用法代码示例。如果您正苦于以下问题:Python MarionetteTestCase.setUp方法的具体用法?Python MarionetteTestCase.setUp怎么用?Python MarionetteTestCase.setUp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类marionette.MarionetteTestCase
的用法示例。
在下文中一共展示了MarionetteTestCase.setUp方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setUp
# 需要导入模块: from marionette import MarionetteTestCase [as 别名]
# 或者: from marionette.MarionetteTestCase import setUp [as 别名]
def setUp(self):
MarionetteTestCase.setUp(self)
self.marionette.__class__ = type('Marionette', (Marionette, MarionetteTouchMixin), {})
self.device = GaiaDevice(self.marionette)
if self.restart and (self.device.is_android_build or self.marionette.instance):
self.device.stop_b2g()
if self.device.is_android_build:
# revert device to a clean state
self.device.manager.removeDir('/data/local/indexedDB')
self.device.manager.removeDir('/data/b2g/mozilla')
self.device.start_b2g()
self.marionette.setup_touch()
# the emulator can be really slow!
self.marionette.set_script_timeout(self._script_timeout)
self.marionette.set_search_timeout(self._search_timeout)
self.lockscreen = LockScreen(self.marionette)
self.apps = GaiaApps(self.marionette)
self.data_layer = GaiaData(self.marionette, self.testvars)
from gaiatest.apps.keyboard.app import Keyboard
self.keyboard = Keyboard(self.marionette)
self.cleanUp()
示例2: setUp
# 需要导入模块: from marionette import MarionetteTestCase [as 别名]
# 或者: from marionette.MarionetteTestCase import setUp [as 别名]
def setUp(self):
MarionetteTestCase.setUp(self)
self.marionette.set_context("chrome")
self.win = self.marionette.current_window_handle
self.marionette.execute_script(
"window.open('chrome://marionette/content/test.xul', '_blank', 'chrome,centerscreen');"
)
示例3: setUp
# 需要导入模块: from marionette import MarionetteTestCase [as 别名]
# 或者: from marionette.MarionetteTestCase import setUp [as 别名]
def setUp(self):
MarionetteTestCase.setUp(self)
self.marionette.set_context("chrome")
self.win = self.marionette.current_window_handle
self.marionette.execute_script("window.open('chrome://marionette/content/test.xul', 'foo', 'chrome,centerscreen');")
self.marionette.switch_to_window('foo')
self.assertNotEqual(self.win, self.marionette.current_window_handle)
示例4: setUp
# 需要导入模块: from marionette import MarionetteTestCase [as 别名]
# 或者: from marionette.MarionetteTestCase import setUp [as 别名]
def setUp(self):
try:
MarionetteTestCase.setUp(self)
except InvalidResponseException:
if self.restart:
pass
self.device = GaiaDevice(self.marionette, self.testvars)
if self.restart and (self.device.is_android_build or self.marionette.instance):
self.device.stop_b2g()
if self.device.is_android_build:
# revert device to a clean state
self.device.manager.removeDir('/data/local/storage/persistent')
self.device.manager.removeDir('/data/b2g/mozilla')
self.device.start_b2g()
# the emulator can be really slow!
self.marionette.set_script_timeout(self._script_timeout)
self.marionette.set_search_timeout(self._search_timeout)
self.lockscreen = LockScreen(self.marionette)
self.apps = GaiaApps(self.marionette)
self.data_layer = GaiaData(self.marionette, self.testvars)
from gaiatest.apps.keyboard.app import Keyboard
self.keyboard = Keyboard(self.marionette)
self.cleanUp()
示例5: setUp
# 需要导入模块: from marionette import MarionetteTestCase [as 别名]
# 或者: from marionette.MarionetteTestCase import setUp [as 别名]
def setUp(self):
MarionetteTestCase.setUp(self)
if self.marionette.session_capabilities['platformName'] == 'DARWIN':
self.mod_key = Keys.META
else:
self.mod_key = Keys.CONTROL
self.action = Actions(self.marionette)
示例6: setUp
# 需要导入模块: from marionette import MarionetteTestCase [as 别名]
# 或者: from marionette.MarionetteTestCase import setUp [as 别名]
def setUp(self):
MarionetteTestCase.setUp(self)
self.marionette.__class__ = type("Marionette", (Marionette, MarionetteTouchMixin), {})
self.marionette.setup_touch()
# the emulator can be really slow!
self.marionette.set_script_timeout(60000)
self.marionette.set_search_timeout(10000)
self.lockscreen = LockScreen(self.marionette)
self.apps = GaiaApps(self.marionette)
self.data_layer = GaiaData(self.marionette)
self.keyboard = Keyboard(self.marionette)
# wifi is true if testvars includes wifi details and wifi manager is defined
self.wifi = (
self.testvars
and "wifi" in self.testvars
and self.marionette.execute_script("return window.navigator.mozWifiManager !== undefined")
)
# device manager
dm_type = os.environ.get("DM_TRANS", "adb")
if dm_type == "adb":
self.device_manager = mozdevice.DeviceManagerADB()
elif dm_type == "sut":
host = os.environ.get("TEST_DEVICE")
if not host:
raise Exception("Must specify host with SUT!")
self.device_manager = mozdevice.DeviceManagerSUT(host=host)
else:
raise Exception("Unknown device manager type: %s" % dm_type)
self.cleanUp()
示例7: setUp
# 需要导入模块: from marionette import MarionetteTestCase [as 别名]
# 或者: from marionette.MarionetteTestCase import setUp [as 别名]
def setUp(self):
# start server
self.loop_test_servers = LoopTestServers()
MarionetteTestCase.setUp(self)
LoopTestDriver.setUp(self, self.marionette)
# Although some of these preferences might require restart, we don't
# use enforce_gecko_prefs (which would restart), as we need to restart
# for the add-on installation anyway.
self.marionette.set_prefs(FIREFOX_PREFERENCES)
xpi_file = os.environ.get("LOOP_XPI_FILE")
if xpi_file:
addons = Addons(self.marionette)
# XXX We should really use temp=True here, but due to the later
# restart to ensure the add-on is installed correctly, this won't work
# at the moment. What we need is a fully restartless add-on - bug 1229352
# at which point we should be able to make this install temporarily
# and after the restart.
addons.install(os.path.abspath(xpi_file))
self.e10s_enabled = os.environ.get("TEST_E10S") == "1"
# Restart the browser nicely, so the preferences and add-on installation
# take full effect.
self.marionette.restart(in_app=True)
# this is browser chrome, kids, not the content window just yet
self.marionette.set_context("chrome")
示例8: setUp
# 需要导入模块: from marionette import MarionetteTestCase [as 别名]
# 或者: from marionette.MarionetteTestCase import setUp [as 别名]
def setUp(self):
MarionetteTestCase.setUp(self)
# the emulator can be really slow!
self.marionette.set_script_timeout(60000)
self.lockscreen = LockScreen(self.marionette)
self.apps = GaiaApps(self.marionette)
示例9: setUp
# 需要导入模块: from marionette import MarionetteTestCase [as 别名]
# 或者: from marionette.MarionetteTestCase import setUp [as 别名]
def setUp(self):
MarionetteTestCase.setUp(self)
test_url = self.marionette.absolute_url('test.html')
self.marionette.navigate(test_url)
self.COOKIE_A = {"name": "foo",
"value": "bar",
"path": "/",
"secure": False}
示例10: setUp
# 需要导入模块: from marionette import MarionetteTestCase [as 别名]
# 或者: from marionette.MarionetteTestCase import setUp [as 别名]
def setUp(self):
MarionetteTestCase.setUp(self)
self.pid = self.marionette.session["processId"]
self.session_id = self.marionette.session_id
self.assertNotEqual(self.marionette.get_pref("browser.startup.page"), 3)
self.marionette.set_pref("browser.startup.page", 3)
示例11: setUp
# 需要导入模块: from marionette import MarionetteTestCase [as 别名]
# 或者: from marionette.MarionetteTestCase import setUp [as 别名]
def setUp(self):
MarionetteTestCase.setUp(self)
self.marionette.enforce_gecko_prefs(
{"marionette.test.bool": True,
"marionette.test.string": "testing",
"marionette.test.int": 3
})
self.marionette.set_context("chrome")
示例12: setUp
# 需要导入模块: from marionette import MarionetteTestCase [as 别名]
# 或者: from marionette.MarionetteTestCase import setUp [as 别名]
def setUp(self):
MarionetteTestCase.setUp(self)
self.setUpScriptData()
self.reset_profile_path = None
self.desktop_backup_path = None
self.createProfileData()
示例13: setUp
# 需要导入模块: from marionette import MarionetteTestCase [as 别名]
# 或者: from marionette.MarionetteTestCase import setUp [as 别名]
def setUp(self):
MarionetteTestCase.setUp(self)
self.marionette.enforce_gecko_prefs({"dom.webcomponents.enabled": True})
self.marionette.navigate(self.marionette.absolute_url("test_shadow_dom.html"))
self.host = self.marionette.find_element(By.ID, "host")
self.marionette.switch_to_shadow_root(self.host)
self.button = self.marionette.find_element(By.ID, "button")
示例14: setUp
# 需要导入模块: from marionette import MarionetteTestCase [as 别名]
# 或者: from marionette.MarionetteTestCase import setUp [as 别名]
def setUp(self):
MarionetteTestCase.setUp(self)
if self.marionette.session_capabilities['platformName'] == 'darwin':
self.mod_key = Keys.META
else:
self.mod_key = Keys.CONTROL
self.remote_uri = self.marionette.absolute_url("javascriptPage.html")
self.marionette.navigate(self.remote_uri)
示例15: setUp
# 需要导入模块: from marionette import MarionetteTestCase [as 别名]
# 或者: from marionette.MarionetteTestCase import setUp [as 别名]
def setUp(self):
# Code to execute before a tests are run.
MarionetteTestCase.setUp(self)
self.actions = Actions(self.marionette)
# The carets to be tested.
self.carets_tested_pref = None
# The carets to be disabled in this test suite.
self.carets_disabled_pref = None