aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java
diff options
context:
space:
mode:
Diffstat (limited to 'uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java')
-rw-r--r--uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java26
1 files changed, 19 insertions, 7 deletions
diff --git a/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java b/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java
index 7f9fe1387a..3745d60fd8 100644
--- a/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java
+++ b/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2013 Vaadin Ltd.
+ * Copyright 2000-2014 Vaadin Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
@@ -126,9 +126,13 @@ public abstract class AbstractTB3Test extends TestBenchTestCase {
} else {
capabilities = getDesiredCapabilities();
- WebDriver dr = TestBench.createDriver(new RemoteWebDriver(new URL(
- getHubURL()), capabilities));
- setDriver(dr);
+ if (System.getProperty("useLocalWebDriver") != null) {
+ setupLocalDriver(capabilities);
+ } else {
+ WebDriver dr = TestBench.createDriver(new RemoteWebDriver(
+ new URL(getHubURL()), capabilities));
+ setDriver(dr);
+ }
}
int w = SCREENSHOT_WIDTH;
@@ -956,10 +960,18 @@ public abstract class AbstractTB3Test extends TestBenchTestCase {
}
public void hitButton(String id) {
- WebDriverBackedSelenium selenium = new WebDriverBackedSelenium(driver,
- driver.getCurrentUrl());
+ if (BrowserUtil.isPhantomJS(getDesiredCapabilities())) {
+ driver.findElement(By.id(id)).click();
+ } else {
+ WebDriverBackedSelenium selenium = new WebDriverBackedSelenium(
+ driver, driver.getCurrentUrl());
+
+ selenium.keyPress("id=" + id, "\\13");
+ }
+ }
- selenium.keyPress("id=" + id, "\\13");
+ protected void openDebugLogTab() {
+ findElement(By.xpath("//button[@title='Debug message log']")).click();
}
}