当前位置: 首页>>代码示例>>Python>>正文


Python selenium.SeleniumExecutor类代码示例

本文整理汇总了Python中bzt.modules.selenium.SeleniumExecutor的典型用法代码示例。如果您正苦于以下问题:Python SeleniumExecutor类的具体用法?Python SeleniumExecutor怎么用?Python SeleniumExecutor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了SeleniumExecutor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_chrome_proxy

    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()
开发者ID:infomaven,项目名称:taurus,代码行数:34,代码来源:test_proxy2jmx.py

示例2: test_selenium_startup_shutdown_python_folder

 def test_selenium_startup_shutdown_python_folder(self):
     """
     run tests from .py files
     :return:
     """
     obj = SeleniumExecutor()
     obj.engine = EngineEmul()
     obj.engine.config.merge({
         'execution': {
             'scenario': {'script': __dir__() + '/../selenium/python/'},
             'executor': 'selenium'
         },
         'reporting': [{'module': 'junit-xml'}]
     })
     obj.engine.config.merge({"provisioning": "local"})
     obj.execution = obj.engine.config['execution']
     obj.settings.merge(obj.engine.config.get("modules").get("selenium"))
     obj.prepare()
     obj.startup()
     while not obj.check():
         time.sleep(1)
     obj.shutdown()
     prepared_files = os.listdir(obj.runner.working_dir)
     python_files = [fname for fname in prepared_files if fname.endswith(".py")]
     self.assertEqual(2, len(python_files))
     self.assertTrue(os.path.exists(obj.runner.settings.get("report-file")))
开发者ID:azweb76,项目名称:taurus,代码行数:26,代码来源:test_SeleniumExecutor.py

示例3: test_resource_files_collection_remote_nose

    def test_resource_files_collection_remote_nose(self):
        obj = SeleniumExecutor()
        obj.engine = EngineEmul()
        obj.execution.merge({"scenario": {"script": __dir__() + "/../selenium/python/"}})
        obj.settings.merge(obj.engine.config.get("modules").get("selenium"))

        self.assertEqual(len(obj.resource_files()), 1)
开发者ID:azweb76,项目名称:taurus,代码行数:7,代码来源:test_SeleniumExecutor.py

示例4: test_selenium_startup_shutdown_java_folder

    def test_selenium_startup_shutdown_java_folder(self):
        """
        run tests from .java files
        :return:
        """
        obj = SeleniumExecutor()
        obj.engine = EngineEmul()
        obj.engine.config.merge(yaml.load(open("tests/yaml/selenium_executor_java.yml").read()))
        obj.engine.config.merge({"provisioning": "local"})
        obj.execution = obj.engine.config['execution']
        obj.settings.merge(obj.engine.config.get("modules").get("selenium"))
        obj.prepare()
        obj.startup()
        while not obj.check():
            time.sleep(1)
        obj.shutdown()

        prepared_files = os.listdir(obj.runner.working_dir)
        java_files = [file for file in prepared_files if file.endswith(".java")]
        class_files = [file for file in prepared_files if file.endswith(".class")]
        jars = [file for file in prepared_files if file.endswith(".jar")]
        self.assertEqual(2, len(java_files))
        self.assertEqual(2, len(class_files))
        self.assertEqual(1, len(jars))
        self.assertTrue(os.path.exists(os.path.join(obj.runner.working_dir, "compiled.jar")))
        self.assertTrue(os.path.exists(obj.runner.report_file))
开发者ID:maribezler,项目名称:taurus,代码行数:26,代码来源:test_SeleniumExecutor.py

示例5: test_selenium_startup_shutdown_python_single

    def test_selenium_startup_shutdown_python_single(self):
        """
        run tests from .py file
        :return:
        """

        obj = SeleniumExecutor()
        obj.engine = EngineEmul()
        obj.engine.config = BetterDict()
        obj.engine.config.merge(yaml.load(open("tests/yaml/selenium_executor_python.yml").read()))
        obj.engine.config.merge({"provisioning": "local"})
        obj.execution = obj.engine.config["execution"]

        obj.execution.merge({"scenario": {"script": ABS_PATH("/../../tests/selenium/python/test_blazemeter_fail.py")}})

        obj.settings.merge(obj.engine.config.get("modules").get("selenium"))
        obj.prepare()
        obj.startup()
        while not obj.check():
            time.sleep(1)
        obj.shutdown()
        prepared_files = os.listdir(obj.runner.working_dir)
        python_files = [file for file in prepared_files if file.endswith(".py")]
        self.assertEqual(1, len(python_files))
        self.assertTrue(os.path.exists(obj.runner.settings.get("report-file")))
