From 27f6390d00567853d81d420887c9a0dffa332271 Mon Sep 17 00:00:00 2001 From: mhajas Date: Fri, 8 Jan 2016 14:09:06 +0100 Subject: [PATCH] Fix grantServerBasedApp test --- .../org/keycloak/testsuite/auth/page/login/OAuthGrant.java | 2 +- .../adapter/example/AbstractDemoExampleAdapterTest.java | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/login/OAuthGrant.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/login/OAuthGrant.java index e3280143f2..9e53575faa 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/login/OAuthGrant.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/login/OAuthGrant.java @@ -45,6 +45,6 @@ public class OAuthGrant extends LoginActions { @Override public boolean isCurrent() { - return driver.getTitle().equals("OAuth Grant"); + return driver.getPageSource().contains("Do you grant these access privileges"); } } diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/AbstractDemoExampleAdapterTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/AbstractDemoExampleAdapterTest.java index 4672978a49..497f10f310 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/AbstractDemoExampleAdapterTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/AbstractDemoExampleAdapterTest.java @@ -17,8 +17,8 @@ import org.keycloak.testsuite.admin.ApiUtil; import org.keycloak.testsuite.auth.page.account.Account; import org.keycloak.testsuite.auth.page.account.Applications; import org.keycloak.testsuite.auth.page.login.OAuthGrant; -import org.keycloak.testsuite.console.page.clients.settings.ClientSettings; import org.keycloak.testsuite.console.page.clients.Clients; +import org.keycloak.testsuite.console.page.clients.settings.ClientSettings; import org.keycloak.testsuite.console.page.events.Config; import org.keycloak.testsuite.console.page.events.LoginEvents; import org.openqa.selenium.By; @@ -203,9 +203,6 @@ public abstract class AbstractDemoExampleAdapterTest extends AbstractExampleAdap @Test public void grantServerBasedApp() { - clientsPage.navigateTo(); - loginPage.form().login(adminUser); - ClientResource clientResource = ApiUtil.findClientResourceByClientId(testRealmResource(), "customer-portal"); ClientRepresentation client = clientResource.toRepresentation(); client.setConsentRequired(true); @@ -237,6 +234,7 @@ public abstract class AbstractDemoExampleAdapterTest extends AbstractExampleAdap assertTrue(oAuthGrantPage.isCurrent()); loginEventsPage.navigateTo(); + loginPage.form().login(adminUser); loginEventsPage.table().filter(); loginEventsPage.table().filterForm().addEventType("REVOKE_GRANT"); loginEventsPage.table().update();