*/
protected abstract String getDeploymentHostname();
+ /**
+ * Used to determine what port the test is running on
+ *
+ * @return The port teh test is running on, by default 8888
+ */
+ protected abstract String getDeploymentPort();
+
/**
* Produces a collection of browsers to run the test on. This method is
* executed by the test runner when determining how many test methods to
* @return The base URL for the test. Does not include a trailing slash.
*/
protected String getBaseURL() {
- return "http://" + getDeploymentHostname() + ":8888";
+ return "http://" + getDeploymentHostname() + ":" + getDeploymentPort();
}
/**
*/
public abstract class PrivateTB3Configuration extends ScreenshotTB3Test {
private static final String HOSTNAME_PROPERTY = "com.vaadin.testbench.deployment.hostname";
+ private static final String PORT_PROPERTY = "com.vaadin.testbench.deployment.port";
private final Properties properties = new Properties();
public PrivateTB3Configuration() {
return hostName;
}
+ @Override
+ protected String getDeploymentPort() {
+ String port = getProperty(PORT_PROPERTY);
+
+ if (port == null || "".equals(port)) {
+ port = "8888";
+ }
+
+ return port;
+ }
+
/**
* Tries to automatically determine the IP address of the machine the test
* is running on.