开发者ID:kobi1023,项目名称:taurus,代码行数:25,代码来源:test_SeleniumExecutor.py

示例6: test_install_tools

    def test_install_tools(self):
        """
        check installation of selenium-server, junit
        :return:
        """
        dummy_installation_path = os.path.abspath(__dir__() + "/../../build/tmp/selenium-taurus")
        base_link = "file://" + __dir__() + "/../data/"

        shutil.rmtree(os.path.dirname(dummy_installation_path), ignore_errors=True)

        selenium_server_link = SeleniumExecutor.SELENIUM_DOWNLOAD_LINK
        SeleniumExecutor.SELENIUM_DOWNLOAD_LINK = base_link + "selenium-server-standalone-2.46.0.jar"

        junit_link = SeleniumExecutor.JUNIT_DOWNLOAD_LINK
        SeleniumExecutor.JUNIT_DOWNLOAD_LINK = base_link + "junit-4.12.jar"

        self.assertFalse(os.path.exists(dummy_installation_path))
        obj = SeleniumExecutor()
        obj.engine = EngineEmul()
        obj.settings.merge({"selenium-tools": {
            "junit": {"selenium-server": os.path.join(dummy_installation_path, "selenium-server.jar")}}})
        obj.settings.merge({"selenium-tools": {
            "junit": {"path": os.path.join(dummy_installation_path, "tools", "junit", "junit.jar")}}})

        obj.execution = BetterDict()
        obj.execution.merge({"scenario": {"script": os.path.abspath(__dir__() + "/../../tests/selenium/jar/")}})
        obj.prepare()
        self.assertTrue(os.path.exists(os.path.join(dummy_installation_path, "selenium-server.jar")))
        self.assertTrue(os.path.exists(os.path.join(dummy_installation_path, "tools", "junit", "junit.jar")))

        SeleniumExecutor.SELENIUM_DOWNLOAD_LINK = selenium_server_link
        SeleniumExecutor.JUNIT_DOWNLOAD_LINK = junit_link
开发者ID:maribezler,项目名称:taurus,代码行数:32,代码来源:test_SeleniumExecutor.py

示例7: test_selenium_startup_shutdown_jar_single

    def test_selenium_startup_shutdown_jar_single(self):
        """
        runt tests from single jar
        :return:
        """
        obj = SeleniumExecutor()
        obj.engine = EngineEmul()
        obj.engine.config.merge(yaml.load(open("tests/yaml/selenium_executor_jar.yml").read()))
        obj.engine.config.merge({"provisioning": "local"})
        obj.execution = obj.engine.config['execution']
        obj.execution.merge(
            {"scenario": {"script": os.path.abspath(__dir__() + "/../../tests/selenium/jar/dummy.jar")}})
        obj.settings.merge(obj.engine.config.get("modules").get("selenium"))
        obj.prepare()
        obj.startup()
        while not obj.check():
            time.sleep(1)
        obj.shutdown()

        prepared_files = os.listdir(obj.runner.working_dir)
        java_files = [file for file in prepared_files if file.endswith(".java")]
        class_files = [file for file in prepared_files if file.endswith(".class")]
        jars = [file for file in prepared_files if file.endswith(".jar")]
        self.assertEqual(len(java_files), 0)
        self.assertEqual(len(class_files), 0)
        self.assertEqual(len(jars), 1)
        self.assertTrue(os.path.exists(obj.runner.report_file))
开发者ID:maribezler,项目名称:taurus,代码行数:27,代码来源:test_SeleniumExecutor.py

示例8: test_resource_files_collection_remote_nose

    def test_resource_files_collection_remote_nose(self):
        obj = SeleniumExecutor()
        obj.engine = EngineEmul()
        obj.execution.merge({"scenario": {"script": __dir__() + "/../selenium/python/"}})
        obj.settings.merge(obj.engine.config.get("modules").get("selenium"))

        res_files = obj.resource_files()
        res_artifacts = os.listdir(os.path.join(obj.engine.artifacts_dir, res_files[0]))
        self.assertEqual(len(res_artifacts), 2)
