Details
diff --git a/testsuite/integration-arquillian/HOW-TO-RUN.md b/testsuite/integration-arquillian/HOW-TO-RUN.md
index f804bf1..b30e836 100644
--- a/testsuite/integration-arquillian/HOW-TO-RUN.md
+++ b/testsuite/integration-arquillian/HOW-TO-RUN.md
@@ -273,20 +273,17 @@ mvn -f testsuite/integration-arquillian/tests/other/console/pom.xml \
```
## Welcome Page tests
-The Welcome Page tests need to be run on WildFly/EAP and with `-Dskip.add.user.json` switch. So that they are disabled by default and are meant to be run separately.
+The Welcome Page tests need to be run on WildFly/EAP. So that they are disabled by default and are meant to be run separately.
# Prepare servers
mvn -f testsuite/integration-arquillian/servers/pom.xml \
clean install \
- -Pauth-server-wildfly \
- -Papp-server-wildfly
+ -Pauth-server-wildfly
# Run tests
- mvn -f testsuite/integration-arquillian/tests/base/pom.xml \
+ mvn -f testsuite/integration-arquillian/tests/other/welcome-page/pom.xml \
clean test \
- -Dtest=WelcomePageTest \
- -Dskip.add.user.json \
-Pauth-server-wildfly
diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/WelcomePage.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/WelcomePage.java
index 9f34a40..41398b8 100644
--- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/WelcomePage.java
+++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/WelcomePage.java
@@ -21,6 +21,9 @@ import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
+import static org.keycloak.testsuite.page.Form.setInputValue;
+import static org.keycloak.testsuite.util.UIUtils.clickLink;
+
/**
* @author <a href="mailto:sthorger@redhat.com">Stian Thorgersen</a>
*/
@@ -44,16 +47,11 @@ public class WelcomePage extends AuthServer {
}
public void setPassword(String username, String password) {
- usernameInput.clear();
- usernameInput.sendKeys(username);
-
- passwordInput.clear();
- passwordInput.sendKeys(password);
-
- passwordConfirmationInput.clear();
- passwordConfirmationInput.sendKeys(password);
+ setInputValue(usernameInput, username);
+ setInputValue(passwordInput, password);
+ setInputValue(passwordConfirmationInput, password);
- createButton.click();
+ clickLink(createButton);
if (!driver.getPageSource().contains("User created")) {
throw new RuntimeException("Failed to updated password");
@@ -61,7 +59,7 @@ public class WelcomePage extends AuthServer {
}
public void navigateToAdminConsole() {
- driver.findElement(By.linkText("Administration Console")).click();
+ clickLink(driver.findElement(By.linkText("Administration Console")));
}
}
diff --git a/testsuite/integration-arquillian/tests/other/pom.xml b/testsuite/integration-arquillian/tests/other/pom.xml
index 52415e0..98d7ce9 100644
--- a/testsuite/integration-arquillian/tests/other/pom.xml
+++ b/testsuite/integration-arquillian/tests/other/pom.xml
@@ -161,6 +161,12 @@
<module>server-config-migration</module>
</modules>
</profile>
+ <profile>
+ <id>welcome-page</id>
+ <modules>
+ <module>welcome-page</module>
+ </modules>
+ </profile>
</profiles>
</project>
diff --git a/testsuite/integration-arquillian/tests/other/welcome-page/pom.xml b/testsuite/integration-arquillian/tests/other/welcome-page/pom.xml
new file mode 100644
index 0000000..8c7b412
--- /dev/null
+++ b/testsuite/integration-arquillian/tests/other/welcome-page/pom.xml
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Copyright 2018 Red Hat, Inc. and/or its affiliates
+ ~ and other contributors as indicated by the @author tags.
+ ~
+ ~ 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 the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <artifactId>integration-arquillian-tests-other</artifactId>
+ <groupId>org.keycloak.testsuite</groupId>
+ <version>4.0.0.CR1-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>integration-arquillian-tests-welcome-page</artifactId>
+
+ <name>Welcome Page tests</name>
+
+ <properties>
+ <browser>phantomjs</browser>
+ <skip.add.user.json>true</skip.add.user.json>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <systemProperties>
+ <pageload.timeout>60000</pageload.timeout> <!-- accessing through external IP could be slow -->
+ </systemProperties>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>enforce</goal>
+ </goals>
+ <configuration>
+ <rules>
+ <requireProperty>
+ <property>auth.server</property>
+ <regex>(wildfly)|(eap)</regex>
+ <regexMessage>Tests require activation of profile "auth-server-wildfly" or "auth-server-eap".</regexMessage>
+ </requireProperty>
+ </rules>
+ <fail>true</fail>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
\ No newline at end of file