Skip to content

Commit

Permalink
test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nartovm committed Nov 25, 2024
1 parent cde2613 commit 10b7118
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 21 deletions.
1 change: 1 addition & 0 deletions apps/chat-e2e/src/tests/publishConversation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ dialAdminTest(
adminTooltipAssertion,
baseAssertion,
setTestIds,
header,
}) => {
dialAdminTest.slow();
setTestIds(
Expand Down
2 changes: 1 addition & 1 deletion apps/chat-e2e/src/ui/selectors/sideBarSelectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export const SideBarSelectors = {
newFolder: '[data-qa="create-folder"]',
resizeIcon: '[data-qa="resize-icon"]',
bottomPanel: '[data-qa="bottom-panel"]',
newEntity: '[data-qa="new-entity"]',
arrowAdditionalIcon: '[data-qa="arrow-icon"]',
search: '[data-qa="search"]',
searchInput: '[data-qa="search-input"]',
Expand Down Expand Up @@ -55,6 +54,7 @@ export const PromptBarSelectors = {
approveRequiredPrompts: () =>
`${PromptBarSelectors.promptFolders} > ${SideBarSelectors.approveRequiredContainer}`,
leftResizeIcon: '[data-qa="left-resize-icon"]',
newEntity: '[data-qa="new-entity"]',
};

export const EntitySelectors = {
Expand Down
23 changes: 22 additions & 1 deletion apps/chat-e2e/src/ui/webElements/promptBar.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { SideBarSelectors } from '../selectors';
import { PromptBarSelectors, SideBarSelectors } from '../selectors';

import { Styles, removeAlpha } from '@/src/ui/domData';
import {
FolderPrompts,
PromptsTree,
Expand Down Expand Up @@ -56,11 +57,31 @@ export class PromptBar extends SideBar {
return this.sharedFolderPrompts;
}

public newEntityButton = this.getChildElementBySelector(
PromptBarSelectors.newEntity,
);

public async createNewPrompt() {
await this.newEntityButton.waitForState();
await this.newEntityButton.click();
}

public async hoverOverNewEntity() {
await this.newEntityButton.waitForState();
await this.newEntityButton.hoverOver();
}

public async getNewEntityBackgroundColor() {
const backgroundColor = await this.newEntityButton.getComputedStyleProperty(
Styles.backgroundColor,
);
return removeAlpha(backgroundColor[0]);
}

public async getNewEntityCursor() {
return this.newEntityButton.getComputedStyleProperty(Styles.cursor);
}

public async dragAndDropPromptFromFolder(
folderName: string,
promptName: string,
Expand Down
19 changes: 0 additions & 19 deletions apps/chat-e2e/src/ui/webElements/sideBar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ export class SideBar extends BaseElement {
return this.chatLoader;
}

public newEntityButton = this.getChildElementBySelector(
SideBarSelectors.newEntity,
);
public newFolderButton = this.getChildElementBySelector(
SideBarSelectors.newFolder,
);
Expand Down Expand Up @@ -64,22 +61,6 @@ export class SideBar extends BaseElement {
SideBarSelectors.pinnedEntities,
).getChildElementBySelector(SideBarSelectors.folderSeparator);

public async hoverOverNewEntity() {
await this.newEntityButton.waitForState();
await this.newEntityButton.hoverOver();
}

public async getNewEntityBackgroundColor() {
const backgroundColor = await this.newEntityButton.getComputedStyleProperty(
Styles.backgroundColor,
);
return removeAlpha(backgroundColor[0]);
}

public async getNewEntityCursor() {
return this.newEntityButton.getComputedStyleProperty(Styles.cursor);
}

public async createNewFolder() {
await this.newFolderButton.click();
}
Expand Down

0 comments on commit 10b7118

Please sign in to comment.