HTMLUNIT_CHROME_AGENT_MATCHER = allOf(containsString("Chrome"), containsString("Mozilla"), containsString("AppleWebKit"), containsString("Safari"));
@After
public void tearDown() {
@@ -54,7 +57,7 @@ public void useHtmlUnit__should_emulate_CHROME_by_default() {
// when
$.driver().useHtmlUnit();
// then
- BrowserAgentTestUtils.assertBrowserAgent(HTMLUNIT_CHROME_AGENT_STRING);
+ BrowserAgentTestUtils.assertBrowserAgent(HTMLUNIT_CHROME_AGENT_MATCHER);
}
@Test
@@ -78,7 +81,7 @@ public void withJavaScript__should_set_js_ON_overriding_given_capabilities() {
}
@Test
- public void emulatingFirefox__should_emulate_latest_firefox__that_is__FIREFOX_45() {
+ public void emulatingFirefox__should_emulate_latest_firefox() {
// given
// when
$.driver().useHtmlUnit().emulatingFirefox();
@@ -92,7 +95,7 @@ public void emulatingChrome__should_emulate_CHROME() {
// when
$.driver().useHtmlUnit().emulatingChrome();
// then
- BrowserAgentTestUtils.assertBrowserAgent(HTMLUNIT_CHROME_AGENT_STRING);
+ BrowserAgentTestUtils.assertBrowserAgent(HTMLUNIT_CHROME_AGENT_MATCHER);
}
@Test
diff --git a/src/test/java/endtoend/browser/util/BrowserAgentTestUtils.java b/src/test/java/endtoend/browser/util/BrowserAgentTestUtils.java
index 521e22ea..daef9b74 100644
--- a/src/test/java/endtoend/browser/util/BrowserAgentTestUtils.java
+++ b/src/test/java/endtoend/browser/util/BrowserAgentTestUtils.java
@@ -27,7 +27,7 @@
public class BrowserAgentTestUtils {
- private static final String AGENT_TEST_URL = classNameToTestFileUrl(BrowserAgentTestUtils.class);
+ public static final String AGENT_TEST_URL = classNameToTestFileUrl(BrowserAgentTestUtils.class);
public static void assertBrowserAgent(String agentString) {
openBrowserAgentTestHelperUrl();
diff --git a/src/test/java/endtoend/functions/jquery/forms/val/ValFunction_ContentEditableTest.java b/src/test/java/endtoend/functions/jquery/forms/val/ValFunction_ContentEditableTest.java
index bbe7ff50..a1d65900 100644
--- a/src/test/java/endtoend/functions/jquery/forms/val/ValFunction_ContentEditableTest.java
+++ b/src/test/java/endtoend/functions/jquery/forms/val/ValFunction_ContentEditableTest.java
@@ -58,6 +58,7 @@ public void val_read__divWithoutContentEditableAttribute___readsEmptyString() {
@Test
@ChromeShouldBeSkipped("chrome can't focus, see test below")
+ @FirefoxSkip("firefox can't focus either, see also text below")
@JavaScriptEnabledOnly
@EdgeSkip("NoSuchWindowException -- TODO add tests for positive case")
public void val_write__divWithoutContentEditableAttribute___hasNoEffect() {
@@ -66,9 +67,12 @@ public void val_write__divWithoutContentEditableAttribute___hasNoEffect() {
@Test
@FirefoxOnly
- @JavaScriptDisabledOnly
- public void val_write__divWithoutContentEditableAttribute___hasNoEffect__Firefox_JS_OFF() {
- verifyAttemptToChangeValOfDivWithoutContentEditableHasNoEffect();
+ public void val_write__divWithoutContentEditableAttribute___throws_exception__FIREFOX() {
+ try {
+ verifyAttemptToChangeValOfDivWithoutContentEditableHasNoEffect();
+ } catch (org.openqa.selenium.WebDriverException e) {
+ assertThat(e.getMessage(), startsWith("Element is not reachable by keyboard"));
+ }
}
@Test
@@ -136,12 +140,15 @@ private void verifyEditableDivAcceptsHtmlCharsCorrectly(String editableDivId, St
assertThat($(editableDivId).html(), is(addCharsDependingOnDriver("TYPED <a>& STUFF")));
}
+ @SuppressWarnings("SameParameterValue")
private String addCharsDependingOnDriver(String resultingHtml) {
WebDriver driver = $.driver().get();
if (isIEDriver(driver)) {
return " " + resultingHtml;
- } else if (isFirefoxDriver(driver) || isOperaDriver(driver)) {
+ } else if (isOperaDriver(driver)) {
return resultingHtml + " ";
+ } else if (isFirefoxDriver(driver)) {
+ return resultingHtml + "
";
}
return resultingHtml;
}
diff --git a/src/test/java/endtoend/functions/jquery/forms/val/ValFunction_IframeTest.java b/src/test/java/endtoend/functions/jquery/forms/val/ValFunction_IframeTest.java
index bacb5623..6fabfcd8 100644
--- a/src/test/java/endtoend/functions/jquery/forms/val/ValFunction_IframeTest.java
+++ b/src/test/java/endtoend/functions/jquery/forms/val/ValFunction_IframeTest.java
@@ -63,9 +63,9 @@ private void verifyIframeTextRead(String expectedIframeText) {
}
/**
- * IE simply dies when we try to FETCH an element from the iframe. If gives no stacktrace info.
+ * IE simply dies when we try to FETCH an element from the iframe. It gives no stacktrace info.
* This had to be done for IE to work: $.driver().get().switchTo().frame(0);
- * They suggested, but didnt have effect: WebElement editable = $.driver().get().switchTo().activeElement();
+ * They suggested, but didn't have effect: WebElement editable = $.driver().get().switchTo().activeElement();
* Also suggested $.driver().get().switchTo().defaultContent(); before switching to frame. No use.
*
*
@@ -73,7 +73,7 @@ private void verifyIframeTextRead(String expectedIframeText) {
* Firefox reads correctly, but edition only works if click before typing (it is as if it doesn't properly focus the iframe body using sendkeys only).
* Edge only types when clicking before (if not clicking, the value ends up empty)
* Chrome works 100%.
- * HtmlUnit reads, but doesnt type.
+ * HtmlUnit reads, but doesn't type.
* PhantomJS same as Edge.
*/
@Test
@@ -86,14 +86,14 @@ public void iframe_with_DesignMode_ON___values_are_CHANGED_correctly__CHROME() {
@FirefoxOnly
public void iframe_with_DesignMode_ON___values_are_CHANGED_correctly__FIREFOX__NOT_CLICKING() {
// see comments above
- verifyTypingAtIframeChangesValueAsExpected(is("iframe-body-content"), false);
+ verifyTypingAtIframeChangesValueAsExpected(is(""), false);
}
@Test
@FirefoxOnly
public void iframe_with_DesignMode_ON___values_are_CHANGED_correctly__FIREFOX__CLICKING() {
// see comments above
- verifyTypingAtIframeChangesValueAsExpected(is("iframe-body-content[typed-value]"), true);
+ verifyTypingAtIframeChangesValueAsExpected(is("[typed-value]"), true);
}
@Test
diff --git a/src/test/java/integration/io/github/seleniumquery/by/DriverVersionUtilsTest.java b/src/test/java/integration/io/github/seleniumquery/by/DriverVersionUtilsTest.java
index 2f9143d9..6aeb443a 100644
--- a/src/test/java/integration/io/github/seleniumquery/by/DriverVersionUtilsTest.java
+++ b/src/test/java/integration/io/github/seleniumquery/by/DriverVersionUtilsTest.java
@@ -54,7 +54,7 @@ private void assertDriverIsNotHtmlUnitDriverEmulatingIE(HtmlUnitDriver htmlUnitD
@Test
public void isHtmlUnitDriverEmulatingIE__firefox_non_deprecated_versions() {
- assertDriverIsNotHtmlUnitDriverEmulatingIE(new HtmlUnitDriver(BrowserVersion.FIREFOX_45));
+ assertDriverIsNotHtmlUnitDriverEmulatingIE(new HtmlUnitDriver(BrowserVersion.FIREFOX_52));
}
@Test
diff --git a/src/test/java/io/github/seleniumquery/functions/jquery/events/DoubleClickFunctionTest.java b/src/test/java/io/github/seleniumquery/functions/jquery/events/DoubleClickFunctionTest.java
index 1ec214b4..88ae3c12 100644
--- a/src/test/java/io/github/seleniumquery/functions/jquery/events/DoubleClickFunctionTest.java
+++ b/src/test/java/io/github/seleniumquery/functions/jquery/events/DoubleClickFunctionTest.java
@@ -27,7 +27,7 @@
import org.openqa.selenium.WebElement;
import org.openqa.selenium.interactions.Keyboard;
import org.openqa.selenium.interactions.Mouse;
-import org.openqa.selenium.interactions.internal.Coordinates;
+import org.openqa.selenium.interactions.Coordinates;
import testinfrastructure.testdouble.org.apache.commons.logging.LogInjector;
import testinfrastructure.testdouble.org.apache.commons.logging.LogSpy;
import testinfrastructure.testdouble.org.openqa.selenium.WebDriverDummy;
@@ -149,4 +149,4 @@ static class ThrowElementHiddenExceptionCoordinates extends CoordinatesSpy {
throw new ElementNotVisibleException("simulating a hidden element");
}
}
-}
\ No newline at end of file
+}
diff --git a/src/test/java/testinfrastructure/testdouble/org/openqa/selenium/WebElementDummy.java b/src/test/java/testinfrastructure/testdouble/org/openqa/selenium/WebElementDummy.java
index dfca1853..311a8ebe 100644
--- a/src/test/java/testinfrastructure/testdouble/org/openqa/selenium/WebElementDummy.java
+++ b/src/test/java/testinfrastructure/testdouble/org/openqa/selenium/WebElementDummy.java
@@ -17,8 +17,8 @@
package testinfrastructure.testdouble.org.openqa.selenium;
import org.openqa.selenium.*;
-import org.openqa.selenium.interactions.internal.Coordinates;
-import org.openqa.selenium.internal.Locatable;
+import org.openqa.selenium.interactions.Coordinates;
+import org.openqa.selenium.interactions.Locatable;
import testinfrastructure.testdouble.PseudoTestDoubleException;
import java.util.List;
diff --git a/src/test/java/testinfrastructure/testdouble/org/openqa/selenium/interactions/MouseDummy.java b/src/test/java/testinfrastructure/testdouble/org/openqa/selenium/interactions/MouseDummy.java
index c3fb6450..df1e0ad9 100644
--- a/src/test/java/testinfrastructure/testdouble/org/openqa/selenium/interactions/MouseDummy.java
+++ b/src/test/java/testinfrastructure/testdouble/org/openqa/selenium/interactions/MouseDummy.java
@@ -17,7 +17,7 @@
package testinfrastructure.testdouble.org.openqa.selenium.interactions;
import org.openqa.selenium.interactions.Mouse;
-import org.openqa.selenium.interactions.internal.Coordinates;
+import org.openqa.selenium.interactions.Coordinates;
import testinfrastructure.testdouble.PseudoTestDoubleException;
public class MouseDummy implements Mouse {
diff --git a/src/test/java/testinfrastructure/testdouble/org/openqa/selenium/interactions/internal/CoordinatesDummy.java b/src/test/java/testinfrastructure/testdouble/org/openqa/selenium/interactions/internal/CoordinatesDummy.java
index ee62b1ea..e13928d3 100644
--- a/src/test/java/testinfrastructure/testdouble/org/openqa/selenium/interactions/internal/CoordinatesDummy.java
+++ b/src/test/java/testinfrastructure/testdouble/org/openqa/selenium/interactions/internal/CoordinatesDummy.java
@@ -17,7 +17,7 @@
package testinfrastructure.testdouble.org.openqa.selenium.interactions.internal;
import org.openqa.selenium.Point;
-import org.openqa.selenium.interactions.internal.Coordinates;
+import org.openqa.selenium.interactions.Coordinates;
import testinfrastructure.testdouble.PseudoTestDoubleException;
public class CoordinatesDummy implements Coordinates {
diff --git a/src/test/java/testinfrastructure/testutils/EnvironmentTestUtils.java b/src/test/java/testinfrastructure/testutils/EnvironmentTestUtils.java
index bbe4f533..ab9e2d2d 100644
--- a/src/test/java/testinfrastructure/testutils/EnvironmentTestUtils.java
+++ b/src/test/java/testinfrastructure/testutils/EnvironmentTestUtils.java
@@ -69,7 +69,17 @@ private static String getGitLastCommitMessageIfAvailable() {
}
public static boolean gitLastCommitMessageContains(String expected) {
- return getGitLastCommitMessageIfAvailable().contains(expected);
+ String gitLastCommitMessageIfAvailable = getGitLastCommitMessageIfAvailable();
+ banner(gitLastCommitMessageIfAvailable);
+ return gitLastCommitMessageIfAvailable.contains(expected);
+ }
+
+ private static void banner(String gitLastCommitMessageIfAvailable) {
+ System.out.println("###############################################################################################");
+ System.out.println("###############################################################################################");
+ System.out.println("### gitLastCommitMessageIfAvailable: " + gitLastCommitMessageIfAvailable);
+ System.out.println("###############################################################################################");
+ System.out.println("###############################################################################################");
}
}
diff --git a/wercker.yml b/wercker.yml
index f7d10687..e3e1c79c 100644
--- a/wercker.yml
+++ b/wercker.yml
@@ -20,7 +20,7 @@
# Steps make up the actions in your pipeline
# Read more about steps on our dev center:
# http://devcenter.wercker.com/docs/steps/index.html
-box: maven:latest
+box: combient/java-mvn
build:
steps: