| import { Page, Locator } from '@playwright/test'; |
| import { getByTestId } from '../core/elements'; |
| import { waitForElement } from '../core/waiting'; |
|
|
| |
| |
| |
| export async function waitForSetupView(page: Page): Promise<Locator> { |
| return waitForElement(page, 'setup-view', { timeout: 10000 }); |
| } |
|
|
| |
| |
| |
| export async function clickSetupGetStarted(page: Page): Promise<void> { |
| const button = await getByTestId(page, 'setup-start-button'); |
| await button.click(); |
| } |
|
|
| |
| |
| |
| export async function clickClaudeContinue(page: Page): Promise<void> { |
| const button = await getByTestId(page, 'claude-next-button'); |
| await button.click(); |
| } |
|
|
| |
| |
| |
| export async function clickSetupFinish(page: Page): Promise<void> { |
| const button = await getByTestId(page, 'setup-finish-button'); |
| await button.click(); |
| } |
|
|
| |
| |
| |
| export async function enterAnthropicApiKey(page: Page, apiKey: string): Promise<void> { |
| |
| const useApiKeyButton = await getByTestId(page, 'use-api-key-button'); |
| await useApiKeyButton.click(); |
|
|
| |
| const input = await getByTestId(page, 'anthropic-api-key-input'); |
| await input.fill(apiKey); |
|
|
| |
| const saveButton = await getByTestId(page, 'save-anthropic-key-button'); |
| await saveButton.click(); |
| } |
|
|
| |
| |
| |
| export async function enterOpenAIApiKey(page: Page, apiKey: string): Promise<void> { |
| |
| const useApiKeyButton = await getByTestId(page, 'use-openai-key-button'); |
| await useApiKeyButton.click(); |
|
|
| |
| const input = await getByTestId(page, 'openai-api-key-input'); |
| await input.fill(apiKey); |
|
|
| |
| const saveButton = await getByTestId(page, 'save-openai-key-button'); |
| await saveButton.click(); |
| } |
|
|