diff --git a/pom.xml b/pom.xml old mode 100644 new mode 100755 index 97fa3f60..ce59d139 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ 4.0.0 xebium com.xebia.incubator - 0.13-SNAPSHOT + 0.15-SNAPSHOT-mqm Xebium jar @@ -29,20 +29,21 @@ - 2.42.0 - 20130530 + 2.45.0 + 20150424 8000 0 + 20140107 1.7 - 1.6.4 + 1.6.6 1.1 - 1.0.3 + 1.2.1 2.6 - scm:git:git://github.com/xebia/Xebium.git - scm:git:git@github.com:xebia/Xebium.git + scm:git:git://github.com/sglebs/Xebium.git + scm:git:git@github.com:sglebs/Xebium.git scm:git:http://github.com/xebia/Xebium @@ -78,7 +79,7 @@ ${operadriver.version} - com.github.detro.ghostdriver + com.codeborne phantomjsdriver ${phantomjsdriver.version} @@ -87,6 +88,11 @@ commons-lang ${commons-lang.version} + + org.json + json + ${orgjson.version} + com.google.guava @@ -131,7 +137,7 @@ org.hamcrest hamcrest-all - 1.1 + 1.3 test @@ -274,7 +280,7 @@ fitnesse-integration - true + false @@ -325,7 +331,7 @@ Xebia B.V. http://xebia.com - + sgrijpink diff --git a/src/main/java/com/xebia/incubator/xebium/DefaultWebDriverSupplier.java b/src/main/java/com/xebia/incubator/xebium/DefaultWebDriverSupplier.java index 34b5db67..a69d4fc2 100644 --- a/src/main/java/com/xebia/incubator/xebium/DefaultWebDriverSupplier.java +++ b/src/main/java/com/xebia/incubator/xebium/DefaultWebDriverSupplier.java @@ -126,6 +126,10 @@ public void setBrowser(String browser) { this.browser = browser; } + public String getBrowser() { + return this.browser; + } + public void setCustomProfilePreferencesFile( File customProfilePreferencesFile) { this.customProfilePreferencesFile = customProfilePreferencesFile; diff --git a/src/main/java/com/xebia/incubator/xebium/RemoteWebDriverSupplier.java b/src/main/java/com/xebia/incubator/xebium/RemoteWebDriverSupplier.java index f1e6ee9c..21ebacf3 100644 --- a/src/main/java/com/xebia/incubator/xebium/RemoteWebDriverSupplier.java +++ b/src/main/java/com/xebia/incubator/xebium/RemoteWebDriverSupplier.java @@ -99,7 +99,9 @@ public Capabilities getCapabilities() { * @throws RuntimeException in case of any error */ public WebDriver get() { - return new Augmenter().augment(new RemoteWebDriver(getRemote(), getCapabilities())); + RemoteWebDriver remoteWebDriver = new RemoteWebDriver(getRemote(), getCapabilities()) ; + remoteWebDriver.setFileDetector(new org.openqa.selenium.remote.LocalFileDetector()); // https://saucelabs.com/resources/selenium-file-upload + return new Augmenter().augment(remoteWebDriver); } diff --git a/src/main/java/com/xebia/incubator/xebium/SeleniumDriverFixture.java b/src/main/java/com/xebia/incubator/xebium/SeleniumDriverFixture.java index 9fe6e0a5..ba31bbc2 100644 --- a/src/main/java/com/xebia/incubator/xebium/SeleniumDriverFixture.java +++ b/src/main/java/com/xebia/incubator/xebium/SeleniumDriverFixture.java @@ -36,7 +36,7 @@ import static com.xebia.incubator.xebium.FitNesseUtil.*; import static org.apache.commons.lang.StringUtils.join; - +import org.openqa.selenium.Keys; /** * Main fixture. Starts a browser session and execute commands. */ @@ -81,8 +81,16 @@ public class SeleniumDriverFixture { public SeleniumDriverFixture() { super(); + initSpecialKeysMapping(); } + private void initSpecialKeysMapping() { + aliases.put("$KEY_BACKSPACE", Keys.chord(Keys.BACK_SPACE)); + aliases.put("$KEY_TAB", Keys.chord(Keys.TAB)); + aliases.put("$KEY_ENTER", Keys.chord(Keys.ENTER)); + aliases.put("$KEY_RETURN", Keys.chord(Keys.RETURN)); + } + private WebDriver defaultWebDriverInstance() { return defaultWebDriverSupplier.newWebDriver(); } @@ -251,7 +259,10 @@ private void setTimeoutOnSelenium() { executeCommand("setTimeout", new String[] { "" + this.timeout }); WebDriver.Timeouts timeouts = getWebDriver().manage().timeouts(); timeouts.setScriptTimeout(this.timeout, TimeUnit.MILLISECONDS); - timeouts.pageLoadTimeout(this.timeout, TimeUnit.MILLISECONDS); + if (defaultWebDriverSupplier.getBrowser() != null && // mqm fix for use with the hsac bridge + defaultWebDriverSupplier.getBrowser().toLowerCase().equals("safari")) //mqm fix for #137 - safari does not support this API + return; + timeouts.pageLoadTimeout(this.timeout, TimeUnit.MILLISECONDS); } /** diff --git a/src/main/java/com/xebia/incubator/xebium/fastseleniumemulation/Type.java b/src/main/java/com/xebia/incubator/xebium/fastseleniumemulation/Type.java index 1d394daa..510fd954 100644 --- a/src/main/java/com/xebia/incubator/xebium/fastseleniumemulation/Type.java +++ b/src/main/java/com/xebia/incubator/xebium/fastseleniumemulation/Type.java @@ -23,6 +23,8 @@ protected Void handleSeleneseCommand(WebDriver driver, String locator, String va if (value == null) { value = ""; } + value = value.replace("\\08", Keys.BACK_SPACE); // sglebs fix + value = value.replace("\\09", Keys.TAB); // sglebs fix value = value.replace("\\10", Keys.ENTER); value = value.replace("\\13", Keys.RETURN); value = value.replace("\\27", Keys.ESCAPE);