Example #1
0
    def configure_properties(self,
                             tc_config_prop_filenames=None,
                             behave_properties=None):
        """Configure selenium instance properties

        :param tc_config_prop_filenames: test case specific properties filenames
        :param behave_properties: dict with behave user data properties
        """
        prop_filenames = DriverWrappersPool.get_configured_value(
            'Config_prop_filenames', tc_config_prop_filenames,
            'properties.cfg;local-properties.cfg')
        prop_filenames = [
            os.path.join(DriverWrappersPool.config_directory, filename)
            for filename in prop_filenames.split(';')
        ]
        prop_filenames = ';'.join(prop_filenames)

        # Configure config only if properties filename has changed
        if self.config_properties_filenames != prop_filenames:
            # Initialize the config object
            self.config = ExtendedConfigParser.get_config_from_file(
                prop_filenames)
            self.config_properties_filenames = prop_filenames

        # Override properties with system properties
        self.config.update_properties(os.environ)

        # Override properties with behave userdata properties
        if behave_properties:
            self.config.update_properties(behave_properties)
Example #2
0
def test_a_toolium_param():
    """
    Verification of a mapped parameter as TOOLIUM
    """
    config_file_path = os.path.join("toolium", "test", "resources", "toolium.cfg")
    dataset.toolium_config = ExtendedConfigParser.get_config_from_file(config_file_path)
    result = map_param("[TOOLIUM:TestExecution_environment]")
    expected = "QA"
    assert expected == result
Example #3
0
    def configure_properties(self, tc_config_prop_filenames=None):
        """Configure selenium instance properties

        :param tc_config_prop_filenames: test case specific properties filenames
        """
        prop_filenames = DriverWrappersPool.get_configured_value('Config_prop_filenames', tc_config_prop_filenames,
                                                                 'properties.cfg;local-properties.cfg')
        prop_filenames = [os.path.join(DriverWrappersPool.config_directory, filename) for filename in
                          prop_filenames.split(';')]
        prop_filenames = ';'.join(prop_filenames)

        # Configure config only if properties filename has changed
        if self.config_properties_filenames != prop_filenames:
            # Initialize the config object
            self.config = ExtendedConfigParser.get_config_from_file(prop_filenames)
            self.config_properties_filenames = prop_filenames

        # Override properties with system properties
        self.config.update_from_system_properties()
Example #4
0
    def configure_properties(self,
                             tc_config_prop_filenames=None,
                             behave_properties=None):
        """Configure selenium instance properties

        :param tc_config_prop_filenames: test case specific properties filenames
        :param behave_properties: dict with behave user data properties
        """
        prop_filenames = DriverWrappersPool.get_configured_value(
            'TOOLIUM_CONFIG_PROPERTIES_FILENAMES', 'Config_prop_filenames',
            tc_config_prop_filenames, 'properties.cfg;local-properties.cfg')
        prop_filenames = [
            os.path.join(DriverWrappersPool.config_directory, filename)
            for filename in prop_filenames.split(';')
        ]
        prop_filenames = ';'.join(prop_filenames)

        # Configure config only if properties filename has changed
        if self.config_properties_filenames != prop_filenames:
            # Initialize the config object
            self.config = ExtendedConfigParser.get_config_from_file(
                prop_filenames)
            self.config_properties_filenames = prop_filenames

        # Override properties with system properties [Deprecated: use toolium system properties]
        self.config.update_properties(os.environ)

        # Override properties with toolium system properties
        self.config.update_toolium_system_properties(os.environ)

        # Override properties with behave userdata properties
        if behave_properties:
            self.config.update_properties(behave_properties)

        # Modify config properties before driver creation
        self.finalize_properties_configuration()