From 191cbca7ad50046fe4d146aa65f5dcaed78b4f11 Mon Sep 17 00:00:00 2001 From: vmuzikar Date: Mon, 28 Jan 2019 18:36:17 +0100 Subject: [PATCH] UI and Node.js adapter tests fixes --- testsuite/integration-arquillian/HOW-TO-RUN.md | 3 ++- .../testsuite/drone/KeycloakWebDriverConfigurator.java | 7 +++++-- .../testsuite/console/realm/LoginSettingsTest.java | 9 ++++++++- .../tests/other/nodejs_adapter/pom.xml | 1 + 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/testsuite/integration-arquillian/HOW-TO-RUN.md b/testsuite/integration-arquillian/HOW-TO-RUN.md index 13ecccc8d0..2b0f532118 100644 --- a/testsuite/integration-arquillian/HOW-TO-RUN.md +++ b/testsuite/integration-arquillian/HOW-TO-RUN.md @@ -434,7 +434,8 @@ Although technically they can be run with almost every test in the testsuite, th * **Supported test modules:** `console`, `base-ui` * **Supported version:** 11 * **Driver download required:** [Internet Explorer Driver Server](http://www.seleniumhq.org/download/); recommended version [3.5.1 32-bit](http://selenium-release.storage.googleapis.com/3.5/IEDriverServer_Win32_3.5.1.zip) -* **Run with:** `-Dbrowser=internetExplorer -Dwebdriver.ie.driver=path/to/IEDriverServer.exe` +* **Run with:** `-Dbrowser=internetExplorer -Dwebdriver.ie.driver=path/to/IEDriverServer.exe -Dauth.server.ssl.required=false` +Note: We currently do not support SSL in IE. #### Apple Safari * **Supported test modules:** `base-ui` diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/drone/KeycloakWebDriverConfigurator.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/drone/KeycloakWebDriverConfigurator.java index d6948ea257..722a5af512 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/drone/KeycloakWebDriverConfigurator.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/drone/KeycloakWebDriverConfigurator.java @@ -54,13 +54,16 @@ public class KeycloakWebDriverConfigurator { updateCapabilityKeys("htmlUnit", webDriverCfg, capabilitiesToAdd); updateCapabilityKeys("appium", webDriverCfg, capabilitiesToAdd); configurePhantomJSDriver(webDriverCfg, capabilitiesToAdd); - acceptAllSSLCerts(capabilitiesToAdd); + acceptAllSSLCerts(webDriverCfg, capabilitiesToAdd); BrowserCapabilities browserCap = registryInstance.get().getEntryFor(webDriverCfg.getBrowser()); webDriverCfg.setBrowserInternal(new KcBrowserCapabilities(capabilitiesToAdd, browserCap)); } - private void acceptAllSSLCerts(DesiredCapabilities capabilitiesToAdd) { + private void acceptAllSSLCerts(WebDriverConfiguration webDriverCfg, DesiredCapabilities capabilitiesToAdd) { + if (webDriverCfg.getBrowser().equals("internetexplorer")) { + return; // IE not supported + } capabilitiesToAdd.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true); capabilitiesToAdd.setCapability(CapabilityType.ACCEPT_INSECURE_CERTS, true); } diff --git a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/realm/LoginSettingsTest.java b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/realm/LoginSettingsTest.java index b7a33f9285..464d6a3962 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/realm/LoginSettingsTest.java +++ b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/realm/LoginSettingsTest.java @@ -30,6 +30,7 @@ import org.keycloak.testsuite.auth.page.login.VerifyEmail; import org.keycloak.testsuite.console.page.realm.LoginSettings; import org.keycloak.testsuite.console.page.realm.LoginSettings.RequireSSLOption; import org.keycloak.testsuite.util.MailServer; +import org.keycloak.testsuite.util.URLUtils; import org.openqa.selenium.Cookie; import java.util.HashSet; @@ -284,7 +285,13 @@ public class LoginSettingsTest extends AbstractRealmTest { log.debug("set"); log.info("check HTTPS required"); - testAccountPage.navigateTo(); + String accountPageUri = testAccountPage.toString(); + if (AUTH_SERVER_SSL_REQUIRED) { // quick and dirty (and hopefully provisional) workaround to force HTTP + accountPageUri = accountPageUri + .replace("https", "http") + .replace(AUTH_SERVER_PORT, System.getProperty("auth.server.http.port")); + } + URLUtils.navigateToUri(accountPageUri); Assert.assertEquals("HTTPS required", testAccountPage.getErrorMessage()); } diff --git a/testsuite/integration-arquillian/tests/other/nodejs_adapter/pom.xml b/testsuite/integration-arquillian/tests/other/nodejs_adapter/pom.xml index c66047b795..032c469b96 100644 --- a/testsuite/integration-arquillian/tests/other/nodejs_adapter/pom.xml +++ b/testsuite/integration-arquillian/tests/other/nodejs_adapter/pom.xml @@ -38,6 +38,7 @@ 8443 9990 9999 + false