Skip to content

Commit 23f9fc3

Browse files
author
Sviatlana Marozka
committed
Merge remote-tracking branch 'upstream/development' into feat/open-graphic-at-full-screen
2 parents a21f432 + 7a6ffb9 commit 23f9fc3

File tree

359 files changed

+8376
-5204
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

359 files changed

+8376
-5204
lines changed

.github/workflows/deploy_dev.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
jobs:
77
gitlab-dev-deploy:
88
if: ${{ github.event.registry_package.package_version.container_metadata.tag.name == 'development' }}
9-
uses: epam/ai-dial-ci/.github/workflows/deploy-development.yml@1.12.1
9+
uses: epam/ai-dial-ci/.github/workflows/deploy-development.yml@1.13.0
1010
with:
1111
gitlab-project-id: "1827"
1212
secrets:
@@ -16,7 +16,7 @@ jobs:
1616

1717
gitlab-dev-deploy-overlay:
1818
if: ${{ github.event.registry_package.package_version.container_metadata.tag.name == 'development' }}
19-
uses: epam/ai-dial-ci/.github/workflows/deploy-development.yml@1.12.1
19+
uses: epam/ai-dial-ci/.github/workflows/deploy-development.yml@1.13.0
2020
with:
2121
gitlab-project-id: "1856"
2222
secrets:

.github/workflows/e2e_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
jobs:
77
e2e-tests:
88
if: ${{ github.event.registry_package.package_version.container_metadata.tag.name == 'development' }}
9-
uses: epam/ai-dial-ci/.github/workflows/e2e-test.yml@1.12.1
9+
uses: epam/ai-dial-ci/.github/workflows/e2e-test.yml@1.13.0
1010
with:
1111
gitlab-project-id: "1843"
1212
secrets:

.github/workflows/pr-title-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ concurrency:
1313

1414
jobs:
1515
pr-title-check:
16-
uses: epam/ai-dial-ci/.github/workflows/pr-title-check.yml@1.12.1
16+
uses: epam/ai-dial-ci/.github/workflows/pr-title-check.yml@1.13.0
1717
secrets:
1818
ACTIONS_BOT_TOKEN: ${{ secrets.ACTIONS_BOT_TOKEN }}

.github/workflows/pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ concurrency:
1010

1111
jobs:
1212
run_tests:
13-
uses: epam/ai-dial-ci/.github/workflows/node_pr.yml@1.12.1
13+
uses: epam/ai-dial-ci/.github/workflows/node_pr.yml@1.13.0
1414
secrets: inherit
1515
with:
1616
node_version: 22

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ concurrency:
1010

1111
jobs:
1212
release:
13-
uses: epam/ai-dial-ci/.github/workflows/node_release.yml@1.12.1
13+
uses: epam/ai-dial-ci/.github/workflows/node_release.yml@1.13.0
1414
secrets: inherit
1515
with:
1616
node_version: 22

apps/chat-e2e/src/assertions/base/baseAssertion.ts

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@ export class BaseAssertion {
2424
}
2525

2626
public async assertEntityIcon(
27-
iconLocator: Locator,
27+
icon: Locator | BaseElement,
2828
expectedIconSource?: string,
2929
) {
30-
const actualIconSource = await iconLocator
30+
const elementLocator = this.getElementLocator(icon);
31+
const actualIconSource = await elementLocator
3132
.getAttribute(Attributes.src)
3233
.then((s) => IconApiHelper.getNonCachedIconSource(s));
3334
//assert icon source is valid
@@ -37,8 +38,8 @@ export class BaseAssertion {
3738
.toBe(expectedIconSource);
3839
}
3940
//assert icon is loaded and displayed
40-
await expect(iconLocator).toHaveJSProperty('complete', true);
41-
await expect(iconLocator).not.toHaveJSProperty('naturalWidth', 0);
41+
await expect(elementLocator).toHaveJSProperty('complete', true);
42+
await expect(elementLocator).not.toHaveJSProperty('naturalWidth', 0);
4243
}
4344

