Skip to content

Commit

Permalink
back to chat updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nartovm committed Nov 25, 2024
1 parent 16dc382 commit 42c3252
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
3 changes: 2 additions & 1 deletion apps/chat-e2e/src/tests/entityIcon.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ dialTest(
dialHomePage,
talkToSelector,
marketplacePage,
header,
addons,
addonsDialog,
iconApiHelper,
Expand Down Expand Up @@ -77,7 +78,7 @@ dialTest(
await dialTest.step(
'Click "See all addons" and verify all addons have valid icons',
async () => {
await marketplaceSidebar.backToChatButton.click();
await header.backToChatButton.click();
const expectedAddons = ModelsUtil.getAddons();
await addons.seeAllAddons();
const actualAddonsIcons = await addonsDialog.getAddonsIcons();
Expand Down
10 changes: 9 additions & 1 deletion apps/chat-e2e/src/ui/webElements/header.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { API } from '@/src/testData';
import { HeaderSelectors, SideBarSelectors } from '@/src/ui/selectors';
import {
HeaderSelectors,
MarketplaceSideBarSelectors,
SideBarSelectors,
} from '@/src/ui/selectors';
import { AccountSettings } from '@/src/ui/webElements/accountSettings';
import { BaseElement } from '@/src/ui/webElements/baseElement';
import { Locator, Page } from '@playwright/test';
Expand Down Expand Up @@ -29,6 +33,10 @@ export class Header extends BaseElement {
SideBarSelectors.newEntity,
);

public backToChatButton = this.getChildElementBySelector(
MarketplaceSideBarSelectors.backToChatButton,
);

public async createNewConversation() {
const modelsResponsePromise = this.page.waitForResponse(API.modelsHost);
const addonsResponsePromise = this.page.waitForResponse(API.addonsHost);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ export class MarketplaceSidebar extends BaseElement {
return this.marketplaceFilter;
}

public backToChatButton = this.getChildElementBySelector(
MarketplaceSideBarSelectors.backToChatButton,
);
public homePageButton = this.getChildElementBySelector(
MarketplaceSideBarSelectors.homePageButton,
);
Expand Down
2 changes: 1 addition & 1 deletion apps/chat/src/components/Header/BackToChat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const BackToChat = () => {
>
<div
className="flex cursor-pointer items-center justify-center rounded border border-transparent bg-accent-primary-alpha p-[2px] hover:border-accent-primary disabled:cursor-not-allowed md:px-[10px]"
data-qa="new-entity"
data-qa="back-to-chat"
>
<IconMessage2 className="text-accent-primary" size={24} />
</div>
Expand Down

0 comments on commit 42c3252

Please sign in to comment.