Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 41 additions & 41 deletions src/DataDriver/DataDriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
warn,
)

__version__ = "1.11.1"
__version__ = "1.11.2"


class DataDriver:
Expand Down Expand Up @@ -273,7 +273,7 @@ class DataDriver:
Test cases do not have named arguments. Keywords do.
- The keyword which is used as
``Test Template`` must be defined within the test suite (in the same
\*.robot file). If the keyword which is used as ``Test Template`` is
\\*.robot file). If the keyword which is used as ``Test Template`` is
defined in a ``Resource`` the DataDriver has no access to its
arguments names.

Expand Down Expand Up @@ -343,8 +343,8 @@ class DataDriver:
~~~~~~~~~~~~~~~~~

+-------------+-------------+-------------+-------------+------------------+
| \**\* Test | ${username} | ${password} | [Tags] | [Documentation] |
| Cases \**\* | | | | |
| \\**\\* Test | ${username} | ${password} | [Tags] | [Documentation] |
| Cases \\**\\* | | | | |
| | | | | |
+=============+=============+=============+=============+==================+
| Right user | demo | ${EMPTY} | 1 | This is a test |
Expand Down Expand Up @@ -565,7 +565,7 @@ class DataDriver:

This can be accessed as usual in Robot Framework®.

``${DataDriver_DATA_LIST}[2][arguments][\${password}]`` would result in ``mode`` .
``${DataDriver_DATA_LIST}[2][arguments][\\${password}]`` would result in ``mode`` .



Expand Down Expand Up @@ -832,7 +832,7 @@ class DataDriver:
.. code :: robotframework

*** Settings ***
Library DataDriver file=${CURDIR}/FoldersToFind/*/ reader_class=glob_reader arg_name=\${folder_name}
Library DataDriver file=${CURDIR}/FoldersToFind/*/ reader_class=glob_reader arg_name=\\${folder_name}
Library OperatingSystem
Test Template Test all Files

Expand Down Expand Up @@ -870,7 +870,7 @@ class DataDriver:


- None(default): Data Driver will search in the test suites folder if a
\*.csv file with the same name than the test suite \*.robot file exists
\\*.csv file with the same name than the test suite \\*.robot file exists
- only file extention: if you just set a file extentions like ".xls" or
".xlsx" DataDriver will search
- absolute path: If an absolute path to a file is set, DataDriver tries
Expand Down Expand Up @@ -1279,7 +1279,7 @@ def get_data_from_source(self): # This method will be called from DataDriver to
[Arguments] ${original_config}
Log To Console ${original_config.dialect} # just a log of the original
Create File ${CURDIR}/test321.csv
... *** Test Cases ***,\${var},\\n123,111,\\n321,222, # generating file
... *** Test Cases ***,\\${var},\\n123,111,\\n321,222, # generating file
${new_config}= Create Dictionary file=test321.csv # set file attribute in a dictionary
[Return] ${new_config} # returns {'file': 'test321.csv'}

Expand Down Expand Up @@ -1345,28 +1345,28 @@ def get_data_from_source(self): # This method will be called from DataDriver to
ROBOT_LIBRARY_SCOPE = "TEST SUITE"

def __init__(
self,
file: Optional[str] = None,
encoding: Union[Encodings, Any] = Encodings.cp1252,
dialect: str = "Excel-EU",
delimiter: str = ";",
quotechar: str = '"',
escapechar: str = "\\",
doublequote: bool = True,
skipinitialspace: bool = False,
lineterminator: str = "\r\n",
*,
sheet_name: Union[str, int] = 0,
reader_class: Optional[Union[AbstractReaderClass, str]] = None,
file_search_strategy: str = "PATH",
file_regex: str = r"(?i)(.*?)(\.csv)",
include: Optional[str] = None,
exclude: Optional[str] = None,
handle_template_tags: TagHandling = TagHandling.UnsetTags,
listseperator: str = ",",
config_keyword: Optional[str] = None,
optimize_pabot: PabotOpt = PabotOpt.Equal,
**kwargs: Any,
self,
file: Optional[str] = None,
encoding: Union[Encodings, Any] = Encodings.cp1252,
dialect: str = "Excel-EU",
delimiter: str = ";",
quotechar: str = '"',
escapechar: str = "\\",
doublequote: bool = True,
skipinitialspace: bool = False,
lineterminator: str = "\r\n",
*,
sheet_name: Union[str, int] = 0,
reader_class: Optional[Union[AbstractReaderClass, str]] = None,
file_search_strategy: str = "PATH",
file_regex: str = r"(?i)(.*?)(\.csv)",
include: Optional[str] = None,
exclude: Optional[str] = None,
handle_template_tags: TagHandling = TagHandling.UnsetTags,
listseperator: str = ",",
config_keyword: Optional[str] = None,
optimize_pabot: PabotOpt = PabotOpt.Equal,
**kwargs: Any,
):
# region: docstring
"""**Example:**
Expand Down Expand Up @@ -1588,9 +1588,9 @@ def _get_filtered_test_list(self):
if self._included_by_tags() and self._not_excluded_by_tags():
self._create_test_from_template()
if (
dynamic_test_list is None
or f"{self.test.parent.name}.{self.test.name}" in dynamic_test_list
or self.test.longname in dynamic_test_list
dynamic_test_list is None
or f"{self.test.parent.name}.{self.test.name}" in dynamic_test_list
or self.test.longname in dynamic_test_list
):
temp_test_list.append(self.test)
temp_data_table.append(self.test_case_data)
Expand All @@ -1610,8 +1610,8 @@ def _not_excluded_by_tags(self):
def _filter_tag(self, filter_setting):
tags = Tags()
if (
self.handle_template_tags != TagHandling.DefaultTags
or len(self.test_case_data.tags) == 0
self.handle_template_tags != TagHandling.DefaultTags
or len(self.test_case_data.tags) == 0
):
tags.add(self.template_test.tags)
tags.add(self.test_case_data.tags)
Expand Down Expand Up @@ -1760,10 +1760,10 @@ def _search_file_from_regex(self):

def _handle_pabot(self, test_list):
if (
get_variable_value("${DYNAMICTEST}")
or get_variable_value("${DYNAMICTESTS}")
or not self.robot_options["test"]
or not get_variable_value("${PABOTQUEUEINDEX}")
get_variable_value("${DYNAMICTEST}")
or get_variable_value("${DYNAMICTESTS}")
or not self.robot_options["test"]
or not get_variable_value("${PABOTQUEUEINDEX}")
):
return None
pabot_process_count = int(get_variable_value("${PABOTNUMBEROFPROCESSES}"))
Expand Down Expand Up @@ -1901,8 +1901,8 @@ def __new__(cls, name, value):
def _add_test_case_tags(self):
if isinstance(self.test_case_data.tags, list):
if (
self.handle_template_tags == TagHandling.DefaultTags
and len(self.test_case_data.tags) > 0
self.handle_template_tags == TagHandling.DefaultTags
and len(self.test_case_data.tags) > 0
):
self.test.tags = Tags()
for tag in self.test_case_data.tags:
Expand Down