Skip to content

Commit

Permalink
fix/2676-new-conversation: fixed monitoring tests
Browse files Browse the repository at this point in the history
  • Loading branch information
irinakartun committed Nov 26, 2024
1 parent 0462651 commit 87f7ea7
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 30 deletions.
44 changes: 20 additions & 24 deletions apps/chat-e2e/src/tests/monitoring/createNewConversation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ dialTest(
'Create new conversation and send new message',
async ({
dialHomePage,
header,
conversations,
talkToEntities,
entitySettings,
Expand All @@ -34,33 +33,14 @@ dialTest(
addons,
}) => {
const expectedAddons = ModelsUtil.getAddons();
const request = 'test request';

await dialTest.step(
'Create new conversation and verify it is moved under Today section in chat bar',
'Verify the list of recent entities and default settings for default model',
async () => {
await dialHomePage.openHomePage();
await dialHomePage.waitForPageLoaded();
await header.createNewConversation();

const todayConversations = await conversations.getTodayConversations();
expect
.soft(
todayConversations.length,
ExpectedMessages.newConversationCreated,
)
.toBe(2);
for (const todayConversation of todayConversations) {
expect
.soft(todayConversation, ExpectedMessages.conversationOfToday)
.toEqual(
expect.stringContaining(ExpectedConstants.newConversationTitle),
);
}
},
);

await dialTest.step(
'Verify the list of recent entities and default settings for default model',
async () => {
const expectedDefaultRecentEntities = [];
for (const entity of recentModelIds) {
expectedDefaultRecentEntities.push(
Expand Down Expand Up @@ -110,13 +90,29 @@ dialTest(
await dialHomePage.mockChatTextResponse(
MockedChatApiResponseBodies.simpleTextBody,
);
await chat.sendRequestWithKeyboard('test request');
await chat.sendRequestWithKeyboard(request);
const messagesCount =
await chatMessages.chatMessages.getElementsCount();
expect
.soft(messagesCount, ExpectedMessages.messageCountIsCorrect)
.toBe(2);
},
);

await dialTest.step(
'Verify new conversation is moved under Today section in chat bar',
async () => {
const todayConversations = await conversations.getTodayConversations();
expect
.soft(
todayConversations.length,
ExpectedMessages.newConversationCreated,
)
.toBe(1);
expect
.soft(todayConversations[0], ExpectedMessages.conversationOfToday)
.toBe(request);
},
);
},
);
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,9 @@ dialTest(
'hidden',
);

const todayConversations = await conversations.getTodayConversations();
const todayConversationsCount = await conversations.getEntitiesCount();
expect
.soft(
todayConversations.includes(conversationInFolder.conversations[0].name),
ExpectedMessages.conversationOfToday,
)
.toBeFalsy();
.soft(todayConversationsCount, ExpectedMessages.entitiesCountIsValid)
.toBe(0);
},
);

0 comments on commit 87f7ea7

Please sign in to comment.