4445
public assertArrayIncludesAll(
@@ -316,6 +317,19 @@ export class BaseAssertion {
316317
.toBe(expectedCount);
317318
}
318319

320+
public assertNumberIsGreaterThan(
321+
actualNumber: number,
322+
expectedNumber: number,
323+
expectedMessage?: string,
324+
) {
325+
expect
326+
.soft(
327+
actualNumber,
328+
expectedMessage ?? ExpectedMessages.elementsCountIsValid,
329+
)
330+
.toBeGreaterThan(expectedNumber);
331+
}
332+
319333
public assertValue(
320334
actualValue: string | number | undefined | null,
321335
expectedValue: string | number,

apps/chat-e2e/src/assertions/promptModalAssertion.ts

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,43 @@
1+
import { BaseAssertion } from '@/src/assertions/base/baseAssertion';
12
import { ExpectedMessages } from '@/src/testData';
2-
import { Colors } from '@/src/ui/domData';
3-
import { PromptModalDialog } from '@/src/ui/webElements';
3+
import { ThemeColorAttributes } from '@/src/ui/domData';
4+
import { BaseElement, PromptModalDialog } from '@/src/ui/webElements';
5+
import { ThemesUtil } from '@/src/utils/themesUtil';
46
import { expect } from '@playwright/test';
57

6-
export class PromptModalAssertion {
8+
export class PromptModalAssertion extends BaseAssertion {
79
readonly promptModalDialog: PromptModalDialog;
810

911
constructor(promptModalDialog: PromptModalDialog) {
12+
super();
1013
this.promptModalDialog = promptModalDialog;
1114
}
1215

13-
public async assertNameFieldIsInvalid(expectedErrorMessage: string) {
14-
const nameBorderColors =
15-
await this.promptModalDialog.name.getAllBorderColors();
16-
Object.values(nameBorderColors).forEach((borders) => {
17-
borders.forEach((borderColor) => {
18-
expect
19-
.soft(borderColor, ExpectedMessages.fieldIsHighlightedWithRed)
20-
.toBe(Colors.textError);
21-
});
22-
});
16+
public async assertFieldIsInvalid(
17+
element: BaseElement,
18+
expectedErrorMessage: string,
19+
) {
20+
await this.assertElementBorderColors(
21+
element,
22+
ThemesUtil.getRgbColorByKey(ThemeColorAttributes.textError),
23+
);
24+
const nameFieldErrorMessage =
25+
this.promptModalDialog.getFieldBottomMessage(element);
26+
await this.assertElementText(nameFieldErrorMessage, expectedErrorMessage);
27+
}
2328

24-
const nameFieldErrorMessage = this.promptModalDialog.getFieldBottomMessage(
29+
public async assertNameFieldIsInvalid(expectedErrorMessage: string) {
30+
await this.assertFieldIsInvalid(
2531
this.promptModalDialog.name,
32+
expectedErrorMessage,
2633
);
27-
await nameFieldErrorMessage.waitFor();
34+
}
2835

29-
await expect
30-
.soft(nameFieldErrorMessage, ExpectedMessages.promptNameInvalid)
31-
.toHaveText(expectedErrorMessage);
36+
public async assertPromptFieldIsInvalid(expectedErrorMessage: string) {
37+
await this.assertFieldIsInvalid(
38+
this.promptModalDialog.prompt,
39+
expectedErrorMessage,
40+
);
3241
}
3342

3443
public async assertNameFieldIsEmpty() {
Lines changed: 8 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
import { PromptPreviewModalAssertion } from '@/src/assertions/promptPreviewModalAssertion';
2-
import { ExpectedMessages } from '@/src/testData';
3-
import { Styles } from '@/src/ui/domData';
42
import { SharedPromptPreviewModal } from '@/src/ui/webElements';
5-
import { expect } from '@playwright/test';
63

74
export class SharedPromptPreviewModalAssertion extends PromptPreviewModalAssertion {
85
readonly sharedPromptPreviewModal: SharedPromptPreviewModal;
@@ -13,42 +10,16 @@ export class SharedPromptPreviewModalAssertion extends PromptPreviewModalAsserti
1310
}
1411

1512
public async assertExportButtonColors(expectedColor: string) {
16-
const buttonColor =
17-
await this.sharedPromptPreviewModal.promptExportButton.getComputedStyleProperty(
18-
Styles.color,
19-
);
20-
const buttonBordersColor =
21-
await this.sharedPromptPreviewModal.promptExportButton.getAllBorderColors();
22-
23-
expect
24-
.soft(buttonColor[0], ExpectedMessages.elementColorIsValid)
25-
.toBe(expectedColor);
26-
Object.values(buttonBordersColor).forEach((borders) => {
27-
borders.forEach((borderColor) => {
28-
expect
29-
.soft(borderColor, ExpectedMessages.borderColorsAreValid)
30-
.toBe(expectedColor);
31-
});
32-
});
13+
const exportButtonElement =
14+
this.sharedPromptPreviewModal.promptExportButtonIcon;
15+
await this.assertElementColor(exportButtonElement, expectedColor);
16+
await this.assertElementBorderColors(exportButtonElement, expectedColor);
3317
}
3418

3519
public async assertDeleteButtonColors(expectedColor: string) {
36-
const buttonColor =
37-
await this.sharedPromptPreviewModal.promptDeleteButton.getComputedStyleProperty(
38-
Styles.color,
39-
);
40-
const buttonBordersColor =
41-
await this.sharedPromptPreviewModal.promptDeleteButton.getAllBorderColors();
42-
43-
expect
44-
.soft(buttonColor[0], ExpectedMessages.elementColorIsValid)
45-
.toBe(expectedColor);
46-
Object.values(buttonBordersColor).forEach((borders) => {
47-
borders.forEach((borderColor) => {
48-
expect
49-
.soft(borderColor, ExpectedMessages.borderColorsAreValid)
50-
.toBe(expectedColor);
51-
});
52-
});
20+
const deleteButtonElement =
21+
this.sharedPromptPreviewModal.promptDeleteButtonIcon;
22+
await this.assertElementColor(deleteButtonElement, expectedColor);
23+
await this.assertElementBorderColors(deleteButtonElement, expectedColor);
5324
}
5425
}

apps/chat-e2e/src/assertions/talkToAgentDialogAssertion.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export class TalkToAgentDialogAssertion extends BaseAssertion {
3434
expectedState: ElementState,
3535
) {
3636
await super.assertElementState(
37-
this.talkToAgentDialog.getAgents().getAgent(agent),
37+
this.talkToAgentDialog.getTalkToAgent(agent),
3838
expectedState,
3939
MarketplaceExpectedMessages.agentIsVisible,
4040
);

apps/chat-e2e/src/core/dialFixtures.ts

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import {
55
AgentInfo,
66
AppEditorContainer,
77
AppEditorGeneralForm,
8+
AppEditorGeneralInfoAgentPreview,
89
AppEditorHeader,
9-
AppEditorPreview,
1010
AppEditorViewForm,
1111
AttachFilesModal,
1212
Chat,
@@ -85,11 +85,13 @@ import { PublicationApiHelper } from '@/src/testData/api/publicationApiHelper';
8585
import { ApiInjector } from '@/src/testData/injector/apiInjector';
8686
import { BrowserStorageInjector } from '@/src/testData/injector/browserStorageInjector';
8787
import { DataInjectorInterface } from '@/src/testData/injector/dataInjectorInterface';
88+
import { DialErrorPage } from '@/src/ui/pages/DialErrorPage';
8889
import { AccountSettings } from '@/src/ui/webElements/accountSettings';
8990
import { Addons } from '@/src/ui/webElements/addons';
9091
import { AddonsDialog } from '@/src/ui/webElements/addonsDialog';
9192
import { AgentSettings } from '@/src/ui/webElements/agentSettings';
9293
import { AppContainer } from '@/src/ui/webElements/appContainer';
94+
import { AppEditorAppSettingsAgentPreview } from '@/src/ui/webElements/appEditor/appEditorAppSettingsAgentPreview';
9395
import { Banner } from '@/src/ui/webElements/banner';
9496
import { Compare } from '@/src/ui/webElements/compare';
9597
import { ConfirmationDialog } from '@/src/ui/webElements/confirmationDialog';
@@ -152,6 +154,7 @@ export const stateFilePath = (index: number) =>
152154
const dialTest = test.extend<{
153155
beforeTestCleanup: string;
154156
dialHomePage: DialHomePage;
157+
dialErrorPage: DialErrorPage;
155158
marketplacePage: MarketplacePage;
156159
appEditorPage: AppEditorPage;
157160
appContainer: AppContainer;
@@ -168,7 +171,8 @@ const dialTest = test.extend<{
168171
appEditorHeader: AppEditorHeader;
169172
appEditorHeaderAssertion: AppEditorHeaderAssertion;
170173
appEditorGeneralForm: AppEditorGeneralForm;
171-
appEditorPreview: AppEditorPreview;
174+
appEditorGeneralInfoAgentPreview: AppEditorGeneralInfoAgentPreview;
175+
appEditorAppSettingsAgentPreview: AppEditorAppSettingsAgentPreview;
172176
appEditorViewForm: AppEditorViewForm;
173177
chatBar: ChatBar;
174178
navigationPanel: NavigationPanel;
@@ -409,6 +413,10 @@ const dialTest = test.extend<{
409413
const dialHomePage = new DialHomePage(page);
410414
await use(dialHomePage);
411415
},
416+
dialErrorPage: async ({ page }, use) => {
417+
const dialErrorPage = new DialErrorPage(page);
418+
await use(dialErrorPage);
419+
},
412420
marketplacePage: async ({ page }, use) => {
413421
const marketplacePage = new MarketplacePage(page);
414422
await use(marketplacePage);
@@ -469,9 +477,15 @@ const dialTest = test.extend<{
469477
const appEditorGeneralForm = appEditorContainer.getAppEditorGeneralForm();
470478
await use(appEditorGeneralForm);
471479
},
472-
appEditorPreview: async ({ appEditorContainer }, use) => {
473-
const appEditorPreview = appEditorContainer.getAppEditorPreview();
474-
await use(appEditorPreview);
480+
appEditorGeneralInfoAgentPreview: async ({ appEditorContainer }, use) => {
481+
const appEditorGeneralInfoPreview =
482+
appEditorContainer.getAppEditorGeneralInfoPreview();
483+
await use(appEditorGeneralInfoPreview);
484+
},
485+
appEditorAppSettingsAgentPreview: async ({ appEditorContainer }, use) => {
486+
const appEditorAppSettingsPreview =
487+
appEditorContainer.getAppEditorAppSettingsPreview();
488+
await use(appEditorAppSettingsPreview);
475489
},
476490
appEditorViewForm: async ({ appEditorContainer }, use) => {
477491
const appEditorViewForm = appEditorContainer.getAppEditorViewForm();

apps/chat-e2e/src/testData/api/modelApiHelper.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ export class ModelApiHelper extends BaseApiHelper {
2222
return allAgents.find(
2323
(a) =>
2424
a.name === agentProps.name &&
25-
((a.version === agentProps.version) !== undefined
26-
? agentProps.version
27-
: ExpectedConstants.defaultAppVersion),
25+
(agentProps.version !== undefined
26+
? a.version === agentProps.version
27+
: a.version === ExpectedConstants.defaultAppVersion),
2828
);
2929
}
3030
}

apps/chat-e2e/src/testData/api/publicationApiHelper.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,18 @@ export class PublicationApiHelper extends BaseApiHelper {
5050
return (await response.json()) as PublishedList;
5151
}
5252

53+
public async listPublishedApps() {
54+
const response = await this.request.get(
55+
this.getHost(API.publishedApplicationsHost),
56+
);
57+
const statusCode = response.status();
58+
expect(
59+
statusCode,
60+
`Received response code: ${statusCode} with body: ${await response.text()}`,
61+
).toBe(200);
62+
return (await response.json()) as PublishedList;
63+
}
64+
5365
public async getPublicationRequestDetails(publicationUrl: string) {
5466
const response = await this.request.post(
5567
this.getHost(API.publicationRequestDetails),

apps/chat-e2e/src/testData/conversationHistory/conversationData.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Conversation } from '@/chat/types/chat';
2-
import { FolderInterface, FolderType } from '@/chat/types/folder';
2+
import { FeatureType } from '@/chat/types/common';
3+
import { FolderInterface } from '@/chat/types/folder';
34
import { DialAIEntityModel } from '@/chat/types/models';
45
import { Prompt } from '@/chat/types/prompt';
56
import { ConversationBuilder, ExpectedConstants } from '@/src/testData';
@@ -27,7 +28,7 @@ export class ConversationData extends FolderData {
2728
private conversationBuilder: ConversationBuilder;
2829

2930
constructor() {
30-
super(FolderType.Chat);
31+
super(FeatureType.Chat);
3132
this.conversationBuilder = new ConversationBuilder();
3233
}
3334

@@ -379,7 +380,11 @@ export class ConversationData extends FolderData {
379380
nestedLevel: number,
380381
folderNames?: Record<number, string>,
381382
) {
382-
return super.prepareNestedFolder(nestedLevel, FolderType.Chat, folderNames);
383+
return super.prepareNestedFolder(
384+
nestedLevel,
385+
FeatureType.Chat,
386+
folderNames,
387+
);
383388
}
384389

385390
public prepareConversationsForNestedFolders(

apps/chat-e2e/src/testData/conversationHistory/folderBuilder.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { FolderInterface, FolderType } from '@/chat/types/folder';
1+
import { FeatureType } from '@/chat/types/common';
2+
import { FolderInterface } from '@/chat/types/folder';
23
import { ExpectedConstants } from '@/src/testData';
34
import { GeneratorUtil } from '@/src/utils';
45

@@ -9,7 +10,7 @@ export class FolderBuilder {
910
this.folder = {
1011
id: GeneratorUtil.randomString(10),
1112
name: ExpectedConstants.newFolderTitle,
12-
type: FolderType.Chat,
13+
type: FeatureType.Chat,
1314
folderId: '',
1415
};
1516
}
@@ -28,7 +29,7 @@ export class FolderBuilder {
2829
return this;
2930
}
3031

31-
withType(type: FolderType): FolderBuilder {
32+
withType(type: FeatureType): FolderBuilder {
3233
this.folder.type = type;
3334
return this;
3435
}

0 commit comments

Comments
 (0)