From a0de0e0b60464ccfeaa0904dd0c2e43ed8eeb83a Mon Sep 17 00:00:00 2001 From: Gregor Gilchrist Date: Tue, 25 Jul 2023 14:38:07 +0200 Subject: [PATCH] fix: masking buy and earn webviews in playwright screenshots so random font issues don't affect tests --- apps/ledger-live-desktop/tests/specs/services/buy.spec.ts | 4 +++- apps/ledger-live-desktop/tests/specs/services/earn.spec.ts | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/ledger-live-desktop/tests/specs/services/buy.spec.ts b/apps/ledger-live-desktop/tests/specs/services/buy.spec.ts index 107d3f2b1eb6..46a2954718e2 100644 --- a/apps/ledger-live-desktop/tests/specs/services/buy.spec.ts +++ b/apps/ledger-live-desktop/tests/specs/services/buy.spec.ts @@ -68,7 +68,9 @@ test("Buy / Sell @smoke", async ({ page }) => { await portfolioPage.startBuyFlow(); await expect(await liveAppWebview.waitForCorrectTextInWebview("theme: dark")).toBe(true); await expect(await liveAppWebview.waitForCorrectTextInWebview("lang: en")).toBe(true); - await expect.soft(page).toHaveScreenshot("buy-app-opened.png"); + await expect + .soft(page) + .toHaveScreenshot("buy-app-opened.png", { mask: [page.locator("webview")] }); }); await test.step("Navigate to Buy app from market", async () => { diff --git a/apps/ledger-live-desktop/tests/specs/services/earn.spec.ts b/apps/ledger-live-desktop/tests/specs/services/earn.spec.ts index f828b6a375e9..155a6ce76927 100644 --- a/apps/ledger-live-desktop/tests/specs/services/earn.spec.ts +++ b/apps/ledger-live-desktop/tests/specs/services/earn.spec.ts @@ -55,6 +55,8 @@ test("Earn @smoke", async ({ page }) => { await expect(await liveAppWebview.waitForCorrectTextInWebview("currencyTicker: USD")).toBe( true, ); - await expect.soft(page).toHaveScreenshot("earn-app-opened.png"); + await expect + .soft(page) + .toHaveScreenshot("earn-app-opened.png", { mask: [page.locator("webview")] }); }); });