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
37 changes: 4 additions & 33 deletions Framework/MainDriverApi.py
Original file line number Diff line number Diff line change
Expand Up @@ -1455,36 +1455,11 @@ def run_test_case(
CommonUtil.CreateJsonReport(TCInfo=after_execution_dict)

debug = True if run_id.startswith("debug") else False
# if str(run_id).startswith("debug"):
# debug = True
# debug_steps = debug_info["debug_steps"]
# str_list = str(debug_steps).split("-")
# debug_steps = str_list[0]
# debug_steps = str(debug_steps[1:-1]).split(",")
#
# if debug and ConfigModule.get_config_value("RunDefinition", "local_run") == "False":
# CommonUtil.Join_Thread_and_Return_Result("screenshot") # Let the capturing screenshot end in thread
# executor.submit(cleanup_runid_from_server, run_id)
# executor.submit(start_sending_log_to_server, run_id, temp_ini_file)
# executor.submit(start_sending_shared_var_to_server, run_id)
# executor.submit(start_sending_step_result_to_server, run_id, debug_steps, sTestStepResultList)
# executor.submit(send_debug_data, run_id, "finished", "yes")

if not debug: # if normal run, then write log file and cleanup driver instances
CommonUtil.Join_Thread_and_Return_Result("screenshot") # Let the capturing screenshot end in thread
cleanup_driver_instances() # clean up drivers
shared.Clean_Up_Shared_Variables() # clean up shared variables
if ConfigModule.get_config_value("RunDefinition", "local_run") == "False":
# executor.submit(
# write_log_file_for_test_case,
# sTestCaseStatus,
# test_case,
# run_id,
# sTestCaseEndTime,
# TestCaseDuration,
# temp_ini_file,
# send_log_file_only_for_fail,
# )
write_log_file_for_test_case(
sTestCaseStatus,
test_case,
Expand Down Expand Up @@ -1725,7 +1700,7 @@ def upload_json_report(Userid, temp_ini_file, run_id, all_run_id_info):
break
time.sleep(1)
else:
print("Could not Upload json report to server")
print("Could not Upload the report to server of run_id '%s'" % run_id)
os.unlink(str(zip_path) + ".zip")
with open(path, "w") as f:
json.dump(json_report, f, indent=2)
Expand Down Expand Up @@ -1771,8 +1746,7 @@ def main(device_dict, user_info_object):
cnt += 1
with open(json_path, "r") as f:
all_run_id_info = json.loads(f.read())
with open(Path.cwd().parent / "Projects" / "Local_run.json", "w") as f:
f.write(json.dumps(all_run_id_info))

if len(all_run_id_info) == 0:
CommonUtil.ExecLog("", "No Test Run Schedule found for the current user : %s" % Userid, 2)
return False
Expand All @@ -1789,7 +1763,6 @@ def main(device_dict, user_info_object):
path = ConfigModule.get_config_value("sectionOne", "temp_run_file_path", temp_ini_file) / Path(run_id.replace(":", "-"))
FL.CreateFolder(path)


# Start websocket server if we're in debug mode.
if run_id.lower().startswith("debug"):
print("[LIVE LOG] Connecting to Live Log service")
Expand Down Expand Up @@ -1828,7 +1801,8 @@ def main(device_dict, user_info_object):
'Built_In_Driver', 'deepak', 'Built_In_Appium', 'Built_In_NET_Win', 'Jarvis']
final_run_params = {}
for param in final_run_params_from_server:
final_run_params[param] = CommonUtil.parse_value_into_object(list(final_run_params_from_server[param].items())[0][1])
final_run_params[param] = CommonUtil.parse_value_into_object(list(final_run_params_from_server[param].items())[1][1])
# final_run_params[param] = CommonUtil.parse_value_into_object(list(final_run_params_from_server[param].items())[0][1])
# final_run_params[param] = CommonUtil.parse_value_into_object(final_run_params_from_server[param]["subfield"])
send_log_file_only_for_fail = ConfigModule.get_config_value("RunDefinition", "upload_log_file_only_for_fail")
send_log_file_only_for_fail = False if send_log_file_only_for_fail.lower() == "false" else True
Expand Down Expand Up @@ -1984,9 +1958,6 @@ def kill(process):
upload_json_report(Userid, temp_ini_file, run_id, all_run_id_info)
# executor.submit(upload_json_report)

# Delete downloaded attachments
FL.DeleteFolder(ConfigModule.get_config_value("sectionOne", "download_folder", temp_ini_file))

# Close websocket connection.
if run_id.lower().startswith("debug"):
ws.close()
Expand Down
185 changes: 0 additions & 185 deletions Projects/Local_run.json

This file was deleted.

11 changes: 1 addition & 10 deletions node_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -786,16 +786,7 @@ def Local_run():
device_dict = All_Device_Info.get_all_connected_device_info()
rem_config = {"local_run": True}
ConfigModule.remote_config = rem_config

path = Path.cwd().parent / "Projects" / "Local_run.json"
with open(path, "r") as f:
Json_data = json.load(f)
if isinstance(Json_data, str):
Json_data = json.loads(Json_data)
all_run_id_info = Json_data if isinstance(Json_data, list) else Json_data["json"]
with open(path, "w") as f:
json.dump(all_run_id_info, f, indent=2)
MainDriverApi.main(device_dict, user_info_object, all_run_id_info)
MainDriverApi.main(device_dict, user_info_object)
except Exception as e:
exc_type, exc_obj, exc_tb = sys.exc_info()
fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]
Expand Down