Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(chat-e2e): e2e publishing preparation #2074

Merged
merged 45 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
48281c1
feat/added-gpt4o-mini-model: added 'gpt-4o-mini-2024-07-18' model to …
irinakartun Aug 5, 2024
2e490ae
Merge branch 'development' of github.com:epam/ai-dial-chat into devel…
irinakartun Aug 6, 2024
38868f8
Merge branch 'development' of github.com:epam/ai-dial-chat into devel…
irinakartun Aug 6, 2024
c1a14e6
Merge branch 'development' of github.com:epam/ai-dial-chat into devel…
irinakartun Aug 8, 2024
d524ea2
Merge branch 'development' of github.com:epam/ai-dial-chat into devel…
irinakartun Aug 8, 2024
6083a80
Merge branch 'development' of github.com:epam/ai-dial-chat into devel…
irinakartun Aug 8, 2024
46cef34
Merge branch 'development' of github.com:epam/ai-dial-chat into devel…
irinakartun Aug 12, 2024
a6c287b
Merge branch 'development' of github.com:epam/ai-dial-chat into devel…
irinakartun Aug 12, 2024
d9fff5c
Merge branch 'development' of github.com:epam/ai-dial-chat into devel…
irinakartun Aug 14, 2024
66efe32
Merge branch 'development' of github.com:epam/ai-dial-chat into devel…
irinakartun Aug 14, 2024
2440f5b
Merge branch 'development' of github.com:epam/ai-dial-chat into devel…
irinakartun Aug 14, 2024
1f83a39
Merge branch 'development' of github.com:epam/ai-dial-chat into devel…
irinakartun Aug 20, 2024
d5bef63
Merge branch 'development' of github.com:epam/ai-dial-chat into devel…
irinakartun Aug 22, 2024
559850f
Merge branch 'development' of github.com:epam/ai-dial-chat into devel…
irinakartun Aug 22, 2024
d378a9e
Merge branch 'development' of github.com:epam/ai-dial-chat into devel…
irinakartun Aug 23, 2024
ad52731
Merge branch 'development' of github.com:epam/ai-dial-chat into devel…
irinakartun Aug 26, 2024
e5621b4
Merge branch 'development' of github.com:epam/ai-dial-chat into devel…
irinakartun Aug 27, 2024
1062e7b
Merge branch 'development' of github.com:epam/ai-dial-chat into devel…
irinakartun Aug 29, 2024
cb78d9a
Merge branch 'development' of github.com:epam/ai-dial-chat into devel…
irinakartun Sep 2, 2024
aabe5dd
Merge branch 'development' of github.com:epam/ai-dial-chat into devel…
irinakartun Sep 5, 2024
49533d9
Merge branch 'development' of github.com:epam/ai-dial-chat into devel…
irinakartun Sep 6, 2024
251ce32
feat/e2e-publishing-preparation: added chat locators; refactored enti…
irinakartun Sep 6, 2024
b35bcc2
feat/e2e-publishing-preparation: reverted test changes
irinakartun Sep 6, 2024
31f1a95
Merge branch 'development' of github.com:epam/ai-dial-chat into feat/…
irinakartun Sep 6, 2024
b268dca
feat/e2e-publishing-preparation: fixed locators
irinakartun Sep 6, 2024
5728fc7
feat/e2e-publishing-preparation: fixed locators
irinakartun Sep 6, 2024
96576db
Merge branch 'development' into feat/e2e-publishing-preparation
irinakartun Sep 10, 2024
4e8c24d
Merge branch 'development' into feat/e2e-publishing-preparation
irinakartun Sep 10, 2024
10bedf5
Merge branch 'development' into feat/e2e-publishing-preparation
irinakartun Sep 10, 2024
869184d
Merge branch 'development' into feat/e2e-publishing-preparation
irinakartun Sep 11, 2024
5604853
Merge branch 'development' into feat/e2e-publishing-preparation
irinakartun Sep 11, 2024
699312d
Merge branch 'development' into feat/e2e-publishing-preparation
irinakartun Sep 11, 2024
8fb9f6e
Merge branch 'development' into feat/e2e-publishing-preparation
irinakartun Sep 11, 2024
e5d77c9
Merge branch 'development' into feat/e2e-publishing-preparation
irinakartun Sep 12, 2024
8a7c741
Merge branch 'development' into feat/e2e-publishing-preparation
irinakartun Sep 12, 2024
f1848c3
Merge branch 'development' into feat/e2e-publishing-preparation
irinakartun Sep 12, 2024
9a72df0
Merge branch 'development' into feat/e2e-publishing-preparation
irinakartun Sep 12, 2024
5cde610
Merge branch 'development' of github.com:epam/ai-dial-chat into feat/…
irinakartun Sep 16, 2024
9b51206
feat/e2e-publishing-preparation: added postfix to all tree entities
irinakartun Sep 16, 2024
787e75a
feat/e2e-publishing-preparation: formatted
irinakartun Sep 16, 2024
e1b87f3
Merge branch 'development' into feat/e2e-publishing-preparation
IlyaBondar Sep 16, 2024
344dbd2
feat/e2e-publishing-preparation: fixed comment
irinakartun Sep 16, 2024
69cadcf
Merge remote-tracking branch 'origin/feat/e2e-publishing-preparation'…
irinakartun Sep 16, 2024
c6bd075
Merge branch 'development' into feat/e2e-publishing-preparation
irinakartun Sep 17, 2024
c693ec4
Merge branch 'development' of github.com:epam/ai-dial-chat into feat/…
irinakartun Sep 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions apps/chat-e2e/src/assertions/conversationAssertion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import {
TreeEntity,
} from '@/src/testData';
import { Colors, Styles } from '@/src/ui/domData';
import { Conversations } from '@/src/ui/webElements';
import { ConversationsTree } from '@/src/ui/webElements/entityTree';
import { expect } from '@playwright/test';

