How to use update_toolium_system_properties method in toolium

Best Python code snippet using toolium_python

driver_wrapper.py

Source:driver_wrapper.py Github

copy

Full Screen

...108 self.config_properties_filenames = prop_filenames109 # Override properties with system properties [Deprecated: use toolium system properties]110 self.config.update_properties(os.environ)111 # Override properties with toolium system properties112 self.config.update_toolium_system_properties(os.environ)113 # Override properties with behave userdata properties114 if behave_properties:115 self.config.update_properties(behave_properties)116 # Modify config properties before driver creation117 self.finalize_properties_configuration()118 def finalize_properties_configuration(self):119 # Override method if config properties (self.config object) need custom modifications before driver creation120 pass121 def configure_visual_baseline(self):122 """Configure baseline directory"""123 # Get baseline name and translate config variables124 baseline_name = self.config.get_optional('VisualTests', 'baseline_name', '{Driver_type}')125 baseline_name = self.config.translate_config_variables(baseline_name)126 # Configure baseline directory if baseline name has changed...

Full Screen

Full Screen

test_config_parser.py

Source:test_config_parser.py Github

copy

Full Screen

...177 # Lowercase option in name178 ('TOOLIUM_APPIUMCAPABILITIES_PLATFORMName', 'AppiumCapabilities', 'platformName', 'Android', 'iOS'),179)180@pytest.mark.parametrize("property_name, section, option, value, new_value", toolium_system_properties)181def test_update_toolium_system_properties(config, property_name, section, option, value, new_value):182 # Check previous value183 if value is None:184 assert not config.has_option(section, option)185 else:186 assert value == config.get(section, option)187 # Change system property and update config188 environment_properties.append(property_name)189 os.environ[property_name] = '{}_{}={}'.format(section, option, new_value)190 config.update_toolium_system_properties(os.environ)191 # Check the new config value192 assert new_value == config.get(section, option)193toolium_system_properties_wrong_format = (194 # No section and option in name195 ('TOOLIUM', 'AppiumCapabilities', 'platformName', 'Android', 'AppiumCapabilities_platformName=iOS'),196 # No option in name197 ('TOOLIUM_APPIUMCAPABILITIES', 'AppiumCapabilities', 'platformName', 'Android',198 'AppiumCapabilities_platformName=iOS'),199 # Option in name different from option in value200 ('TOOLIUM_APPIUMCAPABILITIES_PLATFORM', 'AppiumCapabilities', 'platformName', 'Android',201 'AppiumCapabilities_platformName=iOS'),202 # Additional param in name203 ('TOOLIUM_APPIUMCAPABILITIES_PLATFORMNAME_WRONG', 'AppiumCapabilities', 'platformName', 'Android',204 'AppiumCapabilities_platformName=iOS'),205 # No option in value206 ('TOOLIUM_APPIUMCAPABILITIES_PLATFORMNAME', 'AppiumCapabilities', 'platformName', 'Android',207 'AppiumCapabilities=iOS'),208 # Additional param in value209 ('TOOLIUM_APPIUMCAPABILITIES_PLATFORMNAME', 'AppiumCapabilities', 'platformName', 'Android',210 'AppiumCapabilities_platformName_wrong=iOS'),211 # No equal in value212 ('TOOLIUM_APPIUMCAPABILITIES_PLATFORMNAME', 'AppiumCapabilities', 'platformName', 'Android',213 'AppiumCapabilities_platformName iOS'),214 # Empty section215 ('TOOLIUM__PLATFORMNAME', 'AppiumCapabilities', 'platformName', 'Android', '_platformName=iOS'),216 # Empty option217 ('TOOLIUM_APPIUMCAPABILITIES_', 'AppiumCapabilities', 'platformName', 'Android', 'AppiumCapabilities_=iOS'),218 # No toolium system property219 ('WRONGNAME', 'AppiumCapabilities', 'platformName', 'Android', 'platformName_Android=iOS'),220)221@pytest.mark.parametrize("property_name, section, option, value, property_value",222 toolium_system_properties_wrong_format)223def test_update_toolium_system_properties_wrong_format(config, logger, property_name, section, option, value,224 property_value):225 # Check previous value226 if value is None:227 assert not config.has_option(section, option)228 else:229 assert value == config.get(section, option)230 # Change system property and update config231 environment_properties.append(property_name)232 os.environ[property_name] = property_value233 config.update_toolium_system_properties(os.environ)234 # Check that config value has not changed235 assert value == config.get(section, option)236 # Check logging error message237 if property_name.startswith('TOOLIUM'):238 logger.warning.assert_called_once_with('A toolium system property is configured but its name does not math with'239 ' section and option in value (use TOOLIUM_[SECTION]_[OPTION]=[Section]_'240 '[option]=value): %s=%s' % (property_name, property_value))241 else:242 logger.warning.assert_not_called()243def test_update_properties_behave(config):244 section = 'AppiumCapabilities'245 option = 'platformName'246 orig_value = 'Android'247 new_value = 'iOS'...

Full Screen

Full Screen

config_parser.py

Source:config_parser.py Github

copy

Full Screen

...76 property_name = "{0}_{1}".format(section, option)77 self.set(section, option, new_properties[property_name])78 except KeyError:79 pass80 def update_toolium_system_properties(self, new_properties):81 """ Update config properties values or add new values if property does not exist82 Property name must be 'TOOLIUM_[SECTION]_[OPTION]' and property value must be '[Section]_[option]=value'83 i.e. TOOLIUM_SERVER_ENABLED='Server_enabled=true'84 Section and option can not be configured in property name because they must be case sensitive and, in Windows,85 system properties are case insensitive86 :param new_properties: dict with new properties values87 """88 for property_name, property_value in new_properties.items():89 name_groups = re.match('^TOOLIUM_([^_]+)_(.+)$', property_name)90 value_groups = re.match('^([^_=]+)_([^=]+)=(.*)$', property_value)91 if (name_groups and value_groups92 and name_groups.group(1).upper() == value_groups.group(1).upper()93 and name_groups.group(2).upper() == value_groups.group(2).upper()):94 section = value_groups.group(1)...

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