Skip to content

Commit 16dc382

Browse files
committed
Tests are updated
1 parent 2d44c89 commit 16dc382

File tree

11 files changed

+45
-35
lines changed

11 files changed

+45
-35
lines changed

apps/chat-e2e/src/tests/compareMode.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1282,7 +1282,7 @@ dialTest(
12821282
dataInjector,
12831283
compare,
12841284
conversations,
1285-
chatBar,
1285+
header,
12861286
chatHeader,
12871287
compareConversation,
12881288
conversationDropdownMenu,
@@ -1347,7 +1347,7 @@ dialTest(
13471347
await dialTest.step(
13481348
'Create new chat and verify Compare mode is closed',
13491349
async () => {
1350-
await chatBar.createNewConversation();
1350+
await header.createNewConversation();
13511351
await compare.waitForState({ state: 'hidden' });
13521352
},
13531353
);

apps/chat-e2e/src/tests/conversationNameNumeration.test.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ dialTest(
2323
async ({
2424
dialHomePage,
2525
conversations,
26-
chatBar,
26+
header,
2727
conversationData,
2828
dataInjector,
2929
setTestIds,
@@ -52,7 +52,7 @@ dialTest(
5252
await dialHomePage.waitForPageLoaded();
5353
await conversations.selectConversation(conversation.name);
5454
for (let i = 1; i <= 2; i++) {
55-
await chatBar.createNewConversation();
55+
await header.createNewConversation();
5656
await expect
5757
.soft(
5858
conversations.getEntityByName(
@@ -74,7 +74,7 @@ dialTest(
7474
async ({
7575
dialHomePage,
7676
conversations,
77-
chatBar,
77+
header,
7878
conversationData,
7979
dataInjector,
8080
conversationDropdownMenu,
@@ -113,7 +113,7 @@ dialTest(
113113
await dialHomePage.openHomePage();
114114
await dialHomePage.waitForPageLoaded();
115115
await conversations.selectConversation(secondConversation.name);
116-
await chatBar.createNewConversation();
116+
await header.createNewConversation();
117117
await expect
118118
.soft(
119119
conversations.getEntityByName(thirdConversationName),
@@ -140,7 +140,7 @@ dialTest(
140140
GeneratorUtil.randomString(7),
141141
{ isHttpMethodTriggered: false },
142142
);
143-
await chatBar.createNewConversation();
143+
await header.createNewConversation();
144144
await expect
145145
.soft(
146146
conversations.getEntityByName(fourthConversationName),
@@ -157,7 +157,7 @@ dialTest(
157157
async ({
158158
dialHomePage,
159159
conversations,
160-
chatBar,
160+
header,
161161
conversationData,
162162
dataInjector,
163163
conversationDropdownMenu,
@@ -194,7 +194,7 @@ dialTest(
194194
);
195195
await conversationDropdownMenu.selectMenuOption(MenuOptions.delete);
196196
await confirmationDialog.confirm({ triggeredHttpMethod: 'DELETE' });
197-
await chatBar.createNewConversation();
197+
await header.createNewConversation();
198198
await expect
199199
.soft(
200200
conversations.getEntityByName(
@@ -213,6 +213,7 @@ dialTest(
213213
async ({
214214
dialHomePage,
215215
conversations,
216+
header,
216217
chatBar,
217218
conversationData,
218219
dataInjector,
@@ -259,7 +260,7 @@ dialTest(
259260
folderConversation.conversations[0].name,
260261
);
261262
await chatBar.createNewFolder();
262-
await chatBar.createNewConversation();
263+
await header.createNewConversation();
263264

264265
await chatBar.dragAndDropEntityToFolder(
265266
conversations.getEntityByName(initConversationName),
@@ -283,7 +284,7 @@ dialTest(
283284
await dialTest.step(
284285
'Verify one more conversation with name "New conversation 1" can be created',
285286
async () => {
286-
await chatBar.createNewConversation();
287+
await header.createNewConversation();
287288
await expect
288289
.soft(
289290
conversations.getEntityByName(initConversationName),

apps/chat-e2e/src/tests/defaultModelSettings.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ dialTest(
3838
'Addon icon is set in recent and selected list on default screen for new chat',
3939
async ({
4040
dialHomePage,
41-
chatBar,
41+
header,
4242
conversations,
4343
recentEntities,
4444
entitySettings,
@@ -66,7 +66,7 @@ dialTest(
6666
await dialHomePage.waitForPageLoaded({
6767
isNewConversationVisible: true,
6868
});
69-
await chatBar.createNewConversation();
69+
await header.createNewConversation();
7070

7171
const todayConversations = await conversations.getTodayConversations();
7272
expect
@@ -213,7 +213,7 @@ dialTest(
213213
`It's impossible to send a message with spaces only`,
214214
async ({
215215
dialHomePage,
216-
chatBar,
216+
header,
217217
talkToSelector,
218218
chat,
219219
sendMessage,
@@ -319,7 +319,7 @@ dialTest(
319319
await dialTest.step(
320320
'Create new conversation and verify previous model is preselected and highlighted',
321321
async () => {
322-
await chatBar.createNewConversation();
322+
await header.createNewConversation();
323323
const modelBorderColors = await talkToEntities
324324
.getTalkToEntity(nonDefaultModel)
325325
.getAllBorderColors();
@@ -407,7 +407,7 @@ dialTest(
407407
'Recent "Talk to" list is updated',
408408
async ({
409409
dialHomePage,
410-
chatBar,
410+
header,
411411
chat,
412412
talkToSelector,
413413
marketplacePage,
@@ -424,7 +424,7 @@ dialTest(
424424
MockedChatApiResponseBodies.simpleTextBody,
425425
);
426426
await chat.sendRequestWithButton('test message');
427-
await chatBar.createNewConversation();
427+
await header.createNewConversation();
428428
const modelBorderColors = await talkToEntities
429429
.getTalkToEntity(nonDefaultModel)
430430
.getAllBorderColors();

apps/chat-e2e/src/tests/monitoring/createNewConversation.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ dialTest(
2424
'Create new conversation and send new message',
2525
async ({
2626
dialHomePage,
27-
chatBar,
27+
header,
2828
conversations,
2929
talkToEntities,
3030
entitySettings,
@@ -41,7 +41,7 @@ dialTest(
4141
await dialHomePage.waitForPageLoaded({
4242
isNewConversationVisible: true,
4343
});
44-
await chatBar.createNewConversation();
44+
await header.createNewConversation();
4545

4646
const todayConversations = await conversations.getTodayConversations();
4747
expect

apps/chat-e2e/src/tests/publishConversation.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ dialAdminTest(
383383
await dialHomePage.mockChatTextResponse(
384384
MockedChatApiResponseBodies.simpleTextBody,
385385
);
386-
await chatBar.createNewConversation();
386+
await header.createNewConversation();
387387
await chat.sendRequestWithButton('test');
388388
const exportedData: UploadDownloadData =
389389
await dialHomePage.downloadData(

apps/chat-e2e/src/tests/scrolling.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ dialTest(
193193
conversations,
194194
conversationDropdownMenu,
195195
conversationAssertion,
196-
chatBar,
196+
header,
197197
}) => {
198198
setTestIds('EPMRTC-493', 'EPMRTC-3072', 'EPMRTC-1783', 'EPMRTC-1754');
199199
let firstConversation: Conversation;
@@ -245,7 +245,7 @@ dialTest(
245245
undefined,
246246
{ isHttpMethodTriggered: false },
247247
);
248-
await chatBar.createNewConversation();
248+
await header.createNewConversation();
249249
await expect
250250
.soft(
251251
sendMessage.scrollDownButton.getElementLocator(),

apps/chat-e2e/src/tests/selectChatPanelEntity.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1453,6 +1453,7 @@ dialTest(
14531453
conversations,
14541454
folderConversations,
14551455
chatBar,
1456+
header,
14561457
chatFilter,
14571458
chatFilterDropdownMenu,
14581459
dataInjector,
@@ -1538,7 +1539,7 @@ dialTest(
15381539
async () => {
15391540
await conversations.openEntityDropdownMenu(singleConversation.name);
15401541
await conversationDropdownMenu.selectMenuOption(MenuOptions.select);
1541-
await chatBar.createNewConversation();
1542+
await header.createNewConversation();
15421543
await chatBarAssertion.assertUnselectAllButtonState('hidden');
15431544
},
15441545
);

apps/chat-e2e/src/tests/sharedChatIcons.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,7 +1003,7 @@ dialTest(
10031003
additionalUserShareApiHelper,
10041004
conversationDropdownMenu,
10051005
confirmationDialog,
1006-
chatBar,
1006+
header,
10071007
chat,
10081008
conversationAssertion,
10091009
setTestIds,
@@ -1115,7 +1115,7 @@ dialTest(
11151115
'Create new conversation, send any request and verify Unshare option is not available in context menu',
11161116
async () => {
11171117
const newChatRequest = '1+2';
1118-
await chatBar.createNewConversation();
1118+
await header.createNewConversation();
11191119
await dialHomePage.mockChatTextResponse(
11201120
MockedChatApiResponseBodies.simpleTextBody,
11211121
);

apps/chat-e2e/src/ui/webElements/chatBar.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -134,14 +134,6 @@ export class ChatBar extends SideBar {
134134
return this.bottomDropdownMenu;
135135
}
136136

137-
public async createNewConversation() {
138-
const modelsResponsePromise = this.page.waitForResponse(API.modelsHost);
139-
const addonsResponsePromise = this.page.waitForResponse(API.addonsHost);
140-
await this.newEntityButton.click();
141-
await modelsResponsePromise;
142-
await addonsResponsePromise;
143-
}
144-
145137
public async openCompareMode() {
146138
const modelsResponsePromise = this.page.waitForResponse(API.modelsHost);
147139
const addonsResponsePromise = this.page.waitForResponse(API.addonsHost);

apps/chat-e2e/src/ui/webElements/header.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { HeaderSelectors } from '@/src/ui/selectors';
1+
import { API } from '@/src/testData';
2+
import { HeaderSelectors, SideBarSelectors } from '@/src/ui/selectors';
23
import { AccountSettings } from '@/src/ui/webElements/accountSettings';
34
import { BaseElement } from '@/src/ui/webElements/baseElement';
45
import { Locator, Page } from '@playwright/test';
@@ -23,4 +24,16 @@ export class Header extends BaseElement {
2324
public rightPanelToggle = this.getChildElementBySelector(
2425
HeaderSelectors.rightPanelToggle,
2526
);
27+
28+
public newEntityButton = this.getChildElementBySelector(
29+
SideBarSelectors.newEntity,
30+
);
31+
32+
public async createNewConversation() {
33+
const modelsResponsePromise = this.page.waitForResponse(API.modelsHost);
34+
const addonsResponsePromise = this.page.waitForResponse(API.addonsHost);
35+
await this.newEntityButton.click();
36+
await modelsResponsePromise;
37+
await addonsResponsePromise;
38+
}
2639
}

0 commit comments

Comments
 (0)