export class ConversationAssertion extends SideBarEntityAssertion<Conversations> {
export class ConversationAssertion extends SideBarEntityAssertion<ConversationsTree> {
public async assertReplayIconState(
entity: TreeEntity,
expectedState: ElementState,
) {
const entityIcon = this.sideBarEntities.getConversationReplayIcon(
const entityIcon = this.sideBarEntitiesTree.getEntityReplayIcon(
entity.name,
entity.index,
);
Expand All @@ -31,9 +31,9 @@ export class ConversationAssertion extends SideBarEntityAssertion<Conversations>
conversationName: string,
expectedCursor: string,
) {
await this.sideBarEntities.getEntityByName(conversationName).hover();
const style = await this.sideBarEntities
.getConversationName(conversationName)
await this.sideBarEntitiesTree.getEntityByName(conversationName).hover();
const style = await this.sideBarEntitiesTree
.getEntityName(conversationName)
.getComputedStyleProperty(Styles.cursor);
expect
.soft(style[0], `Conversation cursor is ${expectedCursor}`)
Expand All @@ -42,15 +42,17 @@ export class ConversationAssertion extends SideBarEntityAssertion<Conversations>

public async assertSelectedConversation(conversationName: string) {
const conversationBackgroundColor =
await this.sideBarEntities.getEntityBackgroundColor(conversationName);
await this.sideBarEntitiesTree.getEntityBackgroundColor(conversationName);
expect
.soft(conversationBackgroundColor, 'Conversation is selected')
.toBe(Colors.backgroundAccentSecondary);
}

public async assertConversationInToday(conversationName: string) {
const todayConversations =
await this.sideBarEntities.getChronologyConversations(Chronology.today);
await this.sideBarEntitiesTree.getChronologyConversations(
Chronology.today,
);
expect(todayConversations, ExpectedMessages.conversationOfToday).toContain(
conversationName,
);
Expand Down
2 changes: 1 addition & 1 deletion apps/chat-e2e/src/assertions/folderAssertion.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { CheckboxState, ElementState, ExpectedMessages } from '@/src/testData';
import { EntityType, TreeEntity } from '@/src/testData/types';
import { Folders } from '@/src/ui/webElements';
import { Folders } from '@/src/ui/webElements/entityTree';
import { ThemesUtil } from '@/src/utils/themesUtil';
import { expect } from '@playwright/test';

Expand Down
4 changes: 2 additions & 2 deletions apps/chat-e2e/src/assertions/promptAssertion.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SideBarEntityAssertion } from '@/src/assertions/sideBarEntityAssertion';
import { Prompts } from '@/src/ui/webElements';
import { PromptsTree } from '@/src/ui/webElements/entityTree';

export class PromptAssertion extends SideBarEntityAssertion<Prompts> {}
export class PromptAssertion extends SideBarEntityAssertion<PromptsTree> {}
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { SideBarEntityAssertion } from '@/src/assertions/sideBarEntityAssertion';
import { ExpectedMessages, TreeEntity } from '@/src/testData';
import { SharedWithMePrompts } from '@/src/ui/webElements';
import { SharedWithMePromptsTree } from '@/src/ui/webElements/entityTree';
import { expect } from '@playwright/test';

export class SharedWithMePromptsAssertion extends SideBarEntityAssertion<SharedWithMePrompts> {
export class SharedWithMePromptsAssertion extends SideBarEntityAssertion<SharedWithMePromptsTree> {
public async assertSharedEntityBackgroundColor(
entity: TreeEntity,
expectedColor: string,
) {
const entityBackgroundColor =
await this.sideBarEntities.getSharedPromptBackgroundColor(
await this.sideBarEntitiesTree.getEntityBackgroundColor(
entity.name,
entity.index,
);
Expand Down
39 changes: 20 additions & 19 deletions apps/chat-e2e/src/assertions/sideBarEntityAssertion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ import {
ExpectedMessages,
TreeEntity,
} from '@/src/testData';
import { SideBarEntities } from '@/src/ui/webElements/sideBarEntities';
import { SideBarEntitiesTree } from '@/src/ui/webElements/entityTree/sidebar/sideBarEntitiesTree';
import { ThemesUtil } from '@/src/utils/themesUtil';
import { expect } from '@playwright/test';

export class SideBarEntityAssertion<T extends SideBarEntities> {
readonly sideBarEntities: T;
export class SideBarEntityAssertion<T extends SideBarEntitiesTree> {
readonly sideBarEntitiesTree: T;

constructor(sideBarEntities: T) {
this.sideBarEntities = sideBarEntities;
this.sideBarEntitiesTree = sideBarEntities;
}

public async assertEntityAndCheckboxHasSelectedColors(
Expand All @@ -32,7 +32,7 @@ export class SideBarEntityAssertion<T extends SideBarEntities> {
entity: TreeEntity,
expectedState: ElementState,
) {
const entityLocator = this.sideBarEntities.getEntityByName(
const entityLocator = this.sideBarEntitiesTree.getEntityByName(
entity.name,
entity.index,
);
Expand All @@ -49,7 +49,7 @@ export class SideBarEntityAssertion<T extends SideBarEntities> {
entity: TreeEntity,
expectedState: ElementState,
) {
const entityCheckboxLocator = this.sideBarEntities.getEntityCheckbox(
const entityCheckboxLocator = this.sideBarEntitiesTree.getEntityCheckbox(
entity.name,
entity.index,
);
Expand All @@ -72,7 +72,7 @@ export class SideBarEntityAssertion<T extends SideBarEntities> {
: ExpectedMessages.entityIsNotChecked;
expect
.soft(
await this.sideBarEntities.getEntityCheckboxState(
await this.sideBarEntitiesTree.getEntityCheckboxState(
entity.name,
entity.index,
),
Expand All @@ -85,7 +85,7 @@ export class SideBarEntityAssertion<T extends SideBarEntities> {
entity: TreeEntity,
expectedState: ElementState,
) {
const dotsMenuLocator = this.sideBarEntities.entityDotsMenu(
const dotsMenuLocator = this.sideBarEntitiesTree.entityDotsMenu(
entity.name,
entity.index,
);
Expand All @@ -102,7 +102,7 @@ export class SideBarEntityAssertion<T extends SideBarEntities> {
entity: TreeEntity,
expectedState: ElementState,
) {
await this.sideBarEntities.getEntityByName(entity.name).hover();
await this.sideBarEntitiesTree.getEntityByName(entity.name).hover();
await this.assertEntityDotsMenuState(
{
name: entity.name,
Expand All @@ -115,7 +115,7 @@ export class SideBarEntityAssertion<T extends SideBarEntities> {
expectedColor: string,
) {
const entityBackgroundColor =
await this.sideBarEntities.getEntityBackgroundColor(
await this.sideBarEntitiesTree.getEntityBackgroundColor(
entity.name,
entity.index,
);
Expand All @@ -131,7 +131,7 @@ export class SideBarEntityAssertion<T extends SideBarEntities> {
entity: TreeEntity,
expectedColor: string,
) {
const checkboxElement = this.sideBarEntities.getEntityCheckboxElement(
const checkboxElement = this.sideBarEntitiesTree.getEntityCheckboxElement(
entity.name,
entity.index,
);
Expand All @@ -145,7 +145,7 @@ export class SideBarEntityAssertion<T extends SideBarEntities> {
entity: TreeEntity,
expectedColor: string,
) {
const checkboxElement = this.sideBarEntities.getEntityCheckboxElement(
const checkboxElement = this.sideBarEntitiesTree.getEntityCheckboxElement(
entity.name,
entity.index,
);
Expand All @@ -161,7 +161,7 @@ export class SideBarEntityAssertion<T extends SideBarEntities> {
}

public async assertEntityIcon(entity: TreeEntity, expectedIcon: string) {
const entityIcon = await this.sideBarEntities.getEntityIcon(
const entityIcon = await this.sideBarEntitiesTree.getEntityIcon(
entity.name,
entity.index,
);
Expand All @@ -174,7 +174,7 @@ export class SideBarEntityAssertion<T extends SideBarEntities> {
entity: TreeEntity,
expectedState: ElementState,
) {
const arrowIcon = this.sideBarEntities.getEntityArrowIcon(
const arrowIcon = this.sideBarEntitiesTree.getEntityArrowIcon(
entity.name,
entity.index,
);
Expand All @@ -191,10 +191,11 @@ export class SideBarEntityAssertion<T extends SideBarEntities> {
entity: TreeEntity,
expectedColor: string,
) {
const arrowIconColor = await this.sideBarEntities.getEntityArrowIconColor(
entity.name,
entity.index,
);
const arrowIconColor =
await this.sideBarEntitiesTree.getEntityArrowIconColor(
entity.name,
entity.index,
);
expect
.soft(arrowIconColor[0], ExpectedMessages.sharedIconColorIsValid)
.toBe(expectedColor);
Expand All @@ -204,7 +205,7 @@ export class SideBarEntityAssertion<T extends SideBarEntities> {
entity: TreeEntity,
expectedCount: number,
) {
const arrowIconsCount = await this.sideBarEntities
const arrowIconsCount = await this.sideBarEntitiesTree
.getEntityArrowIcon(entity.name, entity.index)
.count();
expect
Expand Down
37 changes: 22 additions & 15 deletions apps/chat-e2e/src/core/dialFixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ import {
ChatNotFound,
ConversationSettings,
ConversationToCompare,
Conversations,
EntitySelector,
Folders,
MoreInfo,
PromptBar,
SelectFolderModal,
Expand Down Expand Up @@ -69,12 +67,16 @@ import { ConfirmationDialog } from '@/src/ui/webElements/confirmationDialog';
import { DropdownCheckboxMenu } from '@/src/ui/webElements/dropdownCheckboxMenu';
import { DropdownMenu } from '@/src/ui/webElements/dropdownMenu';
import { EntitySettings } from '@/src/ui/webElements/entitySettings';
import {
ConversationsTree,
FolderConversations,
FolderPrompts,
Folders,
PromptsTree,
} from '@/src/ui/webElements/entityTree';
import { ErrorPopup } from '@/src/ui/webElements/errorPopup';
import { ErrorToast } from '@/src/ui/webElements/errorToast';
import { Filter } from '@/src/ui/webElements/filter';
import { FolderConversations } from '@/src/ui/webElements/folderConversations';
import { FolderFiles } from '@/src/ui/webElements/folderFiles';
import { FolderPrompts } from '@/src/ui/webElements/folderPrompts';
import { GroupEntity } from '@/src/ui/webElements/groupEntity';
import { Header } from '@/src/ui/webElements/header';
import { ImportExportLoader } from '@/src/ui/webElements/importExportLoader';
Expand All @@ -83,7 +85,7 @@ import { ModelSelector } from '@/src/ui/webElements/modelSelector';
import { ModelsDialog } from '@/src/ui/webElements/modelsDialog';
import { PlaybackControl } from '@/src/ui/webElements/playbackControl';
import { PromptModalDialog } from '@/src/ui/webElements/promptModalDialog';
import { Prompts } from '@/src/ui/webElements/prompts';
import { PublishingRequestModal } from '@/src/ui/webElements/publishingRequestModal';
import { RecentEntities } from '@/src/ui/webElements/recentEntities';
import { ReplayAsIs } from '@/src/ui/webElements/replayAsIs';
import { Search } from '@/src/ui/webElements/search';
Expand Down Expand Up @@ -125,8 +127,8 @@ const dialTest = test.extend<
sendMessage: SendMessage;
attachmentDropdownMenu: DropdownMenu;
sendMessageInputAttachments: InputAttachments;
conversations: Conversations;
prompts: Prompts;
conversations: ConversationsTree;
prompts: PromptsTree;
folderConversations: FolderConversations;
folderPrompts: FolderPrompts;
conversationSettings: ConversationSettings;
Expand Down Expand Up @@ -190,9 +192,10 @@ const dialTest = test.extend<
attachFilesModal: AttachFilesModal;
uploadFromDeviceModal: UploadFromDeviceModal;
selectFolderModal: SelectFolderModal;
selectUploadFolder: Folders;
attachedAllFiles: FolderFiles;
selectFolders: Folders;
attachedAllFiles: Folders;
settingsModal: SettingsModal;
publishingModal: PublishingRequestModal;
conversationAssertion: ConversationAssertion;
chatBarFolderAssertion: FolderAssertion;
errorToastAssertion: ErrorToastAssertion;
Expand Down Expand Up @@ -325,11 +328,11 @@ const dialTest = test.extend<
await use(sendMessageInputAttachments);
},
conversations: async ({ chatBar }, use) => {
const conversations = chatBar.getConversations();
const conversations = chatBar.getConversationsTree();
await use(conversations);
},
prompts: async ({ promptBar }, use) => {
const prompts = promptBar.getPrompts();
const prompts = promptBar.getPromptsTree();
await use(prompts);
},
folderConversations: async ({ chatBar }, use) => {
Expand Down Expand Up @@ -616,18 +619,22 @@ const dialTest = test.extend<
const selectFolderModal = new SelectFolderModal(page);
await use(selectFolderModal);
},
selectUploadFolder: async ({ selectFolderModal }, use) => {
const selectUploadFolder = selectFolderModal.getUploadFolder();
selectFolders: async ({ selectFolderModal }, use) => {
const selectUploadFolder = selectFolderModal.getSelectFolders();
await use(selectUploadFolder);
},
attachedAllFiles: async ({ attachFilesModal }, use) => {
const attachedAllFiles = attachFilesModal.getFolderFiles();
const attachedAllFiles = attachFilesModal.getAllFolderFiles();
await use(attachedAllFiles);
},
settingsModal: async ({ page }, use) => {
const settingsModal = new SettingsModal(page);
await use(settingsModal);
},
publishingModal: async ({ page }, use) => {
const publishingModal = new PublishingRequestModal(page);
await use(publishingModal);
},
conversationAssertion: async ({ conversations }, use) => {
const conversationAssertion = new ConversationAssertion(conversations);
await use(conversationAssertion);
Expand Down
Loading
Loading