[seam-commits] Seam SVN: r11576 - branches/community/Seam_2_2/src/test/ftest/examples/seambay/src/org/jboss/seam/example/seambay/test/selenium.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Tue Oct 13 07:53:21 EDT 2009


Author: mgencur at redhat.com
Date: 2009-10-13 07:53:20 -0400 (Tue, 13 Oct 2009)
New Revision: 11576

Modified:
   branches/community/Seam_2_2/src/test/ftest/examples/seambay/src/org/jboss/seam/example/seambay/test/selenium/SellTest.java
   branches/community/Seam_2_2/src/test/ftest/examples/seambay/src/org/jboss/seam/example/seambay/test/selenium/WebServiceTestPageTest.java
Log:
fixed joystickSellingTest, findAuctionsTest for hudson jobs

Modified: branches/community/Seam_2_2/src/test/ftest/examples/seambay/src/org/jboss/seam/example/seambay/test/selenium/SellTest.java
===================================================================
--- branches/community/Seam_2_2/src/test/ftest/examples/seambay/src/org/jboss/seam/example/seambay/test/selenium/SellTest.java	2009-10-13 07:19:00 UTC (rev 11575)
+++ branches/community/Seam_2_2/src/test/ftest/examples/seambay/src/org/jboss/seam/example/seambay/test/selenium/SellTest.java	2009-10-13 11:53:20 UTC (rev 11576)
@@ -38,7 +38,7 @@
  */
 public class SellTest extends SeleniumSeamBayTest
 {
-
+   private long listWaitTime = 5000;
    private NumberFormat nf = NumberFormat.getInstance();
    
    @Test(dependsOnGroups={"searchTest"})
@@ -85,6 +85,16 @@
             return browser.isElementPresent(getProperty("SELL_CATEGORY_SELECT_SECOND_OPTION"));
          }
       };
+      /*this sleeping is necessary because although the previous waiting ensures the 14. option present in select component in
+      java code, the web page on its own is not ready yet*/
+      try
+      {
+         Thread.sleep(listWaitTime);
+      }
+      catch (InterruptedException e)
+      {
+      }
+      
       browser.select(getProperty("SELL_CATEGORY_SELECT"), "index=" + category);
       if (subcategory != 0)
       {

Modified: branches/community/Seam_2_2/src/test/ftest/examples/seambay/src/org/jboss/seam/example/seambay/test/selenium/WebServiceTestPageTest.java
===================================================================
--- branches/community/Seam_2_2/src/test/ftest/examples/seambay/src/org/jboss/seam/example/seambay/test/selenium/WebServiceTestPageTest.java	2009-10-13 07:19:00 UTC (rev 11575)
+++ branches/community/Seam_2_2/src/test/ftest/examples/seambay/src/org/jboss/seam/example/seambay/test/selenium/WebServiceTestPageTest.java	2009-10-13 11:53:20 UTC (rev 11576)
@@ -42,7 +42,7 @@
 public class WebServiceTestPageTest extends SeleniumSeamBayTest
 {
       
-   protected static final Long TIMEOUT = 3000L; //3 seconds   
+   protected static final Long TIMEOUT = 25000L; //25 seconds   
    protected static final String HERE_LINK = "xpath=//a[contains(text(),\"here\")]";
    protected static final String SERVICE_PAGE_HEADING= "seamBay Web Services - Test Page"; 
 
@@ -101,7 +101,7 @@
       browser.type(LOGIN_INPUT_USERNAME, username);
       browser.type(LOGIN_INPUT_PASSWORD, password);     
       browser.click(INVOKE_SERVICE_BUTTON);
-      waitForElementContent(RESPONSE_AREA, TIMEOUT*5);
+      waitForElementContent(RESPONSE_AREA, TIMEOUT);
    }
    
    @Test(dependsOnMethods={"loginTest"})
@@ -111,7 +111,7 @@
       browser.click(LIST_CATEGORIES_LINK);
       waitForElementPresent(INVOKE_SERVICE_BUTTON, TIMEOUT);
       browser.click(INVOKE_SERVICE_BUTTON);
-      waitForElementContent(RESPONSE_AREA, TIMEOUT*5);
+      waitForElementContent(RESPONSE_AREA, TIMEOUT);
       String x = browser.getValue(RESPONSE_AREA);
       assertTrue("Response area should contain a list of categories.", x.contains(getProperty("LIST_CATEGORIES_RESPONSE")));      
    }  
@@ -138,21 +138,22 @@
       browser.type(AUCTION_CATEGORY_ID, categoryId);      
       waitForElementPresent(INVOKE_SERVICE_BUTTON, TIMEOUT);
       browser.click(INVOKE_SERVICE_BUTTON);
