mirror of
https://github.com/s-frick/effigenix.git
synced 2026-03-28 17:19:56 +01:00
init e2e ui tests base skeleton
This commit is contained in:
parent
83c7321c8f
commit
c84629cc4e
16 changed files with 1219 additions and 0 deletions
29
test-automation/web-ui/fixtures/seed.fixture.ts
Normal file
29
test-automation/web-ui/fixtures/seed.fixture.ts
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
import { test as base } from '@playwright/test';
|
||||
import { ApiClient } from '../helpers/api-client.js';
|
||||
|
||||
type SeedFixtures = {
|
||||
apiClient: ApiClient;
|
||||
};
|
||||
|
||||
/**
|
||||
* Seed-Fixture: stellt einen authentifizierten ApiClient bereit.
|
||||
*
|
||||
* Strategie (zu klären in Phase 1):
|
||||
* Option A – DB-Reset vor jeder Suite via Spring Boot test-Profile + Liquibase
|
||||
* Option B – Test-Daten mit zufälligen Namen (UUID-Suffix) zur Isolation
|
||||
*
|
||||
* Aktuell: Option B als pragmatischer Einstieg.
|
||||
*/
|
||||
export const test = base.extend<SeedFixtures>({
|
||||
apiClient: async ({ request }, use) => {
|
||||
const res = await request.post('/api/auth/login', {
|
||||
data: {
|
||||
username: process.env.TEST_USER_ADMIN ?? 'admin',
|
||||
password: process.env.TEST_USER_ADMIN_PASS ?? 'admin123',
|
||||
},
|
||||
});
|
||||
const { token } = await res.json();
|
||||
const client = new ApiClient(request, token);
|
||||
await use(client);
|
||||
},
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue