Q183: unsaved input is kept across pages, and leaving or closing asks before losing it
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3f8832702e
commit
2790d88186
27 files changed
+351
-41
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import { expect, type Page } from "@playwright/test";
|
||||
import { expect, type ElectronApplication, type Page } from "@playwright/test";
|
||||
|
||||
/** Runs the setup wizard with a fake OpenAI key and enters the app. */
|
||||
export async function onboard(page: Page, company: string): Promise<void> {
|
||||
@@ -17,3 +17,11 @@ export async function onboard(page: Page, company: string): Promise<void> {
|
||||
await page.getByRole("button", { name: "Finish" }).click();
|
||||
await expect(page.getByRole("button", { name: "Settings" })).toBeVisible();
|
||||
}
|
||||
|
||||
/** Closes the app, answering the unsaved-input question (a native dialog Playwright cannot click) with "discard". */
|
||||
export async function closeApp(app: ElectronApplication): Promise<void> {
|
||||
await app.evaluate(({ dialog }) => {
|
||||
dialog.showMessageBoxSync = () => 0;
|
||||
});
|
||||
await app.close();
|
||||
}
|
||||
Reference in new issue
Block a user