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
47 lines
1.1 KiB
TypeScript
47 lines
1.1 KiB
TypeScript
import type { Page } from '@playwright/test';
|
|
|
|
/**
|
|
* Page object for AI Workflow Builder interactions
|
|
*/
|
|
export class AIBuilderPage {
|
|
readonly page: Page;
|
|
|
|
constructor(page: Page) {
|
|
this.page = page;
|
|
}
|
|
|
|
// #region Locators
|
|
|
|
getWorkflowSuggestions() {
|
|
return this.page.getByTestId('workflow-suggestions');
|
|
}
|
|
|
|
getSuggestionPills() {
|
|
// Get buttons within the pills container section, not the prompt input section
|
|
return this.getWorkflowSuggestions()
|
|
.locator('section[aria-label="Workflow suggestions"]')
|
|
.getByRole('button');
|
|
}
|
|
|
|
getCanvasBuildWithAIButton() {
|
|
return this.page.getByTestId('canvas-build-with-ai-button');
|
|
}
|
|
|
|
// #endregion
|
|
|
|
// #region Actions
|
|
|
|
async waitForWorkflowBuildComplete(options?: { timeout?: number }) {
|
|
const timeout = options?.timeout ?? 300000; // Default 5 minutes
|
|
const workingIndicator = this.page.getByText('Working...');
|
|
|
|
// First wait for the indicator to appear (building has started)
|
|
await workingIndicator.waitFor({ state: 'visible', timeout });
|
|
|
|
// Then wait for it to disappear (building is complete)
|
|
await workingIndicator.waitFor({ state: 'hidden', timeout });
|
|
}
|
|
|
|
// #endregion
|
|
}
|