From 943bd9e48e681e94ac4a4929f18221808bc8f89d Mon Sep 17 00:00:00 2001 From: wyvie Date: Thu, 5 Apr 2018 00:32:35 +0200 Subject: [PATCH] [KEYCLOAK-6808] fix for the WildflyConsoleProtectionTest Access Control is not an 'a' tag, but rather 'span' Also two tests do not behave correctly with a same Before annotated initialization, so reduce number of tests to one, which calls the other one --- .../org/keycloak/testsuite/pages/AppServerWelcomePage.java | 2 +- .../adapter/example/hal/WildflyConsoleProtectionTest.java | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/pages/AppServerWelcomePage.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/pages/AppServerWelcomePage.java index de8bc098a2..3da0273171 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/pages/AppServerWelcomePage.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/pages/AppServerWelcomePage.java @@ -34,7 +34,7 @@ public class AppServerWelcomePage extends AppServerContextRoot { @Page protected OIDCLogin loginPage; - @FindBy(xpath = "//a[text() = 'Access Control']") + @FindBy(xpath = "//span[text() = 'Access Control']") private WebElement accessControlLink; @FindBy(xpath = "//a[text() = 'Manage user profile']") diff --git a/testsuite/integration-arquillian/tests/other/adapters/jboss/wildfly/src/test/java/org/keycloak/testsuite/adapter/example/hal/WildflyConsoleProtectionTest.java b/testsuite/integration-arquillian/tests/other/adapters/jboss/wildfly/src/test/java/org/keycloak/testsuite/adapter/example/hal/WildflyConsoleProtectionTest.java index 37e3bd3d92..4159430fdf 100644 --- a/testsuite/integration-arquillian/tests/other/adapters/jboss/wildfly/src/test/java/org/keycloak/testsuite/adapter/example/hal/WildflyConsoleProtectionTest.java +++ b/testsuite/integration-arquillian/tests/other/adapters/jboss/wildfly/src/test/java/org/keycloak/testsuite/adapter/example/hal/WildflyConsoleProtectionTest.java @@ -93,8 +93,7 @@ public class WildflyConsoleProtectionTest extends AbstractAdapterTest { } } - @Test - public void testLogin() throws InterruptedException { + private void testLogin() throws InterruptedException { appServerWelcomePage.navigateToConsole(); appServerWelcomePage.login("admin", "admin"); WaitUtils.pause(2000); @@ -103,9 +102,7 @@ public class WildflyConsoleProtectionTest extends AbstractAdapterTest { @Test public void testUserCanAccessAccountService() throws InterruptedException { - appServerWelcomePage.navigateToConsole(); - appServerWelcomePage.login("admin", "admin"); - WaitUtils.pause(2000); + testLogin(); appServerWelcomePage.navigateToAccessControl(); appServerWelcomePage.navigateManageProfile(); assertTrue(accountUpdateProfilePage.isCurrent());