|
22 | 22 | * the System theme; nothing is written. The Debate tab shows the account's |
23 | 23 | * real Current Debate, and its empty state comes from answering the |
24 | 24 | * current_debates read with no row. The Debate tab is shot once per side view, |
25 | | - * and with one-off mode on, with and without a Current Debate. One-off mode is |
26 | | - * in memory only; the script toggles it and never taps a debate row. |
| 25 | + * and with one-off mode on, with and without a Current Debate; Prepare and |
| 26 | + * Generate are shot in one-off mode too. One-off mode is in memory only; the |
| 27 | + * script toggles it and never taps a debate row. |
27 | 28 | * |
28 | 29 | * Ask screenshots never call a model and never save a chat: the page answers |
29 | 30 | * ai-stream from a fake stream inside the page (expo/fetch uses the page's |
@@ -458,6 +459,34 @@ async function shootAskScreens(context: BrowserContext, prefix: string, language |
458 | 459 | await streaming.close(); |
459 | 460 | } |
460 | 461 |
|
| 462 | +/** Prepare and Generate in one-off mode, reached in the app so the in-memory mode survives. Nothing is sent or saved. */ |
| 463 | +async function shootOneOffTools(page: Page, prefix: string) { |
| 464 | + await page.goto(`${ORIGIN}/`); |
| 465 | + // Opening the switcher takes the tab out of focus, which drops a load still running; let it finish first. |
| 466 | + await page.getByTestId('current-debate-motion').waitFor({ timeout: 30_000 }); |
| 467 | + await page.waitForFunction(() => !document.querySelector('[data-testid="debate-counts"]')?.textContent?.includes('–')); |
| 468 | + await settle(page); |
| 469 | + await page.getByTestId('current-debate-pill').click(); |
| 470 | + await page.getByTestId('debates-sheet').waitFor(); |
| 471 | + await settle(page); |
| 472 | + await turnOnOneOff(page); |
| 473 | + await closeSwitcher(page); |
| 474 | + await page.getByRole('tab', { name: /^(Prepare|Felkészülés|Preparar)$/ }).click(); |
| 475 | + await page.getByTestId('prepare-tool-generate').waitFor({ timeout: 30_000 }); |
| 476 | + // The Debate tab stays mounted behind Prepare with its own notice; only the visible one is Prepare's. |
| 477 | + await page.getByTestId('one-off-notice').filter({ visible: true }).waitFor(); |
| 478 | + await settle(page); |
| 479 | + await shoot(page, `${prefix}-prepare-oneoff`); |
| 480 | + await page.getByTestId('prepare-tool-generate').click(); |
| 481 | + await page.getByTestId('generate-motion').waitFor({ timeout: 30_000 }); |
| 482 | + const notice = page.getByTestId('generate-screen').getByTestId('one-off-notice'); |
| 483 | + await notice.waitFor(); |
| 484 | + await shoot(page, `${prefix}-generate-oneoff`); |
| 485 | + // Return to debate turns the mode off in place, and the strip says where work goes again. |
| 486 | + await notice.getByRole('button').click(); |
| 487 | + await page.getByTestId('generate-screen').getByTestId('working-in').waitFor(); |
| 488 | +} |
| 489 | + |
461 | 490 | async function shootEmptyDebate(page: Page, prefix: string) { |
462 | 491 | await page.route(`${REST}/current_debates*`, (route) => |
463 | 492 | route.fulfill({ status: 200, contentType: 'application/json', json: [] }), |
@@ -615,6 +644,12 @@ async function main() { |
615 | 644 | shots += 3; |
616 | 645 | await shootResultScreens(signedIn, prefix, language, problems); |
617 | 646 | shots += 9; |
| 647 | + const oneOffPage = await signedIn.newPage(); |
| 648 | + watchErrors(oneOffPage, problems, `${prefix} one-off tools`); |
| 649 | + await pinSettings(oneOffPage, language); |
| 650 | + await shootOneOffTools(oneOffPage, prefix); |
| 651 | + await oneOffPage.close(); |
| 652 | + shots += 2; |
618 | 653 | await signedIn.close(); |
619 | 654 | } |
620 | 655 | } |
|
0 commit comments