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.3 KiB
TypeScript
43 lines
1.3 KiB
TypeScript
import type { Locator } from '@playwright/test';
|
|
|
|
export class ChatHubToolsModal {
|
|
constructor(private root: Locator) {}
|
|
|
|
getRoot(): Locator {
|
|
return this.root;
|
|
}
|
|
|
|
/** Click "Add" button next to a tool in the available tools list */
|
|
getAddButton(toolDisplayName: string): Locator {
|
|
return this.root
|
|
.locator('[class*="item"]')
|
|
.filter({ hasText: toolDisplayName })
|
|
.getByRole('button', { name: /add/i });
|
|
}
|
|
|
|
/** Credential selector rendered by NodeCredentials inside settings view */
|
|
getCredentialSelect(): Locator {
|
|
return this.root.getByTestId('node-credentials-select');
|
|
}
|
|
|
|
/** Save button in the settings view header */
|
|
getSaveButton(): Locator {
|
|
return this.root.getByRole('button', { name: /save/i });
|
|
}
|
|
|
|
/** Get a parameter input by parameter name (e.g. "operation") */
|
|
getParameterInput(parameterName: string): Locator {
|
|
return this.root.getByTestId(`parameter-input-${parameterName}`);
|
|
}
|
|
|
|
/** Get the "from AI" override button scoped to a specific parameter */
|
|
getFromAiOverrideButton(parameterName: string): Locator {
|
|
return this.getParameterInput(parameterName).getByTestId('from-ai-override-button');
|
|
}
|
|
|
|
/** Close button (X) shown in list view */
|
|
getCloseButton(): Locator {
|
|
return this.root.locator('.el-dialog__close').first();
|
|
}
|
|
}
|