diff --git a/apps/ledger-live-desktop/tests/page/portfolio.page.ts b/apps/ledger-live-desktop/tests/page/portfolio.page.ts index 7cb2f22e4fe7..dea46db1909f 100644 --- a/apps/ledger-live-desktop/tests/page/portfolio.page.ts +++ b/apps/ledger-live-desktop/tests/page/portfolio.page.ts @@ -9,6 +9,7 @@ export class PortfolioPage extends AppPage { private swapEntryButton = this.page.getByTestId("swap-entry-button"); private stakeEntryButton = this.page.getByTestId("stake-entry-button"); private chart = this.page.getByTestId("chart-container"); + private operationList = this.page.locator("#operation-list"); private marketPerformanceWidget = this.page.getByTestId("market-performance-widget"); private swapButton = this.marketPerformanceWidget.getByRole("button", { name: "Swap" }); private buyButton = this.marketPerformanceWidget.getByRole("button", { name: "Buy" }); @@ -16,7 +17,9 @@ export class PortfolioPage extends AppPage { private trendTitle = this.marketPerformanceWidget.getByText("1W trend"); private assetRowElements = this.page.locator("[data-testid^='asset-row-']"); private showAllButton = this.page.getByText("Show all"); + private showMoreButton = this.page.getByText("Show more"); private assetRow = (asset: string) => this.page.getByTestId(`asset-row-${asset.toLowerCase()}`); + private operationRows = this.page.locator("[data-testid^='operation-row-']"); @step("Open `Add account` modal") async openAddAccountModal() { @@ -81,9 +84,23 @@ export class PortfolioPage extends AppPage { await assetRowLocator.click(); } + @step("Scroll to operations") async scrollToOperations() { await this.page.waitForTimeout(500); - const operationList = this.page.locator("id=operation-list"); - await operationList.scrollIntoViewIfNeeded(); + await this.operationList.scrollIntoViewIfNeeded(); + } + + @step("check operation history") + async checkOperationHistory() { + await this.operationList.scrollIntoViewIfNeeded(); + expect(await this.operationList).toBeVisible(); + + const numberOfOperationsBefore = await this.operationRows.count(); + + if (await this.showMoreButton.isVisible()) { + await this.showMoreButton.click(); + const numberOfOperationsAfter = await this.operationRows.count(); + expect(numberOfOperationsAfter).toBeGreaterThan(numberOfOperationsBefore); + } } } diff --git a/apps/ledger-live-desktop/tests/specs/speculos/add.account.spec.ts b/apps/ledger-live-desktop/tests/specs/speculos/add.account.spec.ts index bf8c8713e047..fcfa988b19bb 100644 --- a/apps/ledger-live-desktop/tests/specs/speculos/add.account.spec.ts +++ b/apps/ledger-live-desktop/tests/specs/speculos/add.account.spec.ts @@ -5,7 +5,7 @@ import { getDescription } from "../../utils/customJsonReporter"; const currencies = [ { currency: Currency.BTC, xrayTicket: "B2CQA-2499, B2CQA-2644, B2CQA-2672, B2CQA-786" }, - { currency: Currency.ETH, xrayTicket: "B2CQA-2503, B2CQA-2645, B2CQA-2673" }, + { currency: Currency.ETH, xrayTicket: "B2CQA-2503, B2CQA-929, B2CQA-2645, B2CQA-2673" }, { currency: Currency.ETC, xrayTicket: "B2CQA-2502, B2CQA-2646, B2CQA-2674" }, { currency: Currency.XRP, xrayTicket: "B2CQA-2505, B2CQA-2647, B2CQA-2675" }, { currency: Currency.DOT, xrayTicket: "B2CQA-2504, B2CQA-2648, B2CQA-2676" }, @@ -50,6 +50,7 @@ for (const currency of currencies) { if (currency.currency.name !== Currency.TON.name) { await app.layout.expectBalanceVisibility(); } + await app.portfolio.checkOperationHistory(); await app.layout.goToAccounts(); await app.accounts.navigateToAccountByName(firstAccountName); await app.account.expectAccountVisibility(firstAccountName);