开发者ID:VegiS,项目名称:taurus,代码行数:9,代码来源:test_SeleniumExecutor.py

示例9: test_empty_scenario

 def test_empty_scenario(self):
     """
     Raise runtime error when no scenario provided
     :return:
     """
     obj = SeleniumExecutor()
     obj.engine = EngineEmul()
     obj.engine.config.merge({ScenarioExecutor.EXEC: {"executor": "selenium"}})
     obj.execution = obj.engine.config['execution']
     self.assertRaises(ValueError, obj.prepare)
开发者ID:azweb76,项目名称:taurus,代码行数:10,代码来源:test_SeleniumExecutor.py

示例10: test_remote_prov_requests

 def test_remote_prov_requests(self):
     obj = SeleniumExecutor()
     obj.engine = EngineEmul()
     obj.execution.merge({
         "scenario": {
             "requests": [
                 "http://blazedemo.com"
             ]
         }
     })
     obj.resource_files()
开发者ID:azweb76,项目名称:taurus,代码行数:11,代码来源:test_SeleniumExecutor.py

示例11: test_empty_scenario

 def test_empty_scenario(self):
     """
     Raise runtime error when no scenario provided
     :return:
     """
     obj = SeleniumExecutor()
     obj.engine = EngineEmul()
     obj.engine.config = BetterDict()
     obj.engine.config.merge({"execution": {"executor": "selenium"}})
     obj.execution = obj.engine.config["execution"]
     self.assertRaises(RuntimeError, obj.prepare)
开发者ID:kobi1023,项目名称:taurus,代码行数:11,代码来源:test_SeleniumExecutor.py

示例12: test_selenium_prepare_python_folder

 def test_selenium_prepare_python_folder(self):
     """
     Check if scripts exist in working dir
     :return:
     """
     obj = SeleniumExecutor()
     obj.engine = EngineEmul()
     obj.execution.merge({"scenario": {"script": __dir__() + "/../selenium/python/"}})
     obj.prepare()
     python_scripts = os.listdir(obj.runner.working_dir)
     self.assertEqual(len(python_scripts), 2)
开发者ID:azweb76,项目名称:taurus,代码行数:11,代码来源:test_SeleniumExecutor.py

示例13: test_prepare_java_package

 def test_prepare_java_package(self):
     """
     Check if scripts exist in working dir
     :return:
     """
     obj = SeleniumExecutor()
     obj.engine = EngineEmul()
     obj.execution = BetterDict()
     obj.execution.merge(
         {"scenario": {"script": os.path.abspath(__dir__() + "/../../tests/selenium/java_package/")}})
     obj.prepare()
     self.assertTrue(os.path.exists(os.path.join(obj.runner.working_dir, "compiled.jar")))
开发者ID:maribezler,项目名称:taurus,代码行数:12,代码来源:test_SeleniumExecutor.py

示例14: test_javac_fail

 def test_javac_fail(self):
     """
     Test RuntimeError when compilation fails
     :return:
     """
     obj = SeleniumExecutor()
     obj.engine = EngineEmul()
     obj.engine.config = BetterDict()
     obj.engine.config.merge(
         {"execution": {"executor": "selenium", "scenario": {"script": "tests/selenium/invalid/invalid.java"}}})
     obj.execution = obj.engine.config['execution']
     self.assertRaises(RuntimeError, obj.prepare)
开发者ID:maribezler,项目名称:taurus,代码行数:12,代码来源:test_SeleniumExecutor.py

示例15: test_prepare_jar_folder

 def test_prepare_jar_folder(self):
     """
     Check if jars exist in working dir
     :return:
     """
     obj = SeleniumExecutor()
     obj.engine = EngineEmul()
     obj.execution = BetterDict()
     obj.execution.merge({"scenario": {"script": os.path.abspath(__dir__() + "/../../tests/selenium/jar/")}})
     obj.prepare()
     java_scripts = os.listdir(obj.runner.working_dir)
     self.assertEqual(len(java_scripts), 2)
开发者ID:maribezler,项目名称:taurus,代码行数:12,代码来源:test_SeleniumExecutor.py


注:本文中的bzt.modules.selenium.SeleniumExecutor类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。