Add openidm-ui QUnit headless browser tests to CI workflow#144
Open
Add openidm-ui QUnit headless browser tests to CI workflow#144
Conversation
Agent-Logs-Url: https://github.com/OpenIdentityPlatform/OpenIDM/sessions/6430abd9-caf0-4958-b4a6-49f9fead44c2 Co-authored-by: vharseko <6818498+vharseko@users.noreply.github.com>
…ly on Windows Agent-Logs-Url: https://github.com/OpenIdentityPlatform/OpenIDM/sessions/6430abd9-caf0-4958-b4a6-49f9fead44c2 Co-authored-by: vharseko <6818498+vharseko@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add QUnit tests for openidm-ui-admin and openidm-ui-enduser
Add openidm-ui QUnit headless browser tests to CI workflow
Apr 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
build-mavenCI job started OpenIDM and verified it was healthy, but never ran the compiled QUnit UI tests against the live instance. This adds headless Puppeteer/Chrome QUnit runs for bothopenidm-ui-admin(~170 test modules) andopenidm-ui-enduser(~6 test modules) after the service-ready check.Changes
build.yml— "Test on Unix": runsnpx grunt qunitfrom each sub-project using subshells to guarantee working-directory restoration on failurebuild.yml— "Test on Windows": equivalent PowerShell usingPush-Location/Pop-Locationwrapped intry/finallyTests run against compiled artifacts already produced by the Maven build (
target/qunit/index.html,node_modulespopulated viafrontend-maven-plugin), using the existinggrunt-contrib-qunitPuppeteer configuration (--headless=new,--no-sandbox).Original prompt
Problem
In
.github/workflows/build.yml, thebuild-mavenjob starts the OpenIDM service and verifies it's healthy via log checks, but there are no openidm-ui QUnit tests run against the live instance in a headless browser.Requirements
Add QUnit browser tests for
openidm-ui-adminandopenidm-ui-enduserthat run in a headless browser against the real running OpenIDM instance (port 8080). These tests must be added to thebuild.ymlworkflow after the service startup verification (after "OpenIDM ready" check succeeds).How the existing QUnit test infrastructure works
Test structure
openidm-ui/openidm-ui-common/src/test/qunit/index.html— QUnit test runner HTMLopenidm-ui/openidm-ui-common/src/test/qunit/testRunner.js— loadsmain.js, configuresServiceInvoker, initializes i18n, then loads test modules and callsQUnit.start()openidm-ui/openidm-ui-admin/src/test/qunit/main.js— defines ~170 admin QUnit test modulesopenidm-ui/openidm-ui-enduser/src/test/qunit/main.js— defines ~6 enduser QUnit test modulesBuild pipeline
Maven build (
mvn verify) already:frontend-maven-pluginnpm installin each sub-project (openidm-ui-admin,openidm-ui-enduser)grunt build:prodwhich compiles sources, transpiles tests, and runs QUnit via Puppeteer headless ChromeAfter Maven build, the compiled QUnit test artifacts are at:
openidm-ui/openidm-ui-admin/target/qunit/index.html— admin test runneropenidm-ui/openidm-ui-enduser/target/qunit/index.html— enduser test runneropenidm-ui/openidm-ui-admin/target/www/— compiled admin UI (JS, CSS, libs)openidm-ui/openidm-ui-enduser/target/www/— compiled enduser UI (JS, CSS, libs)Grunt QUnit config (from
Gruntfile-common.js)Package dependencies
Each sub-project (
openidm-ui-admin,openidm-ui-enduser) haspackage.jsonwithgrunt-contrib-qunit: 10.1.1which uses Puppeteer.What to add in
build.ymlFor "Test on Unix" step (after the existing log checks on lines 43-46)
After OpenIDM is confirmed running, copy the compiled QUnit test files into the running OpenIDM's UI directory so they're served via HTTP, then run the tests using the existing grunt
qunittask against the running instance. Alternatively, usenpxto run grunt qunit directly since node_modules are already installed by Maven.The key approach: run
npx grunt qunitfrom each sub-project directory (openidm-ui/openidm-ui-adminandopenidm-ui/openidm-ui-enduser). The gruntqunittask is already configured to runtarget/qunit/index.htmlin headless Puppeteer/Chrome. The test files are already compiled by the Maven build step. This runs the QUnit tests in a real headless browser.Add these lines after the existing log checks in the "Test on Unix" step:
For "Test on Windows" step (after existing log checks on lines 54-57)
Add equivalent commands. Note: the Windows step uses PowerShell, and the current working directory changes with
cd openidmat line 51. So paths need to account for being inside theopenidm/directory:Important constraints
Gruntfile-common.jsrun:block), NOT as separate steps.github/workflows/build.ymlfrontend-maven-pluginwith Node v20.12.2)node_modulesare already populated in ...This pull request was created from Copilot chat.