Skip to content

Commit

Permalink
[FIX] : e2e tests for Market page
Browse files Browse the repository at this point in the history
  • Loading branch information
mcayuelas-ledger committed Apr 16, 2024
1 parent 5356127 commit fac6085
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/ten-camels-complain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"ledger-live-desktop": patch
---

Fix e2e tests for Market
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,11 @@ export const MarketRow = memo<Props>(function MarketRowItem({
<TableCell loading />
</TableRow>
) : (
<TableRow data-test-id={`market-${currency?.ticker}-row`} onClick={onCurrencyClick}>
<TableRow
data-test-id={`market-${currency?.ticker}-row`}
onClick={onCurrencyClick}
role="row"
>
<TableCell>{currency?.marketcapRank ?? "-"}</TableCell>
<TableCell mr={3}>
<CryptoCurrencyIconWrapper>
Expand Down
1 change: 1 addition & 0 deletions apps/ledger-live-desktop/tests/specs/market/market.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)).*$") }),
],
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down

0 comments on commit fac6085

Please sign in to comment.