Index: tst_service_screen/test.py =================================================================== diff -u -r57abbbcfc39587f32292187aa6eaabbb7fed7942 -r9be88a63518e20aaf78071ed743c4bf457019b50 --- tst_service_screen/test.py (.../test.py) (revision 57abbbcfc39587f32292187aa6eaabbb7fed7942) +++ tst_service_screen/test.py (.../test.py) (revision 9be88a63518e20aaf78071ed743c4bf457019b50) @@ -41,6 +41,15 @@ return names.o_settings_home_text_obj +def text_obj(text): + """ + Method to set custom object property for information screen. + @param text : (string) parameter text + """ + names.o_SettingsBase_Information_Text["text"] = text + return names.o_SettingsBase_Information_Text + + def navigate_to_settings_screen(): """ Method to navigate to "Settings" screen @@ -53,6 +62,120 @@ test.endSection() +def verify_settings_parameters(): + """ + Method to verify the parameters of 'Service' screen + """ + test.startSection("Verify the parameters of Service screen") + for parameter in config.SERVICE_SCREEN_PARAMETER: + parameter_text = waitForObjectExists(settings_text_obj(parameter)) + test.compare(parameter_text.text, parameter, "{} should be available under 'Service' screen".format(parameter)) + test.endSection() + + +def verify_parameters_under_information(): + """ + Method to verify the parameter under 'Information' + """ + test.startSection("Verify the parameter under Information screen") + test.log("Navigating to 'Information' screen") + mouseClick(waitForObjectExists(names.o_SettingsHome_touchItem_TouchRect_service_information)) + for title in config.INFORMATION_TITLES: + title_text = waitForObjectExists(text_obj(title)) + test.compare(title_text.text, title, "{} should be available".format(title)) + + for info_parameter in config.VERSION_PARAMETERS: + info_parameter_text = waitForObjectExists(text_obj(info_parameter)) + test.compare(info_parameter_text.text, info_parameter, "{} should be available under 'Information'".format(info_parameter)) + + test.log("Verifying services title and parameters") + services_text = waitForObjectExists(text_obj(config.SERIVCES_TITLE)) + test.compare(services_text.text, config.SERIVCES_TITLE, "Service title should be {}".format(config.SERIVCES_TITLE)) + + for services_parameter in config.SERVICES_PARAMETERS: + services_par_text = waitForObjectExists(text_obj(services_parameter)) + test.compare(services_par_text.text, services_parameter, "{} should be available under service tile".format(services_parameter)) + mouseClick(waitForObjectExists(names.o_SettingsBase_backbutton_service_information_mouseArea_MouseArea_2)) + test.endSection() + + +def verify_volume_and_brightness_section(): + """ + Method to verify "Volume and Brightness" screen in service + """ + test.startSection("Verifying volume and brightness screen") + test.log("Verifying the title text of 'Volume And Brightness' screen") + utils.waitForGUI(0.5) + mouseClick(waitForObjectExists(names.o_SettingsHome_mousearea_service_volume_and_brightness)) + volume_and_brightness_text = waitForObjectExists(text_obj(config.VOLUME_AND_BRIGHTNESS_TEXT)) + test.compare(volume_and_brightness_text.text, config.VOLUME_AND_BRIGHTNESS_TEXT, "Volume and Brightness text should be {}".format(config.VOLUME_AND_BRIGHTNESS_TEXT)) + brightness_text = waitForObjectExists(text_obj(config.BRIGHTNESS_TEXT)) + test.compare(brightness_text.text, config.BRIGHTNESS_TEXT,"Brightness title text should be {}".format(config.BRIGHTNESS_TEXT)) + alarm_volume_text = waitForObjectExists(text_obj(config.ALARM_VOLUME_TEXT)) + test.compare(alarm_volume_text.text, config.ALARM_VOLUME_TEXT,"Alarm Volume text should be {}".format(config.ALARM_VOLUME_TEXT)) + notification_text = waitForObjectExists(text_obj(config.NOTIFICATION_MESSAGE_TEXT)) + test.compare(notification_text.text, config.NOTIFICATION_MESSAGE_TEXT, "{} notification message is displayed and should be The response value is incorrect. [1007]".format(config.NOTIFICATION_MESSAGE_TEXT)) + back_btn = waitForObjectExists(text_obj(config.BACK_TEXT)) + test.compare(back_btn.enabled , True, "Back button should be enabled") + utils.waitForGUI(0.5) + mouseClick(waitForObjectExists(names.o_SettingsBase_backbutton_service_vandb_mouseArea_MouseArea_3)) + utils.waitForGUI(1) + test.endSection() + + +def verify_wifi_setting(): + """ + Method to verify "Wi-Fi" screen in service + """ + test.startSection("Verifying Wi-Fi setting") + utils.waitForGUI(0.2) + mouseClick(waitForObjectExists(names.o_SettingsHome_mousearea_service_wifi)) + for services_parameter in config.WIFI_PARAMETERS_TEXTS: + services_par_text = waitForObjectExists(text_obj(services_parameter)) + test.compare(services_par_text.text, services_parameter, "{} should be available under Wi-Fi title".format(services_parameter)) + utils.waitForGUI(0.3) + mouseClick(waitForObjectExists(names.o_SettingsBase_service_wifi_scan_button_mouseArea_MouseArea_2)) + utils.waitForGUI(0.2) + mouseClick(waitForObjectExists(names.o_SettingsHome_backbutton_mousearea_service_wifi)) + test.endSection() + + +def verify_bluetooth_cuff_setting(): + """ + Method to verify "Bluetooth Cuff" screen in service + """ + test.startSection("Verifying Bluetooth Cuff Setting") + utils.waitForGUI(0.2) + mouseClick(waitForObjectExists(names.o_SettingsHome_mousearea_service_bluetooth_cuff)) + for services_parameter in config.BLUETOOTH_CUFF_PARAMETERS: + services_par_text = waitForObjectExists(text_obj(services_parameter)) + test.compare(services_par_text.text, services_parameter, "{} should be available under Bluetooth Cuff title".format(services_parameter)) + utils.waitForGUI(0.2) + mouseClick(waitForObjectExists(names.o_SettingsBase_service_bluetooth_cuff_scan_button_mouseArea_MouseArea_3)) + mouseClick(waitForObjectExists(names.o_SettingsBase_service_bluetooth_cuff_scan_button_mouseArea_MouseArea_3)) + utils.waitForGUI(0.2) + test.compare(waitForObjectExists(names.o_SettingsBase_The_Bluetooth_cuff_pair_clear_error_1001_Text).text, config.BLUETOOTH_CUFF_NOTIFICATION_MESSAGE_TEXT,"Notification Message Text must be {}".format(config.BLUETOOTH_CUFF_NOTIFICATION_MESSAGE_TEXT)) + mouseClick(waitForObjectExists(names.o_SettingsHome_backbutton_mousearea_service_bluetooth_cuff)) + test.endSection() + + +def verify_dg_cleaning_setting(): + """ + Method to verify "DG Cleaning" screen in service + """ + test.startSection("Verifying DG Cleaning setting") + utils.waitForGUI(0.2) + mouseClick(waitForObject(names.o_SettingsHome_mousearea_service_dg_cleaning)) + for services_parameter in config.DG_CLEANING_PARAMETERS: + services_par_text = waitForObjectExists(text_obj(services_parameter)) + test.compare(services_par_text.text, services_parameter, "{} should be available under Bluetooth Cuff title".format(services_parameter)) + utils.waitForGUI(0.2) + mouseClick(waitForObjectExists(names.o_SettingsBase_service_dg_cleaning_scan_button_mouseArea_MouseArea_4)) + utils.waitForGUI(0.2) + mouseClick(waitForObjectExists(names.o_SettingsHome_backbutton_mousearea_service_dg_cleaning)) + test.endSection() + + def get_storage_data_status(file_name): """ Method to verify the storage data exported or not exported. @@ -75,6 +198,7 @@ """ test.startSection("Verifying the the export logs screen") test.log("Navigating to service screen to export log screen") + utils.waitForGUI(0.3) mouseClick(waitForObjectExists(names.o_SettingsHome_export_log_mouseArea_MouseArea)) test.compare(waitForObjectExists(names.o_export_logs_text).text,config.EXPORT_LOG_TEXT,"{} should be under export logs screen ".format(config.EXPORT_LOG_TEXT)) log_status = get_storage_data_status(names.o_usb_folder_slider) @@ -91,7 +215,6 @@ mouseClick(export_option) test.compare(config.EXPORT_LOGS_OPTIONS[option], waitForObjectExists(names.o_combo_box ).displayText, "User should able to select {}".format(config.EXPORT_LOGS_OPTIONS[option])) utils.waitForGUI(1) - test.endSection() @@ -103,7 +226,7 @@ test.log("verification of progress bar color before exporting data") test.compare(waitForObjectExists(names.o_SettingsBase_progressCircle_ProgressCircle).color.name, config.RED_COLOR,"{} color progress bar is displayed for sd-card".format(config.RED_COLOR)) test.compare(waitForObjectExists(names.o_SettingsBase_progressCircle_ProgressCircle_2).color.name, config.GREEN_COLOR,"{} color progress bar is displayed for usb-drive".format(config.GREEN_COLOR)) - + utils.waitForGUI(0.2) mouseClick(waitForObjectExists(names.o_SettingsBase_export_button_mouseArea_MouseArea_2)) utils.waitForGUI(2) @@ -115,7 +238,7 @@ test.compare(waitForObjectExists(names.o_SettingsBase_progressCircle_ProgressCircle).color.name, config.RED_COLOR,"{} color progress bar is displayed for sd-card".format(config.RED_COLOR)) test.compare(waitForObjectExists(names.o_SettingsBase_progressCircle_ProgressCircle_2).color.name, config.GREEN_COLOR,"{} color progress bar is displayed for usb-drive".format(config.GREEN_COLOR)) - mouseClick(waitForObjectExists(names.o_SettingsBase_image_Image_export_log_eject_button )) + mouseClick(waitForObjectExists(names.o_SettingsBase_image_Image_export_log_eject_button )) ## test.compare(waitForObjectExists(names.o_export_btn).text, config.EXPORT_BUTTON_TEXT,"Export button text should be {}".format(config.EXPORT_BUTTON_TEXT)) test.compare(waitForObjectExists(names.o_export_btn).enabled, False, "Export button should be disabled") @@ -131,6 +254,7 @@ verify shutdown button after clicking export button """ test.startSection("verification of system shutdown option") + utils.waitForGUI(0.2) mouseClick(waitForObjectExists(names.o_SettingsBase_export_log_backButton_BackButton)) test.compare(waitForObjectExists(names.o_keyboard_object).text, config.SHUTDOWN_BUTTON_TEXT, "User should able to click {}".format(config.SHUTDOWN_BUTTON_TEXT)) utils.waitForGUI(1) @@ -141,6 +265,7 @@ hd_simulator.cmd_send_poweroff_button_pressed() mouseClick(waitForObjectExists(names.o_cancelTouch_TouchRect)) hd_simulator.cmd_send_poweroff_button_pressed() + utils.waitForGUI(0.2) mouseClick(waitForObjectExists(names.o_shutdownRect_TouchRect)) #0x0E00 #0x0E00 @@ -154,7 +279,12 @@ utils.tstStart(__file__) startApplication(config.AUT_NAME+ " -l") navigate_to_settings_screen() - + verify_settings_parameters() + verify_parameters_under_information() + verify_volume_and_brightness_section() + verify_wifi_setting() + verify_bluetooth_cuff_setting() + verify_dg_cleaning_setting() verify_export_logs_screen() verify_export_functionality() verify_device_shutdown()