LibreChat/e2e/specs/popup.spec.ts
2025-02-12 17:40:38 +01:00

31 lines
No EOL
1.2 KiB
TypeScript

import { expect, test } from '@playwright/test';
import { acceptTermsIfPresent } from '../utils/acceptTermsIfPresent';
const initialNewChatSelector = '[data-testid="nav-new-chat-button"]';
test.describe('Endpoints Presets suite', () => {
test('Endpoints Suite', async ({ page }) => {
// Navigate to the application.
await page.goto('http://localhost:3080/', { timeout: 5000 });
// Accept the Terms & Conditions modal if needed.
await acceptTermsIfPresent(page);
// Click the New Chat button.
await page.locator(initialNewChatSelector).click();
// Open the endpoint menu by clicking the combobox with label "LLM Endpoint Menu".
const llmComboBox = page.getByRole('combobox', { name: 'LLM Endpoint Menu' });
await llmComboBox.click();
// Wait for the Azure OpenAI endpoint item to appear using its test ID.
const azureEndpoint = page.getByTestId('endpoint-item-azureOpenAI');
await azureEndpoint.waitFor({ state: 'visible', timeout: 5000 });
// Verify that the Azure endpoint item is visible.
expect(await azureEndpoint.isVisible()).toBeTruthy();
// Optionally, close the endpoint menu by clicking the New Chat button again.
await page.locator(initialNewChatSelector).click();
});
});