mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-17 18:35:19 +02:00
chore: implement E2E testing setup with Docker Compose and update workflow for backend and Redis services
This commit is contained in:
parent
2c8828f60c
commit
68f45335bc
9 changed files with 433 additions and 233 deletions
|
|
@ -10,15 +10,14 @@ import { expect, test as setup } from "@playwright/test";
|
|||
* POST /auth/jwt/login -> { access_token }
|
||||
* localStorage.setItem("surfsense_bearer_token", access_token)
|
||||
*
|
||||
* Requires a seeded test user in the dev/test DB. Configure via env:
|
||||
* PLAYWRIGHT_TEST_EMAIL, PLAYWRIGHT_TEST_PASSWORD
|
||||
* NEXT_PUBLIC_FASTAPI_BACKEND_URL (defaults to http://localhost:8000)
|
||||
* Requires a seeded test user in the dev/test DB. Defaults match the
|
||||
* docker/docker-compose.e2e.yml local stack and can be overridden via env.
|
||||
*/
|
||||
|
||||
const authFile = path.join(__dirname, "..", "playwright", ".auth", "user.json");
|
||||
|
||||
const TEST_USER_EMAIL = process.env.PLAYWRIGHT_TEST_EMAIL || "test@surfsense.net";
|
||||
const TEST_USER_PASSWORD = process.env.PLAYWRIGHT_TEST_PASSWORD || "TestPassword123!";
|
||||
const TEST_USER_EMAIL = process.env.PLAYWRIGHT_TEST_EMAIL || "e2e-test@surfsense.net";
|
||||
const TEST_USER_PASSWORD = process.env.PLAYWRIGHT_TEST_PASSWORD || "E2eTestPassword123!";
|
||||
const BACKEND_URL = process.env.NEXT_PUBLIC_FASTAPI_BACKEND_URL || "http://localhost:8000";
|
||||
const STORAGE_KEY = "surfsense_bearer_token";
|
||||
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@ import type { APIRequestContext } from "@playwright/test";
|
|||
|
||||
export const BACKEND_URL = process.env.NEXT_PUBLIC_FASTAPI_BACKEND_URL || "http://localhost:8000";
|
||||
|
||||
const TEST_USER_EMAIL = process.env.PLAYWRIGHT_TEST_EMAIL || "test@surfsense.net";
|
||||
const TEST_USER_PASSWORD = process.env.PLAYWRIGHT_TEST_PASSWORD || "TestPassword123!";
|
||||
const TEST_USER_EMAIL = process.env.PLAYWRIGHT_TEST_EMAIL || "e2e-test@surfsense.net";
|
||||
const TEST_USER_PASSWORD = process.env.PLAYWRIGHT_TEST_PASSWORD || "E2eTestPassword123!";
|
||||
|
||||
export async function loginAsTestUser(request: APIRequestContext): Promise<string> {
|
||||
const response = await request.post(`${BACKEND_URL}/auth/jwt/login`, {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue