n8n/packages/testing/playwright/pages/components/SaveChangesModal.ts
n8n-cat-bot[bot] 192b5b8436
refactor: Centralize Element Plus el-message-box selectors into a (#32879)
Co-authored-by: n8n-cat-bot[bot] <n8n-cat-bot[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 18:15:29 +00:00

32 lines
744 B
TypeScript

import type { Locator } from '@playwright/test';
import { MessageBox } from './messageBoxLocators';
/**
* Save Changes Modal component for handling unsaved changes dialogs.
* Appears when navigating away from workflow with unsaved changes.
*/
export class SaveChangesModal {
constructor(private root: Locator) {}
getModal(): Locator {
return this.root.filter({ hasText: 'Save changes before leaving?' });
}
getCancelButton(): Locator {
return new MessageBox(this.root).cancelButton;
}
getCloseButton(): Locator {
return new MessageBox(this.root).closeIcon;
}
async clickCancel(): Promise<void> {
await this.getCancelButton().click();
}
async clickClose(): Promise<void> {
await this.getCloseButton().click();
}
}