diff --git a/atest/TestCases/ConfigKeyword/config_keyword_generate_file.robot b/atest/TestCases/ConfigKeyword/config_keyword_generate_file.robot index 6c9f11f..93a68ad 100644 --- a/atest/TestCases/ConfigKeyword/config_keyword_generate_file.robot +++ b/atest/TestCases/ConfigKeyword/config_keyword_generate_file.robot @@ -1,16 +1,19 @@ *** Settings *** -Library OperatingSystem -Library DataDriver dialect=excel encoding=utf_8 config_keyword=Config -Suite Setup Suite Setup Keyword -Test Template The Test Keyword -Suite Teardown Remove File ${CURDIR}/${random}test321.csv +Library OperatingSystem +Library DataDriver dialect=excel encoding=utf_8 config_keyword=Config + +Suite Setup Suite Setup Keyword +Suite Teardown Remove File ${CURDIR}/${random}test321.csv +Test Template The Test Keyword + *** Test Cases *** Test aaa + *** Keywords *** Suite Setup Keyword - Log This is the single Suite Setup + Log This is the single Suite Setup The Test Keyword [Arguments] ${var} @@ -23,4 +26,4 @@ Config Create File ${CURDIR}/${random}test321.csv ... *** Test Cases ***,\${var},\nTestCase1,111,\nTestCase2,222, ${new_config}= Create Dictionary file=${random}test321.csv - [Return] ${new_config} + RETURN ${new_config} diff --git a/atest/TestCases/ConfigKeyword/custom_reader.robot b/atest/TestCases/ConfigKeyword/custom_reader.robot index d191299..5663463 100644 --- a/atest/TestCases/ConfigKeyword/custom_reader.robot +++ b/atest/TestCases/ConfigKeyword/custom_reader.robot @@ -1,9 +1,10 @@ *** Settings *** -Library Collections -Library DataDriver config_keyword=Config Reader -Test Template check vars -Test Setup Log Hi i am a Setup -Test Teardown Log I am a Teardown +Library Collections +Library DataDriver config_keyword=Config Reader + +Test Setup Log Hi i am a Setup +Test Teardown Log I am a Teardown +Test Template check vars *** Test Cases *** @@ -13,11 +14,11 @@ test default 1 2 *** Keywords *** check vars [Arguments] ${var_1} ${var_2} - Should Be Equal As Integers ${var_1} ${var_2} + Should Be Equal As Integers ${var_1} ${var_2} Should Be True ${{isinstance($var1, int)}} Should Be True ${{isinstance($var2, str)}} Config Reader [Arguments] ${config} ${new_config}= Create Dictionary reader_class=TestCases/custom_reader/custom_reader.py min=0 max=8 - [Return] ${new_config} \ No newline at end of file + RETURN ${new_config} diff --git a/atest/TestCases/DataTypes/Check_DataTypes.robot b/atest/TestCases/DataTypes/Check_DataTypes.robot index 6271bf2..5cb4915 100644 --- a/atest/TestCases/DataTypes/Check_DataTypes.robot +++ b/atest/TestCases/DataTypes/Check_DataTypes.robot @@ -1,24 +1,25 @@ *** Settings *** -Library DataDriver encoding=utf8 -Test Template Test +Library DataDriver encoding=utf8 + +Test Template Test + *** Test Cases *** Template + *** Keywords *** Test - [Arguments] ${scalar} ${list} ${list_eval} ${dict} ${dict_eval} ${eval} ${exp_eval} ${user} + [Arguments] ${scalar} ${list} ${list_eval} ${dict} ${dict_eval} ${eval} ${exp_eval} ${user} Run Keyword ${scalar} ${eval} ${exp_eval} - FOR ${item} ${exp} IN ZIP ${list} ${list_eval} - Should Be Equal ${item} ${exp} + FOR ${item} ${exp} IN ZIP ${list} ${list_eval} + Should Be Equal ${item} ${exp} END - FOR ${Key} IN @{dict_eval} + FOR ${Key} IN @{dict_eval} Should Be Equal ${dict.${Key}} ${dict_eval}[${Key}] END Validate User ${user} - - Sum List [Arguments] ${inputs} ${expected} ${sum}= Set Variable ${0} @@ -33,7 +34,6 @@ Whos Your Daddy Validate User [Arguments] ${user} - Should Be Equal ${user}[id] ${user}[chk][id] - Should Be Equal ${user.name.first} ${user}[chk][name][first] + Should Be Equal ${user}[id] ${user}[chk][id] + Should Be Equal ${user.name.first} ${user}[chk][name][first] Should Be Equal ${user}[name][last] ${user}[chk][name][last] - \ No newline at end of file diff --git a/atest/TestCases/DataTypes/Check_DataTypes_xlsx.robot b/atest/TestCases/DataTypes/Check_DataTypes_xlsx.robot index 2cec68b..54cad1d 100644 --- a/atest/TestCases/DataTypes/Check_DataTypes_xlsx.robot +++ b/atest/TestCases/DataTypes/Check_DataTypes_xlsx.robot @@ -1,23 +1,24 @@ *** Settings *** -Library DataDriver file=.xlsx encoding=utf-8 -Library Collections -Test Template Test +Library DataDriver file=.xlsx encoding=utf-8 +Library Collections + +Test Template Test + *** Test Cases *** Tempalte + *** Keywords *** Test - [Arguments] ${scalar} ${list} ${list_eval} ${dict} ${dict_eval} ${eval} ${exp_eval} ${user} + [Arguments] ${scalar} ${list} ${list_eval} ${dict} ${dict_eval} ${eval} ${exp_eval} ${user} Run Keyword ${scalar} ${eval} ${exp_eval} - Lists Should Be Equal ${list} ${list_eval} - FOR ${Key} IN @{dict_eval} + Lists Should Be Equal ${list} ${list_eval} + FOR ${Key} IN @{dict_eval} Should Be Equal ${dict.${Key}} ${dict_eval}[${Key}] END Validate User ${user} - - Sum List [Arguments] ${inputs} ${expected} ${sum}= Set Variable ${0} @@ -32,7 +33,6 @@ Whos Your Daddy Validate User [Arguments] ${user} - Should Be Equal ${user}[id] ${user}[chk][id] - Should Be Equal ${user.name.first} ${user}[chk][first] + Should Be Equal ${user}[id] ${user}[chk][id] + Should Be Equal ${user.name.first} ${user}[chk][first] Should Be Equal ${user}[name][last] ${user}[chk][last] - \ No newline at end of file diff --git a/atest/TestCases/DataTypes/LiteralEval.robot b/atest/TestCases/DataTypes/LiteralEval.robot index 1e49323..2e01b0b 100644 --- a/atest/TestCases/DataTypes/LiteralEval.robot +++ b/atest/TestCases/DataTypes/LiteralEval.robot @@ -1,27 +1,29 @@ *** Settings *** -Test Template TestKeyword -Library DataDriver encoding=utf-8 +Library DataDriver encoding=utf-8 + +Test Template TestKeyword *** Test Cases *** Template Test + *** Keywords *** TestKeyword [Arguments] ${scalar} ${dict} ${list} ${dotdict} ${user} - Log ${scalar} - Log ${dict} - Log ${dict}[name] - Log ${list} - Log ${dotdict.key} - Log ${dotdict}[key2] - Log ${user} - Log ${user}[name][first] - Log ${user.name.last} - Log ${user.nr} - Log ${user.dict}[test] - Log ${user}[pwd] + Log ${scalar} + Log ${dict} + Log ${dict}[name] + Log ${list} + Log ${dotdict.key} + Log ${dotdict}[key2] + Log ${user} + Log ${user}[name][first] + Log ${user.name.last} + Log ${user.nr} + Log ${user.dict}[test] + Log ${user}[pwd] Log Many ${scalar} Log Many &{dict} Log Many @{list} - Log Many &{dotdict} \ No newline at end of file + Log Many &{dotdict} diff --git a/atest/TestCases/DataTypes/Types_in_dicts.robot b/atest/TestCases/DataTypes/Types_in_dicts.robot index 1ea3e8c..097546b 100644 --- a/atest/TestCases/DataTypes/Types_in_dicts.robot +++ b/atest/TestCases/DataTypes/Types_in_dicts.robot @@ -1,6 +1,10 @@ *** Settings *** -Test Template TestKeyword -Library DataDriver encoding=utf_8 +Library DataDriver encoding=utf_8 + +Test Template TestKeyword + +Test Tags rf7only + *** Test Cases *** Template Test @@ -8,6 +12,7 @@ Template Test *** Keywords *** TestKeyword - [Arguments] ${dict} ${exp} + [Arguments] ${opt}=default ${exp}=Wrong ${dict}=Value Should Be Equal ${dict} ${exp} Log To Console \n${dict} + Should Be Equal ${opt} default diff --git a/atest/TestCases/Defaults/CSV/defaults.robot b/atest/TestCases/Defaults/CSV/defaults.robot index 053e586..38ab5c7 100644 --- a/atest/TestCases/Defaults/CSV/defaults.robot +++ b/atest/TestCases/Defaults/CSV/defaults.robot @@ -1,25 +1,27 @@ *** Settings *** -Library DataDriver -Test Template Check Variables +Library DataDriver + +Test Template Check Variables *** Variables *** ${Default_Tags}= [] -*** Test Cases *** ${var_1} ${var_2} ${var_name} ${var_doc} ${var_tags} -default ${var_1} ${var_2} a a defaults This is the Default Documentation ${Default_Tags} - [Documentation] This is the Default Documentation + +*** Test Cases *** ${var_1} ${var_2} ${var_name} ${var_doc} ${var_tags} +default ${var_1} ${var_2} [Documentation] This is the Default Documentation + a a defaults This is the Default Documentation ${Default_Tags} + *** Keywords *** Check Variables - [Arguments] ${var_1} ${var_2} ${var_name}=None ${var_doc}=None ${var_tags}=None - Verify Variable ${var_1} ${var_2} a - Verify Variable ${TEST_DOCUMENTATION} ${var_doc} This is the Default Documentation - Verify Variable ${TEST_NAME} ${var_name} defaults - Verify Variable ${TEST_TAGS} ${var_tags} ${Default_Tags} - + [Arguments] ${var_1} ${var_2} ${var_name}=None ${var_doc}=None ${var_tags}=None + Verify Variable ${var_1} ${var_2} a + Verify Variable ${TEST_DOCUMENTATION} ${var_doc} This is the Default Documentation + Verify Variable ${TEST_NAME} ${var_name} defaults + Verify Variable ${TEST_TAGS} ${var_tags} ${Default_Tags} Verify Variable [Arguments] ${var} ${exp_var} ${default} - Run Keyword And Continue On Failure Should Not Be Equal ${var} ${default} - Run Keyword And Continue On Failure Should Be Equal As Strings ${var} ${exp_var} + Run Keyword And Continue On Failure Should Not Be Equal ${var} ${default} + Run Keyword And Continue On Failure Should Be Equal As Strings ${var} ${exp_var} diff --git a/atest/TestCases/Defaults/CSV/generic_csv_reader.robot b/atest/TestCases/Defaults/CSV/generic_csv_reader.robot index 43b7b19..8ed0f05 100644 --- a/atest/TestCases/Defaults/CSV/generic_csv_reader.robot +++ b/atest/TestCases/Defaults/CSV/generic_csv_reader.robot @@ -1,22 +1,24 @@ *** Settings *** -Library DataDriver file=generic_csv_reader.csv reader_class=generic_csv_reader -Test Template Check Variables +Library DataDriver file=generic_csv_reader.csv reader_class=generic_csv_reader + +Test Template Check Variables *** Variables *** ${Default_Tags}= [] -*** Test Cases *** ${var_1} ${var_2} ${var_name} -default ${var_1} ${var_2} a a defaults + +*** Test Cases *** ${var_1} ${var_2} ${var_name} +default ${var_1} ${var_2} a a defaults + *** Keywords *** Check Variables [Arguments] ${var_1} ${var_2} ${var_name} - Verify Variable ${var_1} ${var_2} a - Verify Variable ${TEST_NAME} ${var_name} default a a - + Verify Variable ${var_1} ${var_2} a + Verify Variable ${TEST_NAME} ${var_name} default a a Verify Variable [Arguments] ${var} ${exp_var} ${default} - Run Keyword And Continue On Failure Should Not Be Equal ${var} ${default} - Run Keyword And Continue On Failure Should Be Equal As Strings ${var} ${exp_var} + Run Keyword And Continue On Failure Should Not Be Equal ${var} ${default} + Run Keyword And Continue On Failure Should Be Equal As Strings ${var} ${exp_var} diff --git a/atest/TestCases/Defaults/CSV/test_case_names.robot b/atest/TestCases/Defaults/CSV/test_case_names.robot index f74813c..9f075e2 100644 --- a/atest/TestCases/Defaults/CSV/test_case_names.robot +++ b/atest/TestCases/Defaults/CSV/test_case_names.robot @@ -1,26 +1,27 @@ *** Settings *** -Library DataDriver -Test Template Check Variables +Library DataDriver + +Test Template Check Variables *** Variables *** ${Default_Tags}= [] -*** Test Cases *** ${var_1} ${var_2} ${var_name} ${var_doc} ${var_tags} -default ${var_name_1} ${var_name_2} a a defaults This is the Default Documentation ${Default_Tags} - [Documentation] This is the template Documentation +*** Test Cases *** ${var_1} ${var_2} ${var_name} ${var_doc} ${var_tags} +default ${var_name_1} ${var_name_2} [Documentation] This is the template Documentation + a a defaults This is the Default Documentation ${Default_Tags} *** Keywords *** Check Variables - [Arguments] ${var_1} ${var_2} ${var_name} ${var_doc} ${var_tags} - Verify Variable ${var_1} ${var_2} a - Verify Variable ${TEST_DOCUMENTATION} ${var_doc} This is the Default Documentation - Verify Variable ${TEST_NAME} ${var_name} defaults - Verify Variable ${TEST_TAGS} ${var_tags} ${Default_Tags} + [Arguments] ${var_1} ${var_2} ${var_name} ${var_doc} ${var_tags} + Verify Variable ${var_1} ${var_2} a + Verify Variable ${TEST_DOCUMENTATION} ${var_doc} This is the Default Documentation + Verify Variable ${TEST_NAME} ${var_name} defaults + Verify Variable ${TEST_TAGS} ${var_tags} ${Default_Tags} Verify Variable [Arguments] ${var} ${exp_var} ${default} - Run Keyword And Continue On Failure Should Not Be Equal ${var} ${default} - Run Keyword And Continue On Failure Should Be Equal As Strings ${var} ${exp_var} + Run Keyword And Continue On Failure Should Not Be Equal ${var} ${default} + Run Keyword And Continue On Failure Should Be Equal As Strings ${var} ${exp_var} diff --git a/atest/TestCases/Defaults/CSV/test_case_no_names.robot b/atest/TestCases/Defaults/CSV/test_case_no_names.robot index f74813c..9f075e2 100644 --- a/atest/TestCases/Defaults/CSV/test_case_no_names.robot +++ b/atest/TestCases/Defaults/CSV/test_case_no_names.robot @@ -1,26 +1,27 @@ *** Settings *** -Library DataDriver -Test Template Check Variables +Library DataDriver + +Test Template Check Variables *** Variables *** ${Default_Tags}= [] -*** Test Cases *** ${var_1} ${var_2} ${var_name} ${var_doc} ${var_tags} -default ${var_name_1} ${var_name_2} a a defaults This is the Default Documentation ${Default_Tags} - [Documentation] This is the template Documentation +*** Test Cases *** ${var_1} ${var_2} ${var_name} ${var_doc} ${var_tags} +default ${var_name_1} ${var_name_2} [Documentation] This is the template Documentation + a a defaults This is the Default Documentation ${Default_Tags} *** Keywords *** Check Variables - [Arguments] ${var_1} ${var_2} ${var_name} ${var_doc} ${var_tags} - Verify Variable ${var_1} ${var_2} a - Verify Variable ${TEST_DOCUMENTATION} ${var_doc} This is the Default Documentation - Verify Variable ${TEST_NAME} ${var_name} defaults - Verify Variable ${TEST_TAGS} ${var_tags} ${Default_Tags} + [Arguments] ${var_1} ${var_2} ${var_name} ${var_doc} ${var_tags} + Verify Variable ${var_1} ${var_2} a + Verify Variable ${TEST_DOCUMENTATION} ${var_doc} This is the Default Documentation + Verify Variable ${TEST_NAME} ${var_name} defaults + Verify Variable ${TEST_TAGS} ${var_tags} ${Default_Tags} Verify Variable [Arguments] ${var} ${exp_var} ${default} - Run Keyword And Continue On Failure Should Not Be Equal ${var} ${default} - Run Keyword And Continue On Failure Should Be Equal As Strings ${var} ${exp_var} + Run Keyword And Continue On Failure Should Not Be Equal ${var} ${default} + Run Keyword And Continue On Failure Should Be Equal As Strings ${var} ${exp_var} diff --git a/atest/TestCases/Defaults/GLOB/defaults_glob_files.robot b/atest/TestCases/Defaults/GLOB/defaults_glob_files.robot index c54bd08..2af86ec 100644 --- a/atest/TestCases/Defaults/GLOB/defaults_glob_files.robot +++ b/atest/TestCases/Defaults/GLOB/defaults_glob_files.robot @@ -1,7 +1,8 @@ *** Settings *** -Library DataDriver file=${CURDIR}/DataFiles/*_File.json reader_class=glob_reader -Library OperatingSystem -Test Template Test all Files +Library DataDriver file=${CURDIR}/DataFiles/*_File.json reader_class=glob_reader +Library OperatingSystem + +Test Template Test all Files *** Test Cases *** @@ -13,4 +14,4 @@ Test all Files [Arguments] ${file_name} ${file_content}= Get File ${file_name} ${content}= Evaluate json.loads($file_content)["test_case"] - Should Be Equal ${TEST_NAME} ${content} \ No newline at end of file + Should Be Equal ${TEST_NAME} ${content} diff --git a/atest/TestCases/Defaults/GLOB/defaults_glob_folders.robot b/atest/TestCases/Defaults/GLOB/defaults_glob_folders.robot index 58dddb1..06787b3 100644 --- a/atest/TestCases/Defaults/GLOB/defaults_glob_folders.robot +++ b/atest/TestCases/Defaults/GLOB/defaults_glob_folders.robot @@ -1,7 +1,8 @@ *** Settings *** -Library DataDriver file=${CURDIR}/FoldersToFind/*/ reader_class=glob_reader arg_name=\${folder_name} -Library OperatingSystem -Test Template Test all Files +Library DataDriver file=${CURDIR}/FoldersToFind/*/ reader_class=glob_reader arg_name=\${folder_name} +Library OperatingSystem + +Test Template Test all Files *** Test Cases *** diff --git a/atest/TestCases/Defaults/PICT/defaults_pict.robot b/atest/TestCases/Defaults/PICT/defaults_pict.robot index 9f0718f..6dd2884 100644 --- a/atest/TestCases/Defaults/PICT/defaults_pict.robot +++ b/atest/TestCases/Defaults/PICT/defaults_pict.robot @@ -1,18 +1,20 @@ *** Settings *** -Library DataDriver .pict -Suite Setup Log To Console Setup -Suite Teardown Log To Console Teardown -Test Template Check Variables +Library DataDriver .pict + +Suite Setup Log To Console Setup +Suite Teardown Log To Console Teardown +Test Template Check Variables *** Variables *** ${Default_Tags}= [] -*** Test Cases *** ${var_1} ${var_2} -default ${var_1} ${var_2} a a + +*** Test Cases *** ${var_1} ${var_2} +default ${var_1} ${var_2} a a + *** Keywords *** Check Variables [Arguments] ${var_1} ${var_2} Should Not Be Equal As Strings ${var_1} ${var_2} - \ No newline at end of file diff --git a/atest/TestCases/Defaults/PICT/pict_arguments.robot b/atest/TestCases/Defaults/PICT/pict_arguments.robot index f0fd401..e797307 100644 --- a/atest/TestCases/Defaults/PICT/pict_arguments.robot +++ b/atest/TestCases/Defaults/PICT/pict_arguments.robot @@ -1,20 +1,21 @@ *** Settings *** -Library DataDriver pict_arg.pict pict_options=/o:3 -Library Collections -Test Template Check Variables +Library DataDriver pict_arg.pict pict_options=/o:3 +Library Collections + +Test Template Check Variables *** Variables *** -@{COMBO}= +@{COMBO}= @{EMPTY} + -*** Test Cases *** ${var_1} ${var_2} +*** Test Cases *** ${var_1} ${var_2} ${Type}_${Size}_${Format method}_${File system}_${Cluster size}_${Compression} + *** Keywords *** Check Variables [Arguments] ${Type} ${Size} ${Format method} ${File system} ${Cluster size} ${Compression} ${comb}= Set Variable ${Type} ${Size} ${Format method} ${File system} ${Cluster size} ${Compression} - IF $comb in $COMBO - Fail "${comb}" is doubled... - END + IF $comb in $COMBO Fail "${comb}" is doubled... Append To List ${COMBO} ${comb} diff --git a/atest/TestCases/Defaults/XLS/defaults_xls.robot b/atest/TestCases/Defaults/XLS/defaults_xls.robot index 601d90f..fe2fbce 100644 --- a/atest/TestCases/Defaults/XLS/defaults_xls.robot +++ b/atest/TestCases/Defaults/XLS/defaults_xls.robot @@ -1,25 +1,27 @@ *** Settings *** -Library DataDriver defaults_xls.xls -Test Template Check Variables +Library DataDriver defaults_xls.xls + +Test Template Check Variables *** Variables *** ${Default_Tags}= [] -*** Test Cases *** ${var_1} ${var_2} ${var_name} ${var_doc} ${var_tags} -default ${var_1} ${var_2} a a defaults This is the Default Documentation ${Default_Tags} - [Documentation] This is the Default Documentation + +*** Test Cases *** ${var_1} ${var_2} ${var_name} ${var_doc} ${var_tags} +default ${var_1} ${var_2} [Documentation] This is the Default Documentation + a a defaults This is the Default Documentation ${Default_Tags} + *** Keywords *** Check Variables - [Arguments] ${var_1} ${var_2} ${var_name} ${var_doc} ${var_tags} - Verify Variable ${var_1} ${var_2} a - Verify Variable ${TEST_DOCUMENTATION} ${var_doc} This is the Default Documentation - Verify Variable ${TEST_NAME} ${var_name} defaults - Verify Variable ${TEST_TAGS} ${var_tags} ${Default_Tags} - + [Arguments] ${var_1} ${var_2} ${var_name} ${var_doc} ${var_tags} + Verify Variable ${var_1} ${var_2} a + Verify Variable ${TEST_DOCUMENTATION} ${var_doc} This is the Default Documentation + Verify Variable ${TEST_NAME} ${var_name} defaults + Verify Variable ${TEST_TAGS} ${var_tags} ${Default_Tags} Verify Variable [Arguments] ${var} ${exp_var} ${default} - Run Keyword And Continue On Failure Should Not Be Equal ${var} ${default} - Run Keyword And Continue On Failure Should Be Equal As Strings ${var} ${exp_var} + Run Keyword And Continue On Failure Should Not Be Equal ${var} ${default} + Run Keyword And Continue On Failure Should Be Equal As Strings ${var} ${exp_var} diff --git a/atest/TestCases/Defaults/XLS/defaults_xlsx.robot b/atest/TestCases/Defaults/XLS/defaults_xlsx.robot index 8c5ac2b..073dd81 100644 --- a/atest/TestCases/Defaults/XLS/defaults_xlsx.robot +++ b/atest/TestCases/Defaults/XLS/defaults_xlsx.robot @@ -1,25 +1,27 @@ *** Settings *** -Library DataDriver .xlsx -Test Template Check Variables +Library DataDriver .xlsx + +Test Template Check Variables *** Variables *** ${Default_Tags}= [] -*** Test Cases *** ${var_1} ${var_2} ${var_name} ${var_doc} ${var_tags} -default ${var_1} ${var_2} a a defaults This is the Default Documentation ${Default_Tags} - [Documentation] This is the Default Documentation + +*** Test Cases *** ${var_1} ${var_2} ${var_name} ${var_doc} ${var_tags} +default ${var_1} ${var_2} [Documentation] This is the Default Documentation + a a defaults This is the Default Documentation ${Default_Tags} + *** Keywords *** Check Variables - [Arguments] ${var_1} ${var_2} ${var_name} ${var_doc} ${var_tags} - Verify Variable ${var_1} ${var_2} a - Verify Variable ${TEST_DOCUMENTATION} ${var_doc} This is the Default Documentation - Verify Variable ${TEST_NAME} ${var_name} defaults - Verify Variable ${TEST_TAGS} ${var_tags} ${Default_Tags} - + [Arguments] ${var_1} ${var_2} ${var_name} ${var_doc} ${var_tags} + Verify Variable ${var_1} ${var_2} a + Verify Variable ${TEST_DOCUMENTATION} ${var_doc} This is the Default Documentation + Verify Variable ${TEST_NAME} ${var_name} defaults + Verify Variable ${TEST_TAGS} ${var_tags} ${Default_Tags} Verify Variable [Arguments] ${var} ${exp_var} ${default} - Run Keyword And Continue On Failure Should Not Be Equal ${var} ${default} - Run Keyword And Continue On Failure Should Be Equal As Strings ${var} ${exp_var} + Run Keyword And Continue On Failure Should Not Be Equal ${var} ${default} + Run Keyword And Continue On Failure Should Be Equal As Strings ${var} ${exp_var} diff --git a/atest/TestCases/Defaults/XLS/defaults_xlsx_data_type.robot b/atest/TestCases/Defaults/XLS/defaults_xlsx_data_type.robot index b0b5a8b..5eb6141 100644 --- a/atest/TestCases/Defaults/XLS/defaults_xlsx_data_type.robot +++ b/atest/TestCases/Defaults/XLS/defaults_xlsx_data_type.robot @@ -1,23 +1,25 @@ *** Settings *** -Library DataDriver defaults_xlsx.xlsx sheet_name=DataTypes preserve_xls_types=True -Test Template Check Variables +Library DataDriver defaults_xlsx.xlsx sheet_name=DataTypes preserve_xls_types=True + +Test Template Check Variables *** Variables *** ${Default_Tags}= [] -*** Test Cases *** ${var_1} ${var_2} ${var_name} ${var_doc} ${var_tags} -Test: ${var_1} isinstance ${var_2} (${var_name}) a a a This is the Default Documentation ${Default_Tags} - [Documentation] This is the Default Documentation + +*** Test Cases *** ${var_1} ${var_2} ${var_name} ${var_doc} ${var_tags} +Test: ${var_1} isinstance ${var_2} (${var_name}) [Documentation] This is the Default Documentation + a a a This is the Default Documentation ${Default_Tags} + *** Keywords *** Check Variables - [Arguments] ${var_1} ${var_2} ${var_name} - Log ${{type($var_1)}} == ${var_2} => ${{str(type($var_1)) == $var_2}} - Verify Variable ${{type($var_1)}} ${var_2} ${var_name} - + [Arguments] ${var_1} ${var_2} ${var_name} + Log ${{type($var_1)}} == ${var_2} => ${{str(type($var_1)) == $var_2}} + Verify Variable ${{type($var_1)}} ${var_2} ${var_name} Verify Variable [Arguments] ${var} ${exp_var} ${default} - Run Keyword And Continue On Failure Should Not Be Equal As Strings ${var} ${default} - Run Keyword And Continue On Failure Should Be Equal As Strings ${var} ${exp_var} + Run Keyword And Continue On Failure Should Not Be Equal As Strings ${var} ${default} + Run Keyword And Continue On Failure Should Be Equal As Strings ${var} ${exp_var} diff --git a/atest/TestCases/Defaults/XLS/defaults_xlsx_sheet_name.robot b/atest/TestCases/Defaults/XLS/defaults_xlsx_sheet_name.robot index 82cb80a..bb74249 100644 --- a/atest/TestCases/Defaults/XLS/defaults_xlsx_sheet_name.robot +++ b/atest/TestCases/Defaults/XLS/defaults_xlsx_sheet_name.robot @@ -1,26 +1,28 @@ *** Settings *** -Library DataDriver defaults_xlsx.xlsx sheet_name=MySheetName -Test Template Check Variables -#Default Tags tag2 +Library DataDriver defaults_xlsx.xlsx sheet_name=MySheetName + +Test Template Check Variables +# Default Tags tag2 *** Variables *** ${Default_Tags}= [] -*** Test Cases *** ${var_1} ${var_2} ${var_name} ${var_doc} ${var_tags} -default ${var_1} ${var_2} a a defaults This is the Default Documentation ${Default_Tags} - [Documentation] This is the Default Documentation + +*** Test Cases *** ${var_1} ${var_2} ${var_name} ${var_doc} ${var_tags} +default ${var_1} ${var_2} [Documentation] This is the Default Documentation + a a defaults This is the Default Documentation ${Default_Tags} + *** Keywords *** Check Variables - [Arguments] ${var_1} ${var_2} ${var_name} ${var_doc} ${var_tags} - Verify Variable ${var_1} ${var_2} a - Verify Variable ${TEST_DOCUMENTATION} ${var_doc} This is the Default Documentation - Verify Variable ${TEST_NAME} ${var_name} defaults - #Verify Variable ${TEST_TAGS} ${var_tags} ${Default_Tags} - + [Arguments] ${var_1} ${var_2} ${var_name} ${var_doc} ${var_tags} + Verify Variable ${var_1} ${var_2} a + Verify Variable ${TEST_DOCUMENTATION} ${var_doc} This is the Default Documentation + Verify Variable ${TEST_NAME} ${var_name} defaults + # Verify Variable ${TEST_TAGS} ${var_tags} ${Default_Tags} Verify Variable [Arguments] ${var} ${exp_var} ${default} - Run Keyword And Continue On Failure Should Not Be Equal ${var} ${default} - Run Keyword And Continue On Failure Should Be Equal As Strings ${var} ${exp_var} + Run Keyword And Continue On Failure Should Not Be Equal ${var} ${default} + Run Keyword And Continue On Failure Should Be Equal As Strings ${var} ${exp_var} diff --git a/atest/TestCases/Setup_Teardown/Setups_Teardowns.robot b/atest/TestCases/Setup_Teardown/Setups_Teardowns.robot index d7801fc..e71a486 100644 --- a/atest/TestCases/Setup_Teardown/Setups_Teardowns.robot +++ b/atest/TestCases/Setup_Teardown/Setups_Teardowns.robot @@ -1,39 +1,42 @@ -*** Settings *** -Library DataDriver encoding=utf8 -Suite Setup Suite Start -Test Setup Start -Test Template DataDriver demo -Test Teardown End -Suite Teardown Suite End -Force Tags NoPabot - -*** Test Cases *** -Datadriver execution: ${number} - - -*** Keywords *** -Suite Start - Set Suite Variable ${idx} ${1} - Log Suite Setup ${idx} - Log ${{json.dumps($DataDriver_DATA_LIST, indent=2)}} - Log ${{json.dumps($DataDriver_DATA_DICT, indent=2)}} - -Start - Set Suite Variable ${idx} ${idx+1} - Log \nTask Setup ${idx} - Log ${{json.dumps($DataDriver_TEST_DATA, indent=2)}} - -DataDriver demo - [Arguments] ${number} - Set Suite Variable ${idx} ${idx+1} - Log Task Execution ${idx} - Should Be Equal ${idx} ${number} - -End - Set Suite Variable ${idx} ${idx+1} - Log Task Teardown ${idx} - -Suite End - Set Suite Variable ${idx} ${idx+1} - Log Suite Teardown ${idx} - Should Be Equal ${idx} ${11} +*** Settings *** +Library DataDriver encoding=utf8 + +Suite Setup Suite Start +Suite Teardown Suite End +Test Setup Start +Test Teardown End +Test Template DataDriver demo + +Force Tags nopabot + + +*** Test Cases *** +Datadriver execution: ${number} + + +*** Keywords *** +Suite Start + Set Suite Variable ${idx} ${1} + Log Suite Setup ${idx} + Log ${{json.dumps($DataDriver_DATA_LIST, indent=2)}} + Log ${{json.dumps($DataDriver_DATA_DICT, indent=2)}} + +Start + Set Suite Variable ${idx} ${idx+1} + Log \nTask Setup ${idx} + Log ${{json.dumps($DataDriver_TEST_DATA, indent=2)}} + +DataDriver demo + [Arguments] ${number} + Set Suite Variable ${idx} ${idx+1} + Log Task Execution ${idx} + Should Be Equal ${idx} ${number} + +End + Set Suite Variable ${idx} ${idx+1} + Log Task Teardown ${idx} + +Suite End + Set Suite Variable ${idx} ${idx+1} + Log Suite Teardown ${idx} + Should Be Equal ${idx} ${11} diff --git a/atest/TestCases/Some_Fail/2_of_10_fail.robot b/atest/TestCases/Some_Fail/2_of_10_fail.robot index 5fa7abb..7e95a11 100644 --- a/atest/TestCases/Some_Fail/2_of_10_fail.robot +++ b/atest/TestCases/Some_Fail/2_of_10_fail.robot @@ -1,7 +1,9 @@ *** Settings *** -Library DataDriver encoding=UTF8 -Test Template Check -Force Tags Failing +Library DataDriver encoding=UTF8 + +Test Template Check + +Force Tags failing *** Test Cases *** diff --git a/atest/TestCases/Tags/test.robot b/atest/TestCases/Tags/test.robot index d1b8f8b..94922e0 100644 --- a/atest/TestCases/Tags/test.robot +++ b/atest/TestCases/Tags/test.robot @@ -1,7 +1,9 @@ *** Settings *** -Library DataDriver reader_class=foo_reader.py handle_template_tags=DefaultTags -Test Template Foo Template -Force Tags default +Library DataDriver reader_class=foo_reader.py handle_template_tags=DefaultTags + +Test Template Foo Template + +Force Tags default *** Test Cases *** @@ -11,4 +13,4 @@ Execute Toolchain for ${fooarg} *** Keywords *** Foo Template [Arguments] ${fooarg} - Log To Console ${fooarg} - Tags: ${TEST TAGS} \ No newline at end of file + Log To Console ${fooarg} - Tags: ${TEST TAGS} diff --git a/atest/TestCases/Timeouts/timeout.robot b/atest/TestCases/Timeouts/timeout.robot index 1ca49d5..57e630f 100644 --- a/atest/TestCases/Timeouts/timeout.robot +++ b/atest/TestCases/Timeouts/timeout.robot @@ -1,26 +1,30 @@ *** Settings *** -Library DataDriver -Test Template Check Variables -Test Timeout 1s -Force Tags failing +Library DataDriver + +Test Timeout 1s +Test Template Check Variables + +Force Tags failing + *** Variables *** ${Default_Tags}= [] -*** Test Cases *** ${var_1} ${var_2} ${var_name} ${var_doc} ${var_tags} -default ${var_1} ${var_2} a a defaults This is the Default Documentation ${Default_Tags} - [Documentation] This is the Default Documentation + +*** Test Cases *** ${var_1} ${var_2} ${var_name} ${var_doc} ${var_tags} +default ${var_1} ${var_2} [Documentation] This is the Default Documentation + a a defaults This is the Default Documentation ${Default_Tags} + *** Keywords *** Check Variables - [Arguments] ${var_1} ${var_2} ${var_name} ${var_doc} ${var_tags} - Verify Variable ${var_1} ${var_2} a - Verify Variable ${TEST_DOCUMENTATION} ${var_doc} This is the Default Documentation - Verify Variable ${TEST_NAME} ${var_name} defaults - Sleep 2s - + [Arguments] ${var_1} ${var_2} ${var_name} ${var_doc} ${var_tags} + Verify Variable ${var_1} ${var_2} a + Verify Variable ${TEST_DOCUMENTATION} ${var_doc} This is the Default Documentation + Verify Variable ${TEST_NAME} ${var_name} defaults + Sleep 2s Verify Variable [Arguments] ${var} ${exp_var} ${default} - Run Keyword And Continue On Failure Should Not Be Equal ${var} ${default} - Run Keyword And Continue On Failure Should Be Equal As Strings ${var} ${exp_var} + Run Keyword And Continue On Failure Should Not Be Equal ${var} ${default} + Run Keyword And Continue On Failure Should Be Equal As Strings ${var} ${exp_var} diff --git a/atest/TestCases/csv_reader_config/reader_by_filename.robot b/atest/TestCases/csv_reader_config/reader_by_filename.robot index 414abc4..d5977fa 100644 --- a/atest/TestCases/csv_reader_config/reader_by_filename.robot +++ b/atest/TestCases/csv_reader_config/reader_by_filename.robot @@ -1,36 +1,37 @@ *** Settings *** -Library DataDriver reader_class=csv_reader.py -... file=tab-csv-file-name.tsv -... encoding=utf_8 -... dialect=UserDefined -... delimiter=\t -... quotechar=' -... escapechar=\\ -... my_key=my_value -... my_key2=my_value2 -... skipinitialspace=True -... lineterminator=\n +Library DataDriver reader_class=csv_reader.py +... file=tab-csv-file-name.tsv +... encoding=utf_8 +... dialect=UserDefined +... delimiter=\t +... quotechar=' +... escapechar=\\ +... my_key=my_value +... my_key2=my_value2 +... skipinitialspace=True +... lineterminator=\n -Test Template Check Variables +Test Template Check Variables *** Variables *** ${Default_Tags}= [] -*** Test Cases *** ${var_1} ${var_2} ${var_name} ${var_doc} ${var_tags} -default ${var_1} ${var_2} a a defaults This is the Default Documentation ${Default_Tags} - [Documentation] This is the Default Documentation + +*** Test Cases *** ${var_1} ${var_2} ${var_name} ${var_doc} ${var_tags} +default ${var_1} ${var_2} [Documentation] This is the Default Documentation + a a defaults This is the Default Documentation ${Default_Tags} + *** Keywords *** Check Variables - [Arguments] ${var_1} ${var_2} ${var_name} ${var_doc} ${var_tags} - Verify Variable ${var_1} ${var_2} a - Verify Variable ${TEST_DOCUMENTATION} ${var_doc} This is the Default Documentation - Verify Variable ${TEST_NAME} ${var_name} defaults - Verify Variable ${TEST_TAGS} ${var_tags} ${Default_Tags} - + [Arguments] ${var_1} ${var_2} ${var_name} ${var_doc} ${var_tags} + Verify Variable ${var_1} ${var_2} a + Verify Variable ${TEST_DOCUMENTATION} ${var_doc} This is the Default Documentation + Verify Variable ${TEST_NAME} ${var_name} defaults + Verify Variable ${TEST_TAGS} ${var_tags} ${Default_Tags} Verify Variable [Arguments] ${var} ${exp_var} ${default} - Run Keyword And Continue On Failure Should Not Be Equal ${var} ${default} - Run Keyword And Continue On Failure Should Be Equal As Strings ${var} ${exp_var} + Run Keyword And Continue On Failure Should Not Be Equal ${var} ${default} + Run Keyword And Continue On Failure Should Be Equal As Strings ${var} ${exp_var} diff --git a/atest/TestCases/csv_reader_config/reader_by_module_name.robot b/atest/TestCases/csv_reader_config/reader_by_module_name.robot index cb46195..32180da 100644 --- a/atest/TestCases/csv_reader_config/reader_by_module_name.robot +++ b/atest/TestCases/csv_reader_config/reader_by_module_name.robot @@ -1,36 +1,37 @@ *** Settings *** -Library DataDriver reader_class=DataDriver.csv_reader -... file=tab-csv-file-name.tsv -... encoding=utf-8 -... dialect=UserDefined -... delimiter=\t -... quotechar=' -... escapechar=\\ -... my_key=my_value -... my_key2=my_value2 -... skipinitialspace=True -... lineterminator=\n +Library DataDriver reader_class=DataDriver.csv_reader +... file=tab-csv-file-name.tsv +... encoding=utf-8 +... dialect=UserDefined +... delimiter=\t +... quotechar=' +... escapechar=\\ +... my_key=my_value +... my_key2=my_value2 +... skipinitialspace=True +... lineterminator=\n -Test Template Check Variables +Test Template Check Variables *** Variables *** ${Default_Tags}= [] -*** Test Cases *** ${var_1} ${var_2} ${var_name} ${var_doc} ${var_tags} -default ${var_1} ${var_2} a a defaults This is the Default Documentation ${Default_Tags} - [Documentation] This is the Default Documentation + +*** Test Cases *** ${var_1} ${var_2} ${var_name} ${var_doc} ${var_tags} +default ${var_1} ${var_2} [Documentation] This is the Default Documentation + a a defaults This is the Default Documentation ${Default_Tags} + *** Keywords *** Check Variables - [Arguments] ${var_1} ${var_2} ${var_name} ${var_doc} ${var_tags} - Verify Variable ${var_1} ${var_2} a - Verify Variable ${TEST_DOCUMENTATION} ${var_doc} This is the Default Documentation - Verify Variable ${TEST_NAME} ${var_name} defaults - Verify Variable ${TEST_TAGS} ${var_tags} ${Default_Tags} - + [Arguments] ${var_1} ${var_2} ${var_name} ${var_doc} ${var_tags} + Verify Variable ${var_1} ${var_2} a + Verify Variable ${TEST_DOCUMENTATION} ${var_doc} This is the Default Documentation + Verify Variable ${TEST_NAME} ${var_name} defaults + Verify Variable ${TEST_TAGS} ${var_tags} ${Default_Tags} Verify Variable [Arguments] ${var} ${exp_var} ${default} - Run Keyword And Continue On Failure Should Not Be Equal ${var} ${default} - Run Keyword And Continue On Failure Should Be Equal As Strings ${var} ${exp_var} + Run Keyword And Continue On Failure Should Not Be Equal ${var} ${default} + Run Keyword And Continue On Failure Should Be Equal As Strings ${var} ${exp_var} diff --git a/atest/TestCases/csv_reader_config/reader_by_name.robot b/atest/TestCases/csv_reader_config/reader_by_name.robot index 2aea75c..fce617f 100644 --- a/atest/TestCases/csv_reader_config/reader_by_name.robot +++ b/atest/TestCases/csv_reader_config/reader_by_name.robot @@ -1,36 +1,37 @@ *** Settings *** -Library DataDriver reader_class=csv_reader -... file=tab-csv-file-name.tsv -... encoding=utf-8 -... dialect=UserDefined -... delimiter=\t -... quotechar=' -... escapechar=\\ -... my_key=my_value -... my_key2=my_value2 -... skipinitialspace=True -... lineterminator=\n +Library DataDriver reader_class=csv_reader +... file=tab-csv-file-name.tsv +... encoding=utf-8 +... dialect=UserDefined +... delimiter=\t +... quotechar=' +... escapechar=\\ +... my_key=my_value +... my_key2=my_value2 +... skipinitialspace=True +... lineterminator=\n -Test Template Check Variables +Test Template Check Variables *** Variables *** ${Default_Tags}= [] -*** Test Cases *** ${var_1} ${var_2} ${var_name} ${var_doc} ${var_tags} -default ${var_1} ${var_2} a a defaults This is the Default Documentation ${Default_Tags} - [Documentation] This is the Default Documentation + +*** Test Cases *** ${var_1} ${var_2} ${var_name} ${var_doc} ${var_tags} +default ${var_1} ${var_2} [Documentation] This is the Default Documentation + a a defaults This is the Default Documentation ${Default_Tags} + *** Keywords *** Check Variables - [Arguments] ${var_1} ${var_2} ${var_name} ${var_doc} ${var_tags} - Verify Variable ${var_1} ${var_2} a - Verify Variable ${TEST_DOCUMENTATION} ${var_doc} This is the Default Documentation - Verify Variable ${TEST_NAME} ${var_name} defaults - Verify Variable ${TEST_TAGS} ${var_tags} ${Default_Tags} - + [Arguments] ${var_1} ${var_2} ${var_name} ${var_doc} ${var_tags} + Verify Variable ${var_1} ${var_2} a + Verify Variable ${TEST_DOCUMENTATION} ${var_doc} This is the Default Documentation + Verify Variable ${TEST_NAME} ${var_name} defaults + Verify Variable ${TEST_TAGS} ${var_tags} ${Default_Tags} Verify Variable [Arguments] ${var} ${exp_var} ${default} - Run Keyword And Continue On Failure Should Not Be Equal ${var} ${default} - Run Keyword And Continue On Failure Should Be Equal As Strings ${var} ${exp_var} + Run Keyword And Continue On Failure Should Not Be Equal ${var} ${default} + Run Keyword And Continue On Failure Should Be Equal As Strings ${var} ${exp_var} diff --git a/atest/TestCases/csv_reader_config/reader_by_path.robot b/atest/TestCases/csv_reader_config/reader_by_path.robot index b834043..b48611e 100644 --- a/atest/TestCases/csv_reader_config/reader_by_path.robot +++ b/atest/TestCases/csv_reader_config/reader_by_path.robot @@ -1,36 +1,37 @@ *** Settings *** -Library DataDriver reader_class=../src/DataDriver/csv_reader.py -... file=tab-csv-file-name.tsv -... encoding=UTF8 -... dialect=UserDefined -... delimiter=\t -... quotechar=' -... escapechar=\\ -... my_key=my_value -... my_key2=my_value2 -... skipinitialspace=True -... lineterminator=\n +Library DataDriver reader_class=../src/DataDriver/csv_reader.py +... file=tab-csv-file-name.tsv +... encoding=UTF8 +... dialect=UserDefined +... delimiter=\t +... quotechar=' +... escapechar=\\ +... my_key=my_value +... my_key2=my_value2 +... skipinitialspace=True +... lineterminator=\n -Test Template Check Variables +Test Template Check Variables *** Variables *** ${Default_Tags}= [] -*** Test Cases *** ${var_1} ${var_2} ${var_name} ${var_doc} ${var_tags} -default ${var_1} ${var_2} a a defaults This is the Default Documentation ${Default_Tags} - [Documentation] This is the Default Documentation + +*** Test Cases *** ${var_1} ${var_2} ${var_name} ${var_doc} ${var_tags} +default ${var_1} ${var_2} [Documentation] This is the Default Documentation + a a defaults This is the Default Documentation ${Default_Tags} + *** Keywords *** Check Variables - [Arguments] ${var_1} ${var_2} ${var_name} ${var_doc} ${var_tags} - Verify Variable ${var_1} ${var_2} a - Verify Variable ${TEST_DOCUMENTATION} ${var_doc} This is the Default Documentation - Verify Variable ${TEST_NAME} ${var_name} defaults - Verify Variable ${TEST_TAGS} ${var_tags} ${Default_Tags} - + [Arguments] ${var_1} ${var_2} ${var_name} ${var_doc} ${var_tags} + Verify Variable ${var_1} ${var_2} a + Verify Variable ${TEST_DOCUMENTATION} ${var_doc} This is the Default Documentation + Verify Variable ${TEST_NAME} ${var_name} defaults + Verify Variable ${TEST_TAGS} ${var_tags} ${Default_Tags} Verify Variable [Arguments] ${var} ${exp_var} ${default} - Run Keyword And Continue On Failure Should Not Be Equal ${var} ${default} - Run Keyword And Continue On Failure Should Be Equal As Strings ${var} ${exp_var} + Run Keyword And Continue On Failure Should Not Be Equal ${var} ${default} + Run Keyword And Continue On Failure Should Be Equal As Strings ${var} ${exp_var} diff --git a/atest/TestCases/custom_reader/custom_reader.robot b/atest/TestCases/custom_reader/custom_reader.robot index 7d83201..763271a 100644 --- a/atest/TestCases/custom_reader/custom_reader.robot +++ b/atest/TestCases/custom_reader/custom_reader.robot @@ -1,7 +1,8 @@ *** Settings *** -Library DataDriver reader_class=TestCases/custom_reader/custom_reader.py optimize_pabot=equal -... min=0 max=93 -Test Template check vars +Library DataDriver reader_class=TestCases/custom_reader/custom_reader.py optimize_pabot=equal +... min=0 max=93 + +Test Template check vars *** Test Cases *** @@ -11,6 +12,6 @@ test default 1 2 *** Keywords *** check vars [Arguments] ${var_1} ${var_2} - Should Be Equal As Integers ${var_1} ${var_2} + Should Be Equal As Integers ${var_1} ${var_2} Should Be True ${{isinstance($var1, int)}} - Should Be True ${{isinstance($var2, str)}} \ No newline at end of file + Should Be True ${{isinstance($var2, str)}} diff --git a/atest/TestCases/custom_reader/custom_reader_local.robot b/atest/TestCases/custom_reader/custom_reader_local.robot index 0eabced..08a7a16 100644 --- a/atest/TestCases/custom_reader/custom_reader_local.robot +++ b/atest/TestCases/custom_reader/custom_reader_local.robot @@ -1,7 +1,8 @@ *** Settings *** -Library DataDriver reader_class=./custom_reader.py -... min=0 max=16 -Test Template check vars +Library DataDriver reader_class=./custom_reader.py +... min=0 max=16 + +Test Template check vars *** Test Cases *** @@ -11,6 +12,6 @@ test default 1 2 *** Keywords *** check vars [Arguments] ${var_1} ${var_2} - Should Be Equal As Integers ${var_1} ${var_2} + Should Be Equal As Integers ${var_1} ${var_2} Should Be True ${{isinstance($var1, int)}} - Should Be True ${{isinstance($var2, str)}} \ No newline at end of file + Should Be True ${{isinstance($var2, str)}} diff --git a/atest/TestCases/custom_reader/file_search_strategy_none.robot b/atest/TestCases/custom_reader/file_search_strategy_none.robot index eaaf8e4..956778f 100644 --- a/atest/TestCases/custom_reader/file_search_strategy_none.robot +++ b/atest/TestCases/custom_reader/file_search_strategy_none.robot @@ -1,9 +1,11 @@ *** Settings *** -Documentation Check for backwards compatibility since first release required -... file_search_strategy to be None to prevent an exception on init -Library DataDriver reader_class=TestCases/custom_reader/custom_reader.py -... min=0 max=3 file_search_strategy=None -Test Template check vars +Documentation Check for backwards compatibility since first release required +... file_search_strategy to be None to prevent an exception on init + +Library DataDriver reader_class=TestCases/custom_reader/custom_reader.py +... min=0 max=3 file_search_strategy=None + +Test Template check vars *** Test Cases *** @@ -13,6 +15,6 @@ test default 1 2 *** Keywords *** check vars [Arguments] ${var_1} ${var_2} - Should Be Equal As Integers ${var_1} ${var_2} + Should Be Equal As Integers ${var_1} ${var_2} Should Be True ${{isinstance($var1, int)}} - Should Be True ${{isinstance($var2, str)}} \ No newline at end of file + Should Be True ${{isinstance($var2, str)}} diff --git a/atest/TestCases/custom_reader/jsonreader.robot b/atest/TestCases/custom_reader/jsonreader.robot index 869dd35..f8447e0 100644 --- a/atest/TestCases/custom_reader/jsonreader.robot +++ b/atest/TestCases/custom_reader/jsonreader.robot @@ -1,6 +1,7 @@ *** Settings *** -Library DataDriver data.json -Test Template log vars +Library DataDriver data.json + +Test Template log vars *** Test Cases *** @@ -11,4 +12,4 @@ test default 1 2 log vars [Arguments] ${username} ${password} Log To Console \${username}: ${username} - Log To Console \${password}: ${password} \ No newline at end of file + Log To Console \${password}: ${password} diff --git a/atest/TestCases/custom_reader/with_path_and_file.robot b/atest/TestCases/custom_reader/with_path_and_file.robot index abef135..470d72f 100644 --- a/atest/TestCases/custom_reader/with_path_and_file.robot +++ b/atest/TestCases/custom_reader/with_path_and_file.robot @@ -1,9 +1,11 @@ *** Settings *** -Documentation Validate that file is handed if both reader_class and file are -... specified -Library DataDriver reader_class=TestCases/custom_reader/custom_reader.py -... min=0 max=3 file=dummy.txt -Test Template check vars +Documentation Validate that file is handed if both reader_class and file are +... specified + +Library DataDriver reader_class=TestCases/custom_reader/custom_reader.py +... min=0 max=3 file=dummy.txt + +Test Template check vars *** Test Cases *** @@ -13,6 +15,6 @@ test default 1 2 *** Keywords *** check vars [Arguments] ${var_1} ${var_2} - Should Be Equal As Integers ${var_1} ${var_2} + Should Be Equal As Integers ${var_1} ${var_2} Should Be True ${{isinstance($var1, int)}} - Should Be True ${{isinstance($var2, str)}} \ No newline at end of file + Should Be True ${{isinstance($var2, str)}} diff --git a/atest/TestCases/performance/10.000.robot b/atest/TestCases/performance/10.000.robot index 68b48af..b4e33fe 100644 --- a/atest/TestCases/performance/10.000.robot +++ b/atest/TestCases/performance/10.000.robot @@ -1,23 +1,26 @@ *** Settings *** -Library DataDriver file=10000.csv reader_class=generic_csv_reader -Test Template Check Variables -Force Tags performance +Library DataDriver file=10000.csv reader_class=generic_csv_reader + +Test Template Check Variables + +Force Tags performance *** Variables *** ${Default_Tags}= [] -*** Test Cases *** ${var_1} ${var_2} ${var_name} -test ${var_1}|${var_2} a a defaults + +*** Test Cases *** ${var_1} ${var_2} ${var_name} +test ${var_1}|${var_2} a a defaults + *** Keywords *** Check Variables [Arguments] ${var_1} ${var_2} ${var_name} - Verify Variable ${var_1} ${var_2} a - Verify Variable ${TEST_NAME} ${var_name} default a a - + Verify Variable ${var_1} ${var_2} a + Verify Variable ${TEST_NAME} ${var_name} default a a Verify Variable [Arguments] ${var} ${exp_var} ${default} - Run Keyword And Continue On Failure Should Not Be Equal ${var} ${default} - Run Keyword And Continue On Failure Should Be Equal As Strings ${var} ${exp_var} + Run Keyword And Continue On Failure Should Not Be Equal ${var} ${default} + Run Keyword And Continue On Failure Should Be Equal As Strings ${var} ${exp_var} diff --git a/doc/DataDriver.html b/doc/DataDriver.html index c504cee..4ed85d3 100644 --- a/doc/DataDriver.html +++ b/doc/DataDriver.html @@ -6,7 +6,7 @@ - + diff --git a/docs/index.html b/docs/index.html index 58c061c..27f2cc2 100644 --- a/docs/index.html +++ b/docs/index.html @@ -6,7 +6,7 @@ - + diff --git a/example/Login Tests/DataDriven.robot b/example/Login Tests/DataDriven.robot index 5127540..6e14cd3 100644 --- a/example/Login Tests/DataDriven.robot +++ b/example/Login Tests/DataDriven.robot @@ -1,18 +1,20 @@ *** Settings *** -Library DataDriver -Resource login_resources.robot +Library DataDriver +Resource login_resources.robot + +Suite Setup Open my Browser +Suite Teardown Close Browsers +Test Setup Open Login Page +Test Template Invalid Login -Suite Setup Open my Browser -Test Setup Open Login Page -Test Template Invalid Login -Suite Teardown Close Browsers *** Test Cases *** Login with user '${username}' and password '${password}' Default UserData + *** Keywords *** Invalid login - [Arguments] ${username} ${password} + [Arguments] ${username} ${password} Input username ${username} Input pwd ${password} click login button diff --git a/example/Login Tests/DataDriven_pict.robot b/example/Login Tests/DataDriven_pict.robot index 7170883..c6c2ee8 100644 --- a/example/Login Tests/DataDriven_pict.robot +++ b/example/Login Tests/DataDriven_pict.robot @@ -1,19 +1,21 @@ *** Settings *** -Library DataDriver DataDriven.pict -Resource login_resources.robot +Library DataDriver DataDriven.pict +Resource login_resources.robot + +Suite Setup Open my Browser +Suite Teardown Close Browsers +Test Setup Open Login Page +Test Template Invalid Login -Suite Setup Open my Browser -Suite Teardown Close Browsers -Test Setup Open Login Page -Test Template Invalid Login *** Test Cases *** Login with user '${username}' and password '${password}' Default UserData + *** Keywords *** Invalid login - [Arguments] ${username} ${password} - [Tags] FLAT + [Tags] flat + [Arguments] ${username} ${password} Input username ${username} Input pwd ${password} click login button diff --git a/example/Login Tests/DataDriven_regex.robot b/example/Login Tests/DataDriven_regex.robot index 17dd751..19c69c7 100644 --- a/example/Login Tests/DataDriven_regex.robot +++ b/example/Login Tests/DataDriven_regex.robot @@ -1,19 +1,21 @@ *** Settings *** -Library DataDriver file=${CURDIR} reader_class=generic_csv_reader file_search_strategy=regex file_regex=(?i)(.*?)(\\.pictout) dialect=userdefined delimiter=\t encoding=UTF-8 -Resource login_resources.robot +Library DataDriver file=${CURDIR} reader_class=generic_csv_reader file_search_strategy=regex file_regex=(?i)(.*?)(\\.pictout) dialect=userdefined delimiter=\t encoding=UTF-8 +Resource login_resources.robot + +Suite Setup Open my Browser +Suite Teardown Close Browsers +Test Setup Open Login Page +Test Template Invalid Login -Suite Setup Open my Browser -Suite Teardown Close Browsers -Test Setup Open Login Page -Test Template Invalid Login *** Test Cases *** Login with user '${username}' and password '${password}' Default UserData + *** Keywords *** Invalid login - [Arguments] ${username} ${password} - [Tags] FLAT + [Tags] flat + [Arguments] ${username} ${password} Input username ${username} Input pwd ${password} click login button diff --git a/example/Login Tests/DataDriven_xls.robot b/example/Login Tests/DataDriven_xls.robot index a146ea3..70d2268 100644 --- a/example/Login Tests/DataDriven_xls.robot +++ b/example/Login Tests/DataDriven_xls.robot @@ -1,19 +1,21 @@ *** Settings *** -Library DataDriver DataDriven.xls -Resource login_resources.robot +Library DataDriver DataDriven.xls +Resource login_resources.robot + +Suite Setup Open my Browser +Suite Teardown Close Browsers +Test Setup Open Login Page +Test Template Invalid Login -Suite Setup Open my Browser -Suite Teardown Close Browsers -Test Setup Open Login Page -Test Template Invalid Login *** Test Cases *** Login with user '${username}' and password '${password}' Default UserData + *** Keywords *** Invalid login - [Arguments] ${username} ${password} - [Tags] FLAT + [Tags] flat + [Arguments] ${username} ${password} Input username ${username} Input pwd ${password} click login button diff --git a/example/Login Tests/DataDriven_xlsx.robot b/example/Login Tests/DataDriven_xlsx.robot index b70ca06..c056354 100644 --- a/example/Login Tests/DataDriven_xlsx.robot +++ b/example/Login Tests/DataDriven_xlsx.robot @@ -1,19 +1,21 @@ *** Settings *** -Library DataDriver DataDriven.xlsx -Resource login_resources.robot +Library DataDriver DataDriven.xlsx +Resource login_resources.robot + +Suite Setup Open my Browser +Suite Teardown Close Browsers +Test Setup Open Login Page +Test Template Invalid Login -Suite Setup Open my Browser -Suite Teardown Close Browsers -Test Setup Open Login Page -Test Template Invalid Login *** Test Cases *** Login with user '${username}' and password '${password}' Default UserData + *** Keywords *** Invalid login - [Arguments] ${username} ${password} - [Tags] FLAT + [Tags] flat + [Arguments] ${username} ${password} Input username ${username} Input pwd ${password} click login button diff --git a/example/Login Tests/invalidLogins.robot b/example/Login Tests/invalidLogins.robot index 5148b3e..2365275 100644 --- a/example/Login Tests/invalidLogins.robot +++ b/example/Login Tests/invalidLogins.robot @@ -1,27 +1,27 @@ *** Settings *** -Resource login_resources.robot -Suite Setup Open my Browser -Suite Teardown Close Browsers -Test Setup Open Login Page -Test Template Invalid login +Resource login_resources.robot +Suite Setup Open my Browser +Suite Teardown Close Browsers +Test Setup Open Login Page +Test Template Invalid login -*** Test Cases *** User Passwort -Right user empty pass demo ${EMPTY} -Right user wrong pass demo FooBar - + +*** Test Cases *** User Passwort +Right user empty pass demo ${EMPTY} +Right user wrong pass demo FooBar Empty user right pass ${EMPTY} mode Empty user empty pass ${EMPTY} ${EMPTY} Empty user wrong pass ${EMPTY} FooBar - -Wrong user right pass FooBar mode -Wrong user empty pass FooBar ${EMPTY} -Wrong user wrong pass FooBar FooBar - +Wrong user right pass FooBar mode +Wrong user empty pass FooBar ${EMPTY} +Wrong user wrong pass FooBar FooBar + + *** Keywords *** Invalid login [Arguments] ${username} ${password} Input username ${username} Input pwd ${password} click login button - Error page should be visible \ No newline at end of file + Error page should be visible diff --git a/example/Login Tests/login_resources.robot b/example/Login Tests/login_resources.robot index 7aeb7cc..5673c85 100644 --- a/example/Login Tests/login_resources.robot +++ b/example/Login Tests/login_resources.robot @@ -1,9 +1,11 @@ *** Settings *** -Library SeleniumLibrary +Library SeleniumLibrary + *** Variables *** -${LOGIN URL} http://localhost:7272 -${BROWSER} firefox +${LOGIN URL} http://localhost:7272 +${BROWSER} firefox + *** Keywords *** Open my Browser diff --git a/example/Login Tests/validTest.robot b/example/Login Tests/validTest.robot index 5eec843..ff35b52 100644 --- a/example/Login Tests/validTest.robot +++ b/example/Login Tests/validTest.robot @@ -1,6 +1,7 @@ -*** Settings *** +*** Settings *** Resource login_resources.robot + *** Test Cases *** valid Login [Setup] Open my Browser @@ -8,4 +9,4 @@ valid Login Input pwd mode click login button welcome page should be visible - [Teardown] Close Browsers \ No newline at end of file + [Teardown] Close Browsers diff --git a/pyproject.toml b/pyproject.toml index a9b6405..71fb708 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,12 +9,12 @@ exclude = [ ] [tool.ruff] -unfixable = [] +lint.unfixable = [] exclude = [ "atest", "example" ] -ignore = [ +lint.ignore = [ "B008", # do not perform function calls in argument defaults "E501", # line too long "N815", # mixedCase variable in class scope @@ -29,7 +29,7 @@ ignore = [ "PTH207", # Replace `glob` with `Path.glob` or `Path.rglob` ] target-version = "py37" -select = [ +lint.select = [ "E", "F", "W", diff --git a/src/DataDriver/DataDriver.py b/src/DataDriver/DataDriver.py index 64865d9..4c6a035 100644 --- a/src/DataDriver/DataDriver.py +++ b/src/DataDriver/DataDriver.py @@ -18,13 +18,13 @@ import traceback from glob import glob from pathlib import Path -from typing import Any, Optional, Union # type: ignore +from typing import Any, Dict, List, Optional, Union # type: ignore from robot.api.logger import console # type: ignore from robot.libraries.BuiltIn import BuiltIn # type: ignore from robot.model.tags import Tags # type: ignore from robot.model.testsuite import TestSuite # type: ignore -from robot.running import ArgInfo # type: ignore +from robot.running import ArgumentSpec # type: ignore from robot.running.model import TestCase # type: ignore from robot.utils.dotdict import DotDict # type: ignore from robot.utils.importer import Importer # type: ignore @@ -51,7 +51,7 @@ warn, ) -__version__ = "1.10.0" +__version__ = "1.11.0" class DataDriver: @@ -1863,26 +1863,33 @@ def _replace_test_case_keywords(self): self.test.setup = self.template_test.setup self.test.teardown = self.template_test.teardown self.test.body.create_keyword( - name=self.template_keyword.name, args=self._get_template_arguments() + name=self.template_keyword.name, + args=self._get_template_arguments(), + lineno=self.template_keyword.lineno, ) - def _get_template_arguments(self): + def _get_template_arguments(self) -> Union[List[Any], Dict[str, Any]]: + is_rf_7 = isinstance(self.template_keyword.args, ArgumentSpec) + if is_rf_7: + keyword_arguments = [] + for arg in self.template_keyword.args: + arg_name = f"${{{arg.name}}}" + if arg_name in self.test_case_data.arguments: + keyword_arguments.append((arg.name, self.test_case_data.arguments[arg_name])) + elif arg.required: + raise ValueError(f"Unassigned requiered argument detected: {arg_name}.") + return keyword_arguments return_arguments = [] - unassigned_arguments = [] for arg in self.template_keyword.args: if isinstance(arg, str): variable_match = search_variable(arg) arg_name = variable_match.name - elif isinstance(arg, ArgInfo): - arg_name = f"${{{arg.name}}}" else: - raise TypeError(f"Unknown argument type: {type(arg)} (DataDriver.py: 1869)") + raise TypeError(f"Unknown argument type: {type(arg)} (DataDriver.py)") if arg_name in self.test_case_data.arguments: - if unassigned_arguments: - raise ValueError(f"Unassigned argument(s) detected: {unassigned_arguments}.") return_arguments.append(self.test_case_data.arguments[arg_name]) else: - unassigned_arguments.append(arg_name) + raise ValueError(f"Unassigned argument detected: {arg_name}.") return return_arguments def _add_test_case_tags(self): diff --git a/src/DataDriver/utils.py b/src/DataDriver/utils.py index d8b9ef0..51e6c72 100644 --- a/src/DataDriver/utils.py +++ b/src/DataDriver/utils.py @@ -37,7 +37,7 @@ class Encodings(Enum): - an IBM PC code page, which is ASCII compatible """ - ascii = auto() # noqa: A003 + ascii = auto() big5 = auto() big5hkscs = auto() cp037 = auto()