From e70ffd0105bf7784fc78c98ba5d75c89566ae8c2 Mon Sep 17 00:00:00 2001 From: Tomas Ondrusko <67582554+tondrusk@users.noreply.github.com> Date: Mon, 28 Aug 2023 10:06:12 +0200 Subject: [PATCH] Handle GitHub logout properly (#22463) Add profile info update to GitHub login test cases Closes #22461 Signed-off-by: Tomas Ondrusko --- .../org/keycloak/testsuite/pages/social/GitHubLoginPage.java | 4 +++- .../java/org/keycloak/testsuite/broker/SocialLoginTest.java | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/pages/social/GitHubLoginPage.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/pages/social/GitHubLoginPage.java index 3b4b39b652..a0ae844a24 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/pages/social/GitHubLoginPage.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/pages/social/GitHubLoginPage.java @@ -50,6 +50,8 @@ public class GitHubLoginPage extends AbstractSocialLoginPage { public void logout() { log.info("performing logout from GitHub"); URLUtils.navigateToUri("https://github.com/logout"); - UIUtils.clickLink(logoutButton); + if (URLUtils.currentUrlEquals("https://github.com/logout")) { + UIUtils.clickLink(logoutButton); + } } } diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/SocialLoginTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/SocialLoginTest.java index ae7e335c46..d271c51075 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/SocialLoginTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/SocialLoginTest.java @@ -372,6 +372,7 @@ public class SocialLoginTest extends AbstractKeycloakTest { public void githubLogin() throws InterruptedException { setTestProvider(GITHUB); performLogin(); + assertUpdateProfile(true, true, false); appPage.assertCurrent(); testTokenExchange(); } @@ -380,6 +381,7 @@ public class SocialLoginTest extends AbstractKeycloakTest { public void githubPrivateEmailLogin() throws InterruptedException { setTestProvider(GITHUB_PRIVATE_EMAIL); performLogin(); + assertUpdateProfile(true, true, false); appPage.assertCurrent(); }