Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -5703,7 +5703,7 @@ def disable_step(data_set):
if len(steps) == 0:
CommonUtil.ExecLog(sModuleInfo, "All steps have been enabled", 1)
else:
CommonUtil.ExecLog(sModuleInfo, "%s steps have been enabled" % steps, 1)
CommonUtil.ExecLog(sModuleInfo, "%s steps have been disabled" % steps, 1)
CommonUtil.disabled_step += steps

return "passed"
Expand Down
30 changes: 15 additions & 15 deletions Framework/MainDriverApi.py
Original file line number Diff line number Diff line change
Expand Up @@ -699,10 +699,10 @@ def run_all_test_steps_in_a_test_case(
def calculate_test_case_result(sModuleInfo, TestCaseID, run_id, sTestStepResultList, testcase_info):
if "BLOCKED" in sTestStepResultList:
CommonUtil.ExecLog(sModuleInfo, "Test Case Blocked", 3)
sTestCaseStatus = "Blocked"
return "Blocked"
elif "CANCELLED" in sTestStepResultList or "Cancelled" in sTestStepResultList:
CommonUtil.ExecLog(sModuleInfo, "Test Case Cancelled", 3)
sTestCaseStatus = "Cancelled"
return "Cancelled"
elif "zeuz_failed".upper() in sTestStepResultList:
step_index = 0
for each in sTestStepResultList:
Expand All @@ -714,24 +714,23 @@ def calculate_test_case_result(sModuleInfo, TestCaseID, run_id, sTestStepResultL
else:
sTestCaseStatus = "Blocked"
CommonUtil.ExecLog(sModuleInfo, "Test Case " + sTestCaseStatus, 3)
return sTestCaseStatus

elif "WARNING" in sTestStepResultList:
CommonUtil.ExecLog(sModuleInfo, "Test Case Contain Warning(s)", 2)
sTestCaseStatus = "Failed"
return "Failed"
elif "NOT RUN" in sTestStepResultList:
CommonUtil.ExecLog(sModuleInfo, "Test Case Contain Not Run Steps", 2)
sTestCaseStatus = "Failed"
elif "SKIPPED" in sTestStepResultList:
sTestCaseStatus = "Skipped"
return "Failed"
elif all([i == "SKIPPED" for i in sTestStepResultList]):
CommonUtil.ExecLog(sModuleInfo, "Test Case Skipped", 1)
return "Skipped"
elif "PASSED" in sTestStepResultList:
CommonUtil.ExecLog(sModuleInfo, "Test Case Passed", 1)
sTestCaseStatus = "Passed"
return "Passed"
else:
CommonUtil.ExecLog(sModuleInfo, "Test Case Status Unknown", 2)
sTestCaseStatus = "Unknown"

return sTestCaseStatus
return "Unknown"


# writes the log file for a test case
Expand Down Expand Up @@ -1007,8 +1006,9 @@ def run_test_case(
if performance and browserDriver:
shared.Set_Shared_Variables("selenium_driver", browserDriver)

sTestCaseStatus = None
if check_test_skip(run_id, tc_num):
sTestStepResultList = ['SKIPPED']
sTestStepResultList = ['SKIPPED' for i in range(len(testcase_info['steps']))]
else:
sTestStepResultList = run_all_test_steps_in_a_test_case(
testcase_info,
Expand All @@ -1023,9 +1023,8 @@ def run_test_case(
performance
)
if check_test_skip(run_id, tc_num, False):
sTestStepResultList[-1] = 'SKIPPED'

# TODO: Test case run is completed here somewhere.
CommonUtil.ExecLog(sModuleInfo, "Test Case Skipped", 1)
sTestCaseStatus = 'Skipped'

ConfigModule.add_config_value(
"sectionOne",
Expand All @@ -1039,7 +1038,8 @@ def run_test_case(
sTestCaseEndTime = datetime.fromtimestamp(TestCaseEndTime, tz=pytz.UTC).strftime("%Y-%m-%d %H:%M:%S")

# Decide if Test Case Pass/Failed
sTestCaseStatus = calculate_test_case_result(sModuleInfo, test_case, run_id, sTestStepResultList, testcase_info)
if sTestCaseStatus is None:
sTestCaseStatus = calculate_test_case_result(sModuleInfo, test_case, run_id, sTestStepResultList, testcase_info)

#Writing error information in a text file
if sTestCaseStatus == "Failed" or sTestCaseStatus == "Blocked":
Expand Down