mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
test: Migrate UI tests from Cypress -> Playwright (no-changelog) (#18201)
This commit is contained in:
@@ -1,23 +0,0 @@
|
||||
import type { Page } from '@playwright/test';
|
||||
|
||||
export const getSuggestedActionsButton = (page: Page) => page.getByTestId('suggested-action-count');
|
||||
export const getSuggestedActionItem = (page: Page, text?: string) => {
|
||||
const items = page.getByTestId('suggested-action-item');
|
||||
if (text) {
|
||||
return items.getByText(text);
|
||||
}
|
||||
return items;
|
||||
};
|
||||
export const getSuggestedActionsPopover = (page: Page) =>
|
||||
page.locator('[data-reka-popper-content-wrapper=""]').filter({ hasText: /./ });
|
||||
|
||||
export const getErrorActionItem = (page: Page) =>
|
||||
getSuggestedActionItem(page, 'Set up error notifications');
|
||||
|
||||
export const getTimeSavedActionItem = (page: Page) =>
|
||||
getSuggestedActionItem(page, 'Track time saved');
|
||||
|
||||
export const getEvaluationsActionItem = (page: Page) =>
|
||||
getSuggestedActionItem(page, 'Test reliability of AI steps');
|
||||
|
||||
export const getIgnoreAllButton = (page: Page) => page.getByTestId('suggested-action-ignore-all');
|
||||
@@ -1,14 +0,0 @@
|
||||
import { expect } from '@playwright/test';
|
||||
import type { Page } from '@playwright/test';
|
||||
|
||||
export const getActivationModal = (page: Page) => page.getByTestId('activation-modal');
|
||||
|
||||
export const closeActivationModal = async (page: Page) => {
|
||||
await expect(getActivationModal(page)).toBeVisible();
|
||||
|
||||
// click checkbox so it does not show again
|
||||
await getActivationModal(page).getByText("Don't show again").click();
|
||||
|
||||
// confirm modal
|
||||
await getActivationModal(page).getByRole('button', { name: 'Got it' }).click();
|
||||
};
|
||||
@@ -1,3 +1,5 @@
|
||||
import { nanoid } from 'nanoid';
|
||||
|
||||
import type { n8nPage } from '../pages/n8nPage';
|
||||
|
||||
/**
|
||||
@@ -47,7 +49,7 @@ export class WorkflowComposer {
|
||||
fileName: string,
|
||||
name?: string,
|
||||
): Promise<{ workflowName: string }> {
|
||||
const workflowName = name ?? `Imported Workflow ${Date.now()}`;
|
||||
const workflowName = name ?? `Imported Workflow ${nanoid(8)}`;
|
||||
await this.n8n.goHome();
|
||||
await this.n8n.workflows.clickAddWorkflowButton();
|
||||
await this.n8n.canvas.importWorkflow(fileName, workflowName);
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
import { expect } from '@playwright/test';
|
||||
import type { Page } from '@playwright/test';
|
||||
|
||||
// Helper to open workflow settings modal
|
||||
export const openWorkflowSettings = async (page: Page) => {
|
||||
await page.getByTestId('workflow-menu').click();
|
||||
await page.getByTestId('workflow-menu-item-settings').click();
|
||||
await expect(page.getByTestId('workflow-settings-dialog')).toBeVisible();
|
||||
};
|
||||
Reference in New Issue
Block a user