Index: shared/scripts/names.py =================================================================== diff -u -rffb28af3cb1ae17c31092f9f96d14c2ec82adeea -rc178841263d7366f577776e63b59bd562e5d4d72 --- shared/scripts/names.py (.../names.py) (revision ffb28af3cb1ae17c31092f9f96d14c2ec82adeea) +++ shared/scripts/names.py (.../names.py) (revision c178841263d7366f577776e63b59bd562e5d4d72) @@ -2,3 +2,37 @@ from objectmaphelper import * +o_Gui_MainView = {"type": "Gui::MainView", "unnamed": 1, "visible": True} +o_Overlay = {"container": o_Gui_MainView, "type": "Overlay", "unnamed": 1, "visible": True} +o_borderRect_Rectangle = {"container": o_Overlay, "gradient": 0, "id": "_borderRect", "type": "Rectangle", "unnamed": 1, "visible": True} +o_minimizeButton_UpDownButton = {"container": o_Overlay, "gradient": 0, "id": "_minimizeButton", "type": "UpDownButton", "unnamed": 1, "visible": True} +o_shape_Shape = {"container": o_Gui_MainView, "id": "_shape", "type": "Shape", "unnamed": 1, "visible": True} +o_PreTreatmentCreateStack_PreTreatmentCreateStack = {"container": o_Gui_MainView, "objectName": "_PreTreatmentCreateStack", "type": "PreTreatmentCreateStack", "visible": True} +o_PreTreatmentCreateStack_PreTreatmentBase_TreatmentFlowBase = {"container": o_PreTreatmentCreateStack_PreTreatmentCreateStack, "objectName": "_PreTreatmentBase", "type": "TreatmentFlowBase", "visible": True} +o_PreTreatmentBase_titleBar_StepNavigationTitleBar = {"container": o_PreTreatmentCreateStack_PreTreatmentBase_TreatmentFlowBase, "gradient": 0, "id": "_titleBar", "type": "StepNavigationTitleBar", "unnamed": 1, "visible": True} +o_titleBar_Rectangle = {"container": o_Overlay, "gradient": 0, "id": "_titleBar", "type": "Rectangle", "unnamed": 1, "visible": True} +o_PreTreatmentBase_input_TextInput = {"container": o_PreTreatmentCreateStack_PreTreatmentBase_TreatmentFlowBase, "echoMode": 0, "id": "_input", "type": "TextInput", "unnamed": 1, "visible": True} +o_PreTreatmentBase_CONFIRM_Text = {"container": o_PreTreatmentCreateStack_PreTreatmentBase_TreatmentFlowBase, "text": "CONFIRM", "type": "Text", "unnamed": 1, "visible": True} +o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate = {"container": o_PreTreatmentCreateStack_PreTreatmentCreateStack, "objectName": "_PreTreatmentCreate", "type": "PreTreatmentCreate", "visible": True} +o_PreTreatmentCreate_bloodFlowRate_SliderCreateTreatment = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "gradient": 0, "objectName": "_bloodFlowRate", "type": "SliderCreateTreatment", "visible": True} +o_PreTreatmentCreate_bloodFlowRateSlider_Slider = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "gradient": 0, "objectName": "_bloodFlowRateSlider", "type": "Slider", "visible": True} +o_PreTreatmentCreate_dialysateFlowRate_SliderCreateTreatment = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "gradient": 0, "objectName": "_dialysateFlowRate", "type": "SliderCreateTreatment", "visible": True} +o_PreTreatementCreateStack_PreTreatmentBase_TreatmentFlowBase = {"container":o_PreTreatmentCreateStack_PreTreatmentBase_TreatmentFlowBase,"objectName":"_PreTreatmentBase","type":"TreatmentFlowBase", "visible": True} +back_b = {"container": o_PreTreatementCreateStack_PreTreatmentBase_TreatmentFlowBase, "gradient": 0, "objectName": "_backButton", "type": "BackButton", "visible": True} + +conform_c={"container": o_Gui_MainView, "gradient": 0, "objectName": "_confirmButton", "type": "TouchRect", "visible": False} +o_confirmButton_TouchRect = {"container": o_Gui_MainView, "gradient": 0, "objectName": "_confirmButton", "type": "TouchRect", "visible": False} +o_backButton_BackButton = {"container": o_Gui_MainView, "gradient": 0, "objectName": "_backButton", "type": "BackButton", "visible": False} +o_NinePatchImage = {"container": o_Gui_MainView, "occurrence": 6, "type": "NinePatchImage", "unnamed": 1, "visible": False} +o_PreTreatmentBase_backgroundRect_Rectangle = {"container": o_PreTreatmentCreateStack_PreTreatmentBase_TreatmentFlowBase, "gradient": 0, "id": "_backgroundRect", "type": "Rectangle", "unnamed": 1, "visible": True} +keyBackground_Rectangle = {"container": o_Gui_MainView, "gradient": 0, "id": "keyBackground", "type": "Rectangle", "unnamed": 1, "visible": True} +t_Text = {"container": o_Gui_MainView, "text": "t", "type": "Text", "unnamed": 1, "visible": True} +o_PreTreatmentBase_confirmButton_TouchRect = {"container": o_PreTreatmentCreateStack_PreTreatmentBase_TreatmentFlowBase, "gradient": 0, "objectName": "_confirmButton", "type": "TouchRect", "visible": True} + + +patient_id = {"container": o_PreTreatmentCreateStack_PreTreatmentBase_TreatmentFlowBase, "echoMode": 0, "id": "_input", "type": "TextInput", "unnamed": 1, "visible": True} +o_MainHome_MainHome = {"container": o_Gui_MainView, "objectName": "_MainHome", "type": "MainHome", "visible": True} +standby_page = {"container": o_MainHome_MainHome, "type": "Column", "unnamed": 1, "visible": True} +displayed_time = {"container": o_Gui_MainView, "text": "01/06/2022 02:22:07", "type": "Text", "unnamed": 1, "visible": True} +create_treatment_rectangle = {"container": o_MainHome_MainHome, "gradient": 0, "id": "_createTreatmentRect", "type": "TouchRect", "unnamed": 1, "visible": True} + Index: suite.conf =================================================================== diff -u -rffb28af3cb1ae17c31092f9f96d14c2ec82adeea -rc178841263d7366f577776e63b59bd562e5d4d72 --- suite.conf (.../suite.conf) (revision ffb28af3cb1ae17c31092f9f96d14c2ec82adeea) +++ suite.conf (.../suite.conf) (revision c178841263d7366f577776e63b59bd562e5d4d72) @@ -1,6 +1,6 @@ AUT=denaliSquish LANGUAGE=Python OBJECTMAPSTYLE=script -TEST_CASES=tst_post +TEST_CASES=tst_post tst_patientID_UI tst_standbymode tst_pre_treatment tst_case2 tst_case1 VERSION=3 WRAPPERS=Qt Index: tst_standbymode/test.py =================================================================== diff -u --- tst_standbymode/test.py (revision 0) +++ tst_standbymode/test.py (revision c178841263d7366f577776e63b59bd562e5d4d72) @@ -0,0 +1,97 @@ + +import names +import squish +import math +import datetime +import test +import sys +from time import sleep +from dialin.ui import utils +from dialin.ui import unittests + +from dialin.ui.hd_simulator import HDSimulator + +from builtins import str as pyStr +from builtins import int as pyInt +# from dialin.ui.dg_simulator import DGSimulator +# from dialin.ui.hd_simulator_alarms import HDAlarmsSimulator +GOODMORNING_START_TIME_SEC = 0 +GOODEVENING_START_TIME_SEC = 43200 + + +def get_current_time(): + """ + Tests to get current time. + + @return: current time in seconds + """ + now = datetime.datetime.now() + current_time = now.strftime("%H:%M:%S") + hours, minutes, seconds = current_time.split(':') + time_in_seconds = datetime.timedelta(hours = pyInt(hours), + minutes = pyInt(minutes), + seconds = pyInt(seconds)) + total_seconds = time_in_seconds.total_seconds() + return total_seconds + + +def verification_of_create_treatment_text(): + """ + Tests for verification of create treatment text. + + @return: N/A + """ + standby_text = waitForObject(names.standby_page) + create_treatment = object.children(standby_text)[1] + child = object.children(create_treatment)[1] + test.compare(child.text, "CREATE TREATMENT") + + +def verification_of_welcome_text_on_standby_mode(current_time): + """ + Tests to verify welcome text based on current time. + + @return: current time in seconds + """ + standby_text = waitForObject(names.standby_page) + child = object.children(standby_text)[0] + if current_time >= GOODMORNING_START_TIME_SEC and \ + current_time <= GOODEVENING_START_TIME_SEC: + test.compare(child.text, "Good Morning") + else: + test.compare(child.text, "Good Evening") + + +def main(): + + utils.tstStart("demo") + startApplication("denaliSquish") + + hd = HDSimulator() + #dg = DGSimulator() + hd.cmd_send_power_on_self_test_version_request() + hd.cmd_send_hd_operation_mode(3) + + current_time = get_current_time() + verification_of_welcome_text_on_standby_mode(current_time) + sleep(0.5) + verification_of_create_treatment_text() + + utils.tstDone() + + + #sleep(10) + #hd.logger.debug("Canceling treatment") + #hd.cmd_send_hd_operation_mode(HDOpModes.MODE_STAN.value) + #hd.logger.debug("Starting treatment") + #hd.cmd_send_hd_operation_mode(HDOpModes.MODE_TREA.value) + + #hd.cmd_initiate_treatment_response(YES, 0) + + + #hd.pre_treatment_on_selected_patient_id() + # hd.cmd_send_hd_post(0, True, True) + # hd.cmd_send_hd_operation_mode(4, 0) + + #hd.pre_treatment() + #hd._handler_ui_pre_treatment_uf_request("6")