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 37 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
6 changes: 3 additions & 3 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 { Conversations } from '@/src/ui/webElements/entityTree';
import { expect } from '@playwright/test';

export class ConversationAssertion extends SideBarEntityAssertion<Conversations> {
public async assertReplayIconState(
entity: TreeEntity,
expectedState: ElementState,
) {
const entityIcon = this.sideBarEntities.getConversationReplayIcon(
const entityIcon = this.sideBarEntities.getEntityReplayIcon(
entity.name,
entity.index,
);
Expand All @@ -33,7 +33,7 @@ export class ConversationAssertion extends SideBarEntityAssertion<Conversations>
) {
await this.sideBarEntities.getEntityByName(conversationName).hover();
const style = await this.sideBarEntities
.getConversationName(conversationName)
.getEntityName(conversationName)
.getComputedStyleProperty(Styles.cursor);
expect
.soft(style[0], `Conversation cursor is ${expectedCursor}`)
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
2 changes: 1 addition & 1 deletion 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 { Prompts } from '@/src/ui/webElements/entityTree';

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

export class SharedWithMePromptsAssertion extends SideBarEntityAssertion<SharedWithMePrompts> {
Expand All @@ -9,7 +9,7 @@ export class SharedWithMePromptsAssertion extends SideBarEntityAssertion<SharedW
expectedColor: string,
) {
const entityBackgroundColor =
await this.sideBarEntities.getSharedPromptBackgroundColor(
await this.sideBarEntities.getEntityBackgroundColor(
entity.name,
entity.index,
);
Expand Down
2 changes: 1 addition & 1 deletion apps/chat-e2e/src/assertions/sideBarEntityAssertion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
ExpectedMessages,
TreeEntity,
} from '@/src/testData';
import { SideBarEntities } from '@/src/ui/webElements/sideBarEntities';
import { SideBarEntities } from '@/src/ui/webElements/entityTree/sidebar/sideBarEntities';
import { ThemesUtil } from '@/src/utils/themesUtil';
import { expect } from '@playwright/test';

Expand Down
29 changes: 18 additions & 11 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 {
Conversations,
FolderConversations,
FolderPrompts,
Folders,
Prompts,
} 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 @@ -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 @@ -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
16 changes: 9 additions & 7 deletions apps/chat-e2e/src/core/dialSharedWithMeFixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,14 @@ import {
ConfirmationDialog,
ConversationSettings,
ConversationToCompare,
Conversations,
DropdownMenu,
EntitySelector,
EntitySettings,
ErrorToast,
FolderPrompts,
PromptBar,
PromptModalDialog,
Prompts,
RecentEntities,
SendMessage,
SharedFolderPrompts,
SharedPromptPreviewModal,
VariableModalDialog,
} from '../ui/webElements';
Expand All @@ -41,10 +37,16 @@ import dialTest, { stateFilePath } from '@/src/core/dialFixtures';
import { LocalStorageManager } from '@/src/core/localStorageManager';
import { AppContainer } from '@/src/ui/webElements/appContainer';
import { ChatNotFound } from '@/src/ui/webElements/chatNotFound';
import {
Conversations,
FolderPrompts,
Prompts,
SharedFolderPrompts,
} from '@/src/ui/webElements/entityTree';
import { SharedFolderConversations } from '@/src/ui/webElements/entityTree/sidebar/sharedFolderConversations';
import { SharedWithMeConversations } from '@/src/ui/webElements/entityTree/sidebar/sharedWithMeConversations';
import { SharedWithMePrompts } from '@/src/ui/webElements/entityTree/sidebar/sharedWithMePrompts';
import { PlaybackControl } from '@/src/ui/webElements/playbackControl';
import { SharedFolderConversations } from '@/src/ui/webElements/sharedFolderConversations';
import { SharedWithMeConversations } from '@/src/ui/webElements/sharedWithMeConversations';
import { SharedWithMePrompts } from '@/src/ui/webElements/sharedWithMePrompts';
import { BucketUtil } from '@/src/utils';
import { Page } from '@playwright/test';

Expand Down
14 changes: 7 additions & 7 deletions apps/chat-e2e/src/tests/chatBarConversation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ dialTest(
await dialHomePage.openHomePage();
await dialHomePage.waitForPageLoaded();
const chatNameOverflow = await conversations
.getConversationName(conversationName)
.getEntityName(conversationName)
.getComputedStyleProperty(Styles.text_overflow);
expect
.soft(chatNameOverflow[0], ExpectedMessages.chatNameIsTruncated)
Expand All @@ -138,7 +138,7 @@ dialTest(
async () => {
await conversations.getEntityByName(conversationName).hover();
const chatNameOverflow = await conversations
.getConversationName(conversationName)
.getEntityName(conversationName)
.getComputedStyleProperty(Styles.text_overflow);
expect
.soft(chatNameOverflow[0], ExpectedMessages.chatNameIsTruncated)
Expand All @@ -152,7 +152,7 @@ dialTest(
await conversations.openEntityDropdownMenu(conversationName);
await conversationDropdownMenu.selectMenuOption(MenuOptions.rename);
const chatNameOverflow = await conversations
.getConversationName(conversationName)
.getEntityName(conversationName)
.getComputedStyleProperty(Styles.text_overflow);
expect
.soft(chatNameOverflow[0], ExpectedMessages.chatNameIsTruncated)
Expand Down Expand Up @@ -180,7 +180,7 @@ dialTest(
await conversations.openEntityDropdownMenu(conversationName);
await conversationDropdownMenu.selectMenuOption(MenuOptions.delete);
const chatNameOverflow = await conversations
.getConversationName(conversationName)
.getEntityName(conversationName)
.getComputedStyleProperty(Styles.text_overflow);
expect
.soft(chatNameOverflow[0], ExpectedMessages.chatNameIsTruncated)
Expand Down Expand Up @@ -217,7 +217,7 @@ dialTest(
.toBeVisible();

const chatNameOverflow = await conversations
.getConversationName(newName)
.getEntityName(newName)
.getComputedStyleProperty(Styles.text_overflow);
expect
.soft(chatNameOverflow[0], ExpectedMessages.chatNameIsTruncated)
Expand Down Expand Up @@ -287,7 +287,7 @@ dialTest(
)
.toBeHidden();
const actualName = await conversations
.getConversationName(expectedName)
.getEntityName(expectedName)
.getElementInnerContent();
expect
.soft(actualName, ExpectedMessages.conversationNameUpdated)
Expand Down Expand Up @@ -1369,7 +1369,7 @@ for (const [request, expectedConversationName] of testRequestMap.entries()) {
await sendMessage.send(request);

const actualConversationName = await conversations
.getConversationName(expectedConversationName)
.getEntityName(expectedConversationName)
.getElementInnerContent();
expect
.soft(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,7 @@ dialTest(
.getEntityByName(firstConversation.name)
.click({ button: 'right' });
await conversationDropdownMenuAssertion.assertMenuState('visible');
await conversations.getConversationName(firstConversation.name).click();
await conversations.getEntityName(firstConversation.name).click();

// Folder context menu
await folderConversations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,8 @@ dialTest(
async () => {
await attachFilesModal.checkAttachedFile(Attachment.longImageName);
const attachmentNameOverflow = await attachFilesModal
.attachedFileName(Attachment.longImageName)
.getAllFiles()
.getEntityName(Attachment.longImageName)
.getComputedStyleProperty(Styles.text_overflow);
expect
.soft(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,16 @@ dialTest(
UploadMenuOptions.attachUploadedFiles,
);
for (const file of initAttachedFiles) {
const isFileChecked = attachFilesModal.attachedFileCheckBox(file);
const isFileChecked = attachFilesModal
.getAllFiles()
.getEntityCheckbox(file);
await expect
.soft(isFileChecked, ExpectedMessages.attachmentFileIsChecked)
.toBeChecked();

const fileNameColor = await attachFilesModal
.attachedFileName(file)
.getAllFiles()
.getEntityName(file)
.getComputedStyleProperty(Styles.color);
expect
.soft(fileNameColor[0], ExpectedMessages.attachmentNameColorIsValid)
Expand Down
17 changes: 11 additions & 6 deletions apps/chat-e2e/src/tests/errorUploadFromDevice.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,15 @@ dialTest(
await uploadFromDeviceModal.uploadButton.click();
await expect
.soft(
attachFilesModal.attachedFile(Attachment.sunImageName),
attachFilesModal
.getAllFiles()
.getEntityByName(Attachment.sunImageName),
ExpectedMessages.fileIsUploaded,
)
.toBeVisible();
const attachmentNameColor = await attachFilesModal
.attachedFileName(Attachment.sunImageName)
.getAllFiles()
.getEntityName(Attachment.sunImageName)
.getComputedStyleProperty(Styles.color);
expect
.soft(
Expand Down Expand Up @@ -314,14 +317,16 @@ dialTest(
await uploadFromDeviceModal.uploadFiles();
await expect
.soft(
attachFilesModal.attachedFile(Attachment.fileWithoutExtension),
attachFilesModal
.getAllFiles()
.getEntityByName(Attachment.fileWithoutExtension),
ExpectedMessages.fileIsAttached,
)
.toBeVisible();

const isFileChecked = attachFilesModal.attachedFileCheckBox(
Attachment.fileWithoutExtension,
);
const isFileChecked = attachFilesModal
.getAllFiles()
.getEntityCheckbox(Attachment.fileWithoutExtension);
await expect
.soft(isFileChecked, ExpectedMessages.attachmentFileIsChecked)
.toBeChecked();
Expand Down
Loading