diff --git a/Jenkinsfile b/Jenkinsfile index 5a38e5b..44152e8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -520,7 +520,7 @@ PY def props = fileExists('build.env') ? readProperties(file: 'build.env') : [:] echo "Build complete for ${props['SEMVER'] ?: env.VERSION_TAG}" } - archiveArtifacts artifacts: 'build/**', allowEmptyArchive: true, fingerprint: true + archiveArtifacts artifacts: 'build/**, frontend/coverage/**, frontend/test-results/**, frontend/playwright-report/**', allowEmptyArchive: true, fingerprint: true } } } diff --git a/testing/frontend/e2e/home.spec.js b/testing/frontend/e2e/home.spec.js index 8437c4d..bb1885e 100644 --- a/testing/frontend/e2e/home.spec.js +++ b/testing/frontend/e2e/home.spec.js @@ -1,6 +1,33 @@ import { expect, test } from "../../../frontend/node_modules/@playwright/test/index.mjs"; test.beforeEach(async ({ page }) => { + await page.addInitScript(() => { + const originalFetch = window.fetch.bind(window); + const jsonResponse = (body) => + new Response(JSON.stringify(body), { + status: 200, + headers: { "content-type": "application/json" }, + }); + + window.fetch = (resource, options) => { + const requestUrl = typeof resource === "string" ? resource : resource?.url || ""; + const url = new URL(requestUrl, window.location.origin); + if (url.pathname === "/api/auth/config") { + return Promise.resolve(jsonResponse({ enabled: false })); + } + if (url.pathname === "/api/lab/status") { + return Promise.resolve( + jsonResponse({ + connected: true, + atlas: { up: true }, + oceanus: { up: false }, + }), + ); + } + return originalFetch(resource, options); + }; + }); + await page.route("**/api/auth/config", async (route) => { await route.fulfill({ status: 200,