Refactor infra tests, clean E2E step suites, and fix TS in tests
This commit is contained in:
43
tests/e2e/workflows/steps-07-09-cars-flow.e2e.test.ts
Normal file
43
tests/e2e/workflows/steps-07-09-cars-flow.e2e.test.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
import { describe, it, expect, beforeAll, afterAll } from 'vitest';
|
||||
import path from 'path';
|
||||
import { PlaywrightAutomationAdapter } from 'packages/infrastructure/adapters/automation';
|
||||
import { StepId } from 'packages/domain/value-objects/StepId';
|
||||
|
||||
describe('Workflow – steps 7–9 cars flow', () => {
|
||||
let adapter: PlaywrightAutomationAdapter;
|
||||
const fixtureBaseUrl = `file://${path.resolve(process.cwd(), 'html-dumps')}`;
|
||||
|
||||
beforeAll(async () => {
|
||||
adapter = new PlaywrightAutomationAdapter({
|
||||
headless: true,
|
||||
timeout: 5000,
|
||||
baseUrl: fixtureBaseUrl,
|
||||
mode: 'mock',
|
||||
});
|
||||
await adapter.connect();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await adapter.disconnect();
|
||||
});
|
||||
|
||||
it('executes time limits, cars, and add car in sequence', async () => {
|
||||
await adapter.navigateToPage(`${fixtureBaseUrl}/step-07-time-limits.html`);
|
||||
const step7Result = await adapter.executeStep(StepId.create(7), {
|
||||
practice: 10,
|
||||
qualify: 10,
|
||||
race: 20,
|
||||
});
|
||||
expect(step7Result.success).toBe(true);
|
||||
|
||||
await adapter.navigateToPage(`${fixtureBaseUrl}/step-08-set-cars.html`);
|
||||
const step8Result = await adapter.executeStep(StepId.create(8), {});
|
||||
expect(step8Result.success).toBe(true);
|
||||
|
||||
await adapter.navigateToPage(`${fixtureBaseUrl}/step-09-add-car.html`);
|
||||
const step9Result = await adapter.executeStep(StepId.create(9), {
|
||||
carSearch: 'Porsche 911 GT3 R',
|
||||
});
|
||||
expect(step9Result.success).toBe(true);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user