diff options
author | Swoichha Adhikari <swoichhaa@gmail.com> | 2021-12-06 12:59:19 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-06 12:59:19 +0300 |
commit | 161381ba9f5b2c93a7f81ac058f5eb7a9ca3ee65 (patch) | |
tree | 07100701a528a80bd0151568326d43bad915e5e4 /test | |
parent | 452b9a751ac7dbac87478fd98835417c5ade06ac (diff) |
get proper errors from scenario outline tests (#9232)
Diffstat (limited to 'test')
-rw-r--r-- | test/gui/TestLogParser.py | 60 | ||||
-rw-r--r-- | test/gui/tst_syncing/test.feature | 2 |
2 files changed, 48 insertions, 14 deletions
diff --git a/test/gui/TestLogParser.py b/test/gui/TestLogParser.py index b10dc19b3..81372f542 100644 --- a/test/gui/TestLogParser.py +++ b/test/gui/TestLogParser.py @@ -32,29 +32,63 @@ def traverse_loop(data): if 'result' in error and error['result'] == 'PASS': continue + # Again, we will have to loop through the 'tests' to get failing tests from Scenario Outlines. + if "tests" in error and len(error['tests']) > 0: + for outlineStep in error['tests']: + # Append the information of failing tests into the list of failing tests + if ( + 'result' in outlineStep + and outlineStep['result'] == 'ERROR' + ): + failing_test = { + "Feature File": str( + feature_file['name'] + ), + "Feature": str(feature['name']), + "Scenario": str(scenario['name']), + "Example": str(test_step['name']), + "Test Step": str(error['name']), + "Error Details": str( + outlineStep['detail'] + ) + if ('detail' in outlineStep) + else "Error details not found", + } + failing_tests.append(failing_test) + continue + # Append the information of failing tests into the list of failing tests - # If the error detail is missing(occurs mainly in runtime error) then we display the entire error object. - test = { - "Feature File": str(feature_file['name']), - "Feature": str(feature['name']), - "Scenario": str(scenario['name']), - "Test Step": str(test_step['name']), - "Error Details": str(error['detail']) - if ('detail' in error) - else "Error details not found", - } - - failing_tests.append(test) + # If the error detail is missing(occurs mainly in runtime error) then we display "Error details not found" message. + if 'result' in error and error['result'] == 'ERROR': + failing_test = { + "Feature File": str(feature_file['name']), + "Feature": str(feature['name']), + "Scenario": str(scenario['name']), + "Test Step": str(test_step['name']), + "Error Details": str(error['detail']) + if ('detail' in error) + else "Error details not found", + } + failing_tests.append(failing_test) return failing_tests def filter_redundancy(raw_data): unique_scenarios = [] + unique_scenario_outline_examples = [] filtered_data = [] for scenario in raw_data: - if scenario['Scenario'] not in unique_scenarios: + # The 'Scenario' name in Scenario Outline is not unique for each test. + # So we use 'Example' to uniquely identify each test in Scenario Outline. + if ( + 'Example' in scenario + and scenario['Example'] not in unique_scenario_outline_examples + ): + unique_scenario_outline_examples.append(scenario['Example']) + filtered_data.append(scenario) + elif 'Example' not in scenario and scenario['Scenario'] not in unique_scenarios: unique_scenarios.append(scenario['Scenario']) filtered_data.append(scenario) else: diff --git a/test/gui/tst_syncing/test.feature b/test/gui/tst_syncing/test.feature index b3d71d523..2fd572d04 100644 --- a/test/gui/tst_syncing/test.feature +++ b/test/gui/tst_syncing/test.feature @@ -157,7 +157,7 @@ Feature: Syncing files Scenario: Many subfolders can be synced - Given user "Alice" has created folder "parent" on the server + Given user "Alice" has created folder "parent" on the server And user "Alice" has set up a client with default settings When user "Alice" creates a folder "parent/subfolderEmpty1" inside the sync folder And user "Alice" creates a folder "parent/subfolderEmpty2" inside the sync folder |