Skip to content

Commit

Permalink
Remove Account Console version 2
Browse files Browse the repository at this point in the history
Closes #19664

Signed-off-by: Jon Koops <jonkoops@gmail.com>
  • Loading branch information
jonkoops committed Mar 26, 2024
1 parent 2f0a9ba commit 4130daa
Show file tree
Hide file tree
Showing 84 changed files with 43 additions and 11,334 deletions.
1 change: 0 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Expand Up @@ -43,5 +43,4 @@
/js/ @keycloak/ui-maintainers
/adapters/oidc/js/ @keycloak/ui-maintainers
/rest/admin-ui-ext/ @keycloak/ui-maintainers
/themes/src/main/resources/theme/keycloak.v2/account/ @keycloak/ui-maintainers
/testsuite/integration-arquillian/tests/other/base-ui/ @keycloak/ui-maintainers
37 changes: 0 additions & 37 deletions .github/workflows/ci.yml
Expand Up @@ -578,42 +578,6 @@ jobs:
with:
job-id: fips-integration-tests-${{ matrix.mode }}

account-console-integration-tests:
name: Account Console IT
runs-on: ubuntu-latest
needs: build
timeout-minutes: 75
strategy:
matrix:
browser: [chrome]
fail-fast: false
steps:
- uses: actions/checkout@v4

- id: integration-test-setup
name: Integration test setup
uses: ./.github/actions/integration-test-setup

- name: Run Account Console IT
run: ./mvnw test ${{ env.SUREFIRE_RETRY }} -Pauth-server-quarkus -Dtest=**.account2.**,!SigningInTest#passwordlessWebAuthnTest,!SigningInTest#twoFactorWebAuthnTest -Dbrowser=${{ matrix.browser }} "-Dwebdriver.chrome.driver=$CHROMEWEBDRIVER/chromedriver" -f testsuite/integration-arquillian/tests/other/base-ui/pom.xml 2>&1 | misc/log/trimmer.sh

- name: Upload JVM Heapdumps
if: always()
uses: ./.github/actions/upload-heapdumps

- uses: ./.github/actions/upload-flaky-tests
name: Upload flaky tests
env:
GH_TOKEN: ${{ github.token }}
with:
job-name: Account Console IT

- name: Surefire reports
if: always()
uses: ./.github/actions/archive-surefire-reports
with:
job-id: account-console-integration-tests-${{ matrix.browser }}

