This commit is contained in:
2025-11-30 14:00:46 +01:00
parent f8a1fbeb50
commit 9a1feb2912
37 changed files with 3079 additions and 7301 deletions

View File

@@ -1,35 +1,27 @@
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';
import { describe, it, expect, beforeEach, afterEach } from 'vitest';
import type { StepHarness } from '../support/StepHarness';
import { createStepHarness } from '../support/StepHarness';
describe('Step 7 time limits', () => {
let adapter: PlaywrightAutomationAdapter;
const fixtureBaseUrl = `file://${path.resolve(process.cwd(), 'html-dumps')}`;
let harness: StepHarness;
beforeAll(async () => {
adapter = new PlaywrightAutomationAdapter({
headless: true,
timeout: 5000,
baseUrl: fixtureBaseUrl,
mode: 'mock',
});
await adapter.connect();
beforeEach(async () => {
harness = await createStepHarness();
});
afterAll(async () => {
await adapter.disconnect();
afterEach(async () => {
await harness.dispose();
});
it('executes on Time Limits page and navigates to Cars', async () => {
await adapter.navigateToPage(`${fixtureBaseUrl}/step-07-time-limits.html`);
const page = adapter.getPage();
await harness.navigateToFixtureStep(7);
const page = harness.adapter.getPage();
expect(page).not.toBeNull();
const stepIndicatorBefore = await page!.textContent('[data-indicator]');
expect(stepIndicatorBefore).toContain('Time Limits');
const result = await adapter.executeStep(StepId.create(7), {
const result = await harness.executeStep(7, {
practice: 10,
qualify: 10,
race: 20,