chore: add wait time for loader

This commit is contained in:
Van-QA 2024-04-10 18:51:08 +07:00
parent cdab762a6a
commit 9abea8067b
3 changed files with 5 additions and 1 deletions

View File

@ -1,7 +1,7 @@
import { expect } from '@playwright/test'
import { page, test, TIMEOUT } from '../config/fixtures'
test('Select GPT model for chat via Use model button from Jan Hub', async ({ hubPage }) => {
test('Select GPT model from Hub and Chat with Invalid API Key', async ({ hubPage }) => {
await hubPage.navigateByMenu()
await hubPage.verifyContainerVisible()
@ -23,6 +23,8 @@ test('Select GPT model for chat via Use model button from Jan Hub', async ({ hub
.getByTestId('btn-send-chat')
.click()
await page.waitForSelector('[data-testid$="-loader"]', { state: 'hidden', timeout: TIMEOUT });
const APIKeyError = page.getByTestId('invalid-API-key-error')
await expect(APIKeyError).toBeVisible({
timeout: TIMEOUT,

View File

@ -31,6 +31,7 @@ export default function GenerateResponse() {
<div
className="absolute left-0 top-0 h-full bg-gray-200"
style={{ width: `${loader}%` }}
data-testid="response-loader"
/>
<span className="relative z-10">Generating response...</span>
</div>

View File

@ -40,6 +40,7 @@ export default function ModelStart() {
<div
className="absolute left-0 top-0 h-full bg-blue-200"
style={{ width: `${loader}%` }}
data-testid="model-loader"
/>
<span className="relative z-10">
{stateModel.state === 'start' ? 'Starting' : 'Stopping'}