Security: Sync from Public / sync-from-public (push) Has been cancelled
Test: Benchmark Nightly / build (push) Has been cancelled
Test: Benchmark Nightly / Notify Cats on failure (push) Has been cancelled
CI: Python / Checks (push) Has been cancelled
Test: Evals Python / Workflow Comparison Python (push) Has been cancelled
Util: Check Docs URLs / check-docs-urls (push) Has been cancelled
Test: Visual Storybook / Cloudflare Pages (push) Has been cancelled
Test: E2E Performance / build-and-test-performance (push) Has been cancelled
Test: Workflows Nightly / Run Workflow Tests (push) Has been cancelled
Util: Cleanup CI Docker Images / Delete stale CI images (push) Has been cancelled
Test: Benchmark Destroy Env / build (push) Has been cancelled
Util: Update Node Popularity / update-popularity (push) Has been cancelled
Test: E2E Coverage Weekly / Coverage Tests (push) Has been cancelled
43 lines
1.2 KiB
TypeScript
43 lines
1.2 KiB
TypeScript
import type { Locator, Page } from '@playwright/test';
|
|
|
|
/**
|
|
* AddResource component for creating workflows, credentials, folders, and data tables.
|
|
* Represents the "add resource" functionality in the project header.
|
|
*
|
|
* @example
|
|
* // Access via workflows page
|
|
* await n8n.workflows.addResource.workflow();
|
|
* await n8n.workflows.addResource.credential();
|
|
* await n8n.workflows.addResource.folder();
|
|
* await n8n.workflows.addResource.dataTable();
|
|
*/
|
|
export class AddResource {
|
|
constructor(private page: Page) {}
|
|
|
|
getWorkflowButton(): Locator {
|
|
return this.page.getByTestId('add-resource-workflow');
|
|
}
|
|
|
|
async workflow(): Promise<void> {
|
|
await this.getWorkflowButton().click();
|
|
}
|
|
|
|
async credential(): Promise<void> {
|
|
await this.page.getByTestId('add-resource-credential').click();
|
|
}
|
|
|
|
async folder(): Promise<void> {
|
|
await this.page.getByTestId('add-resource').click();
|
|
await this.page.getByTestId('action-folder').click();
|
|
}
|
|
|
|
async dataTable(fromDataTableTab: boolean = true): Promise<void> {
|
|
if (fromDataTableTab) {
|
|
await this.page.getByTestId('add-resource-dataTable').click();
|
|
} else {
|
|
await this.page.getByTestId('add-resource').click();
|
|
await this.page.getByTestId('action-dataTable').click();
|
|
}
|
|
}
|
|
}
|