Index: suite.conf =================================================================== diff -u -r8df6f936193bbd9127d3ec940562e62db0060bcb -r3840a7480f702f48ccfab1d624c3700527ec1ab2 --- suite.conf (.../suite.conf) (revision 8df6f936193bbd9127d3ec940562e62db0060bcb) +++ suite.conf (.../suite.conf) (revision 3840a7480f702f48ccfab1d624c3700527ec1ab2) @@ -1,6 +1,6 @@ AUT=denaliSquish LANGUAGE=Python OBJECTMAPSTYLE=script -TEST_CASES=tst_environment tst_post tst_standbymode tst_In_treatment +TEST_CASES=tst_environment tst_post tst_standbymode tst_In_treatment tst_service_screen VERSION=3 WRAPPERS=Qt Index: tst_service_screen/test.py =================================================================== diff -u --- tst_service_screen/test.py (revision 0) +++ tst_service_screen/test.py (revision 3840a7480f702f48ccfab1d624c3700527ec1ab2) @@ -0,0 +1,124 @@ +#-*- 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_settings_date_and_time +# date 05/26/2022 +# author Papiya Mandal +# author Amrita Debnath + +import builtins +import names + +from configuration import config, utility +from configuration.config import SERVICE_CONF_LOCATION +from dialin.ui.hd_simulator import HDSimulator +from dialin.common.hd_defs import HDOpModes +from dialin.ui import utils + +SERVICES_TITLE_TEXT = "Please Enter The Service Password" +SET_DATE_AND_TIME_TEXT = "Set Date And Time" +INCORRECT_PASSWORD = "abcd" +INCORRECT_PASSWORD_MSG = "Incorrect service password" +SERVICE_SCREEN_OPTIONS = ["Information", "Volume And Brightness", "Wi-Fi", "Bluetooth Cuff", "Dialysate Generator Settings", "Set Date And Time", "Set Language", "Software Update", "Factory Reset", "Calibration ", ] + +hd_simulator = HDSimulator() + +def settings_text_obj(text): + names.o_settings_home_text_obj["text"] = text + return names.o_settings_home_text_obj + +def services_screen_text_obj(text): + names.o_services_screen_text_obj["text"] = text + return names.o_services_screen_text_obj + +def navigate_to_settings_screen(): + """ + Method to navigate to "Settings" screen + """ + test.startSection("Navigating to 'Device Settings' screen") + hd_simulator.cmd_send_hd_operation_mode(op_mode=HDOpModes.MODE_STAN.value, sub_mode=HDOpModes.MODE_FAUL.value) + utils.waitForGUI(1) + mouseClick(waitForObjectExists(names.o_settings_Text)) + device_settings_text = waitForObjectExists(settings_text_obj(config.DEVICE_SETTINGS_TEXT)) + test.compare(device_settings_text.text, config.DEVICE_SETTINGS_TEXT, "{} screen is displayed".format(config.DEVICE_SETTINGS_TEXT)) + test.endSection() + +def verify_incorrect_password_msg(): + """ + Method to verify the message displayed + upon entering wrong password + """ + test.startSection("Verifying the functionalities with Incorrect password") + test.log("Clicking on password entry field") + utils.waitForGUI(0.3) + mouseClick(waitForObjectExists(names.o_password_text_field)) + utility.enter_keyboard_numeric_value(entry=str(INCORRECT_PASSWORD)) + mouseClick(waitForObjectExists(names.o_show_password)) + test.log("Verifying the entered password") + password = str((waitForObjectExists(names.o_password_text_field)).text) + test.compare(password, INCORRECT_PASSWORD, "Entered password should be {}".format(str(INCORRECT_PASSWORD))) + mouseClick(waitForObjectExists(services_screen_text_obj(config.CONFIRM_TEXT))) + incorrect_password_text = waitForObjectExists(settings_text_obj(INCORRECT_PASSWORD_MSG)) + test.compare(incorrect_password_text.text, INCORRECT_PASSWORD_MSG, "{} message should display upon entering wrong password".format(INCORRECT_PASSWORD_MSG)) + test.endSection() + +def navigate_to_services_password_screen_and_enter_password(): + """ + Method to navigate to services screen + and verify the "Please Enter The Service Password" + title is displayed and enter password, verify the + password and click on confirm button + """ + test.startSection("Navigating to 'services password' screen and enter password") + mouseClick(waitForObjectExists(settings_text_obj(config.SERIVCES_TITLE))) + services_password_title = waitForObjectExists(services_screen_text_obj(SERVICES_TITLE_TEXT)) + test.compare(services_password_title.text, SERVICES_TITLE_TEXT, "{} should display once user is navigated to services password screen".format(SERVICES_TITLE_TEXT)) + utils.waitForGUI(0.5) + verify_incorrect_password_msg() + utils.waitForGUI(0.5) + mouseClick(waitForObjectExists(settings_text_obj(config.SERIVCES_TITLE))) + utils.waitForGUI(0.5) + test.log("Clicking on password entry field") + utils.waitForGUI(0.5) + mouseClick(waitForObjectExists(names.o_switch_keyboard_to_keypad)) + mouseClick(waitForObjectExists(names.o_password_text_field)) + with open(SERVICE_CONF_LOCATION, "r") as file: + lines = file.readlines() + for index, line in enumerate(lines): + if "Service Password" in line: + services_password = lines[index+1][:-1] + break + else: + continue + utility.enter_keyboard_numeric_value(entry=str(services_password)) + mouseClick(waitForObjectExists(names.o_show_password)) + test.log("Verifying the entered password") + password = str((waitForObjectExists(names.o_password_text_field)).text) + test.compare(password, str(services_password), "Entered password should be {}".format(str(services_password))) + mouseClick(waitForObjectExists(services_screen_text_obj(config.CONFIRM_TEXT))) + utils.waitForGUI(0.5) + test.log("Verifying the 'Export' button") + test.compare(str(waitForObjectExists(settings_text_obj(config.EXPORT_TEXT)).text), config.EXPORT_TEXT,"'Export' button text should be {}".format(config.EXPORT_TEXT)) + utils.waitForGUI(0.1) + test.compare(waitForObjectExists(settings_text_obj(config.EXPORT_TEXT)).enabled , True, "'Export' button should be enabled") + test.log("Verifying the 'Shutdown' button enabled") + test.compare(str(waitForObjectExists(names.o_shutdown_text).text), config.SHUTDOWN_TEXT,"'SHUTDOWN' button text should be {}".format(config.SHUTDOWN_TEXT)) + test.compare(waitForObjectExists(names.o_shutdown_text).enabled , True, "'SHUTDOWN' button should be enabled") + for option in SERVICE_SCREEN_OPTIONS: + option_text = waitForObjectExists(settings_text_obj(option)) + test.compare(option_text.text, option, "{} should be available under services screen".format(option)) + test.endSection() + +def main(): + + utils.tstStart(__file__) + startApplication(config.AUT_NAME) + + navigate_to_settings_screen() + navigate_to_services_password_screen_and_enter_password() + utils.tstDone() Index: tst_settings_date_and_time/test.py =================================================================== diff -u -r1ffdc0cb8c3dcb23f1772d6bc94aa6a9604f106f -r3840a7480f702f48ccfab1d624c3700527ec1ab2 --- tst_settings_date_and_time/test.py (.../test.py) (revision 1ffdc0cb8c3dcb23f1772d6bc94aa6a9604f106f) +++ tst_settings_date_and_time/test.py (.../test.py) (revision 3840a7480f702f48ccfab1d624c3700527ec1ab2) @@ -71,25 +71,6 @@ device_settings_text = waitForObjectExists(settings_text_obj(config.DEVICE_SETTINGS_TEXT)) test.compare(device_settings_text.text, config.DEVICE_SETTINGS_TEXT, "{} screen is displayed".format(config.DEVICE_SETTINGS_TEXT)) test.endSection() - -def verify_incorrect_password_msg(): - """ - Method to verify the message displayed - upon entering wrong password - """ - test.startSection("Verifying the functionalities with Incorrect password") - test.log("Clicking on password entry field") - utils.waitForGUI(0.3) - mouseClick(waitForObjectExists(names.o_password_text_field)) - utility.enter_keyboard_numeric_value(entry=str(INCORRECT_PASSWORD)) - mouseClick(waitForObjectExists(names.o_show_password)) - test.log("Verifying the entered password") - password = str((waitForObjectExists(names.o_password_text_field)).text) - test.compare(password, INCORRECT_PASSWORD, "Entered password should be {}".format(str(INCORRECT_PASSWORD))) - mouseClick(waitForObjectExists(services_screen_text_obj(config.CONFIRM_TEXT))) - incorrect_password_text = waitForObjectExists(settings_text_obj(INCORRECT_PASSWORD_MSG)) - test.compare(incorrect_password_text.text, INCORRECT_PASSWORD_MSG, "{} message should display upon entering wrong password".format(INCORRECT_PASSWORD_MSG)) - test.endSection() def navigate_to_services_password_screen_and_enter_password(): """ @@ -103,12 +84,6 @@ services_password_title = waitForObjectExists(services_screen_text_obj(SERVICES_TITLE_TEXT)) test.compare(services_password_title.text, SERVICES_TITLE_TEXT, "{} should display once user is navigated to services password screen".format(SERVICES_TITLE_TEXT)) utils.waitForGUI(0.5) - verify_incorrect_password_msg() - utils.waitForGUI(0.5) - mouseClick(waitForObjectExists(settings_text_obj(config.SERIVCES_TITLE))) - utils.waitForGUI(0.5) - test.log("Clicking on password entry field") - utils.waitForGUI(0.5) mouseClick(waitForObjectExists(names.o_switch_keyboard_to_keypad)) mouseClick(waitForObjectExists(names.o_password_text_field)) with open(SERVICE_CONF_LOCATION, "r") as file: @@ -125,20 +100,9 @@ password = str((waitForObjectExists(names.o_password_text_field)).text) test.compare(password, str(services_password), "Entered password should be {}".format(str(services_password))) mouseClick(waitForObjectExists(services_screen_text_obj(config.CONFIRM_TEXT))) - utils.waitForGUI(0.5) - test.log("Verifying the 'Export' button") - test.compare(str(waitForObjectExists(settings_text_obj(config.EXPORT_TEXT)).text), config.EXPORT_TEXT,"'Export' button text should be {}".format(config.EXPORT_TEXT)) - utils.waitForGUI(0.1) - test.compare(waitForObjectExists(settings_text_obj(config.EXPORT_TEXT)).enabled , True, "'Export' button should be enabled") - test.log("Verifying the 'Shutdown' button enabled") - test.compare(str(waitForObjectExists(names.o_shutdown_text).text), config.SHUTDOWN_TEXT,"'SHUTDOWN' button text should be {}".format(config.SHUTDOWN_TEXT)) - test.compare(waitForObjectExists(names.o_shutdown_text).enabled , True, "'SHUTDOWN' button should be enabled") - for option in SERVICE_SCREEN_OPTIONS: - option_text = waitForObjectExists(settings_text_obj(option)) - test.compare(option_text.text, option, "{} should be available under services screen".format(option)) - test.endSection() - - + test.endSection() + + def navigate_to_set_date_and_time(): """ Method to navigate to set date and time