#-*- 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, HDOpSubModes from dialin.ui import utils EXPORT_LOGS = "EXport Logs" SERVICE_SCREEN_OPTIONS = ["Information", "Volume And Brightness", "Wi-Fi", "Bluetooth Cuff", "DG Cleaning", "Service", "Export Logs"] 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_SERV.value, sub_mode=HDOpSubModes.STANDBY_START_STATE.value) utils.waitForGUI(1) device_settings_text = waitForObjectExists(settings_text_obj(config.SERIVCES_TITLE)) test.compare(device_settings_text.text, config.SERIVCES_TITLE, "{} screen is displayed".format(config.SERIVCES_TITLE)) verify_export_logs_screen() mouseClick(waitForObjectExists(names.o_shutdown_btn)) test.compare(device_settings_text.text, config.SHUTDOWN_BUTTON_TEXT, "{} screen is displayed".format(config.SHUTDOWN_BUTTON_TEXT)) test.compare(device_settings_text.text, config.SERIVCES_TITLE, "{} screen is displayed".format(config.SERIVCES_TITLE)) test.endSection() def verify_export_logs_screen(): """ Method to verify the export logs screen """ test.startSection("Verifying the the export logs screen") test.log("Navigating to service screen to export log screen") utils.waitForGUI(0.3) mouseClick(waitForObjectExists(settings_text_obj(EXPORT_LOGS))) for logs in config.EXPORT_LOGS_OPTIONS: logs_export = waitForObjectExists(services_screen_text_obj(logs)) test.compare(logs_export.text, logs, "{} should be available under export logs screen".format(logs)) mouseClick(waitForObjectExists(names.o_back_btn)) test.compare(services_screen_text_obj.text, config.BACK_BUTTON_TEXT, "{} screen is displayed".format(config.BACK_BUTTON_TEXT)) test.endSection() def main(): utils.tstStart(__file__) startApplication(config.AUT_NAME) navigate_to_settings_screen() utils.tstDone()