Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🩹 [QAA-304] Adding check for operation history when adding an account #8168

Merged
merged 2 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading