Skip to content

Commit

Permalink
test: 💅 updating checks for broadcast
Browse files Browse the repository at this point in the history
  • Loading branch information
VicAlbr committed Dec 10, 2024
1 parent e764d7d commit d6e084a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 24 deletions.
6 changes: 4 additions & 2 deletions apps/ledger-live-desktop/tests/page/account.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ export class AccountPage extends AppPage {
private advancedButton = this.page.getByText("Advanced");
private accountAdvancedLogs = this.page.getByTestId("Advanced_Logs");
private operationRows = this.page.locator("[data-testid^='operation-row-']");
private selectSpecificOperation = (operationType: string) =>
this.page.locator("[data-testid^='operation-row-']").filter({ hasText: operationType });
private closeModal = this.page.getByTestId("modal-close-button");
private accountbutton = (accountName: string) =>
this.page.getByRole("button", { name: `${accountName}` });
Expand Down Expand Up @@ -82,8 +84,8 @@ export class AccountPage extends AppPage {
}

@step("Click on last operation")
async clickOnLastOperation() {
await this.operationRows.first().click();
async clickOnLastOperation(operation: string) {
await this.selectSpecificOperation(operation).first().click();
}

@step("Click Stake button on banner")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ test.describe("Delegate flows", () => {
await app.drawer.close();

await app.layout.syncAccounts();
await app.account.clickOnLastOperation();
await app.account.clickOnLastOperation("Delegated");
await app.delegateDrawer.expectDelegationInfos(account.delegate);
},
);
Expand Down
38 changes: 17 additions & 21 deletions apps/ledger-live-desktop/tests/specs/speculos/send.tx.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ import { test } from "../../fixtures/common";
import { Account } from "@ledgerhq/live-common/e2e/enum/Account";
import { Fee } from "@ledgerhq/live-common/e2e/enum/Fee";
import { Transaction } from "../../models/Transaction";
import { addTmsLink, addBugLink } from "tests/utils/allureUtils";
import { addTmsLink } from "tests/utils/allureUtils";
import { getDescription } from "../../utils/customJsonReporter";
import { CLI } from "tests/utils/cliUtils";
import { isRunningInScheduledWorkflow } from "tests/utils/githubUtils";
import { getEnv } from "@ledgerhq/live-env";

//Warning 🚨: XRP Tests may fail due to API HTTP 429 issue - Jira: LIVE-14237

Expand All @@ -21,10 +22,9 @@ const transactionsAmountInvalid = [
xrayTicket: "B2CQA-2569",
},
{
transaction: new Transaction(Account.XRP_1, Account.XRP_3, "1", undefined, "noTag"),
expectedErrorMessage: "Recipient address is inactive. Send at least 10 XRP to activate it",
transaction: new Transaction(Account.XRP_1, Account.XRP_3, "0.1", undefined, "noTag"),
expectedErrorMessage: "Recipient address is inactive. Send at least 1 XRP to activate it",
xrayTicket: "B2CQA-2571",
bugTicket: "BACK-8110",
},
{
transaction: new Transaction(Account.DOT_1, Account.DOT_2, "1.2"),
Expand Down Expand Up @@ -270,16 +270,18 @@ test.describe("Send flows", () => {
transaction.transaction.accountToCredit.address,
);
await app.drawer.close();

await app.layout.goToAccounts();
await app.accounts.clickSyncBtnForAccount(
transaction.transaction.accountToCredit.accountName,
);
await app.accounts.navigateToAccountByName(
transaction.transaction.accountToCredit.accountName,
);
await app.account.clickOnLastOperation();
await app.sendDrawer.expectReceiverInfos(transaction.transaction);
// Todo: Update method => Check the receiver account only when we broadcast
if (!getEnv("DISABLE_TRANSACTION_BROADCAST")) {
await app.layout.goToAccounts();
await app.accounts.clickSyncBtnForAccount(
transaction.transaction.accountToCredit.accountName,
);
await app.accounts.navigateToAccountByName(
transaction.transaction.accountToCredit.accountName,
);
await app.account.clickOnLastOperation("Received");
await app.sendDrawer.expectReceiverInfos(transaction.transaction);
}
},
);
});
Expand Down Expand Up @@ -444,16 +446,10 @@ test.describe("Send flows", () => {
test(
`Check "${transaction.expectedErrorMessage}" for ${transaction.transaction.accountToDebit.currency.name} - invalid amount ${transaction.transaction.amount} input error`,
{
annotation: [
{ type: "TMS", description: transaction.xrayTicket },
{ type: "BUG", description: transaction.bugTicket },
],
annotation: { type: "TMS", description: transaction.xrayTicket },
},
async ({ app }) => {
await addTmsLink(getDescription(test.info().annotations).split(", "));
if (transaction.bugTicket) {
await addBugLink(getDescription(test.info().annotations).split(", "));
}

await app.layout.goToAccounts();
await app.accounts.navigateToAccountByName(
Expand Down

0 comments on commit d6e084a

Please sign in to comment.