From fac6085981aa1c3958ec81a23f63e51a1fc5e753 Mon Sep 17 00:00:00 2001 From: Martin Cayuelas Date: Tue, 16 Apr 2024 11:09:56 +0200 Subject: [PATCH] [FIX] : e2e tests for Market page --- .changeset/ten-camels-complain.md | 5 +++++ .../market/MarketList/components/MarketRowItem.tsx | 6 +++++- .../tests/specs/market/market.spec.ts | 1 + .../tests/specs/services/ethereumStaking.spec.ts | 13 +++++++++---- 4 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 .changeset/ten-camels-complain.md diff --git a/.changeset/ten-camels-complain.md b/.changeset/ten-camels-complain.md new file mode 100644 index 000000000000..4a7d67875d2c --- /dev/null +++ b/.changeset/ten-camels-complain.md @@ -0,0 +1,5 @@ +--- +"ledger-live-desktop": patch +--- + +Fix e2e tests for Market diff --git a/apps/ledger-live-desktop/src/renderer/screens/market/MarketList/components/MarketRowItem.tsx b/apps/ledger-live-desktop/src/renderer/screens/market/MarketList/components/MarketRowItem.tsx index 727f3934b131..25493a23f175 100644 --- a/apps/ledger-live-desktop/src/renderer/screens/market/MarketList/components/MarketRowItem.tsx +++ b/apps/ledger-live-desktop/src/renderer/screens/market/MarketList/components/MarketRowItem.tsx @@ -91,7 +91,11 @@ export const MarketRow = memo(function MarketRowItem({ ) : ( - + {currency?.marketcapRank ?? "-"} diff --git a/apps/ledger-live-desktop/tests/specs/market/market.spec.ts b/apps/ledger-live-desktop/tests/specs/market/market.spec.ts index 7c8e50a11b1d..22b58d73db40 100644 --- a/apps/ledger-live-desktop/tests/specs/market/market.spec.ts +++ b/apps/ledger-live-desktop/tests/specs/market/market.spec.ts @@ -42,6 +42,7 @@ test("Market", async ({ page }) => { page.locator("data-test-id=market-coin-price"), page.locator("data-test-id=market-cap"), page.locator("data-test-id=market-price-change"), + page.getByRole("row").filter({ hasText: new RegExp("^(?!.*(?:Bitcoin|Ethereum)).*$") }), ], }; diff --git a/apps/ledger-live-desktop/tests/specs/services/ethereumStaking.spec.ts b/apps/ledger-live-desktop/tests/specs/services/ethereumStaking.spec.ts index b7d800df5242..cb992d5d0f89 100644 --- a/apps/ledger-live-desktop/tests/specs/services/ethereumStaking.spec.ts +++ b/apps/ledger-live-desktop/tests/specs/services/ethereumStaking.spec.ts @@ -148,16 +148,21 @@ test("Ethereum staking flows via portfolio, asset page and market page @smoke", }); await test.step("Market page loads with ETH staking available", async () => { - await layout.goToMarket(); - await marketPage.waitForLoading(); - await expect.soft(page).toHaveScreenshot("market-loaded-with-eth-stake-button-available.png", { + const maskItemsInMarket = { mask: [ page.locator("data-test-id=market-small-graph"), page.locator("data-test-id=market-coin-price"), page.locator("data-test-id=market-cap"), page.locator("data-test-id=market-price-change"), + page.getByRole("row").filter({ hasText: new RegExp("^(?!.*(?:Bitcoin|Ethereum)).*$") }), ], - }); + }; + + await layout.goToMarket(); + await marketPage.waitForLoading(); + await expect + .soft(page) + .toHaveScreenshot("market-loaded-with-eth-stake-button-available.png", maskItemsInMarket); }); await test.step("start stake flow via Stake entry button", async () => {