From 075c0729e6c54f1cfce32023ec72f476b3ee1c8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Carden=CC=83a?= <35935591+luisecm@users.noreply.github.com> Date: Thu, 26 Sep 2024 12:59:38 -0600 Subject: [PATCH] update(test): fixes for CI bugs on automation tests --- playwright/PageObjects/ChatsMain.ts | 6 ------ playwright/specs/02-friends-one-instance.spec.ts | 2 +- playwright/specs/24-files.spec.ts | 7 ++++++- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/playwright/PageObjects/ChatsMain.ts b/playwright/PageObjects/ChatsMain.ts index 112c4559..b9ade7c6 100644 --- a/playwright/PageObjects/ChatsMain.ts +++ b/playwright/PageObjects/ChatsMain.ts @@ -1058,16 +1058,10 @@ export class ChatsMainPage extends MainPage { const fileEmbedName = fileEmbed.getByTestId("file-embed-name"); const fileEmbedSize = fileEmbed.getByTestId("file-embed-size"); const downloadButton = fileEmbed.getByTestId("file-embed-download-button"); - const shareButton = fileEmbed.getByTestId("file-embed-share-button"); - const addToFilesButton = fileEmbed.getByTestId( - "file-embed-add-to-files-button", - ); await expect(fileEmbedIcon).toBeVisible(); await expect(fileEmbedName).toHaveText(name); await expect(fileEmbedSize).toHaveText(size); await expect(downloadButton).toBeVisible(); - await expect(shareButton).toBeVisible(); - await expect(addToFilesButton).toBeVisible(); } async validateImageEmbedInChat(name: string, size: string, sent: boolean) { diff --git a/playwright/specs/02-friends-one-instance.spec.ts b/playwright/specs/02-friends-one-instance.spec.ts index 07416ce5..c1032992 100644 --- a/playwright/specs/02-friends-one-instance.spec.ts +++ b/playwright/specs/02-friends-one-instance.spec.ts @@ -72,7 +72,7 @@ test.describe("Friends tests", () => { await friendsScreen.goToAllFriendsList(); await expect(friendsScreen.buttonFriendsAll).toHaveCSS( "background-color", - "color(srgb 0.371765 0.371765 1)", + "rgb(35, 41, 62)", ); await expect(friendsScreen.buttonFriendsActive).toHaveCSS( "background-color", diff --git a/playwright/specs/24-files.spec.ts b/playwright/specs/24-files.spec.ts index f4b4add8..fed487b5 100644 --- a/playwright/specs/24-files.spec.ts +++ b/playwright/specs/24-files.spec.ts @@ -119,8 +119,13 @@ test.describe("Files Page Tests", () => { // Create again the same folder await filesPage.createNewFolder("NewFolder"); + // Validate only one folder is created + const countOfFolders = await page.locator('[data-cy^="folder-"]').count(); + // One element located by the count is '[data-cy="folder-list"]' which is the sidebar folder list, therefore only one folder is created + expect(countOfFolders).toEqual(2); + // Toast notification should be displayed - await expect(filesPage.toastNotification).toBeVisible(); + await filesPage.toastNotification.last().waitFor({ state: "visible" }); }); test("F10 - User can create subfolders and navigate to parent folder with go back button", async ({