Index: shared/scripts/configuration/config.py =================================================================== diff -u -rb7f4fef664182ef9b8be312166923cf6d040bd76 -redaed8bef65561113afab047c420fb310eb55295 --- shared/scripts/configuration/config.py (.../config.py) (revision b7f4fef664182ef9b8be312166923cf6d040bd76) +++ shared/scripts/configuration/config.py (.../config.py) (revision edaed8bef65561113afab047c420fb310eb55295) @@ -26,6 +26,9 @@ "Magenta":"#fd28fd", "Orange": "#f2721c", "Peach":"#f1979a", "Red": "#c53b33", "Rose":"#fc178d", "Slate blue":"#7f7ffa", "Violet": "#6435c9", "White": "#ffffff", "Yellow": "#fcfc4d"} +#Service password loction +SERVICE_CONF_LOCATION = os.environ['HOME']+"/Projects/application/resources/settings/Service.conf" + #standby mode GOODMORNING_START_TIME_SEC = 0 GOODEVENING_START_TIME_SEC = 43200 @@ -37,5 +40,8 @@ BRIGHTNESS_MAX_VAL = 100 VOLUME_MIN_VAL = 20 VOLUME_MAX_VAL = 100 - - +DEVICE_SETTINGS_TEXT = "Device Settings" +SERVICE_TEXT = "Service" +PASSWORD = 123 +CONFIRM_TEXT = "CONFIRM" +SERVICE_BACK_BTN = "BACK" Index: shared/scripts/configuration/utility.py =================================================================== diff -u -r60052e368730f397362b57a0d216da2785fe51c9 -redaed8bef65561113afab047c420fb310eb55295 --- shared/scripts/configuration/utility.py (.../utility.py) (revision 60052e368730f397362b57a0d216da2785fe51c9) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision edaed8bef65561113afab047c420fb310eb55295) @@ -11,8 +11,11 @@ # @date (last) 15-Jan-2022 # ############################################################################ - +import names import squish +import test +import csv +from dialin.ui import utils from builtins import int as pyInt @@ -64,4 +67,24 @@ return True return False - \ No newline at end of file + +def keyboard_input(key_value): + names.o_keyboard_object["text"] = key_value + return names.o_keyboard_object + +def enter_keyboard_numeric_value(entry): + """ + Method to enter user desired + value using keypad + @param entry: (str) User expected value + """ + test.startSection("Entering {}".format(entry)) + for value in entry: + if value.isalpha(): + value = pyStr(value) + else: + value = pyInt(value) + key_val = squish.waitForObject(keyboard_input(value)) + squish.mouseClick(key_val) + utils.waitForGUI(0.1) + test.endSection() \ No newline at end of file Index: shared/scripts/names.py =================================================================== diff -u -r2c7da26ac2ba169d208a91e591ff7a1e494abead -redaed8bef65561113afab047c420fb310eb55295 --- shared/scripts/names.py (.../names.py) (revision 2c7da26ac2ba169d208a91e591ff7a1e494abead) +++ shared/scripts/names.py (.../names.py) (revision edaed8bef65561113afab047c420fb310eb55295) @@ -56,6 +56,7 @@ #settings_Home +o_SettingsBase_SettingsBase = {"container": o_Gui_MainView, "objectName": "_SettingsBase", "type": "SettingsBase", "visible": True} o_settings_Text = {"container": o_Gui_MainView, "text": "Settings", "type": "Text", "unnamed": 1, "visible": True} o_SettingsHome_SettingsHome = {"container": o_Gui_MainView, "objectName": "_SettingsHome", "type": "SettingsHome", "visible": True} o_settings_home_text_obj = {"container": o_SettingsHome_SettingsHome, "type": "Text", "unnamed": 1, "visible": True} @@ -74,8 +75,8 @@ device_settings_screen = {"container": o_Gui_MainView, "text": "Treatment", "type": "Text", "unnamed": 1, "visible": True} o_SettingsHome_SettingsHome_2 = {"container": o_Gui_MainView, "objectName": "_SettingsHome", "type": "SettingsHome", "visible": True} o_SettingsHome_Wi_Fi_Text = {"container": o_SettingsHome_SettingsHome_2, "text": "Wi-Fi", "type": "Text", "unnamed": 1, "visible": True} -o_Gui_MainView_2 = {"type": "Gui::MainView", "unnamed": 1, "visible": True} -o_SettingsBase_SettingsWiFi = {"container": o_Gui_MainView_2, "objectName": "_SettingsBase", "type": "SettingsWiFi", "visible": True} +o_Gui_MainView = {"type": "Gui::MainView", "unnamed": 1, "visible": True} +o_SettingsBase_SettingsWiFi = {"container": o_Gui_MainView, "objectName": "_SettingsBase", "type": "SettingsWiFi", "visible": True} o_SettingsBase_Wi_Fi_Text = {"container": o_SettingsBase_SettingsWiFi, "text": "Wi-Fi", "type": "Text", "unnamed": 1, "visible": True} o_SettingsBase_IP_Address_Text = {"container": o_SettingsBase_SettingsWiFi, "text": "IP Address", "type": "Text", "unnamed": 1, "visible": True} o_SettingsBase_Gateway_Text = {"container": o_SettingsBase_SettingsWiFi, "text": "Gateway", "type": "Text", "unnamed": 1, "visible": True} @@ -86,18 +87,35 @@ o_SettingsHome_Bluetooth_Cuff_Text = {"container": o_SettingsHome_SettingsHome_2, "text": "Bluetooth Cuff", "type": "Text", "visible": True} o_SettingsBase_Devices_Label = {"container": o_SettingsBase_SettingsBase, "text": "Devices", "type": "Label", "unnamed": 1, "visible": True} o_SettingsBase_Bluetooth_Cuff_Text = {"container": o_SettingsBase_SettingsBase, "text": "Bluetooth Cuff", "type": "Text", "unnamed": 1, "visible": True} -o_SettingsBase_SettingsDG = {"container": o_Gui_MainView_2, "objectName": "_SettingsBase", "type": "SettingsDG", "visible": True} +o_SettingsBase_SettingsDG = {"container": o_Gui_MainView, "objectName": "_SettingsBase", "type": "SettingsDG", "visible": True} o_SettingsBase_DG_Cleaning_Text = {"container": o_SettingsBase_SettingsDG, "text": "DG Cleaning", "type": "Text", "unnamed": 1, "visible": True} o_SettingsHome_DG_Cleaning_Text = {"container": o_SettingsHome_SettingsHome_2, "text": "DG Cleaning", "type": "Text", "unnamed": 1, "visible": True} o_SettingsBase_Water_Flush_Text = {"container": o_SettingsBase_SettingsDG, "text": "Water Flush", "type": "Text", "unnamed": 1, "visible": True} o_SettingsBase_Heat_Disinfection_Text = {"container": o_SettingsBase_SettingsDG, "text": "Heat Disinfection", "type": "Text", "unnamed": 1, "visible": True} o_SettingsBase_Chemical_Disinfection_Text = {"container": o_SettingsBase_SettingsDG, "text": "Chemical Disinfection", "type": "Text", "unnamed": 1, "visible": True} o_SettingsBase_backButton_BackButton = {"container": o_SettingsBase_SettingsWiFi, "gradient": 0, "objectName": "_backButton", "type": "BackButton", "visible": True} -o_back_button = {"container": o_Gui_MainView_2, "text": "BACK", "type": "Text", "unnamed": 1, "visible": False} +o_back_button = {"container": o_Gui_MainView, "text": "BACK", "type": "Text", "unnamed": 1, "visible": False} o_SettingsBase_SCAN_Text_2 = {"container": o_SettingsBase_SettingsBase, "text": "SCAN", "type": "Text", "unnamed": 1, "visible": True} o_SettingsBase_ssidText_Text = {"container": o_SettingsBase_SettingsWiFi, "id": "_ssidText", "type": "Text", "unnamed": 1, "visible": True} o_SettingsBase_input_TextInput = {"container": o_SettingsBase_SettingsWiFi, "echoMode": 0, "id": "_input", "type": "TextInput", "unnamed": 1, "visible": True} o_SettingsBase_input_TextInput_2 = {"container": o_SettingsBase_SettingsWiFi, "echoMode": 0, "id": "_input", "type": "TextInput", "unnamed": 1, "visible": True} o_SettingsBase_input_TextInput_3 = {"container": o_SettingsBase_SettingsWiFi, "echoMode": 0, "id": "_input", "type": "TextInput", "unnamed": 1, "visible": True} o_SettingsBase_input_TextInput_4 = {"container": o_SettingsBase_SettingsWiFi, "echoMode": 0, "id": "_input", "type": "TextInput", "unnamed": 1, "visible": True} + + +o_services_screen_text_obj = {"container": o_SettingsBase_SettingsBase, "type": "Text", "unnamed": 1, "visible": True} +o_settings_text = {"container":o_Gui_MainView , "text": "Settings", "type": "Text", "unnamed": 1, "visible": True} +o_service_text = {"container": o_Gui_MainView , "text": "Service", "type": "Text", "unnamed": 1, "visible": True} +o_userConfirmation_UserConfirmation = {"container": o_Gui_MainView, "objectName": "UserConfirmation", "type": "UserConfirmation", "visible": True} +o_service_text_title = {"container": o_userConfirmation_UserConfirmation, "text": "Service Password", "type": "Text", "unnamed": 1, "visible": True} +o_password_text_field = {"container": o_userConfirmation_UserConfirmation, "id": "_password", "type": "TextEntry", "unnamed": 1, "visible": True} +o_show_password = {"container": o_userConfirmation_UserConfirmation, "id": "_showPassword", "source": "qrc:/images/iEye", "type": "Image", "unnamed": 1, "visible": True} +o_switch_keyboard_to_keypad = {"container": o_Gui_MainView, "text": "&123", "type": "Text", "unnamed": 1, "visible": True} o_keyboard_object = {"container": o_Gui_MainView, "type": "Text", "unnamed": 1, "visible": True} +#virtal keypad input field +o_keypad_input = {"container": o_Gui_MainView, "id": "_keyText", "type": "Text", "unnamed": 1, "visible": True} +#virtal keypad back space key +o_back_space_key = {"container": o_Gui_MainView, "id": "_backspaceKeyIcon", "source": "qrc:/plugins/QtQuick/VirtualKeyboard/Styles/denali/images/iBackspace.svg", "type": "Image", "unnamed": 1, "visible": True} +o_service_confirm_btn = {"container": o_userConfirmation_UserConfirmation, "text": "CONFIRM", "type": "Text", "unnamed": 1, "visible": True} +o_userConfirmation_backButton_BackButton = {"container": o_userConfirmation_UserConfirmation, "gradient": 0, "objectName": "_backButton", "type": "BackButton", "visible": True} +o_service_back_btn = {"container": o_Gui_MainView, "type": "Text", "unnamed": 1, "visible": True} Index: tst_settings_information/test.py =================================================================== diff -u -r2c7da26ac2ba169d208a91e591ff7a1e494abead -redaed8bef65561113afab047c420fb310eb55295 --- tst_settings_information/test.py (.../test.py) (revision 2c7da26ac2ba169d208a91e591ff7a1e494abead) +++ tst_settings_information/test.py (.../test.py) (revision edaed8bef65561113afab047c420fb310eb55295) @@ -20,12 +20,14 @@ from dialin.utils.conversions import unsigned_integer_to_bytearray from dialin.ui.hd_simulator import HDSimulator from dialin.ui.dg_simulator import DGSimulator -from dialin.common.hd_defs import HDOpModes +from configuration.config import SERVICE_CONF_LOCATION +from dialin.common.hd_defs import HDOpModes,HDOpSubModes from dialin.ui import utils hd_simulator = HDSimulator() dg_simulator = DGSimulator() + DAY_3 = 3 DAY_25 = 25 DAY_12 = 12 @@ -50,8 +52,13 @@ BRIGHTNESS_BUFFER = 20 VOLUME_BUFFER = 20 VOLUME_RANGE = [80, 40, 20, 100, 60] +SERVICES_TITLE_TEXT = "Service Password" +INCORRECT_PASSWORD = "abcd" +INCORRECT_PASSWORD_MSG = "Incorrect service password" - +def services_screen_text_obj(text): + names.o_services_screen_text_obj["text"] = text + return names.o_services_screen_text_obj def settings_text_obj(text): names.o_settings_home_text_obj["text"] = text @@ -355,6 +362,52 @@ mouseClick(waitForObjectExists(names.o_keyboard_object)) test.endSection() +def navigate_to_service_password_screen(): + """ +        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") + hd_simulator.cmd_send_hd_operation_mode(op_mode=HDOpModes.MODE_STAN.value, sub_mode=HDOpSubModes.STANDBY_START_STATE.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.compare(waitForObjectExists(names.o_service_text).text,config.SERVICE_TEXT, "{} screen is displayed".format(config.SERVICE_TEXT)) + mouseClick(waitForObjectExists(names.o_service_text)) + services_password_title = (waitForObjectExists(names.o_service_text_title).text) + test.compare(services_password_title, SERVICES_TITLE_TEXT, "{} should display once user is navigated to services password screen".format(SERVICES_TITLE_TEXT)) + 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))) + confirm_button = (waitForObjectExists(names.o_service_confirm_btn).text) + test.compare(confirm_button, config.CONFIRM_TEXT, "Button text should be {}".format(config.CONFIRM_TEXT)) + mouseClick(waitForObjectExists(names.o_service_confirm_btn)) + utils.waitForGUI(0.5) + mouseClick(waitForObjectExists(names.o_service_text)) + test.compare(waitForObjectExists(names.o_service_back_btn).text, config.SERVICE_BACK_BTN, "Button text should be {}".format(config.SERVICE_BACK_BTN)) + mouseClick(waitForObjectExists(names.o_service_back_btn)) + utils.waitForGUI(1) + test.endSection() + + def main(): utils.tstStart(__file__) @@ -385,30 +438,32 @@ hd_serial="HD09876543210987", dg_major=100, dg_minor=95, dg_micro=105, dg_build=1000, dg_fpga_id=124, dg_fpga_major=75, dg_fpga_minor=65, dg_fpga_lab=125, dg_compatibility_rev=4000, dg_serial="DG9876543210987") - + utils.waitForGUI(0.5) verify_service_date(hd_day=DAY_3, hd_month=MONTH_NOVEMBER, hd_year=YEAR_2022, hd_interval_days=INTERVAL_DAYS_2_YEARS, dg_day=DAY_25, dg_month=MONTH_JAN, dg_year=YEAR_1977, dg_interval_days=INTERVAL_DAYS_1_YEARS) - + utils.waitForGUI(0.5) verify_service_date(hd_day=DAY_25, hd_month=MONTH_JAN, hd_year=YEAR_1977, hd_interval_days=INTERVAL_DAYS_1_YEARS, dg_day=DAY_12, dg_month=MONTH_APRIL, dg_year=YEAR_2001, dg_interval_days=INTERVAL_DAYS_6_MONTHS) - + utils.waitForGUI(0.5) verify_service_date(hd_day=DAY_12, hd_month=MONTH_APRIL, hd_year=YEAR_2001, hd_interval_days=INTERVAL_DAYS_6_MONTHS, dg_day=DAY_30, dg_month=MONTH_AUGUST, dg_year=YEAR_2045, dg_interval_days=INTERVAL_DAYS_10_MONTHS) - + utils.waitForGUI(0.5) verify_service_date(hd_day=DAY_30, hd_month=MONTH_AUGUST, hd_year=YEAR_2045, hd_interval_days=INTERVAL_DAYS_10_MONTHS, dg_day=DAY_3, dg_month=MONTH_NOVEMBER, dg_year=YEAR_2022, dg_interval_days=INTERVAL_DAYS_2_YEARS) - + test.log("Navigating to 'Settings' screen") mouseClick(waitForObjectExists(service_date_obj(config.BACK_TEXT))) utils.waitForGUI(0.5) test.log("Navigating to 'Volume and Brightness' screen") mouseClick(waitForObjectExists(settings_text_obj(config.VOLUME_AND_BRIGHTNESS_TEXT))) verify_volume_and_brightness_section() - + verify_alarm_volume() - + verify_wifi_setting() verify_bluetooth_cuff_setting() verify_dg_cleaning_setting() + navigate_to_service_password_screen() + utils.tstDone() \ No newline at end of file