n8n/packages/testing/playwright/pages/SecuritySettingsPage.ts
n8n-cat-bot[bot] 31f718f8f8
Some checks failed
CI: Master (Build, Test, Lint) / Build for Github Cache (push) Waiting to run
CI: Master (Build, Test, Lint) / Unit tests (22.22.3) (push) Waiting to run
CI: Master (Build, Test, Lint) / Unit tests (24.16.0) (push) Waiting to run
CI: Master (Build, Test, Lint) / Lint (push) Waiting to run
CI: Master (Build, Test, Lint) / Performance (push) Waiting to run
CI: Master (Build, Test, Lint) / Notify Slack on failure (push) Blocked by required conditions
Build: Benchmark Image / build (push) Has been cancelled
Util: Sync API Docs / sync-public-api (push) Has been cancelled
Release: Schedule Patch Release PRs / Create patch release PR (${{ matrix.track }}) (beta) (push) Has been cancelled
Release: Schedule Patch Release PRs / Create patch release PR (${{ matrix.track }}) (stable) (push) Has been cancelled
Release: Schedule Patch Release PRs / Create patch release PR (${{ matrix.track }}) (v1) (push) Has been cancelled
chore: Route option selections through FloatingUiHelper (#32620)
Co-authored-by: n8n-cat-bot[bot] <n8n-cat-bot[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-18 22:22:20 +00:00

48 lines
1.4 KiB
TypeScript

import type { Locator } from '@playwright/test';
import { BasePage } from './BasePage';
type RedactionScope = 'production' | 'all';
const SCOPE_OPTION_LABEL: Record<RedactionScope, string> = {
production: 'Production executions (Recommended)',
all: 'Manual and production executions',
};
export class SecuritySettingsPage extends BasePage {
async goto() {
// Wait for the settings to load so all components are available. Attach the
// listener before navigating, or the response can land before we wait for it.
await Promise.all([
this.waitForRestResponse('/rest/settings/security', 'GET'),
this.page.goto('/settings/security'),
]);
}
getEnforcementToggle(): Locator {
return this.page.getByTestId('enable-redaction-enforcement');
}
getEnforcementScopeSelect(): Locator {
return this.page.getByTestId('redaction-enforcement-scope-select');
}
getEnforcementSummary(): Locator {
return this.page.getByTestId('redaction-enforcement-summary');
}
private getConfirmDialog(): Locator {
return this.page.getByRole('dialog');
}
async enableEnforcement(): Promise<void> {
await this.getEnforcementToggle().click();
await this.getConfirmDialog().getByRole('button', { name: 'Enable' }).click();
}
async selectScope(scope: RedactionScope): Promise<void> {
await this.getEnforcementScopeSelect().click();
await this.getVisiblePopoverOption(SCOPE_OPTION_LABEL[scope]).click();
}
}