wip
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { describe, it, expect, beforeEach, afterEach } from 'vitest';
|
||||
import type { StepHarness } from '../support/StepHarness';
|
||||
import { createStepHarness } from '../support/StepHarness';
|
||||
import { IRACING_SELECTORS } from 'packages/infrastructure/adapters/automation/dom/IRacingSelectors';
|
||||
|
||||
describe('Step 3 – race information', () => {
|
||||
let harness: StepHarness;
|
||||
@@ -13,26 +14,46 @@ describe('Step 3 – race information', () => {
|
||||
await harness.dispose();
|
||||
});
|
||||
|
||||
it('fills race information on Race Information page', async () => {
|
||||
it('fills race information on Race Information page and persists values in form fields', async () => {
|
||||
await harness.navigateToFixtureStep(3);
|
||||
|
||||
|
||||
const page = harness.adapter.getPage();
|
||||
expect(page).not.toBeNull();
|
||||
|
||||
|
||||
const sidebarRaceInfo = await page!.textContent(
|
||||
'#wizard-sidebar-link-set-session-information',
|
||||
);
|
||||
expect(sidebarRaceInfo).toContain('Race Information');
|
||||
|
||||
const result = await harness.executeStep(3, {
|
||||
|
||||
const config = {
|
||||
sessionName: 'GridPilot E2E Session',
|
||||
password: 'secret',
|
||||
description: 'Step 3 race information E2E',
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
const result = await harness.executeStep(3, config);
|
||||
|
||||
expect(result.success).toBe(true);
|
||||
expect(result.error).toBeUndefined();
|
||||
|
||||
|
||||
const sessionNameInput = page!
|
||||
.locator(IRACING_SELECTORS.steps.sessionName)
|
||||
.first();
|
||||
const passwordInput = page!
|
||||
.locator(IRACING_SELECTORS.steps.password)
|
||||
.first();
|
||||
const descriptionInput = page!
|
||||
.locator(IRACING_SELECTORS.steps.description)
|
||||
.first();
|
||||
|
||||
const sessionNameValue = await sessionNameInput.inputValue();
|
||||
const passwordValue = await passwordInput.inputValue();
|
||||
const descriptionValue = await descriptionInput.inputValue();
|
||||
|
||||
expect(sessionNameValue).toBe(config.sessionName);
|
||||
expect(passwordValue).toBe(config.password);
|
||||
expect(descriptionValue).toBe(config.description);
|
||||
|
||||
const footerText = await page!.textContent('.wizard-footer');
|
||||
expect(footerText).toMatch(/Server Details|Admins/i);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user