Index: shared/scripts/configuration/config.py =================================================================== diff -u -r0cc92d3b75bfb96dc4ecafd760a9ce15e455033b -r7bfa8590610e69d04dfa9ee4adafab65b60c187b --- shared/scripts/configuration/config.py (.../config.py) (revision 0cc92d3b75bfb96dc4ecafd760a9ce15e455033b) +++ shared/scripts/configuration/config.py (.../config.py) (revision 7bfa8590610e69d04dfa9ee4adafab65b60c187b) @@ -25,10 +25,6 @@ "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 - BLOOD_PRIMING_TEXT = "Blood Priming" SALINE_UNIT = "mL" BLOOD_PRIMING_DEFAULT_VALUE = "0 mL" Index: tst_standbymode/test.py =================================================================== diff -u -r0cc92d3b75bfb96dc4ecafd760a9ce15e455033b -r7bfa8590610e69d04dfa9ee4adafab65b60c187b --- tst_standbymode/test.py (.../test.py) (revision 0cc92d3b75bfb96dc4ecafd760a9ce15e455033b) +++ tst_standbymode/test.py (.../test.py) (revision 7bfa8590610e69d04dfa9ee4adafab65b60c187b) @@ -7,44 +7,42 @@ # IN PART OR IN WHOLE, # WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. # -# file tst_In_treatment -# date 2020/01/11 -# author Joseph Varghese -# +# file tst_standbymode +# date 2022/04/01 +# author Joseph varghese +# author Amol Shinde +# author Bhavana Savanth # NOTE: # This test contradicts verification of standbymode. import names import datetime import test -from time import sleep from dialin.ui import utils +from configuration import config,utility from dialin.ui.hd_simulator import HDSimulator -from configuration import utility, config -from builtins import int as pyInt +from dialin.common.hd_defs import HDOpModes +hd_simulator = HDSimulator() +MORNING_MIN = "05" +MORNING_MAX = "12" +AFTERNOON_MAX = "18" + 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(): + hours = current_time.split(':')[0] + return hours + +def verify_create_treatment_text(): """ Tests for verification of create treatment text. - @return: N/A """ standby_text = waitForObject(names.o_standby_page) @@ -53,17 +51,17 @@ 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.o_standby_page) child = object.children(standby_text)[0] - if current_time >= config.GOODMORNING_START_TIME_SEC and \ - current_time <= config.GOODEVENING_START_TIME_SEC: + if current_time >= MORNING_MIN and current_time < MORNING_MAX: test.compare(child.text, "Good Morning") + elif current_time >= MORNING_MAX and current_time < AFTERNOON_MAX: + test.compare(child.text, "Good Afternoon") else: test.compare(child.text, "Good Evening") @@ -73,16 +71,14 @@ utils.tstStart("tst_standbymode") utility.start_application(config.AUT_NAME) - hd = HDSimulator() - #dg = DGSimulator() - hd.cmd_send_power_on_self_test_version_request() - hd.cmd_send_hd_operation_mode(3) + hd_simulator.cmd_send_power_on_self_test_version_request() + hd_simulator.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) + verify_create_treatment_text() utils.tstDone() + \ No newline at end of file