[seam-commits] Seam SVN: r10074 - trunk/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
Mon Feb 23 05:53:40 EST 2009


Author: jharting
Date: 2009-02-23 05:53:40 -0500 (Mon, 23 Feb 2009)
New Revision: 10074

Modified:
   trunk/src/test/ftest/examples/seambay/src/org/jboss/seam/example/seambay/test/selenium/SellTest.java
   trunk/src/test/ftest/examples/seambay/src/org/jboss/seam/example/seambay/test/selenium/seambay.properties
Log:
JBSEAM-3690

Modified: trunk/src/test/ftest/examples/seambay/src/org/jboss/seam/example/seambay/test/selenium/SellTest.java
===================================================================
--- trunk/src/test/ftest/examples/seambay/src/org/jboss/seam/example/seambay/test/selenium/SellTest.java	2009-02-23 09:21:40 UTC (rev 10073)
+++ trunk/src/test/ftest/examples/seambay/src/org/jboss/seam/example/seambay/test/selenium/SellTest.java	2009-02-23 10:53:40 UTC (rev 10074)
@@ -24,6 +24,9 @@
 import static org.testng.AssertJUnit.assertTrue;
 import static org.testng.AssertJUnit.assertEquals;
 
+import java.text.NumberFormat;
+import java.text.ParseException;
+
 import org.testng.annotations.Test;
 
 import com.thoughtworks.selenium.Wait;
@@ -35,8 +38,11 @@
  */
 public class SellTest extends SeleniumSeamBayTest
 {
+
+   private NumberFormat nf = NumberFormat.getInstance();
+   
    @Test(dependsOnGroups={"searchTest"})
-   public void joystickSellingTest()
+   public void joystickSellingTest() throws NumberFormatException, ParseException
    {
       String title = "Saitek X52 Pro Flight System";
       int category = 7;
@@ -48,7 +54,7 @@
       sellItem(title, category, subcategory, duration, price, description);
    }
 
-   protected void sellItem(String title, int category, int subcategory, String duration, String price, String description)
+   protected void sellItem(String title, int category, int subcategory, String duration, String price, String description) throws NumberFormatException, ParseException
    {
       login();
       browser.clickAndWait(getProperty("SELL"));
@@ -76,7 +82,7 @@
          @Override
          public boolean until()
          {
-            return browser.isElementPresent(getProperty("SELL_CATEGORY_SELECT"));
+            return browser.isElementPresent(getProperty("SELL_CATEGORY_SELECT_SECOND_OPTION"));
          }
       };
       browser.select(getProperty("SELL_CATEGORY_SELECT"), "index=" + category);
@@ -113,10 +119,10 @@
       browser.clickAndWait(getProperty("SELL_NEXT"));
    }
    
-   protected void validatePreview(String price, String description)
+   protected void validatePreview(String price, String description) throws NumberFormatException, ParseException
    {
       assertTrue("Must be on preview page to validate preview.", browser.getLocation().contains(getProperty("SELL_PREVIEW_URL")));
-      assertEquals("Unexpected price on preview page.", Double.valueOf(price), Double.valueOf(browser.getText(getProperty("SELL_PREVIEW_PRICE"))));
+      assertEquals("Unexpected price on preview page.", Double.valueOf(price), nf.parse(browser.getText(getProperty("SELL_PREVIEW_PRICE"))).doubleValue());
       assertEquals("Unexpected description on description page.", description, browser.getText(getProperty("SELL_PREVIEW_DESCRIPTION")));
    }
 }

Modified: trunk/src/test/ftest/examples/seambay/src/org/jboss/seam/example/seambay/test/selenium/seambay.properties
===================================================================
--- trunk/src/test/ftest/examples/seambay/src/org/jboss/seam/example/seambay/test/selenium/seambay.properties	2009-02-23 09:21:40 UTC (rev 10073)
+++ trunk/src/test/ftest/examples/seambay/src/org/jboss/seam/example/seambay/test/selenium/seambay.properties	2009-02-23 10:53:40 UTC (rev 10074)
@@ -34,6 +34,7 @@
 SELL_NEXT id=sellForm:next
 SELL_CONFIRM id=sellForm:confirm
 SELL_CATEGORY_SELECT id=rootCategory
+SELL_CATEGORY_SELECT_SECOND_OPTION xpath=id(\"rootCategory\")/option[2] # availability of second option indicates that category list has been loaded
 SELL_SUBCATEGORY_SELECT id\=tier2
 
 SEARCH_FIELD id=search:searchTerm




More information about the seam-commits mailing list