summaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2015-06-03 08:44:02 +0300
committerVaadin Code Review <review@vaadin.com>2015-06-05 13:14:48 +0000
commitc4d006d0c6098b1047adb56c0fc7df6f71fe620c (patch)
tree284c849dd719ecbacf7b644aeb0f5334a4f7e9a3 /uitest
parent7c48ad2b38cbbdc2877ae106a7c2dfbcae512f3b (diff)
downloadvaadin-framework-c4d006d0c6098b1047adb56c0fc7df6f71fe620c.tar.gz
vaadin-framework-c4d006d0c6098b1047adb56c0fc7df6f71fe620c.zip
Run local tests on localhost
* Allows running test when offline Change-Id: Ifb1d9ab60c299d6bbf31381fc26e50c639db8dc4
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java19
1 files changed, 18 insertions, 1 deletions
diff --git a/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java b/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java
index 77b9b9ef7d..1c0542b209 100644
--- a/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java
+++ b/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java
@@ -141,6 +141,9 @@ public abstract class PrivateTB3Configuration extends ScreenshotTB3Test {
@Override
protected String getBaseURL() {
+ if (isRunLocally()) {
+ return "http://localhost:8888";
+ }
String url = getProperty(DEPLOYMENT_PROPERTY);
if (url == null || url.trim().isEmpty()) {
return super.getBaseURL();
@@ -150,12 +153,26 @@ public abstract class PrivateTB3Configuration extends ScreenshotTB3Test {
@Override
protected String getDeploymentHostname() {
- if (getRunLocallyBrowser() != null) {
+ if (isRunLocally()) {
return "localhost";
}
return getConfiguredDeploymentHostname();
}
+ private boolean isRunLocally() {
+ if (properties.containsKey(RUN_LOCALLY_PROPERTY)) {
+ return true;
+ }
+
+ if (properties.containsKey(ALLOW_RUN_LOCALLY_PROPERTY)
+ && properties.get(ALLOW_RUN_LOCALLY_PROPERTY).equals("true")
+ && getClass().getAnnotation(RunLocally.class) != null) {
+ return true;
+ }
+
+ return false;
+ }
+
/**
* Gets the hostname that tests are configured to use.
*