Author: vuthelinh
Date: 2010-06-16 23:58:55 -0400 (Wed, 16 Jun 2010)
New Revision: 3354
Modified:
portal/trunk/testsuite/selenium-snifftests/src/main/java/org/exoplatform/portal/selenium/SeleniumTestCaseGenerator.java
Log:
TESTVN-927 : SeleniumTestCaseGenerator.java updated with 3 new functions
Modified:
portal/trunk/testsuite/selenium-snifftests/src/main/java/org/exoplatform/portal/selenium/SeleniumTestCaseGenerator.java
===================================================================
---
portal/trunk/testsuite/selenium-snifftests/src/main/java/org/exoplatform/portal/selenium/SeleniumTestCaseGenerator.java 2010-06-16
22:34:14 UTC (rev 3353)
+++
portal/trunk/testsuite/selenium-snifftests/src/main/java/org/exoplatform/portal/selenium/SeleniumTestCaseGenerator.java 2010-06-17
03:58:55 UTC (rev 3354)
@@ -90,14 +90,14 @@
sb.append("public String speed = \"100\";\n");
sb.append("public String timeout = \"30000\";\n");
sb.append("public int timeoutSecInt = 30;\n");
- sb.append("public String browser = \"firefox\";\n");
+ sb.append("public String browser = \"firefox\";\n");
sb.append("public String host = \"localhost\";\n");
sb.append("public void setSpeed() {\n selenium.setSpeed(speed);\n}\n\n");
sb.append("public void setUp() throws Exception {\n");
sb.append(" browser = System.getProperty(\"selenium.browser\",
browser);\n");
sb.append(" timeout = System.getProperty(\"selenium.timeout\",
timeout);\n");
sb.append(" timeoutSecInt = Integer.parseInt(timeout)/1000;\n");
- sb.append(" speed = System.getProperty(\"selenium.speed\",
speed);\n");
+ sb.append(" speed = System.getProperty(\"selenium.speed\",
speed);\n");
sb.append(" host = System.getProperty(\"selenium.host\",
host);\n");
sb.append(" super.setUp(\"http://\" + host +
\":8080/portal/\", \"*\" + browser);\n");
sb.append("}\n\n");
@@ -162,6 +162,16 @@
sb.append("TestCase.assertTrue(selenium.getConfirmation().matches(\"^");
sb.append(param2);
sb.append("$\"));\n");
+ } else if (param1.equals("assertLocation")) {
+ sb.append("TestCase.assertTrue(selenium.getLocation().matches(\"^");
+ sb.append(param2);
+ sb.append("$\"));\n");
+ }else if (param1.equals("waitForValue")) {
+ sb.append("TestCase.assertTrue(selenium.getValue(\"");
+ sb.append(param2);
+ sb.append("\").matches(\"^");
+ sb.append(param3);
+ sb.append("$\"));\n");
} else if (param1.equals("assertElementPresent") ||
param1.equals("assertElementNotPresent")) {
if (param1.equals("assertElementPresent")) {
sb.append("TestCase.assertTrue");
@@ -290,7 +300,7 @@
sb.append(param2);
sb.append("\")) \nbreak; }\n catch (Exception e) {}\n");
sb.append("Thread.sleep(1000);\n");
- sb.append("}\n");
+ sb.append("}\n");
} else if (param1.equals("waitForTextNotPresent")) {
sb.append("for (int second = 0;; second++) {\n");
sb.append(getTimeoutMessage(param1));
@@ -298,7 +308,7 @@
sb.append(param2);
sb.append("\")) \nbreak; }\n catch (Exception e) {}\n");
sb.append("Thread.sleep(1000);\n");
- sb.append("}\n");
+ sb.append("}\n");
} else if (param1.equals("waitForTable")) {
sb.append("for (int second = 0;; second++) {\n");
sb.append(getTimeoutMessage(param1));
@@ -386,6 +396,9 @@
sb.append("verifyFalse(selenium.isChecked(\"").append(param2).append("\"));\n");
} else if (param1.equals("deleteCookie")) {
sb.append("selenium.deleteCookie(\"").append(param2).append("\",\"").append(param3).append("\");\n");
+ } else if (param1.equals("windowMaximize")) {
+ sb.append("selenium.windowMaximize()").append(";\n");
+
} else if (param1.equals("waitForText")) {
sb.append("for (int second = 0;; second++) {\n");
sb.append(getTimeoutMessage(param1));
@@ -520,4 +533,4 @@
private static final String[] _FIX_PARAM_NEW_SUBS = new String[] { "\\n",
"\\n" };
public static final String SLASH = "/";
-}
+}
Show replies by date