-      waitForElementContent(RESPONSE_AREA, TIMEOUT*5);      
+      waitForElementContent(RESPONSE_AREA, TIMEOUT);      
    }
    
    @Test(dependsOnMethods={"loginTest","createNewAuctionTest"})
    public void findAuctionsTest(){
       String searchTerm = "Animals";      
       loginService();      
-      createNewAuctionService();      
+      createNewAuctionService();   
+      confirmAuctionService();
       waitForElementPresent(FIND_AUCTIONS_LINK, TIMEOUT);
       browser.click(FIND_AUCTIONS_LINK);
       waitForElementPresent(SEARCH_TERM, TIMEOUT);     
       browser.type(SEARCH_TERM, searchTerm);
       waitForElementPresent(INVOKE_SERVICE_BUTTON, TIMEOUT);
       browser.click(INVOKE_SERVICE_BUTTON);
-      waitForElementContent(RESPONSE_AREA, TIMEOUT*5);
+      waitForElementContent(RESPONSE_AREA, TIMEOUT);
       String x = browser.getValue(RESPONSE_AREA);
       assertTrue("Response area should contain information about finding auction.", x.contains(getProperty("FIND_AUCTIONS_RESPONSE")));      
    }  
@@ -174,7 +175,7 @@
       browser.type(AUCTION_CATEGORY_ID, categoryId);      
       waitForElementPresent(INVOKE_SERVICE_BUTTON, TIMEOUT);
       browser.click(INVOKE_SERVICE_BUTTON);
-      waitForElementContent(RESPONSE_AREA, TIMEOUT*5);
+      waitForElementContent(RESPONSE_AREA, TIMEOUT);
       String x = browser.getValue(RESPONSE_AREA);
       assertTrue("Response area should contain information about updating the auction.", x.contains(getProperty("UPDATE_AUCTION_RESPONSE")));      
    } 
@@ -190,7 +191,7 @@
       browser.type(AUCTION_DURATION, duration);
       waitForElementPresent(INVOKE_SERVICE_BUTTON, TIMEOUT);
       browser.click(INVOKE_SERVICE_BUTTON);
-      waitForElementContent(RESPONSE_AREA, TIMEOUT*5);
+      waitForElementContent(RESPONSE_AREA, TIMEOUT);
       String x = browser.getValue(RESPONSE_AREA);
       assertTrue("Response area should contain information about setting duration.", x.contains(getProperty("SET_DURATION_RESPONSE")));      
    } 
@@ -206,7 +207,7 @@
       browser.type(STARTING_PRICE, price);
       waitForElementPresent(INVOKE_SERVICE_BUTTON, TIMEOUT);
       browser.click(INVOKE_SERVICE_BUTTON);
-      waitForElementContent(RESPONSE_AREA, TIMEOUT*5);
+      waitForElementContent(RESPONSE_AREA, TIMEOUT);
       String x = browser.getValue(RESPONSE_AREA);
       assertTrue("Response area should contain information about setting starting price.", x.contains(getProperty("SET_STARTING_PRICE_RESPONSE")));      
    } 
@@ -219,7 +220,7 @@
       browser.click(GET_AUCTION_DETAILS_LINK);
       waitForElementPresent(INVOKE_SERVICE_BUTTON, TIMEOUT);
       browser.click(INVOKE_SERVICE_BUTTON);
-      waitForElementContent(RESPONSE_AREA, TIMEOUT*5);
+      waitForElementContent(RESPONSE_AREA, TIMEOUT);
       String x = browser.getValue(RESPONSE_AREA);
       assertTrue("Response area should contain auction details.", x.contains(getProperty("AUCTION_DETAILS_PRICE_RESPONSE")));      
    } 
@@ -231,7 +232,7 @@
       browser.click(LOGOUT_LINK);
       waitForElementPresent(INVOKE_SERVICE_BUTTON, TIMEOUT);
       browser.click(INVOKE_SERVICE_BUTTON);
-      waitForElementContent(RESPONSE_AREA, TIMEOUT*5);
+      waitForElementContent(RESPONSE_AREA, TIMEOUT);
       String x = browser.getValue(RESPONSE_AREA);
       assertTrue("Response area should contain logout confirmation.", x.contains(getProperty("LOGOUT_RESPONSE")));      
    }    
@@ -240,14 +241,18 @@
    public void confirmAuctionTest(){            
       loginService();      
       createNewAuctionService();      
+      confirmAuctionService();
+      String x = browser.getValue(RESPONSE_AREA);
+      assertTrue("Response area should contain information about confirmation.", x.contains(getProperty("CONFIRMATION_RESPONSE")));      
+   }  
+   
+   public void confirmAuctionService(){
       waitForElementPresent(CONFIRM_AUCTION_LINK, TIMEOUT);
       browser.click(CONFIRM_AUCTION_LINK);
       waitForElementPresent(INVOKE_SERVICE_BUTTON, TIMEOUT);
       browser.click(INVOKE_SERVICE_BUTTON);
-      waitForElementContent(RESPONSE_AREA, TIMEOUT*5);
-      String x = browser.getValue(RESPONSE_AREA);
-      assertTrue("Response area should contain information about confirmation.", x.contains(getProperty("CONFIRMATION_RESPONSE")));      
-   }  
+      waitForElementContent(RESPONSE_AREA, TIMEOUT);
+   }
    
    public void waitForElementPresent(final String locator, Long timeout){
       new Wait()



More information about the seam-commits mailing list