Skip to content

Commit

Permalink
feat(chat-e2e): fix replay flaky test (#1858)
Browse files Browse the repository at this point in the history
  • Loading branch information
irinakartun authored Aug 1, 2024
1 parent 1e2edfc commit 75fd22c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ export class ConversationData extends FolderData {
(m) => (m.model!.id = updatedModel.id),
);
defaultReplayConversation.replay!.replayAsIs = false;
defaultReplayConversation.selectedAddons = [];
}
return defaultReplayConversation;
}
Expand Down
16 changes: 14 additions & 2 deletions apps/chat-e2e/src/tests/abortedReplay.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ dialTest(
sendMessageAssertion,
page,
}) => {
dialTest.slow();
setTestIds('EPMRTC-512', 'EPMRTC-3451', 'EPMRTC-1448', 'EPMRTC-1132');
let firstConversation: Conversation;
let secondConversation: Conversation;
Expand Down Expand Up @@ -101,8 +102,14 @@ dialTest(
await dialTest.step(
'Verify no "Share" option is available in dropdown menu for partially replayed conversation',
async () => {
await dialHomePage.openHomePage();
await dialHomePage.openHomePage({
iconsToBeLoaded: [
firstRandomModel.iconUrl,
secondRandomModel.iconUrl,
],
});
await dialHomePage.waitForPageLoaded();
await conversations.getEntityByName(replayConversation.name).waitFor();
await conversations.openEntityDropdownMenu(replayConversation.name);
await conversationDropdownMenuAssertion.assertMenuExcludesOptions(
MenuOptions.share,
Expand Down Expand Up @@ -247,8 +254,10 @@ dialTest(
iconApiHelper,
chatMessagesAssertion,
recentEntitiesAssertion,
conversations,
page,
}) => {
dialTest.slow();
setTestIds('EPMRTC-1132');
let firstConversation: Conversation;
let secondConversation: Conversation;
Expand Down Expand Up @@ -316,8 +325,11 @@ dialTest(
await dialTest.step(
'Open conversation settings, select "Replay as is" option and verify it is highlighted',
async () => {
await dialHomePage.openHomePage();
await dialHomePage.openHomePage({
iconsToBeLoaded: [thirdRandomModel.iconUrl, newRandomModel.iconUrl],
});
await dialHomePage.waitForPageLoaded();
await conversations.getEntityByName(replayConversation.name).waitFor();
await chatHeader.openConversationSettingsPopup();
await recentEntities.replayAsIsButton.click();
await page.mouse.move(0, 0);
Expand Down
4 changes: 3 additions & 1 deletion apps/chat-e2e/src/ui/webElements/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,10 @@ export class Chat extends BaseElement {
}

public async proceedReplaying(waitForAnswer = false) {
const proceedGeneratingButton = this.getSendMessage().proceedGenerating;
await proceedGeneratingButton.waitForState();
const requestPromise = this.page.waitForRequest(API.chatHost);
await this.getSendMessage().proceedGenerating.click();
await proceedGeneratingButton.click();
const request = await requestPromise;
await this.waitForResponse(waitForAnswer);
return request.postDataJSON();
Expand Down

0 comments on commit 75fd22c

Please sign in to comment.