How to use is_maximizable method in toolium

Best Python code snippet using toolium_python

test_driver_wrapper.py

Source:test_driver_wrapper.py Github

copy

Full Screen

...191 assert driver_wrapper.is_web_test() == is_web192 assert driver_wrapper.is_android_web_test() == is_android_web193 assert driver_wrapper.is_ios_web_test() == is_ios_web194@pytest.mark.parametrize("driver_type, is_maximizable", maximizable_drivers)195def test_is_maximizable(driver_type, is_maximizable, driver_wrapper):196 driver_wrapper.config.set('Driver', 'type', driver_type)197 assert driver_wrapper.is_maximizable() == is_maximizable198# (reuse_driver, reuse_driver_session, restart_driver_after_failure, restart_driver_fail,199# reuse_driver_from_tags, scope, test_passed, expected_should_reuse_driver)200should_be_reused = (201 ('true', 'true', 'true', 'true', True, 'function', True, True), # all = true202 # reuse_driver203 ('true', 'false', 'false', 'false', False, 'function', True, True), # reuse = true, function204 ('true', 'false', 'false', 'false', False, 'module', True, False), # reuse = true, module205 ('true', 'false', 'false', 'false', False, 'session', True, False), # reuse = true, session206 ('false', 'false', 'false', 'false', False, 'function', True, False), # reuse = false207 # restart_driver_after_failure208 ('true', 'false', 'false', 'false', False, 'function', True, True), # restart = false, test passed209 ('true', 'false', 'true', 'false', False, 'function', True, True), # restart = true, test passed210 ('true', 'false', 'false', 'false', False, 'function', False, True), # restart = false, test failed211 ('true', 'false', 'true', 'false', False, 'function', False, False), # restart = true, test failed...

Full Screen

Full Screen

driver_wrapper.py

Source:driver_wrapper.py Github

copy

Full Screen

...115 self.remote_node_video_enabled = True if self.server_type in ['ggr', 'selenoid'] else False116 if self.is_mobile_test() and not self.is_web_test() and self.config.getboolean_optional('Driver',117 'appium_app_strings'):118 self.app_strings = self.driver.app_strings()119 if self.is_maximizable():120 bounds_x, bounds_y = self.get_config_window_bounds()121 self.driver.set_window_position(bounds_x, bounds_y)122 self.logger.debug('Window bounds: %s x %s', bounds_x, bounds_y)123 if maximize:124 window_width = self.config.get_optional('Driver', 'window_width')125 window_height = self.config.get_optional('Driver', 'window_height')126 if window_width and window_height:127 self.driver.set_window_size(window_width, window_height)128 else:129 self.driver.maximize_window()130 window_size = self.utils.get_window_size()131 self.logger.debug('Window size: %s x %s', window_size['width'], window_size['height'])132 self.update_visual_baseline()133 self.utils.discard_logcat_logs()134 if self.config.get('Driver', 'type') != 'ios':135 self.utils.set_implicitly_wait()136 return self.driver137 def get_config_window_bounds(self):138 bounds_x = int(self.config.get_optional('Driver', 'bounds_x') or 0)139 bounds_y = int(self.config.get_optional('Driver', 'bounds_y') or 0)140 monitor_index = int(self.config.get_optional('Driver', 'monitor') or -1)141 if monitor_index > -1:142 try:143 monitor = screeninfo.get_monitors()[monitor_index]144 bounds_x += monitor.x145 bounds_y += monitor.y146 except NotImplementedError:147 self.logger.warn('Current environment doesn\'t support get_monitors')148 return bounds_x, bounds_y149 def is_android_test(self):150 driver_name = self.config.get('Driver', 'type').split('-')[0]151 return driver_name == 'android'152 def is_ios_test(self):153 driver_name = self.config.get('Driver', 'type').split('-')[0]154 return driver_name in ('ios', 'iphone')155 def is_mobile_test(self):156 return self.is_android_test() or self.is_ios_test()157 def is_web_test(self):158 appium_browser_name = self.config.get_optional('AppiumCapabilities', 'browserName')159 return not self.is_mobile_test() or appium_browser_name not in (None, '')160 def is_android_web_test(self):161 return self.is_android_test() and self.is_web_test()162 def is_ios_web_test(self):163 return self.is_ios_test() and self.is_web_test()164 def is_maximizable(self):165 return not self.is_mobile_test()166 def should_reuse_driver(self, scope, test_passed, context=None):167 reuse_driver = self.config.getboolean_optional('Driver', 'reuse_driver')168 reuse_driver_session = self.config.getboolean_optional('Driver', 'reuse_driver_session')169 restart_driver_after_failure = (self.config.getboolean_optional('Driver', 'restart_driver_after_failure') or170 self.config.getboolean_optional('Driver', 'restart_driver_fail'))171 if context and scope == 'function':172 reuse_driver = reuse_driver or (hasattr(context, 'reuse_driver_from_tags')173 and context.pytalos.reuse_driver_from_tags)174 return (((reuse_driver and scope == 'function') or (reuse_driver_session and scope != 'session'))175 and (test_passed or not restart_driver_after_failure))176 def get_driver_platform(self):177 platform = ''178 if 'platform' in self.driver.desired_capabilities:...

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