changeset 99:6ebca48f4353

modifying GuiClientDBModificationsSmokeTest, purge the agent list before adding new agent
author Jana Fabrikova <jfabriko@redhat.com>
date Wed, 25 Sep 2013 09:59:49 +0200
parents 994289841798
children 6c2a5f90b3f3
files ChangeLog scripts/delete_agents_db_commands.txt scripts/delete_all_agents_from_db.sh src/org/thermostat/qa/testsuites/GuiClientDBModificationsSmokeTest.java
diffstat 4 files changed, 19 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Sep 25 08:55:25 2013 +0200
+++ b/ChangeLog	Wed Sep 25 09:59:49 2013 +0200
@@ -1,3 +1,12 @@
+2013-09-25  Jana Fabrikova  <jfabriko@redhat.com>
+
+	* src/org/thermostat/qa/testsuites/GuiClientDBModificationsSmokeTest.java:
+	modifying the testcase - delete agents from db before test starts,
+	so newly added agent is visible in gui every time
+	* scripts/delete_all_agents_from_db.sh:
+	* scripts/delete_agents_db_commands.txt:
+	auxiliary script and text file with commands for mongodb
+
 2013-09-25  Jana Fabrikova  <jfabriko@redhat.com>
 
 	* src/org/thermostat/qa/testsuites/GuiClientSmokeTest.java:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/scripts/delete_agents_db_commands.txt	Wed Sep 25 09:59:49 2013 +0200
@@ -0,0 +1,4 @@
+use thermostat
+db["agent-config"].remove()
+exit
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/scripts/delete_all_agents_from_db.sh	Wed Sep 25 09:59:49 2013 +0200
@@ -0,0 +1,2 @@
+mongo --port `cat scripts/mongoPortNumber.txt` < scripts/delete_agents_db_commands.txt
+
--- a/src/org/thermostat/qa/testsuites/GuiClientDBModificationsSmokeTest.java	Wed Sep 25 08:55:25 2013 +0200
+++ b/src/org/thermostat/qa/testsuites/GuiClientDBModificationsSmokeTest.java	Wed Sep 25 09:59:49 2013 +0200
@@ -85,6 +85,8 @@
      * <img src="patterns/noAA/AllAgentsDialog/close_button2.png"><br /><br /> 
      * This method uses scripts and files 
      * <ul>
+     * <li><a href="scripts/delete_all_agents_from_db.sh">delete_all_agents_from_db.sh</a>,
+     * <li><a href="scripts/delete_agents_db_commands.txt">delete_agents_db_commands.txt</a>
      * <li><a href="scripts/find_mongo_port_and_add_agent.sh">find_mongo_port_and_add_agent.sh</a>,
      * <li><a href="scripts/add_agent_db_commands.txt">add_agent_db_commands.txt</a>, 
      * <li><a href="scripts/delete_added_agent.sh">delete_added_agent.sh</a>,
@@ -99,6 +101,8 @@
     public void testAddAgentAndSeeItInGUITest() throws IOException, AWTException {
         // start storage
         GuiRobot robot = startStorageOnly();
+    
+        runHelperBashScript("delete_all_agents_from_db.sh");
         
         // find out on which port to connect to db and add new agent to db
         List<String> output1 = runHelperBashScript("find_mongo_port_and_add_agent.sh");