Skip to content

Commit

Permalink
🩹 [QAA-304] Adding check for operation history when adding an account (…
Browse files Browse the repository at this point in the history
…#8168)

* test: adding check for operation history when adding an account
  • Loading branch information
VicAlbr authored Oct 22, 2024
1 parent 10f94d0 commit b715c21
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
21 changes: 19 additions & 2 deletions apps/ledger-live-desktop/tests/page/portfolio.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,17 @@ 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" });
private assetAllocationTitle = this.page.getByText("Asset allocation");
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() {
Expand Down Expand Up @@ -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);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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" },
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit b715c21

Please sign in to comment.