forms-integration-tests:
name: Forms IT
runs-on: ubuntu-latest
Expand Down Expand Up @@ -797,7 +761,6 @@ jobs:
- clustering-integration-tests
- fips-unit-tests
- fips-integration-tests
- account-console-integration-tests
- forms-integration-tests
- webauthn-integration-tests
- sssd-unit-tests
Expand Down
2 changes: 0 additions & 2 deletions common/src/main/java/org/keycloak/common/Profile.java
Expand Up @@ -50,8 +50,6 @@ public enum Feature {

ACCOUNT_API("Account Management REST API", Type.DEFAULT),

@Deprecated
ACCOUNT2("Account Console version 2", Type.DEPRECATED, Feature.ACCOUNT_API),
ACCOUNT3("Account Console version 3", Type.DEFAULT, Feature.ACCOUNT_API),

ADMIN_FINE_GRAINED_AUTHZ("Fine-Grained Admin Permissions", Type.PREVIEW),
Expand Down
9 changes: 4 additions & 5 deletions common/src/test/java/org/keycloak/common/ProfileTest.java
Expand Up @@ -27,7 +27,7 @@ public class ProfileTest {
private static final Profile.Feature DISABLED_BY_DEFAULT_FEATURE = Profile.Feature.DOCKER;
private static final Profile.Feature PREVIEW_FEATURE = Profile.Feature.ADMIN_FINE_GRAINED_AUTHZ;
private static final Profile.Feature EXPERIMENTAL_FEATURE = Profile.Feature.DYNAMIC_SCOPES;
private static Profile.Feature DEPRECATED_FEATURE = Profile.Feature.ACCOUNT2;
private static Profile.Feature DEPRECATED_FEATURE = Profile.Feature.LINKEDIN_OAUTH;

@Rule
public TemporaryFolder temporaryFolder = new TemporaryFolder();
Expand Down Expand Up @@ -94,7 +94,6 @@ public void checkSuccessIfFeatureDisabledWithDisabledDependencies() {
properties.setProperty("keycloak.profile.feature.account3", "disabled");
properties.setProperty("keycloak.profile.feature.account_api", "disabled");
Profile.configure(new PropertiesProfileConfigResolver(properties));
Assert.assertFalse(Profile.isFeatureEnabled(Profile.Feature.ACCOUNT2));
Assert.assertFalse(Profile.isFeatureEnabled(Profile.Feature.ACCOUNT_API));
}

Expand Down Expand Up @@ -149,9 +148,9 @@ public void configWithCommaSeparatedList() {

@Test
public void testKeys() {
Assert.assertEquals("account2", Profile.Feature.ACCOUNT2.getKey());
Assert.assertEquals("account2", Profile.Feature.ACCOUNT2.getUnversionedKey());
Assert.assertEquals("account2:v1", Profile.Feature.ACCOUNT2.getVersionedKey());
Assert.assertEquals("account3", Profile.Feature.ACCOUNT3.getKey());
Assert.assertEquals("account3", Profile.Feature.ACCOUNT3.getUnversionedKey());
Assert.assertEquals("account3:v1", Profile.Feature.ACCOUNT3.getVersionedKey());
}

@Test
Expand Down
Expand Up @@ -34,7 +34,6 @@
"UPLOAD_SCRIPTS",
"ACCOUNT_API",
"TOKEN_EXCHANGE",
"ACCOUNT2",
"SCRIPTS",
"ADMIN_FINE_GRAINED_AUTHZ",
"OPENSHIFT_INTEGRATION",
Expand All @@ -43,7 +42,6 @@
"previewFeatures":[
"ACCOUNT_API",
"TOKEN_EXCHANGE",
"ACCOUNT2",
"SCRIPTS",
"ADMIN_FINE_GRAINED_AUTHZ",
"OPENSHIFT_INTEGRATION",
Expand Down
Expand Up @@ -49,7 +49,7 @@ public void testInvalidFeatureVersion() {
@Test
public void testValidFeatures() {
FeaturePropertyMappers.validateEnabledFeature("preview");
FeaturePropertyMappers.validateEnabledFeature(Feature.ACCOUNT2.getVersionedKey());
FeaturePropertyMappers.validateEnabledFeature(Feature.ACCOUNT3.getVersionedKey());
}

}
Expand Up @@ -47,14 +47,14 @@ public void failMultipleOptionValue(LaunchResult result) {
}

@Test
@Launch({"build", "--features", "account2", "account3"})
@Launch({"build", "--features", "linkedin-oauth", "account3"})
public void failMultipleMultiOptionValue(LaunchResult result) {
CLIResult cliResult = (CLIResult) result;
assertThat(cliResult.getErrorOutput(), containsString("Option '--features' (feature) expects one or more comma separated values without whitespace. Expected values are: "));
}

@Test
@Launch({"build", "--features", "xyz,account2"})
@Launch({"build", "--features", "xyz,account3"})
public void failInvalidMultiOptionValue(LaunchResult result) {
CLIResult cliResult = (CLIResult) result;
assertThat(cliResult.getErrorOutput(), containsString("xyz is an unrecognized feature, it should be one of"));
Expand Down
Expand Up @@ -48,10 +48,6 @@ default String getDefaultThemeName(Theme.Type type) {
return DEFAULT_V3;
}

if ((type == Theme.Type.ACCOUNT) && Profile.isFeatureEnabled(Profile.Feature.ACCOUNT2)) {
return DEFAULT_V2;
}

if ((type == Theme.Type.ADMIN) && Profile.isFeatureEnabled(Profile.Feature.ADMIN2)) {
return DEFAULT_V2;
}
Expand Down
Expand Up @@ -227,15 +227,12 @@ private void setThemes(ServerInfoRepresentation info) {

private LinkedList<String> filterThemes(Theme.Type type, LinkedList<String> themeNames) {
LinkedList<String> filteredNames = new LinkedList<>(themeNames);

boolean filterAccountV2 = (type == Theme.Type.ACCOUNT) &&
!Profile.isFeatureEnabled(Profile.Feature.ACCOUNT2);
boolean filterAdminV2 = (type == Theme.Type.ADMIN) &&
!Profile.isFeatureEnabled(Profile.Feature.ADMIN2);
boolean filterLoginV2 = (type == Theme.Type.LOGIN) &&
!Profile.isFeatureEnabled(Profile.Feature.LOGIN2);

if (filterAccountV2 || filterAdminV2 || filterLoginV2) {
if (filterAdminV2 || filterLoginV2) {
filteredNames.remove("keycloak.v2");
filteredNames.remove("rh-sso.v2");
}
Expand Down
21 changes: 0 additions & 21 deletions testsuite/integration-arquillian/HOW-TO-RUN.md
Expand Up @@ -352,17 +352,6 @@ mvn -f testsuite/integration-arquillian/tests/other/springboot-tests/pom.xml \
[-Pspringboot27]
```

## Base UI tests
Similarly to Admin Console tests, these tests are focused on UI, specifically on the parts of the server that are accessed by an end user (like Login page, or Account Console).
They are designed to work with mobile browsers (alongside the standard desktop browsers). For details on the supported browsers and their configuration please refer to [Different Browsers chapter](#different-browsers).
#### Execution example
```
mvn -f testsuite/integration-arquillian/tests/other/base-ui/pom.xml \
clean test \
-Pandroid \
-Dappium.avd=Nexus_5X_API_27
```

## Disabling features
Some features in Keycloak can be disabled. To run the testsuite with a specific feature disabled use the `auth.server.feature` system property. For example to run the tests with authorization disabled run:
```
Expand Down Expand Up @@ -454,28 +443,20 @@ You can use many different real-world browsers to run the integration tests.
Although technically they can be run with almost every test in the testsuite, they can fail with some of them as the tests often require specific optimizations for given browser. Therefore, only some of the test modules have support to be run with specific browsers.

#### Mozilla Firefox
* **Supported test modules:** `console`, `base-ui`
* **Supported version:** latest stable
* **Driver download required:** [GeckoDriver](https://github.com/mozilla/geckodriver/releases)
* **Run with:** `-Dbrowser=firefox -Dwebdriver.gecko.driver=path/to/geckodriver`; optionally you can specify `-Dfirefox_binary=path/to/firefox/binary`

#### Google Chrome
* **Supported test modules:** `console`, `base-ui`
* **Supported version:** latest stable
* **Driver download required:** [ChromeDriver](https://sites.google.com/a/chromium.org/chromedriver/) that corresponds with your version of the browser
* **Run with:** `-Dbrowser=chrome -Dwebdriver.chrome.driver=path/to/chromedriver`

#### Apple Safari
* **Supported test modules:** `base-ui`
* **Supported version:** latest stable
* **Driver download required:** no (the driver is bundled with macOS)
* **Run with:** `-Dbrowser=safari`

#### [DEPRECATED] Mozilla Firefox with legacy driver
* **Supported test modules:** `console`
* **Supported version:** [52 ESR](http://ftp.mozilla.org/pub/firefox/releases/52.9.0esr/) ([Extended Support Release](https://www.mozilla.org/en-US/firefox/organizations/))
* **Driver download required:** no
* **Run with:** `-Dbrowser=firefox -DfirefoxLegacyDriver=true -Dfirefox_binary=path/to/firefox-52-esr/binary`

#### Automatic driver downloads
You can rely on automatic driver downloads which is provided by [Arquillian Drone](http://arquillian.org/arquillian-extension-drone/#_automatic_download). To do so just omit the `-Dwebdriver.{browser}.driver` CLI argument when running the tests.
Expand All @@ -491,7 +472,6 @@ The tests will try to start the Appium server automatically but you can do it ma
To use a mobile browser you need to create a virtual device. The most convenient way to do so is to install the desired platform's IDE - either [Android Studio](https://developer.android.com/studio/) (for Android devices) or [Xcode](https://developer.apple.com/xcode/) (for iOS devices) - then you can create a device (smartphone/tablet) there. For details please refer to documentation of those IDEs.

#### Google Chrome on Android
* **Supported test modules:** `base-ui`
* **Supported host OS:** Windows, Linux, macOS
* **Supported browser version:** latest stable
* **Supported mobile OS version:** Android 7.x, 8.x
Expand All @@ -503,7 +483,6 @@ To use a mobile browser you need to create a virtual device. The most convenient
* Chrome on Android uses ChromeDriver similarly to regular desktop Chrome. The ChromeDriver is bundled with the Appium server. To use a newer ChromeDriver please follow the [Appium documentation](http://appium.io/docs/en/writing-running-appium/web/chromedriver/).

#### Apple Safari on iOS
* **Supported test modules:** `base-ui`
* **Supported host OS:** macOS
* **Supported browser version:** _depends on the mobile OS version_
* **Supported mobile OS version:** iOS 11.x
Expand Down
30 changes: 0 additions & 30 deletions testsuite/integration-arquillian/README.md
Expand Up @@ -110,36 +110,6 @@ UI testing is sometimes very tricky due to different demands and behaviours of d
The base testsuite contains custom Arquillian extensions and most functional tests.
The other test modules depend on this module.

### Base UI Testsuite
Contains most of the UI-focused tests that don't cover Admin Console, i.e. all the parts of the server that are intended to be accessed by an end user.
The tests placed here are exclusively covering the UI functionality of the server, i.e. checking if all the page elements are visible, links clickable etc., and are focused on simplicity and stability.
This differs them from other integration tests and Admin Console UI tests.

They are designed to work with most of the desktop browsers (HtmlUnit included) as well as mobile browsers (Chrome on Android and Safari on iOS). Please see [HOW-TO-RUN.md](HOW-TO-RUN.md) for details on supported browsers.

The tests are place in a separate module (`tests/other/base-ui`) and are disabled by default.

#### Types of adapter tests

1. Using *custom test servlets*
2. Using *example demo apps* from `keycloak/examples` modules.

#### Relative vs Non-relative scenario

The test suite can handle both types.
It automatically modifies imported test realms and deployments' adapter configs based on scenario type.

| Scenario | Description | Realm config (server side) | Adapter config (client side) |
| --- | --- | --- | --- |
| **Relative** | auth server == app server | client `baseUrl`, `adminUrl` and `redirect-uris` can be relative | `auth-server-url` can be relative |
| **Non-relative** | auth server != app server | client `baseUrl`, `adminUrl` and `redirect-uris` need to include FQDN of the app server | `auth-server-url` needs to include FQDN of the auth server|

#### Adapter Config Mode

1. ~~**Provided** - In `standalone.xml` using `secure-deployment`. *Wildfly only.*~~ WIP
2. **Bundled** - In the deployed war in `/WEB-INF/keycloak.json`. **Default.**


## Custom Arquillian Extensions

Custom extensions are registered in `META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension`.
Expand Down
Expand Up @@ -17,8 +17,6 @@
package org.keycloak.testsuite.util;

import org.jboss.arquillian.graphene.wait.ElementBuilder;
import org.keycloak.common.Profile;
import org.keycloak.testsuite.ProfileAssume;
import org.openqa.selenium.By;
import org.openqa.selenium.TimeoutException;
import org.openqa.selenium.WebDriver;
Expand Down Expand Up @@ -147,12 +145,6 @@ public static void waitForPageToLoad() {
log.warn("URL seems unstable! (Some redirect are probably still in progress)");
}
}

if (
ProfileAssume.isFeatureEnabled(Profile.Feature.ACCOUNT2) && currentUrl.matches("^[^\\/]+:\\/\\/[^\\/]+\\/auth\\/realms\\/[^\\/]+\\/account\\/.*$") // check for new Account Console URL
) {
pause(2000); // TODO rework this temporary workaround once KEYCLOAK-11201 and/or KEYCLOAK-8181 are fixed
}
}

public static void waitForModalFadeIn() {
Expand Down
Expand Up @@ -16,39 +16,12 @@
*/
package org.keycloak.testsuite.adapter.example.fuse;

import static org.hamcrest.Matchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.keycloak.testsuite.auth.page.AuthRealm.DEMO;
import static org.keycloak.testsuite.utils.fuse.FuseUtils.assertCommand;
import static org.keycloak.testsuite.utils.fuse.FuseUtils.getCommandOutput;
import static org.keycloak.testsuite.utils.io.IOUtil.loadRealm;
import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlStartsWith;
import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlStartsWithLoginUrlOf;

import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import javax.management.InstanceNotFoundException;
import javax.management.MBeanException;
import javax.management.MBeanServerConnection;
import javax.management.ObjectName;
import javax.management.ReflectionException;
import javax.management.remote.JMXConnector;
import javax.management.remote.JMXConnectorFactory;
import javax.management.remote.JMXServiceURL;
import org.jboss.arquillian.drone.api.annotation.Drone;
import org.jboss.arquillian.graphene.page.Page;
import org.junit.Assert;
import org.junit.Assume;
import org.junit.Before;
import org.junit.Test;
import org.keycloak.common.Profile;
import org.keycloak.protocol.oidc.OIDCLoginProtocolService;
import org.keycloak.representations.idm.RealmRepresentation;
import org.keycloak.testsuite.adapter.AbstractExampleAdapterTest;
Expand All @@ -59,21 +32,49 @@
import org.keycloak.testsuite.adapter.page.fuse.CustomerPortalFuseExample;
import org.keycloak.testsuite.adapter.page.fuse.ProductPortalFuseExample;
import org.keycloak.testsuite.arquillian.annotation.AppServerContainer;
import org.keycloak.testsuite.arquillian.annotation.DisableFeature;
import org.keycloak.testsuite.auth.page.AuthRealm;
import org.keycloak.testsuite.pages.LogoutConfirmPage;
import org.keycloak.testsuite.utils.arquillian.ContainerConstants;
import org.keycloak.testsuite.auth.page.login.OIDCLogin;
import org.keycloak.testsuite.pages.LogoutConfirmPage;
import org.keycloak.testsuite.util.DroneUtils;
import org.keycloak.testsuite.util.JavascriptBrowser;
import org.keycloak.testsuite.util.WaitUtils;
import org.keycloak.testsuite.utils.arquillian.ContainerConstants;
import org.keycloak.testsuite.utils.fuse.FuseUtils.Result;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;

import javax.management.InstanceNotFoundException;
import javax.management.MBeanException;
import javax.management.MBeanServerConnection;
import javax.management.ObjectName;
import javax.management.ReflectionException;
import javax.management.remote.JMXConnector;
import javax.management.remote.JMXConnectorFactory;
import javax.management.remote.JMXServiceURL;
import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.allOf;
import static org.hamcrest.Matchers.containsInAnyOrder;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.not;
import static org.junit.Assert.assertTrue;
import static org.keycloak.testsuite.auth.page.AuthRealm.DEMO;
import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlStartsWith;
import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlStartsWithLoginUrlOf;
import static org.keycloak.testsuite.utils.fuse.FuseUtils.assertCommand;
import static org.keycloak.testsuite.utils.fuse.FuseUtils.getCommandOutput;
import static org.keycloak.testsuite.utils.io.IOUtil.loadRealm;

@AppServerContainer(ContainerConstants.APP_SERVER_FUSE63)
@AppServerContainer(ContainerConstants.APP_SERVER_FUSE7X)
@DisableFeature(value = Profile.Feature.ACCOUNT2, skipRestart = true) // TODO remove this (KEYCLOAK-16228)
public class FuseAdapterTest extends AbstractExampleAdapterTest {


Expand Down
6 changes: 0 additions & 6 deletions testsuite/integration-arquillian/tests/other/pom.xml
Expand Up @@ -142,12 +142,6 @@
<module>sssd</module>
</modules>
</profile>
<profile>
<id>base-ui</id>
<modules>
<module>base-ui</module>
</modules>
</profile>
<profile>
<id>springboot</id>
<modules>
Expand Down

0 comments on commit 4130daa

Please sign in to comment.