本文整理汇总了Python中bzt.modules.selenium.SeleniumExecutor.env方法的典型用法代码示例。如果您正苦于以下问题:Python SeleniumExecutor.env方法的具体用法?Python SeleniumExecutor.env怎么用?Python SeleniumExecutor.env使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bzt.modules.selenium.SeleniumExecutor
的用法示例。
在下文中一共展示了SeleniumExecutor.env方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_chrome_proxy
# 需要导入模块: from bzt.modules.selenium import SeleniumExecutor [as 别名]
# 或者: from bzt.modules.selenium.SeleniumExecutor import env [as 别名]
def test_chrome_proxy(self):
self.obj.responses = [
ResponseEmul(200, '{"result" : {}}'),
ResponseEmul(200, '{"result" : {"port": "port1", "host": "host1"}}'),
ResponseEmul(200, ''),
ResponseEmul(200, ''), # startup: startRecording
ResponseEmul(200, ''), # shutdown: stopRecording
ResponseEmul(200, '{"result" : "http://jmx_url"}'),
ResponseEmul(200, 'regular jmx contents'),
ResponseEmul(200, '{"result" : "http://smartjmx_url"}'),
ResponseEmul(200, 'smartjmx content')]
self.obj.engine.config.merge({
'modules': {
'recorder': {
'token': '123'}}})
self.obj.settings = self.obj.engine.config.get('modules').get('recorder')
self.sniff_log(self.obj.log)
executor = SeleniumExecutor()
executor.env = self.obj.engine.env
self.obj.engine.provisioning.executors = [executor]
self.obj.prepare()
if is_linux():
self._check_linux()
elif is_windows():
self._check_windows()
else: # MacOS
self._check_mac()
self.obj.shutdown()
self.obj.post_process()
示例2: setUp
# 需要导入模块: from bzt.modules.selenium import SeleniumExecutor [as 别名]
# 或者: from bzt.modules.selenium.SeleniumExecutor import env [as 别名]
def setUp(self):
super(TestJUnitTester, self).setUp()
engine_obj = EngineEmul()
paths = [local_paths_config()]
engine_obj.configure(paths)
# just download geckodriver & chromedriver with selenium
selenium = SeleniumExecutor()
selenium.engine = engine_obj
selenium.env = selenium.engine.env
selenium.execution.merge({"scenario": {"requests": ["req"]}})
selenium.prepare()
self.obj = JUnitTester()
self.obj.settings = engine_obj.config.get("modules").get("junit")
self.obj.engine = engine_obj
self.obj.env = self.obj.engine.env
示例3: test_full
# 需要导入模块: from bzt.modules.selenium import SeleniumExecutor [as 别名]
# 或者: from bzt.modules.selenium.SeleniumExecutor import env [as 别名]
def test_full(self):
self.obj.api_delay = 1
self.obj.responses = [
ResponseEmul(200, '{"result" : {}}'),
ResponseEmul(200, '{"result" : {"port": "port1", "host": "host1"}}'),
ResponseEmul(200, ''),
ResponseEmul(200, ''), # startup: startRecording
ResponseEmul(200, ''), # shutdown: stopRecording
ResponseEmul(200, '{"result" : "http://jmx_url"}'),
ResponseEmul(200, 'regular jmx contents'),
ResponseEmul(200, '{"result" : "http://smartjmx_url"}'),
ResponseEmul(200, 'smartjmx content')]
self.obj.engine.config.merge({
'modules': {
'recorder': {
'token': '123'}}})
self.obj.settings = self.obj.engine.config.get('modules').get('recorder')
executor = SeleniumExecutor()
executor.env = self.obj.engine.env
self.obj.engine.provisioning.executors = [executor]
self.obj.prepare()
self.assertEqual(self.obj.proxy_addr, 'http://host1:port1')
self.obj.startup()
self.obj.shutdown()
self.obj.post_process()
with open(self.obj.engine.artifacts_dir + '/generated.smart.jmx') as fd:
lines = fd.readlines()
self.assertEqual(len(lines), 1)
self.assertEqual(lines[0].strip(), 'smartjmx content')
with open(self.obj.engine.artifacts_dir + '/generated.simple.jmx') as fd:
lines = fd.readlines()
self.assertEqual(len(lines), 1)
self.assertEqual(lines[0].strip(), 'regular jmx contents')