Skip to content

Commit c06ea06

Browse files
Copilotvharseko
andauthored
Add CI test for configurable REST context path (/myidm) (#152)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: vharseko <6818498+vharseko@users.noreply.github.com> Co-authored-by: Valery Kharseko <vharseko@3a-systems.ru>
1 parent 341483c commit c06ea06

2 files changed

Lines changed: 22 additions & 2 deletions

File tree

.github/workflows/build.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,25 @@ jobs:
6767
npx playwright test --reporter=list
6868
env:
6969
OPENIDM_URL: http://localhost:8080
70+
- name: Start OpenIDM with custom context path /myidm
71+
if: runner.os == 'Linux'
72+
run: |
73+
openidm/shutdown.sh
74+
timeout 1m bash -c 'while [ -f openidm/.openidm.pid ]; do sleep 2; done' || true
75+
rm -rf openidm/logs/*
76+
OPENIDM_OPTS="-Dlogback.configurationFile=conf/logging-config.groovy -Dopenidm.context.path=/myidm" openidm/startup.sh &
77+
timeout 3m bash -c 'until grep -q "OpenIDM ready" openidm/logs/openidm0.log.0 ; do sleep 5; done' || cat openidm/logs/openidm0.log.0
78+
grep -q "OpenIDM ready" openidm/logs/openidm0.log.0
79+
! grep "ERROR" openidm/logs/openidm0.log.0
80+
! grep "SEVERE" openidm/logs/openidm0.log.0
81+
- name: UI Smoke Tests with /myidm context path (Playwright)
82+
if: runner.os == 'Linux'
83+
run: |
84+
cd e2e
85+
npx playwright test --reporter=list
86+
env:
87+
OPENIDM_URL: http://localhost:8080
88+
OPENIDM_CONTEXT_PATH: /myidm
7089
- name: Test on Windows
7190
if: runner.os == 'Windows'
7291
run: |

e2e/ui-smoke-test.spec.mjs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import { test, expect } from "@playwright/test";
1919

2020
const BASE_URL = process.env.OPENIDM_URL || "http://localhost:8080";
21+
const CONTEXT_PATH = process.env.OPENIDM_CONTEXT_PATH || "/openidm";
2122
const ADMIN_USER = process.env.OPENIDM_ADMIN_USER || "openidm-admin";
2223
const ADMIN_PASS = process.env.OPENIDM_ADMIN_PASS || "openidm-admin";
2324

@@ -119,7 +120,7 @@ test.describe("OpenIDM UI Smoke Tests", () => {
119120
});
120121

121122
test("REST API ping is accessible", async ({ request }) => {
122-
const response = await request.get(`${BASE_URL}/openidm/info/ping`, {
123+
const response = await request.get(`${BASE_URL}${CONTEXT_PATH}/info/ping`, {
123124
headers: {
124125
"X-OpenIDM-Username": ADMIN_USER,
125126
"X-OpenIDM-Password": ADMIN_PASS,
@@ -131,7 +132,7 @@ test.describe("OpenIDM UI Smoke Tests", () => {
131132
});
132133

133134
test("REST API config endpoint is accessible", async ({ request }) => {
134-
const response = await request.get(`${BASE_URL}/openidm/config/ui/configuration`, {
135+
const response = await request.get(`${BASE_URL}${CONTEXT_PATH}/config/ui/configuration`, {
135136
headers: {
136137
"X-OpenIDM-Username": ADMIN_USER,
137138
"X-OpenIDM-Password": ADMIN_PASS,

0 commit comments

Comments
 (0)