def test_remote_prov_requests(self): obj = SeleniumExecutor() obj.engine = EngineEmul() obj.execution.merge( {"scenario": { "requests": ["http://blazedemo.com"] }}) obj.resource_files()
def test_remote_prov_requests(self): obj = SeleniumExecutor() obj.engine = EngineEmul() obj.execution.merge({ "scenario": { "requests": [ "http://blazedemo.com" ] } }) obj.resource_files()
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)
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)
def test_resource_files_collection_remote_nose(self): obj = SeleniumExecutor() obj.engine = EngineEmul() obj.execution = BetterDict() 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)
def test_resource_files_collection_remote_jar(self): obj = SeleniumExecutor() obj.engine = self.engine_obj obj.settings = self.selenium_config obj.engine.config.merge({'execution': {'scenario': {'script': 'tests/selenium/jar/'}, '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")) res_files = obj.resource_files() res_artifacts = os.listdir(os.path.join(obj.engine.artifacts_dir, res_files)) self.assertEqual(len(res_artifacts), 2)
def test_dont_copy_local_script_to_artifacts(self): "ensures that .java file is not copied into artifacts-dir" obj = SeleniumExecutor() obj.engine = EngineEmul() filename = "BlazeDemo.java" script_path = __dir__() + "/../data/" + filename obj.execution.merge({"scenario": { "script": script_path, }}) obj.prepare() files = obj.resource_files() self.assertIn(script_path, files) artifacts_script = os.path.join(obj.engine.artifacts_dir, filename) self.assertFalse(os.path.exists(artifacts_script))
def test_resource_files_collection_remote_jar(self): obj = SeleniumExecutor() obj.engine = self.engine_obj obj.settings = self.selenium_config obj.engine.config.merge( {'execution': {'scenario': {'script': __dir__() + '/../selenium/jar/'}, '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")) 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)
def test_dont_copy_local_script_to_artifacts(self): "ensures that .java file is not copied into artifacts-dir" obj = SeleniumExecutor() obj.engine = EngineEmul() filename = "BlazeDemo.java" script_path = __dir__() + "/../data/" + filename obj.execution.merge({ "scenario": { "script": script_path, } }) obj.prepare() files = obj.resource_files() self.assertIn(script_path, files) artifacts_script = os.path.join(obj.engine.artifacts_dir, filename) self.assertFalse(os.path.exists(artifacts_script))