playwright rewrite (#36276)

* initial version playwright rewrite

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* small refactor cancel button

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* added policies ciba to playwright

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* added policies spec

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* added flow tests

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* added axe tests for flows

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* added more tests for authentication flows

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* added client advanced test to playwright

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* added client authorization tests

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* added axe check

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* added test for initial access token

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* added registration policies test

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* added client scope test

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* added client scope tests

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* updated dependency

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* added client role test

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* fix running playwright tests

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* added client saml

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* added saml test

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* added events test

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* more groups tests

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* added group role test

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* added realm settings i18n tests

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* added oidc and saml test for identity provider

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* fix tests

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* update ci to run playwright instead of cypress

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* add masthead test and use component instead

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* added organizations test

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* added export realm test

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* added partial import

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* added realm roles

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* add realm client policies test

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* added client profile tests

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* merge errors

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* realm settings

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* added realm settings general test

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* add login tab and localization

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* realm settings accessibility test

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* added user profile test

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* added realm create test

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* added realm user registration spec

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* added sessions test

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* added kerberos test

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* added ldap mapper test

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* added ldap test

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* removed cypress tests

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* added user tab test

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* run playwright tests instead of jest tests

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* fixed some tests

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* fixed tests

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* fixed some more tests

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* fix test

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* fixed tests

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* fix test

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* removed cypress

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* remove cyperss

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* Remove some more workflow remanants from Cypress

Signed-off-by: Jon Koops <jonkoops@gmail.com>
Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* lock file

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* pr review

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

---------

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>
Signed-off-by: Jon Koops <jonkoops@gmail.com>
Co-authored-by: Jon Koops <jonkoops@gmail.com>
This commit is contained in:
Erik Jan de Wit
2025-03-12 12:35:22 +01:00
committed by GitHub
parent b1a7c79311
commit 095a194ec3
338 changed files with 10508 additions and 29025 deletions

View File

@@ -1,20 +0,0 @@
name: Cache Cypress
description: Caches Cypress binary to speed up the build.
runs:
using: composite
steps:
- id: cache-key
name: Cache key based on Cypress version
shell: bash
run: echo "key=cypress-binary-$(jq -r '.devDependencies.cypress' js/apps/admin-ui/package.json)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
name: Cache Cypress binary
with:
# See: https://docs.cypress.io/app/references/advanced-installation#Binary-cache
path: |
~/.cache/Cypress
/AppData/Local/Cypress/Cache
~/Library/Caches/Cypress
key: ${{ runner.os }}-${{ steps.cache-key.outputs.key }}

View File

@@ -23,17 +23,7 @@ runs:
- name: PNPM store cache
uses: ./.github/actions/pnpm-store-cache
- name: Cypress binary cache
uses: ./.github/actions/cypress-cache
- name: Install dependencies
shell: bash
run: pnpm install --prefer-offline --frozen-lockfile
working-directory: js
# This step is only needed to ensure that the Cypress binary is installed.
# If the binary was retrieved from the cache, this step is a no-op.
- name: Install Cypress dependencies
shell: bash
working-directory: js/apps/admin-ui
run: pnpm exec cypress install

View File

@@ -132,9 +132,6 @@ jobs:
- run: pnpm --fail-if-no-match --filter ${{ env.WORKSPACE }} build
working-directory: js
- run: pnpm --fail-if-no-match --filter ${{ env.WORKSPACE }} cy:check-types
working-directory: js
account-ui-e2e:
name: Account UI E2E
needs:
@@ -170,7 +167,7 @@ jobs:
working-directory: js
- name: Run Playwright tests
run: pnpm --fail-if-no-match --filter ${{ env.WORKSPACE }} test
run: pnpm --fail-if-no-match --filter ${{ env.WORKSPACE }} test:integration
working-directory: js
- name: Upload Playwright report
@@ -216,7 +213,6 @@ jobs:
WORKSPACE: keycloak-admin-ui
strategy:
matrix:
container: [1, 2, 3, 4, 5]
browser: [chrome, firefox]
exclude:
# Only test with Firefox on scheduled runs
@@ -225,18 +221,6 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Install Google Chrome
if: matrix.browser == 'chrome'
uses: browser-actions/setup-chrome@v1
with:
chrome-version: stable
- name: Install Firefox
if: matrix.browser == 'firefox'
uses: browser-actions/setup-firefox@v1
with:
firefox-version: latest
- uses: ./.github/actions/pnpm-setup
- name: Compile Admin Client
@@ -261,21 +245,21 @@ jobs:
KC_BOOTSTRAP_ADMIN_CLIENT_ID: temporary-admin-service
KC_BOOTSTRAP_ADMIN_CLIENT_SECRET: temporary-admin-service
- name: Start LDAP server
run: pnpm --fail-if-no-match --filter ${{ env.WORKSPACE }} cy:ldap-server &
- name: Install Playwright browsers
run: pnpm --fail-if-no-match --filter ${{ env.WORKSPACE }} exec playwright install --with-deps
working-directory: js
- name: Run Cypress
uses: cypress-io/github-action@v6
- name: Run Playwright tests
run: pnpm --fail-if-no-match --filter ${{ env.WORKSPACE }} test:integration
working-directory: js
- name: Upload Playwright report
uses: actions/upload-artifact@v4
if: always()
with:
install: false
browser: ${{ matrix.browser }}
wait-on: http://localhost:8080
working-directory: js/apps/admin-ui
env:
SPLIT: ${{ strategy.job-total }}
SPLIT_INDEX: ${{ strategy.job-index }}
SPLIT_RANDOM_SEED: ${{ needs.generate-test-seed.outputs.seed }}
name: admin-ui-playwright-report
path: js/apps/admin-ui/playwright-report
retention-days: 30
- name: Upload server logs
if: always()
@@ -284,15 +268,6 @@ jobs:
name: admin-ui-server-log-${{ matrix.container }}-${{ matrix.browser }}
path: ~/server.log
- name: Upload Cypress videos
uses: actions/upload-artifact@v4
if: always() && github.repository != 'keycloak/keycloak-private'
with:
name: cypress-videos-${{ matrix.container }}-${{ matrix.browser }}
path: js/apps/admin-ui/cypress/videos
if-no-files-found: ignore
retention-days: 10
check:
name: Status Check - Keycloak JavaScript CI
if: always()