diff --git a/e2e/setup/authenticate.ts b/e2e/setup/authenticate.ts index 6abac7a7e4..e78d25bea5 100644 --- a/e2e/setup/authenticate.ts +++ b/e2e/setup/authenticate.ts @@ -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 }); diff --git a/e2e/specs/keys.spec.ts b/e2e/specs/keys.spec.ts index 021f260d60..47d8a9924a 100644 --- a/e2e/specs/keys.spec.ts +++ b/e2e/specs/keys.spec.ts @@ -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(); }); });