feat(ux): run sessions from Race Day with quick actions
Race Day gets Start practice, New track layout and Create race, a session picker, only the buttons that apply, and New practice day (replaces Reset data on Timing; laps stay in the training stats). Timing is for following and links to Race Day. The Dashboard shows the three common tasks first. Guide, READMEs, screenshot and the "Run a session" video follow the flow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3a6789f42f
commit
c4df90706a
23 files changed
+344
-111
No files matched your search
@@ -13,6 +13,8 @@ export async function runRaceDaySmoke({ evaluate, navigate, fill, savedState, wa
|
||||
assert.equal(response.ok, true);
|
||||
};
|
||||
const buttonDisabled = async id => await evaluate(`document.getElementById(${JSON.stringify(id)})?.disabled`);
|
||||
// Race Day renders only the buttons that apply right now (no greyed-out Pause before a start).
|
||||
const shown = async id => await evaluate(`Boolean(document.getElementById(${JSON.stringify(id)}))`);
|
||||
|
||||
const decoder = await startFakeDecoder();
|
||||
try {
|
||||
@@ -46,8 +48,8 @@ export async function runRaceDaySmoke({ evaluate, navigate, fill, savedState, wa
|
||||
|
||||
await navigate("race_day", "raceDayStart");
|
||||
await waitFor(async () => (await buttonDisabled("raceDayStart")) === false, "start enabled once preflight is ready");
|
||||
assert.equal(await buttonDisabled("raceDayPause"), true);
|
||||
assert.equal(await buttonDisabled("raceDayFinish"), true);
|
||||
assert.equal(await shown("raceDayPause"), false, "no Pause before a start");
|
||||
assert.equal(await shown("raceDayFinish"), false, "no Finish before a start");
|
||||
|
||||
await click("raceDayStart");
|
||||
await waitFor(async () => (await findSession("Race Day Heat 1")).status === "running", "heat 1 running");
|
||||
@@ -56,15 +58,15 @@ export async function runRaceDaySmoke({ evaluate, navigate, fill, savedState, wa
|
||||
// normalizeSession() in src/app.js stores "not paused" as 0, not null (Number(null) === 0
|
||||
// passes its Number.isFinite check) - every real usage treats pausedAt as falsy, so match that.
|
||||
assert.ok(!started.pausedAt, "not paused after start");
|
||||
await waitFor(async () => (await buttonDisabled("raceDayPause")) === false, "pause enabled after start");
|
||||
await waitFor(async () => (await buttonDisabled("raceDayPause")) === false, "pause shown after start");
|
||||
assert.equal(await buttonDisabled("raceDayFinish"), false);
|
||||
assert.equal(await buttonDisabled("raceDayResume"), true);
|
||||
assert.equal(await shown("raceDayResume"), false, "no Resume while running");
|
||||
|
||||
await click("raceDayPause");
|
||||
await waitFor(async () => (await findSession("Race Day Heat 1")).status === "paused", "heat 1 paused");
|
||||
assert.ok((await findSession("Race Day Heat 1")).pausedAt, "pausedAt recorded");
|
||||
await waitFor(async () => (await buttonDisabled("raceDayResume")) === false, "resume enabled after pause");
|
||||
assert.equal(await buttonDisabled("raceDayPause"), true);
|
||||
await waitFor(async () => (await buttonDisabled("raceDayResume")) === false, "resume shown after pause");
|
||||
assert.equal(await shown("raceDayPause"), false, "no Pause while paused");
|
||||
await pause(1200);
|
||||
|
||||
await click("raceDayResume");
|
||||
|
||||
Reference in new issue
Block a user