mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-22 11:20:15 +01:00
Fix Keys Spec
This commit is contained in:
parent
d1eb7fcfc7
commit
6f250e0d6b
2 changed files with 10 additions and 10 deletions
|
|
@ -10,7 +10,7 @@ async function register(page: Page, user: User) {
|
|||
await page.getByRole('link', { name: 'Sign up' }).click();
|
||||
await page.getByLabel('Full name').click();
|
||||
await page.getByLabel('Full name').fill('test');
|
||||
await page.getByText('Username (optional)').click();
|
||||
await page.getByLabel('Username (optional)').click();
|
||||
await page.getByLabel('Username (optional)').fill('test');
|
||||
await page.getByLabel('Email').click();
|
||||
await page.getByLabel('Email').fill(user.email);
|
||||
|
|
@ -57,7 +57,7 @@ async function authenticate(config: FullConfig, user: User) {
|
|||
await page.goto(baseURL, { timeout });
|
||||
await register(page, user);
|
||||
try {
|
||||
await page.waitForURL(`${baseURL}/chat/new`, { timeout });
|
||||
await page.waitForURL(`${baseURL}/c/new`, { timeout });
|
||||
} catch (error) {
|
||||
console.error('Error:', error);
|
||||
const userExists = page.getByTestId('registration-error');
|
||||
|
|
@ -78,7 +78,7 @@ async function authenticate(config: FullConfig, user: User) {
|
|||
console.log('🤖: ✔️ user successfully logged out');
|
||||
|
||||
await login(page, user);
|
||||
await page.waitForURL(`${baseURL}/chat/new`, { timeout });
|
||||
await page.waitForURL(`${baseURL}/c/new`, { timeout });
|
||||
console.log('🤖: ✔️ user successfully authenticated');
|
||||
|
||||
await page.context().storageState({ path: storageState as string });
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { expect, test } from '@playwright/test';
|
|||
import type { Page } from '@playwright/test';
|
||||
|
||||
const enterTestKey = async (page: Page, endpoint: string) => {
|
||||
await page.getByTestId('new-conversation-menu').click();
|
||||
await page.locator('.hide-scrollbar > .group').click();
|
||||
await page.getByTestId(`endpoint-item-${endpoint}`).hover({ force: true });
|
||||
await page.getByRole('button', { name: 'Set API Key' }).click();
|
||||
await page.getByTestId(`input-${endpoint}`).fill('test');
|
||||
|
|
@ -16,13 +16,13 @@ test.describe('Key suite', () => {
|
|||
await page.goto('http://localhost:3080/', { timeout: 5000 });
|
||||
const endpoint = 'chatGPTBrowser';
|
||||
|
||||
const newTopicButton = page.getByTestId('new-conversation-menu');
|
||||
const newTopicButton = page.locator('.hide-scrollbar > .group');
|
||||
await newTopicButton.click();
|
||||
|
||||
const endpointItem = page.getByTestId(`endpoint-item-${endpoint}`);
|
||||
await endpointItem.click();
|
||||
|
||||
let setKeyButton = page.getByRole('button', { name: 'Set API key first' });
|
||||
let setKeyButton = page.getByRole('button', { name: 'Set API Key' });
|
||||
|
||||
expect(setKeyButton.count()).toBeTruthy();
|
||||
|
||||
|
|
@ -51,15 +51,15 @@ test.describe('Key suite', () => {
|
|||
|
||||
test('Test Setting and Revoking Keys from Settings', async ({ page }) => {
|
||||
await page.goto('http://localhost:3080/', { timeout: 5000 });
|
||||
const endpoint = 'bingAI';
|
||||
const endpoint = 'chatGPTBrowser';
|
||||
|
||||
const newTopicButton = page.getByTestId('new-conversation-menu');
|
||||
const newTopicButton = page.locator('.hide-scrollbar > .group');
|
||||
await newTopicButton.click();
|
||||
|
||||
const endpointItem = page.getByTestId(`endpoint-item-${endpoint}`);
|
||||
await endpointItem.click();
|
||||
|
||||
let setKeyButton = page.getByRole('button', { name: 'Set API key first' });
|
||||
let setKeyButton = page.getByRole('button', { name: 'Set API Key' });
|
||||
|
||||
expect(setKeyButton.count()).toBeTruthy();
|
||||
|
||||
|
|
@ -80,7 +80,7 @@ test.describe('Key suite', () => {
|
|||
|
||||
await page.getByRole('button', { name: 'Close' }).click();
|
||||
|
||||
setKeyButton = page.getByRole('button', { name: 'Set API key first' });
|
||||
setKeyButton = page.getByRole('button', { name: 'Set API Key' });
|
||||
expect(setKeyButton.count()).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue