test: Migrate 1-workflows to Playwright (#17360)

This commit is contained in:
shortstacked
2025-08-01 10:27:48 +01:00
committed by GitHub
parent 38cef9d133
commit b99b93a637
19 changed files with 1248 additions and 68 deletions

View File

@@ -26,4 +26,31 @@ export class WorkflowComposer {
await responsePromise;
await this.n8n.notifications.waitForNotificationAndClose(notificationMessage, { timeout });
}
/**
* Creates a new workflow by clicking the add workflow button and setting the name
* @param workflowName - The name of the workflow to create
*/
async createWorkflow(workflowName = 'My New Workflow') {
await this.n8n.workflows.clickAddWorkflowButton();
await this.n8n.canvas.setWorkflowName(workflowName);
await this.n8n.canvas.saveWorkflow();
}
/**
* Creates a new workflow by importing a JSON file
* @param fileName - The workflow JSON file name (e.g., 'test_pdf_workflow.json', will search in workflows folder)
* @param name - Optional custom name. If not provided, generates a unique name
* @returns The actual workflow name that was used
*/
async createWorkflowFromJsonFile(
fileName: string,
name?: string,
): Promise<{ workflowName: string }> {
const workflowName = name ?? `Imported Workflow ${Date.now()}`;
await this.n8n.goHome();
await this.n8n.workflows.clickAddWorkflowButton();
await this.n8n.canvas.importWorkflow(fileName, workflowName);
return { workflowName };
}
}