diff --git a/.gitignore b/.gitignore index 873e221b..c2d81f3b 100644 --- a/.gitignore +++ b/.gitignore @@ -86,3 +86,4 @@ $RECYCLE.BIN/ /playwright-report/ /blob-report/ /playwright/.cache/ +/downloads/ diff --git a/playwright/PageObjects/ChatsElements/EmojiPicker.ts b/playwright/PageObjects/ChatsElements/EmojiPicker.ts index 1c7df2bb..4c755b64 100644 --- a/playwright/PageObjects/ChatsElements/EmojiPicker.ts +++ b/playwright/PageObjects/ChatsElements/EmojiPicker.ts @@ -112,15 +112,13 @@ export class EmojiPicker extends CombinedSelector { expect(emojisCount).toEqual(expectedNumber); } - async validateEmojiSnapshot() { - await expect(this.page).toHaveScreenshot({ - maxDiffPixels: 400, - mask: [ - this.skinToneSelector, - this.frequentlyUsedSection, - this.page.getByTestId("chat-topbar-profile-picture"), - this.page.getByTestId("chat-preview-picture"), - ], - }); + async validateSingleEmojiSize(emoji: string, expectedSize: string) { + const emojiLocator = this.page + .getByTestId("emoji-container") + .locator("span") + .filter({ + hasText: emoji, + }); + await expect(emojiLocator).toHaveCSS("font-size", expectedSize); } } diff --git a/playwright/snapshots/03-friends-two-instances.spec.ts/Two-instances-tests---Friends-and-Chats-B66---Sending-and-receiving-emojis-and-emoji-picker-tests-1.png b/playwright/snapshots/03-friends-two-instances.spec.ts/Two-instances-tests---Friends-and-Chats-B66---Sending-and-receiving-emojis-and-emoji-picker-tests-1.png deleted file mode 100644 index 8905dd70..00000000 Binary files a/playwright/snapshots/03-friends-two-instances.spec.ts/Two-instances-tests---Friends-and-Chats-B66---Sending-and-receiving-emojis-and-emoji-picker-tests-1.png and /dev/null differ diff --git a/playwright/snapshots/03-friends-two-instances.spec.ts/Two-instances-tests---Friends-and-Chats-B66---Sending-and-receiving-emojis-and-emoji-picker-tests-2.png b/playwright/snapshots/03-friends-two-instances.spec.ts/Two-instances-tests---Friends-and-Chats-B66---Sending-and-receiving-emojis-and-emoji-picker-tests-2.png deleted file mode 100644 index d44f1d29..00000000 Binary files a/playwright/snapshots/03-friends-two-instances.spec.ts/Two-instances-tests---Friends-and-Chats-B66---Sending-and-receiving-emojis-and-emoji-picker-tests-2.png and /dev/null differ diff --git a/playwright/snapshots/03-friends-two-instances.spec.ts/Two-instances-tests---Friends-and-Chats-B66---Sending-and-receiving-emojis-and-emoji-picker-tests-3.png b/playwright/snapshots/03-friends-two-instances.spec.ts/Two-instances-tests---Friends-and-Chats-B66---Sending-and-receiving-emojis-and-emoji-picker-tests-3.png deleted file mode 100644 index d5dccd50..00000000 Binary files a/playwright/snapshots/03-friends-two-instances.spec.ts/Two-instances-tests---Friends-and-Chats-B66---Sending-and-receiving-emojis-and-emoji-picker-tests-3.png and /dev/null differ diff --git a/playwright/specs/03-friends-two-instances.spec.ts b/playwright/specs/03-friends-two-instances.spec.ts index 7189d1b5..de69d82a 100644 --- a/playwright/specs/03-friends-two-instances.spec.ts +++ b/playwright/specs/03-friends-two-instances.spec.ts @@ -1565,11 +1565,11 @@ test.describe("Two instances tests - Friends and Chats", () => { // Change emoji size in emojis container view await chatsMainPageSecond.openEmojiPicker(); await emojiPickerSecond.changeEmojiSizeView("16"); - await emojiPickerSecond.validateEmojiSnapshot(); + await emojiPickerSecond.validateSingleEmojiSize("😀", "16px"); await emojiPickerSecond.changeEmojiSizeView("45"); - await emojiPickerSecond.validateEmojiSnapshot(); + await emojiPickerSecond.validateSingleEmojiSize("😀", "45px"); await emojiPickerSecond.changeEmojiSizeView("30"); - await emojiPickerSecond.validateEmojiSnapshot(); + await emojiPickerSecond.validateSingleEmojiSize("😀", "30px"); // Validate emoji categories displayed in emoji container const emojiCategories = [