mirror of
https://github.com/n8n-io/n8n.git
synced 2026-05-25 05:45:24 +02:00
148 lines
3.8 KiB
TypeScript
148 lines
3.8 KiB
TypeScript
import type { Locator } from '@playwright/test';
|
|
|
|
import { BasePage } from './BasePage';
|
|
|
|
export class WorkflowSettingsModal extends BasePage {
|
|
get container() {
|
|
return this.page.getByTestId('workflow-settings-dialog');
|
|
}
|
|
|
|
getModal(): Locator {
|
|
return this.container;
|
|
}
|
|
|
|
getWorkflowMenu(): Locator {
|
|
return this.page.getByTestId('workflow-menu');
|
|
}
|
|
|
|
getSettingsMenuItem(): Locator {
|
|
return this.page.getByTestId('workflow-menu-item-settings');
|
|
}
|
|
|
|
getErrorWorkflowField(): Locator {
|
|
return this.container.getByTestId('workflow-settings-error-workflow');
|
|
}
|
|
|
|
getTimezoneField(): Locator {
|
|
return this.container.getByTestId('workflow-settings-timezone');
|
|
}
|
|
|
|
getSaveFailedExecutionsField(): Locator {
|
|
return this.container.getByTestId('workflow-settings-save-failed-executions');
|
|
}
|
|
|
|
getSaveSuccessExecutionsField(): Locator {
|
|
return this.container.getByTestId('workflow-settings-save-success-executions');
|
|
}
|
|
|
|
getSaveManualExecutionsField(): Locator {
|
|
return this.container.getByTestId('workflow-settings-save-manual-executions');
|
|
}
|
|
|
|
getSaveExecutionProgressField(): Locator {
|
|
return this.container.getByTestId('workflow-settings-save-execution-progress');
|
|
}
|
|
|
|
getTimeoutSwitch(): Locator {
|
|
return this.container.getByTestId('workflow-settings-timeout-workflow');
|
|
}
|
|
|
|
getTimeoutInput(): Locator {
|
|
return this.container.getByTestId('workflow-settings-timeout-form').locator('input').first();
|
|
}
|
|
|
|
getDuplicateMenuItem(): Locator {
|
|
return this.page.getByTestId('workflow-menu-item-duplicate');
|
|
}
|
|
|
|
getDeleteMenuItem(): Locator {
|
|
return this.page.getByTestId('workflow-menu-item-delete');
|
|
}
|
|
|
|
getArchiveMenuItem(): Locator {
|
|
return this.page.getByTestId('workflow-menu-item-archive');
|
|
}
|
|
|
|
getArchiveMenuItemWrapper(): Locator {
|
|
return this.getArchiveMenuItem();
|
|
}
|
|
|
|
getUnarchiveMenuItem(): Locator {
|
|
return this.page.getByTestId('workflow-menu-item-unarchive');
|
|
}
|
|
|
|
getPushToGitMenuItem(): Locator {
|
|
return this.page.getByTestId('workflow-menu-item-push');
|
|
}
|
|
|
|
getUnpublishMenuItem(): Locator {
|
|
return this.page.getByTestId('workflow-menu-item-unpublish');
|
|
}
|
|
|
|
getUnpublishModal(): Locator {
|
|
return this.page.getByTestId('workflow-history-version-unpublish-modal');
|
|
}
|
|
|
|
async clickUnpublishMenuItem(): Promise<void> {
|
|
await this.getUnpublishMenuItem().click();
|
|
}
|
|
|
|
async confirmUnpublishModal(): Promise<void> {
|
|
await this.getUnpublishModal().getByRole('button', { name: 'Unpublish' }).click();
|
|
}
|
|
|
|
getSaveButton(): Locator {
|
|
return this.container.getByRole('button', { name: 'Save' });
|
|
}
|
|
|
|
getDuplicateModal(): Locator {
|
|
return this.page.getByTestId('duplicate-modal');
|
|
}
|
|
|
|
getDuplicateNameInput(): Locator {
|
|
return this.getDuplicateModal().locator('input').first();
|
|
}
|
|
|
|
getDuplicateTagsInput(): Locator {
|
|
return this.getDuplicateModal().locator('.el-select__tags input');
|
|
}
|
|
|
|
getDuplicateSaveButton(): Locator {
|
|
return this.getDuplicateModal().getByRole('button', { name: /duplicate|save/i });
|
|
}
|
|
|
|
async open(): Promise<void> {
|
|
await this.getWorkflowMenu().click();
|
|
await this.getSettingsMenuItem().click();
|
|
}
|
|
|
|
async clickSave(): Promise<void> {
|
|
await this.getSaveButton().click();
|
|
}
|
|
|
|
async selectErrorWorkflow(workflowName: string): Promise<void> {
|
|
await this.getErrorWorkflowField().click();
|
|
await this.page.getByRole('option', { name: workflowName }).first().click();
|
|
}
|
|
|
|
async clickArchiveMenuItem(): Promise<void> {
|
|
await this.getArchiveMenuItem().click();
|
|
}
|
|
|
|
async clickUnarchiveMenuItem(): Promise<void> {
|
|
await this.getUnarchiveMenuItem().click();
|
|
}
|
|
|
|
async clickDeleteMenuItem(): Promise<void> {
|
|
await this.getDeleteMenuItem().click();
|
|
}
|
|
|
|
async confirmDeleteModal(): Promise<void> {
|
|
await this.page.getByRole('button', { name: 'delete' }).click();
|
|
}
|
|
|
|
async confirmArchiveModal(): Promise<void> {
|
|
await this.page.locator('.btn--confirm').click();
|
|
}
|
|
}
|