n8n/packages/testing/playwright/pages/components/SetupWorkflowCredentialsModal.ts
n8n-cat-bot[bot] 08a7038f97
chore: Consolidate duplicate test-id definitions in page objects (#32861)
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 15:51:49 +00:00

32 lines
898 B
TypeScript

import type { Locator, Page } from '@playwright/test';
/**
* Shared component for the "Setup workflow credentials" modal that appears in
* the workflow editor (e.g. after importing a template or skipping credential
* setup). Owns the `setup-workflow-credentials-modal` test-id so it is declared
* in a single place.
*/
export class SetupWorkflowCredentialsModal {
constructor(private readonly root: Locator) {}
static fromPage(page: Page): SetupWorkflowCredentialsModal {
return new SetupWorkflowCredentialsModal(page.getByTestId('setup-workflow-credentials-modal'));
}
getModal(): Locator {
return this.root;
}
getContinueButton(): Locator {
return this.root.getByTestId('continue-button');
}
getFormSteps(): Locator {
return this.root.getByTestId('setup-credentials-form-step');
}
async clickContinue(): Promise<void> {
await this.getContinueButton().click();
}
}