You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2014/12/12 12:01:25 UTC
svn commit: r1644859 - in
/myfaces/tobago/trunk/tobago-example/tobago-example-test: ./
src/main/webapp/test/attribute/
src/test/java/org/apache/myfaces/tobago/example/test/
Author: lofwyr
Date: Fri Dec 12 11:01:25 2014
New Revision: 1644859
URL: http://svn.apache.org/r1644859
Log:
tests
Modified:
myfaces/tobago/trunk/tobago-example/tobago-example-test/pom.xml
myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/test/attribute/popup-modal.selenium.html
myfaces/tobago/trunk/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/AutomaticSeleniumTest.java
myfaces/tobago/trunk/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/TestTheAutomaticSeleniumTest.java
myfaces/tobago/trunk/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/TobagoSelenium.java
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-test/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-test/pom.xml?rev=1644859&r1=1644858&r2=1644859&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-test/pom.xml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-test/pom.xml Fri Dec 12 11:01:25 2014
@@ -172,10 +172,12 @@
<artifactId>log4j</artifactId>
<scope>runtime</scope>
</dependency>
+<!--
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</dependency>
+-->
<dependency>
<groupId>oro</groupId>
<artifactId>oro</artifactId>
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/test/attribute/popup-modal.selenium.html
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/test/attribute/popup-modal.selenium.html?rev=1644859&r1=1644858&r2=1644859&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/test/attribute/popup-modal.selenium.html (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/test/attribute/popup-modal.selenium.html Fri Dec 12 11:01:25 2014
@@ -33,11 +33,16 @@
<td></td>
</tr>
<tr>
- <td>clickAndWait</td>
+ <td>click</td>
<td>//button[1]</td>
<td></td>
</tr>
<tr>
+ <td>waitForPageToLoad</td>
+ <td>3000</td>
+ <td></td>
+</tr>
+<tr>
<td>waitForElementPresent</td>
<td>class=tobago-popup tobago-popup-markup-modal</td>
<td></td>
@@ -48,11 +53,16 @@
<td></td>
</tr>
<tr>
- <td>clickAndWait</td>
+ <td>click</td>
<td>//button[2]</td>
<td></td>
</tr>
<tr>
+ <td>waitForPageToLoad</td>
+ <td>3000</td>
+ <td></td>
+</tr>
+<tr>
<td>waitForElementPresent</td>
<td>class=tobago-popup tobago-popup-markup-modal</td>
<td></td>
@@ -63,11 +73,16 @@
<td></td>
</tr>
<tr>
- <td>clickAndWait</td>
+ <td>click</td>
<td>//button[3]</td>
<td></td>
</tr>
<tr>
+ <td>waitForPageToLoad</td>
+ <td>3000</td>
+ <td></td>
+</tr>
+<tr>
<td>waitForElementPresent</td>
<td>class=tobago-popup</td>
<td></td>
@@ -78,11 +93,16 @@
<td></td>
</tr>
<tr>
- <td>clickAndWait</td>
+ <td>click</td>
<td>//button[4]</td>
<td></td>
</tr>
<tr>
+ <td>waitForPageToLoad</td>
+ <td>3000</td>
+ <td></td>
+</tr>
+<tr>
<td>waitForElementPresent</td>
<td>class=tobago-popup tobago-popup-markup-modal</td>
<td></td>
@@ -93,11 +113,16 @@
<td></td>
</tr>
<tr>
- <td>clickAndWait</td>
+ <td>click</td>
<td>//button[5]</td>
<td></td>
</tr>
<tr>
+ <td>waitForPageToLoad</td>
+ <td>3000</td>
+ <td></td>
+</tr>
+<tr>
<td>waitForElementPresent</td>
<td>class=tobago-popup</td>
<td></td>
@@ -108,11 +133,16 @@
<td></td>
</tr>
<tr>
- <td>clickAndWait</td>
+ <td>click</td>
<td>//button[6]</td>
<td></td>
</tr>
<tr>
+ <td>waitForPageToLoad</td>
+ <td>3000</td>
+ <td></td>
+</tr>
+<tr>
<td>waitForElementPresent</td>
<td>class=tobago-popup tobago-popup-markup-modal</td>
<td></td>
@@ -123,11 +153,16 @@
<td></td>
</tr>
<tr>
- <td>clickAndWait</td>
+ <td>click</td>
<td>//button[7]</td>
<td></td>
</tr>
<tr>
+ <td>waitForPageToLoad</td>
+ <td>3000</td>
+ <td></td>
+</tr>
+<tr>
<td>waitForElementPresent</td>
<td>class=tobago-popup</td>
<td></td>
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/AutomaticSeleniumTest.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/AutomaticSeleniumTest.java?rev=1644859&r1=1644858&r2=1644859&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/AutomaticSeleniumTest.java (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/AutomaticSeleniumTest.java Fri Dec 12 11:01:25 2014
@@ -57,8 +57,15 @@ public class AutomaticSeleniumTest exten
for (final SeleniumScriptItem item : script.getItems()) {
LOG.info("Calling: " + item);
- getSelenium().command(item.getCommand(), item.getParameters()[0], item.getParameters()[1]);
- getSelenium().checkPage();
+ try {
+ getSelenium().command(item.getCommand(), item.getParameters()[0], item.getParameters()[1]);
+ LOG.debug("command done");
+ getSelenium().checkPage();
+ LOG.debug("check done");
+ } catch (Exception e) {
+ LOG.error("error with item:" + item, e);
+ throw e;
+ }
}
}
@@ -87,12 +94,18 @@ public class AutomaticSeleniumTest exten
final List<Object[]> result = new ArrayList<Object[]>();
+ String quickFilter = null;
+ // for quick quick filter, you may set here a temporary string
+// quickFilter = "popup-modal.xhtml";
+
for (final String path : paths) {
- final Object[] objects = {
- path.replace('.', '_'), // because dots will be displayed strange in the IDE
- createUrl(path)
- };
- result.add(objects);
+ if (quickFilter == null || path.contains(quickFilter)) {
+ final Object[] objects = {
+ path.replace('.', '_'), // because dots will be displayed strange in the IDE
+ createUrl(path)
+ };
+ result.add(objects);
+ }
}
return result;
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/TestTheAutomaticSeleniumTest.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/TestTheAutomaticSeleniumTest.java?rev=1644859&r1=1644858&r2=1644859&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/TestTheAutomaticSeleniumTest.java (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/TestTheAutomaticSeleniumTest.java Fri Dec 12 11:01:25 2014
@@ -83,6 +83,7 @@ public class TestTheAutomaticSeleniumTes
Assert.fail("The test should fail, but wasn't.");
} catch (final AssertionError e) { // from IDE
+ LOG.debug("test404", e);
Assert.assertTrue(e.getMessage().contains("404 - page not found"));
} catch (final SeleniumException e) { // from mvn -Pintegration-test
LOG.info("Exception: '" + e.getMessage() + "'");
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/TobagoSelenium.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/TobagoSelenium.java?rev=1644859&r1=1644858&r2=1644859&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/TobagoSelenium.java (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/TobagoSelenium.java Fri Dec 12 11:01:25 2014
@@ -22,8 +22,10 @@ package org.apache.myfaces.tobago.exampl
import com.thoughtworks.selenium.DefaultSelenium;
import com.thoughtworks.selenium.HttpCommandProcessor;
import com.thoughtworks.selenium.SeleniumException;
+import org.apache.myfaces.tobago.internal.util.StringUtils;
import org.junit.Assert;
+//public class TobagoSelenium extends WebDriverBackedSelenium {
public class TobagoSelenium extends DefaultSelenium {
public static final String ERROR_ON_SERVER = "error on server";
@@ -36,11 +38,26 @@ public class TobagoSelenium extends Defa
//XXX should be replaced
//XXX http://www.seleniumhq.org/docs/appendix_migrating_from_rc_to_webdriver.jsp#migrating-to-webdriver-reference
super(new HttpCommandProcessor("localhost", 4444, "*firefox", browserUrl));
+
+// super(new FirefoxDriver(), browserUrl);
+// super(new SafariDriver(), browserUrl);
+// super(new ChromeDriver(), browserUrl);
+
this.browserUrl = browserUrl;
+//System.out.println("n 12 ********----------------**********************");
+// final WebDriverBackedSelenium selenium =
+// new WebDriverBackedSelenium(new FirefoxDriver(), browserUrl);
+// selenium.clickAndWait();
+
+
}
public String command(final String command, final String parameter1, final String parameter2) {
- return commandProcessor.doCommand(command, new String[]{parameter1, parameter2});
+ if (StringUtils.isNotBlank(parameter2)) {
+ return commandProcessor.doCommand(command, new String[]{parameter1, parameter2});
+ } else {
+ return commandProcessor.doCommand(command, new String[]{parameter1});
+ }
}
public void killSession() {