Index: tst_service_screen/test.py =================================================================== diff -u -r4ffabb3d2d53942662c17b2d6dfd2b02b5895e29 -rc93470567d8adf60e6b64224c6cad7f9a2f674ac --- tst_service_screen/test.py (.../test.py) (revision 4ffabb3d2d53942662c17b2d6dfd2b02b5895e29) +++ tst_service_screen/test.py (.../test.py) (revision c93470567d8adf60e6b64224c6cad7f9a2f674ac) @@ -29,6 +29,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 @@ -56,9 +65,6 @@ 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(): @@ -69,6 +75,36 @@ 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 option in range(len(config.EXPORT_LOGS_OPTIONS)): + + utils.waitForGUI(1) + mouseClick(waitForObjectExists(names.o_combo_box )) + 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, "User should able to select {}".format(config.EXPORT_LOGS_OPTIONS[option])) + + +def verify_export_functionality(): + """ + verify log before clicking export button and after clicking export button + """ + +# 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() + + pass + + +def verify_device_shutdown(): + + mouseClick(waitForObjectExists(names.o_shutdown_btn)) + test.compare(waitForObjectExists(names.o_shutdown_btn).text, config.SHUTDOWN_BUTTON_TEXT, "User should able to click {}".format(config.SHUTDOWN_BUTTON_TEXT)) + test.endSection() + # 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)) @@ -83,16 +119,22 @@ # 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)) # - 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() + + + + def main(): utils.tstStart(__file__) startApplication(config.AUT_NAME) - export_log_text(text) - export_log_id(id) + #export_log_text(text) + #export_log_id(id) navigate_to_settings_screen() + verify_export_logs_screen() + + verify_export_functionality() + verify_device_shutdown() + utils.tstDone()