Mercurial > hg > ThermostatQA
view src/org/thermostat/qa2/tests/GuiClientSmokeTest.java @ 171:1d7ab9111fd2
- added tests ported to the new framework (package org.thermostat.qa2.tests)
- added/updated required targets in Makefile
- new info about dependecies added to README.md
- authorization and error checking code added to mongo js scripts
- done necessary changes to reporter, so it can be used with new framework
- updated keyrings
- added required pattern (for gui tests)
author | Zdenek Zambersky <zzambers@redhat.com> |
---|---|
date | Tue, 10 Mar 2015 13:48:12 +0100 |
parents | |
children | 2f4f704ba819 |
line wrap: on
line source
/* ThermostatQA - test framework for Thermostat Monitoring Tool Copyright 2015 Red Hat, Inc. This file is part of ThermostatQA ThermostatQA is distributed under the GNU General Public License, version 2 or any later version (with a special exception described below, commonly known as the "Classpath Exception"). A copy of GNU General Public License (GPL) is included in this distribution, in the file COPYING. Linking ThermostatQA code with other modules is making a combined work based on ThermostatQA. Thus, the terms and conditions of the GPL cover the whole combination. As a special exception, the copyright holders of ThermostatQA give you permission to link this code with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on ThermostatQA code. If you modify ThermostatQA, you may extend this exception to your version of the software, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package org.thermostat.qa2.tests; import static org.thermostat.qa2.framework.Assert.assertRuns; import org.thermostat.qa2.framework.Robot; import org.thermostat.qa2.framework.annotations.SetupStorage; import org.thermostat.qa2.framework.annotations.RunGnomeKeyring; import org.thermostat.qa2.framework.annotations.RunStorage; import org.thermostat.qa2.framework.annotations.Test; import org.thermostat.qa2.framework.services.ThermostatGui; /** * Test class ported from old framework * @author Zdeněk Žamberský */ @RunGnomeKeyring @SetupStorage(type = "mongo") public class GuiClientSmokeTest { @Test public void startGuiWithoutStorage() throws Exception { ThermostatGui gui = new ThermostatGui(); gui.start(); assertRuns(gui, "thermostat gui should be running"); Robot robot = new Robot(); robot.makeScreenshot("FailureToConnectToStorageDialog1"); robot.checkForPattern("FailureToConnectToStorageDialog/error_icon"); robot.checkForPattern("FailureToConnectToStorageDialog/configure_button"); robot.checkForPattern("FailureToConnectToStorageDialog/quit_button"); robot.saveScreenshot("FailureToConnectToStorageDialog2"); } @Test @RunStorage public void startGuiWithStorageBasicTest() throws Exception { ThermostatGui gui = new ThermostatGui(); gui.start(); assertRuns(gui, "thermostat gui should be running"); Robot robot = new Robot(); robot.makeScreenshot("startGUIWithStorageBasicTest1"); robot.checkForPattern("MainWindow/magnify_icon"); robot.checkForPattern("MainWindow/main_menu"); robot.saveScreenshot("startGUIWithStorageBasicTest2"); } @Test @RunStorage public void startGuiWithStorageMenuTest() throws Exception { ThermostatGui gui = new ThermostatGui(); gui.start(); assertRuns(gui, "thermostat gui should be running"); Robot robot = new Robot(); robot.makeScreenshot("startGUIWithStorageMenuTest1"); robot.checkForPattern("MainMenu/menu_bar_file"); robot.checkForPattern("MainMenu/menu_bar_edit"); robot.checkForPattern("MainMenu/menu_bar_view"); robot.checkForPattern("MainMenu/menu_bar_help"); robot.saveScreenshot("startGUIWithStorageMenuTest2"); } @Test @RunStorage public void startGuiWithStorageMenuFileTest() throws Exception { ThermostatGui gui = new ThermostatGui(); gui.start(); assertRuns(gui, "thermostat gui should be running"); Robot robot = new Robot(); robot.enterMainMenu(); robot.makeScreenshot("startGUIWithStorageMenuFileTest1"); robot.checkForPattern("MainMenu/menu_file_exit"); robot.saveScreenshot("startGUIWithStorageMenuFileTest2"); } @Test @RunStorage public void startGUIWithStorageMenuEditTest() throws Exception { ThermostatGui gui = new ThermostatGui(); gui.start(); assertRuns(gui, "thermostat gui should be running"); Robot robot = new Robot(); robot.enterMainMenu(); robot.pressRightKey(); robot.pressLeftKey(); robot.pressRightKey(); robot.makeScreenshot("startGUIWithStorageMenuEditTest1"); robot.checkForPattern("MainMenu/menu_edit_client_preferences"); robot.checkForPattern("MainMenu/menu_edit_show_unconnected_hosts"); robot.checkForPattern("MainMenu/menu_edit_show_non_living_vm"); robot.saveScreenshot("startGUIWithStorageMenuEditTest2"); } @Test @RunStorage public void startGUIWithStorageMenuViewTest() throws Exception { ThermostatGui gui = new ThermostatGui(); gui.start(); assertRuns(gui, "thermostat gui should be running"); Robot robot = new Robot(); robot.enterMainMenu(); robot.pressRightKey(); robot.pressRightKey(); robot.makeScreenshot("startGUIWithStorageMenuViewTest1"); robot.checkForPattern("MainMenu/menu_view_all_agents"); robot.saveScreenshot("startGUIWithStorageMenuViewTest2"); } @Test @RunStorage public void startGUIWithStorageMenuHelpTest() throws Exception { ThermostatGui gui = new ThermostatGui(); gui.start(); assertRuns(gui, "thermostat gui should be running"); Robot robot = new Robot(); robot.enterMainMenu(); robot.pressRightKey(); robot.pressRightKey(); robot.pressRightKey(); robot.makeScreenshot("startGUIWithStorageMenuHelpTest1"); robot.checkForPattern("MainMenu/menu_help_about"); robot.saveScreenshot("startGUIWithStorageMenuHelpTest2"); } @Test @RunStorage public void startGUIWithStorageMenuHelpAboutTest() throws Exception { ThermostatGui gui = new ThermostatGui(); gui.start(); assertRuns(gui, "thermostat gui should be running"); Robot robot = new Robot(); robot.enterMainMenu(); robot.pressRightKey(); robot.pressRightKey(); robot.pressRightKey(); robot.pressDownKey(); robot.pressEnterKey(); robot.makeScreenshot("startGUIWithStorageMenuHelpAboutTest1"); robot.checkForPattern("AboutDialog/thermostat_logo"); robot.checkForPattern("AboutDialog/thermostat_title"); robot.checkForPattern("AboutDialog/about_text_upper_part"); robot.checkForPattern("AboutDialog/about_text_lower_part"); robot.saveScreenshot("startGUIWithStorageMenuHelpAboutTest2"); } @Test @RunStorage public void editClientPreferences() throws Exception { ThermostatGui gui = new ThermostatGui(); gui.start(); assertRuns(gui, "thermostat gui should be running"); Robot robot = new Robot(); robot.enterMainMenu(); robot.pressRightKey(); robot.pressDownKey(); robot.pressEnterKey(); robot.makeScreenshot("editClientPreferencesTest1"); robot.checkForPattern("ClientPreferencesDialog/ok_button"); robot.checkForPattern("ClientPreferencesDialog/cancel_button"); robot.checkForPattern("ClientPreferencesDialog/connection_info_label"); robot.checkForPattern("ClientPreferencesDialog/user_name_label"); robot.checkForPattern("ClientPreferencesDialog/password_label"); robot.checkForPattern("ClientPreferencesDialog/storage_url_label"); robot.checkForPattern("ClientPreferencesDialog/save_entitlements_checked"); robot.saveScreenshot("editClientPreferencesTest2"); } @Test @RunStorage public void allAgentsDialog() throws Exception { ThermostatGui gui = new ThermostatGui(); gui.start(); assertRuns(gui, "thermostat gui should be running"); Robot robot = new Robot(); robot.enterMainMenu(); robot.pressRightKey(); robot.pressRightKey(); robot.pressDownKey(); robot.pressEnterKey(); robot.makeScreenshot("allAgentsDialogTest1"); robot.checkForPattern("AllAgentsDialog/close_button"); robot.saveScreenshot("allAgentsDialogTest2"); } }