Index: shared/scripts/configuration/strings.py =================================================================== diff -u -ra81fa769324346dd2b15d19a869a83b91a3d3877 -r3cfcbf4c6dc09214cdbde312a5e5c7a90970e975 --- shared/scripts/configuration/strings.py (.../strings.py) (revision a81fa769324346dd2b15d19a869a83b91a3d3877) +++ shared/scripts/configuration/strings.py (.../strings.py) (revision 3cfcbf4c6dc09214cdbde312a5e5c7a90970e975) @@ -22,7 +22,7 @@ EXPORT_TEXT ="Export Logs" SHUTDOWN_BUTTON_TEXT = "SHUTDOWN" BACK_BUTTON_TEXT = "BACK" -EXPORT_LOGS_OPTIONS = ["Application", "Service", "Treatment"] +EXPORT_LOGS_OPTIONS = ["Application", "Treatment", "Service"] SD_CARD_DETAILS =["SD-Card (MB)", "Free : 0.000","Total: 0.000"] USB_DRIVE_DETAILS = ["USB Drive (MB)","Free : 0.000","Total: 0.000"] EXPORT_BUTTON_TEXT = "Export" Index: shared/scripts/names.py =================================================================== diff -u -r06d29555beb8ba4c368040050afe740cb3233d0f -r3cfcbf4c6dc09214cdbde312a5e5c7a90970e975 --- shared/scripts/names.py (.../names.py) (revision 06d29555beb8ba4c368040050afe740cb3233d0f) +++ shared/scripts/names.py (.../names.py) (revision 3cfcbf4c6dc09214cdbde312a5e5c7a90970e975) @@ -62,9 +62,14 @@ o_back_btn = {"container": o_Gui_MainView, "type": "Text", "unnamed": 1, "visible": True} o_export_logs_text = {"container": o_SettingsBase_SettingsBase, "text": "Export Logs", "type": "Text", "unnamed": 1, "visible": True} o_combo_box_base_object={"container": o_SettingsBase_SettingsBase, "id": "_logTypeRow", "type": "Row", "unnamed": 1, "visible": True} -o_combo_box={"container": o_combo_box_base_object, "id": "_logTypeCombo", "type": "ComboBox", "unnamed": 1, "visible": True} -o_treatment_comno_box={"checkable": False, "container": o_Overlay, "id": "_logTypeDelegate", "occurrence": 1, "type": "ItemDelegate", "unnamed": 1, "visible": True} -o_service_combo_box={"checkable": False, "container": o_Overlay, "id": "_logTypeDelegate", "text":"Service", "type": "ItemDelegate", "unnamed": 1, "visible": True} +o_combo_box= {"container": o_SettingsBase_SettingsBase, "id": "_logTypeCombo", "type": "ComboBox", "unnamed": 1, "visible": True} + +o_option_combo_box={"container": o_Overlay, "type": "Text", "unnamed": 1, "visible": True} + + + +#o_option_combo_box={"checkable": False, "container": o_Overlay, "id": "_logTypeDelegate", "type": "ItemDelegate", "unnamed": 1, "visible": True} +#o_service_combo_box={"checkable": False, "container": o_Overlay, "id": "_logTypeDelegate", "text":"Service", "type": "ItemDelegate", "unnamed": 1, "visible": True} o_combo_box_text={"container": o_SettingsBase_SettingsBase, "echoMode": 0, "type": "TextField", "unnamed": 1, "visible": True} #SD Card Information o_sd_card_text = {"container": o_SettingsBase_SettingsBase, "text": "SD-Card (MB)\nFree : 0.000\nTotal: 0.000", "type": "Label", "unnamed": 1, "visible": True} @@ -86,8 +91,12 @@ o_shutdown_text = {"container": o_Gui_MainView, "text": "SHUTDOWN", "type": "Text", "unnamed": 1, "visible": True} #alarm minimize button o_minimize_button = {"container": o_Overlay, "id": "_image", "source": "qrc:/images/iChevronDown", "type": "Image", "unnamed": 1, "visible": True} +o_logTypeDelegate_ItemDelegate = {"checkable": False, "container": o_Overlay, "occurrence": 1, "type": "ItemDelegate", "unnamed": 1, "visible": True} +o_checkable_false_container_container_o_Gui_MainView_type_Overlay_unnamed_1_visible_true_id_logTypeDelegate_occurrence_3_type_ItemDelegate_unnamed_1_visible_true_Text_1 = "{checkable='false' container={container=':o_Gui_MainView' type='Overlay' unnamed='1' visible='true'} id='_logTypeDelegate' occurrence='3' type='ItemDelegate' unnamed='1' visible='true'}.Text_1" + + Index: tst_service_screen/test.py =================================================================== diff -u -r06d29555beb8ba4c368040050afe740cb3233d0f -r3cfcbf4c6dc09214cdbde312a5e5c7a90970e975 --- tst_service_screen/test.py (.../test.py) (revision 06d29555beb8ba4c368040050afe740cb3233d0f) +++ tst_service_screen/test.py (.../test.py) (revision 3cfcbf4c6dc09214cdbde312a5e5c7a90970e975) @@ -28,6 +28,15 @@ hd_simulator = HDSimulator() + +def custom_object_for_export_log(text): + """ + Method to set object property based on text + @param text : (string) parameter text + """ + names.o_option_combo_box["text"] = text + return names.o_option_combo_box + def settings_text_obj(text): names.o_settings_home_text_obj["text"] = text return names.o_settings_home_text_obj @@ -45,10 +54,7 @@ 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(waitForObjectExists(names.o_shutdown_btn).text, config.SHUTDOWN_BUTTON_TEXT, "{} screen is displayed".format(config.SHUTDOWN_BUTTON_TEXT)) - test.endSection() + def verify_export_logs_screen(): """ @@ -58,29 +64,44 @@ test.log("Navigating to service screen to export log screen") mouseClick(waitForObjectExists(settings_text_obj(EXPORT_LOGS))) test.compare(waitForObjectExists(names.o_export_logs_text).text,config.EXPORT_TEXT,"{} should be under export logs screen ".format(config.EXPORT_TEXT)) -# 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)) -# mouseClick(waitForObjectExists(settings_text_obj(EXPORT_LOGS))) - combobox_dropdown = waitForObjectExists(names.o_combo_box ) - for option in range(3): + + for option in range(len(config.EXPORT_LOGS_OPTIONS)): + + utils.waitForGUI(1) mouseClick(waitForObjectExists(names.o_combo_box )) - test.compare(combobox_dropdown.text.option[0], config.EXPORT_LOGS_OPTIONS[0], "{} combo box is displayed".format(config.EXPORT_LOGS_OPTIONS[0])) - mouseClick(waitForObjectExists(names.o_combo_box )) - test.compare(waitForObjectExists(names.o_combo_box).text, config.EXPORT_LOGS_OPTIONS, "{} combo box is displayed".format(config.EXPORT_LOGS_OPTIONS)) + export_option = waitForObjectExists(custom_object_for_export_log(config.EXPORT_LOGS_OPTIONS[option])) + + utils.waitForGUI(1) + mouseClick(export_option) + test.compare(config.EXPORT_LOGS_OPTIONS[option], waitForObjectExists(names.o_combo_box ).displayText, "{} combo box is displayed") + + +def verify_export_functionality(): + """ + verify log before clicking export button and after clicking export button + """ + pass + + +def verify_device_shutdown(): - mouseClick(waitForObjectExists(names.o_export_btn )) - test.compare(waitForObjectExists(names.o_export_btn).text, config.EXPORT_BUTTON_TEXT,"{} screen is displayed".format(config.EXPORT_BUTTON_TEXT)) - test.endSection() + mouseClick(waitForObjectExists(names.o_shutdown_btn)) + mouseClick(waitForObjectExists(names.o_shutdown_btn)) + test.compare(waitForObjectExists(names.o_shutdown_btn).text, config.SHUTDOWN_BUTTON_TEXT, "{} screen is displayed".format(config.SHUTDOWN_BUTTON_TEXT)) + test.endSection() + + def main(): utils.tstStart(__file__) startApplication(config.AUT_NAME) navigate_to_settings_screen() + verify_export_logs_screen() + + verify_export_functionality() + verify_device_shutdown() + utils.tstDone()