mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
test: Migrate 1-workflows to Playwright (#17360)
This commit is contained in:
@@ -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 };
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user