Index: tst_cloud_sync - treatment_screen/test.py =================================================================== diff -u -rd996aaf31adc64849c4d3c5b13ca4b677ae6a4be -r0aa784ff8329e586d6f038069484da93a6ec5236 --- tst_cloud_sync - treatment_screen/test.py (.../test.py) (revision d996aaf31adc64849c4d3c5b13ca4b677ae6a4be) +++ tst_cloud_sync - treatment_screen/test.py (.../test.py) (revision 0aa784ff8329e586d6f038069484da93a6ec5236) @@ -19,14 +19,15 @@ import names import os import time -from dialin.ui.hd_simulator import HDSimulator from dialin.ui import utils from configuration import utility from configuration import config +from dialin.ui.hd_simulator import HDSimulator +from dialin.ui.dg_simulator import DGSimulator from dialin.common.hd_defs import HDOpModes, PreTreatmentSubModes, PostTreatmentStates from dialin.utils.conversions import float_to_bytearray, integer_to_bytearray,unsigned_integer_to_bytearray - +dg_simulator = DGSimulator() hd_simulator = HDSimulator() POST_TREATMENT_INSTRUCTION_COUNT = 2 @@ -39,6 +40,10 @@ DEVICE_FACTORY_RESET_REQUEST = '1639391827,1,0,2005,0' DEVICE_FACTORY_RESET_CONFIRM = '1639391827,1,0,1005,1,0' DEVICE_INFO_REQUEST = '1639391827,1,9,2002,0' +DG_VERSION_SERIAL_REQUEST = '1657706417,7,0,1001,3,,DG1234567890123,06300216' +HD_VERSION_SERIAL_REQUEST = '1657706411,1,0,1001,3,HD1234567890123,,06300216' +DEVICE_HD_INFO_RESPONSE = '1639391827,1,0,1002,3,HD1234567890123,,sw_version' +DEVICE_DG_INFO_RESPONSE = '1639391827,1,0,1002,3,,DG1234567890123,sw_version' @@ -66,11 +71,10 @@ @input: (string) message - expected message to be write on out.buf file. """ cloud_out_log = utility.get_cloud_sync_output_file() - with open(cloud_out_log, "w") as filereader: filereader.write(message) test.log("User written message - %s into out.buf file" %message) - utils.waitForGUI(1) + utils.waitForGUI(3) def verify_log_response(actual_cloudsync_data, expected_cloudsync_data): @@ -99,6 +103,9 @@ startApplication(config.AUT_NAME) utils.waitForGUI(1.5) + main_item = waitForObjectExists(names.o_mainItem_Item) + expected_software_version = str(object.children(main_item)[5]) + set_data_in_cloud_sync_output_file(CODE_DISPLAY_REQUEST) verify_code_from_treatment_response() @@ -109,6 +116,18 @@ set_data_in_cloud_sync_output_file(DEVICE_FACTORY_RESET_REQUEST) factory_reset_response = utility.retrive_log_data() verify_log_response(factory_reset_response[0], DEVICE_FACTORY_RESET_CONFIRM) + + HD_VERSION = HD_VERSION_SERIAL_REQUEST.split(",") + hd_simulator.cmd_send_serial_hd_data(HD_VERSION[5]) + set_data_in_cloud_sync_output_file(DEVICE_INFO_REQUEST) + device_credentials_response = utility.retrive_log_data() + verify_log_response(device_credentials_response[0], DEVICE_HD_INFO_RESPONSE) + + DG_VERSION = DG_VERSION_SERIAL_REQUEST.split(",") + dg_simulator.cmd_send_serial_dg_data(DG_VERSION[6]) + set_data_in_cloud_sync_output_file(DEVICE_INFO_REQUEST) + device_credentials_response = utility.retrive_log_data() + verify_log_response(device_credentials_response[0], DEVICE_DG_INFO_RESPONSE) utils.tstDone()