Skip to content

Commit

Permalink
fix(chat-e2e): fixed flaky tests for header tooltip (epam#1814)
Browse files Browse the repository at this point in the history
  • Loading branch information
irinakartun authored Jul 23, 2024
1 parent 57905f5 commit ee1500a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
7 changes: 6 additions & 1 deletion apps/chat-e2e/src/tests/chatHeader.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { Conversation } from '@/chat/types/chat';
import { DialAIEntityModel } from '@/chat/types/models';
import dialTest from '@/src/core/dialFixtures';
import { ExpectedMessages } from '@/src/testData';
import { API, ExpectedMessages } from '@/src/testData';
import { responseThrottlingTimeout } from '@/src/ui/pages';
import { ModelsUtil } from '@/src/utils';
import { expect } from '@playwright/test';

Expand Down Expand Up @@ -55,6 +56,10 @@ dialTest(
async () => {
await dialHomePage.openHomePage();
await dialHomePage.waitForPageLoaded();
await dialHomePage.throttleAPIResponse(
API.chatHost,
responseThrottlingTimeout * 2,
);
const requestsData = await chat.sendRequestWithKeyboard(request, false);

expect
Expand Down
3 changes: 3 additions & 0 deletions apps/chat-e2e/src/tests/replay.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { FolderInterface } from '@/chat/types/folder';
import { DialAIEntityModel } from '@/chat/types/models';
import dialTest from '@/src/core/dialFixtures';
import {
API,
ExpectedConstants,
ExpectedMessages,
Import,
Expand Down Expand Up @@ -284,6 +285,7 @@ dialTest(
await talkToSelector.selectModel(bison);
await entitySettings.setSystemPrompt(replayPrompt);
await temperatureSlider.setTemperature(replayTemp);
await dialHomePage.throttleAPIResponse(API.chatHost);
replayRequest = await chat.startReplay();
},
);
Expand Down Expand Up @@ -585,6 +587,7 @@ dialTest(
iconsToBeLoaded: [gpt35Model.iconUrl],
});
await dialHomePage.waitForPageLoaded();
await dialHomePage.throttleAPIResponse(API.chatHost);
replayRequest = await chat.startReplay(
conversation.messages[0].content,
);
Expand Down
2 changes: 1 addition & 1 deletion apps/chat-e2e/src/ui/pages/basePage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export interface UploadDownloadData {
}

const apiTimeout = 35000;
const responseThrottlingTimeout = 2500;
export const responseThrottlingTimeout = 2500;

export class BasePage {
protected page: Page;
Expand Down

0 comments on commit ee1500a

Please sign in to comment.