How to use is_remote_video_enabled method in toolium

Best Python code snippet using toolium_python

test_driver_utils.py

Source:test_driver_utils.py Github

copy

Full Screen

...248 'record_test_videos': 'true'}}}}249 with requests_mock.mock() as req_mock:250 req_mock.get(url, json=config_response_json)251 # Get remote video configuration and check result252 assert utils.is_remote_video_enabled('grid', '10.20.30.40') is True253 assert url == req_mock.request_history[0].url254def test_is_remote_video_enabled_grid_disabled(utils):255 # Configure mock256 url = 'http://{}:{}/config'.format('10.20.30.40', 3000)257 config_response_json = {'out': [], 'error': [], 'exit_code': 0,258 'filename': ['selenium_grid_extras_config.json'],259 'config_runtime': {'theConfigMap': {260 'video_recording_options': {'width': '1024', 'videos_to_keep': '5',261 'frames': '30',262 'record_test_videos': 'false'}}}}263 with requests_mock.mock() as req_mock:264 req_mock.get(url, json=config_response_json)265 # Get remote video configuration and check result266 assert utils.is_remote_video_enabled('grid', '10.20.30.40') is False267 assert url == req_mock.request_history[0].url268@mock.patch('toolium.utils.driver_utils.requests.get')269def test_is_remote_video_enabled_non_grid_extras(req_get_mock, utils):270 # Configure mock271 req_get_mock.side_effect = ConnectionError('exception error')272 # Get remote video configuration and check result273 assert utils.is_remote_video_enabled('grid', '10.20.30.40') is False274def test_is_remote_video_enabled_grid_empty_node(utils):275 # Get remote video configuration and check result276 assert utils.is_remote_video_enabled('grid', '') is False277def test_is_remote_video_enabled_ggr(utils):278 # Get remote video configuration and check result279 assert utils.is_remote_video_enabled('ggr', '') is True280def test_is_remote_video_enabled_selenoid(utils):281 # Get remote video configuration and check result282 assert utils.is_remote_video_enabled('selenoid', '') is True283def test_is_remote_video_enabled_unknown_server(utils):284 # Get remote video configuration and check result285 assert utils.is_remote_video_enabled('unknown', '') is False286@pytest.mark.parametrize("driver_type, appium_app, appium_browser_name, bar_height", navigation_bar_tests)287def test_get_safari_navigation_bar_height(driver_type, appium_app, appium_browser_name, bar_height, driver_wrapper,288 utils):289 driver_wrapper.config.set('Driver', 'type', driver_type)290 if appium_app:291 driver_wrapper.config.set('AppiumCapabilities', 'app', appium_app)292 if appium_browser_name:293 driver_wrapper.config.set('AppiumCapabilities', 'browserName', appium_browser_name)294 assert utils.get_safari_navigation_bar_height() == bar_height295def test_get_window_size_android_native(driver_wrapper, utils):296 # Configure driver mock297 window_size = {'width': 375, 'height': 667}298 driver_wrapper.driver.get_window_size.return_value = window_size299 driver_wrapper.config.set('Driver', 'type', 'android')...

Full Screen

Full Screen

driver_utils.py

Source:driver_utils.py Github

copy

Full Screen

...212 response = requests.get(video_url)213 open(filepath, 'wb').write(response.content)214 self.logger.info("Video saved in '%s'", filepath)215 DriverWrappersPool.videos_number += 1216 def is_remote_video_enabled(self, server_type, remote_node):217 """Check if the remote node has the video recorder enabled218 :param server_type: server type (grid, ggr, selenoid)219 :param remote_node: remote node name220 :returns: true if it has the video recorder enabled221 """222 enabled = False223 if server_type == 'grid' and remote_node:224 url = '{}/config'.format(self._get_remote_node_url(remote_node))225 try:226 response = requests.get(url, timeout=5).json()227 record_videos = response['config_runtime']['theConfigMap']['video_recording_options'][228 'record_test_videos']229 except (requests.exceptions.ConnectionError, requests.exceptions.ReadTimeout, KeyError):230 record_videos = 'false'...

Full Screen

Full Screen

driver_wrapper.py

Source:driver_wrapper.py Github

copy

Full Screen

...180 self.driver = ConfigDriver(self.config, self.utils).create_driver()181 # Save session id and remote node to download video after the test execution182 self.session_id = self.driver.session_id183 self.server_type, self.remote_node = self.utils.get_remote_node()184 self.remote_node_video_enabled = self.utils.is_remote_video_enabled(self.server_type, self.remote_node)185 # Save app_strings in mobile tests186 if (self.is_mobile_test() and not self.is_web_test()187 and self.config.getboolean_optional('Driver', 'appium_app_strings')):188 self.app_strings = self.driver.app_strings()189 # Resize and move browser190 self.resize_window()191 # Log window size192 window_size = self.utils.get_window_size()193 self.logger.debug('Window size: %s x %s', window_size['width'], window_size['height'])194 # Update baseline195 self.update_visual_baseline()196 # Discard previous logcat logs197 self.utils.discard_logcat_logs()198 # Set implicitly wait timeout...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run toolium automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful