Index: shared/scripts/configuration/config.py =================================================================== diff -u -rbc82fc2b60dcc4c9744c1809077ffbffba338073 -r630472cb04dff51e3ae61fabeb852fb75288eb63 --- shared/scripts/configuration/config.py (.../config.py) (revision bc82fc2b60dcc4c9744c1809077ffbffba338073) +++ shared/scripts/configuration/config.py (.../config.py) (revision 630472cb04dff51e3ae61fabeb852fb75288eb63) @@ -25,3 +25,7 @@ "Magenta":"#fd28fd", "Orange": "#f2721c", "Peach":"#f1979a", "Red": "#c53b33", "Rose":"#fc178d", "Slate blue":"#7f7ffa", "Violet": "#6435c9", "White": "#ffffff", "Yellow": "#fcfc4d"} +#standby mode +GOODMORNING_START_TIME_SEC = 0 +GOODEVENING_START_TIME_SEC = 43200 + Index: shared/scripts/configuration/utility.py =================================================================== diff -u -r43912429fcbd404b5a7820deb13fb69dfd61cb62 -r630472cb04dff51e3ae61fabeb852fb75288eb63 --- shared/scripts/configuration/utility.py (.../utility.py) (revision 43912429fcbd404b5a7820deb13fb69dfd61cb62) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision 630472cb04dff51e3ae61fabeb852fb75288eb63) @@ -16,9 +16,7 @@ import squish import test - from squish import * - from builtins import int as pyInt from configuration import config Index: shared/scripts/names.py =================================================================== diff -u -r43912429fcbd404b5a7820deb13fb69dfd61cb62 -r630472cb04dff51e3ae61fabeb852fb75288eb63 --- shared/scripts/names.py (.../names.py) (revision 43912429fcbd404b5a7820deb13fb69dfd61cb62) +++ shared/scripts/names.py (.../names.py) (revision 630472cb04dff51e3ae61fabeb852fb75288eb63) @@ -31,19 +31,19 @@ o_PreTreatmentBase_confirmButton_TouchRect = {"container": o_PreTreatmentCreateStack_PreTreatmentBase_TreatmentFlowBase, "gradient": 0, "objectName": "_confirmButton", "type": "TouchRect", "visible": True} #standbymode -patient_id = {"container": o_PreTreatmentCreateStack_PreTreatmentBase_TreatmentFlowBase, "echoMode": 0, "id": "_input", "type": "TextInput", "unnamed": 1, "visible": True} +o_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} -treatmentStack_TreatmentStack = {"container": o_Gui_MainView, "objectName": "TreatmentStack", "type": "TreatmentStack", "visible": True} -treatmentStack_TreatmentBloodPrime_ScreenItem = {"container": treatmentStack_TreatmentStack, "objectName": "_TreatmentBloodPrime", "type": "ScreenItem", "visible": True} +o_standby_page = {"container": o_MainHome_MainHome, "type": "Column", "unnamed": 1, "visible": True} +o_displayed_time = {"container": o_Gui_MainView, "text": "01/06/2022 02:22:07", "type": "Text", "unnamed": 1, "visible": True} +o_create_treatment_rectangle = {"container": o_MainHome_MainHome, "gradient": 0, "id": "_createTreatmentRect", "type": "TouchRect", "unnamed": 1, "visible": True} +o_treatmentStack_TreatmentStack = {"container": o_Gui_MainView, "objectName": "TreatmentStack", "type": "TreatmentStack", "visible": True} +o_treatmentStack_TreatmentBloodPrime_ScreenItem = {"container": o_treatmentStack_TreatmentStack, "objectName": "_TreatmentBloodPrime", "type": "ScreenItem", "visible": True} #in-treatment -blood_priming = {"container": treatmentStack_TreatmentBloodPrime_ScreenItem, "text": "Blood Priming", "type": "Text", "unnamed": 1, "visible": True} -blood_priming_value_by_default = {"container": treatmentStack_TreatmentBloodPrime_ScreenItem, "text": "0 mL", "type": "Text", "unnamed": 1, "visible": True} -treatmentStack_treatmentHome_TreatmentHome = {"container": treatmentStack_TreatmentStack, "id": "_treatmentHome", "type": "TreatmentHome", "unnamed": 1, "visible": True} +blood_priming = {"container": o_treatmentStack_TreatmentBloodPrime_ScreenItem, "text": "Blood Priming", "type": "Text", "unnamed": 1, "visible": True} +blood_priming_value_by_default = {"container": o_treatmentStack_TreatmentBloodPrime_ScreenItem, "text": "0 mL", "type": "Text", "unnamed": 1, "visible": True} +treatmentStack_treatmentHome_TreatmentHome = {"container": o_treatmentStack_TreatmentStack, "id": "_treatmentHome", "type": "TreatmentHome", "unnamed": 1, "visible": True} uf_minimum_value = {"container": treatmentStack_treatmentHome_TreatmentHome, "text": "0.000", "type": "Text", "unnamed": 1, "visible": True} uf_maximum_value = {"container": treatmentStack_treatmentHome_TreatmentHome, "text": "0.600", "type": "Text", "unnamed": 1, "visible": True} uf_minimum_value_pop_up = {"container": o_Overlay, "text": "0.000", "type": "Text", "unnamed": 1, "visible": True} Index: tst_standbymode/test.py =================================================================== diff -u -rc178841263d7366f577776e63b59bd562e5d4d72 -r630472cb04dff51e3ae61fabeb852fb75288eb63 --- tst_standbymode/test.py (.../test.py) (revision c178841263d7366f577776e63b59bd562e5d4d72) +++ tst_standbymode/test.py (.../test.py) (revision 630472cb04dff51e3ae61fabeb852fb75288eb63) @@ -1,24 +1,27 @@ +# -*- coding: utf-8 -*- +## +# Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. +# copyright +# THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, +# IN PART OR IN WHOLE, +# WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. +# +# file tst_standbymode +# author Joseph Varghese +# +# NOTE: +# This test contradicts verification of standby mode screen + 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 configuration import config 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 +from dialin.common.hd_defs import HDOpModes - def get_current_time(): """ Tests to get current time. @@ -35,28 +38,31 @@ return total_seconds -def verification_of_create_treatment_text(): +def verify_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] + standby_text = waitForObject(names.o_standby_page) + CREATE_TREATMENT_RECTANGLE_INDEX_VALUE = 1 + create_treatment = object.children(standby_text)[CREATE_TREATMENT_RECTANGLE_INDEX_VALUE] + CREATE_TREATMENT_TEXT_INDEX_VALUE = 1 + child = object.children(create_treatment)[CREATE_TREATMENT_TEXT_INDEX_VALUE] test.compare(child.text, "CREATE TREATMENT") -def verification_of_welcome_text_on_standby_mode(current_time): +def verify_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: + standby_text = waitForObject(names.o_standby_page) + STANDBY_TEXT_INDEX_VALUE = 0 + child = object.children(standby_text)[STANDBY_TEXT_INDEX_VALUE] + if current_time >= config.GOODMORNING_START_TIME_SEC and \ + current_time <= config.GOODEVENING_START_TIME_SEC: test.compare(child.text, "Good Morning") else: test.compare(child.text, "Good Evening") @@ -68,30 +74,13 @@ startApplication("denaliSquish") hd = HDSimulator() - #dg = DGSimulator() hd.cmd_send_power_on_self_test_version_request() - hd.cmd_send_hd_operation_mode(3) + hd.cmd_send_hd_operation_mode(HDOpModes.MODE_STAN.value) current_time = get_current_time() - verification_of_welcome_text_on_standby_mode(current_time) - sleep(0.5) - verification_of_create_treatment_text() + verify_welcome_text_on_standby_mode(current_time) + utils.waitForGUI(0.5) + verify_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")