diff --git a/apps/ledger-live-desktop/tests/component/layout.component.ts b/apps/ledger-live-desktop/tests/component/layout.component.ts index d62c202a3900..b32cbf2f4206 100644 --- a/apps/ledger-live-desktop/tests/component/layout.component.ts +++ b/apps/ledger-live-desktop/tests/component/layout.component.ts @@ -1,4 +1,3 @@ -import { expect } from "@playwright/test"; import { step } from "../misc/reporters/step"; import { Component } from "tests/page/abstractClasses"; @@ -52,15 +51,6 @@ export class Layout extends Component { await this.drawerMarketButton.click(); } - async checkInputErrorNotVisible() { - await this.inputError.waitFor({ state: "hidden" }); - } - - @step("synchronize accounts") - async syncAccounts() { - await this.topbarSynchronizeButton.click(); - } - @step("Open Accounts") async goToAccounts() { await this.drawerAccountsButton.click(); @@ -96,15 +86,6 @@ export class Layout extends Component { await this.topbarSettingsButton.click(); } - async checkErrorMessage(errorMessage: string | null) { - if (errorMessage !== null) { - await this.inputError.waitFor({ state: "visible" }); - const errorText: any = await this.inputError.textContent(); - const normalize = (str: string) => str.replace(/\u00A0/g, " ").trim(); - expect(normalize(errorText)).toEqual(normalize(errorMessage)); - } - } - async lockApp() { await this.topbarLockButton.click(); } diff --git a/apps/ledger-live-desktop/tests/enum/Account.ts b/apps/ledger-live-desktop/tests/enum/Account.ts index bc352dc797a0..d657e7204c28 100644 --- a/apps/ledger-live-desktop/tests/enum/Account.ts +++ b/apps/ledger-live-desktop/tests/enum/Account.ts @@ -79,12 +79,6 @@ export class Account { "12fY9vqzD8j1uvqSRx9y3gXRA1S3bwr5xunBVZvx1eeZFaHY", ); - static readonly DOT_3 = new Account( - Currency.DOT, - "Polkadot 3", - "1532VyvZyyMUmLfhMUYh2KRVLzwYfHcxjtejyX4swkpG82BX", - ); - static readonly SOL_1 = new Account( Currency.SOL, "Solana 1", @@ -128,12 +122,6 @@ export class Account { "6TFDU3BYQ2FO32SOYQDTHDW5XKGEYH4FCT34ZQRHFPJRVMLEQWOO2OEUU4", ); - static readonly ALGO_3 = new Account( - Currency.ALGO, - "Algorand 3", - "3ASRTAN6KCZCICTIFQ5N2UBOSSBOZ7WFSOI2CJEJ4ESK532RODQZ7KCSOA", - ); - static readonly XLM_1 = new Account( Currency.XLM, "Stellar 1", diff --git a/apps/ledger-live-desktop/tests/enum/Fee.ts b/apps/ledger-live-desktop/tests/enum/Fee.ts deleted file mode 100644 index 18656868014f..000000000000 --- a/apps/ledger-live-desktop/tests/enum/Fee.ts +++ /dev/null @@ -1,5 +0,0 @@ -export enum Fee { - FAST = "fast", - MEDIUM = "medium", - SLOW = "slow", -} diff --git a/apps/ledger-live-desktop/tests/enum/Token.ts b/apps/ledger-live-desktop/tests/enum/Tokens.ts similarity index 100% rename from apps/ledger-live-desktop/tests/enum/Token.ts rename to apps/ledger-live-desktop/tests/enum/Tokens.ts diff --git a/apps/ledger-live-desktop/tests/models/Transaction.ts b/apps/ledger-live-desktop/tests/models/Transaction.ts index 896eb230cf60..7f784156daae 100644 --- a/apps/ledger-live-desktop/tests/models/Transaction.ts +++ b/apps/ledger-live-desktop/tests/models/Transaction.ts @@ -1,24 +1,10 @@ import { Account } from "../enum/Account"; -import { Token } from "../enum/Token"; -export abstract class Transaction { +export class Transaction { constructor( public readonly accountToDebit: Account, - public readonly accountToCredit: Account, + public readonly recipient: string, public readonly amount: string, public readonly speed: string, ) {} } -export class BasicTransaction extends Transaction {} -export class TokenTransaction extends Transaction { - constructor( - accountToDebit: Account, - public readonly accountToCredit1: Account, - public readonly accountToCredit2: Account, - amount: string, - speed: string, - public readonly token: Token, - ) { - super(accountToDebit, accountToCredit1, amount, speed); - } -} diff --git a/apps/ledger-live-desktop/tests/page/account.page.ts b/apps/ledger-live-desktop/tests/page/account.page.ts index 84baed51f5ae..b3cfc535c4c7 100644 --- a/apps/ledger-live-desktop/tests/page/account.page.ts +++ b/apps/ledger-live-desktop/tests/page/account.page.ts @@ -1,7 +1,8 @@ import { expect } from "@playwright/test"; import { step } from "tests/misc/reporters/step"; import { AppPage } from "tests/page/abstractClasses"; -import { Token } from "tests/enum/Token"; +import { Token } from "tests/enum/Tokens"; + export class AccountPage extends AppPage { readonly settingsButton = this.page.getByTestId("account-settings-button"); private settingsDeleteButton = this.page.getByTestId("account-settings-delete-button"); @@ -30,7 +31,6 @@ export class AccountPage extends AppPage { this.page.getByRole("button", { name: `${accountName}` }); private tokenRow = (tokenTicker: string) => this.page.getByTestId(`token-row-${tokenTicker}`); private addTokenButton = this.page.getByRole("button", { name: "Add token" }); - private viewDetailsButton = this.page.getByText("View details"); @step("Navigate to token $0") async navigateToToken(token: Token) { @@ -69,16 +69,6 @@ export class AccountPage extends AppPage { await this.stakeButton.click(); } - @step("Click on View Details button") - async navigateToViewDetails() { - await this.viewDetailsButton.click(); - } - - @step("Click on last operation") - async clickOnLastOperation() { - await this.operationRows.first().click(); - } - async clickBannerCTA() { await this.stakeBannerButton.scrollIntoViewIfNeeded(); await this.stakeBannerButton.click(); @@ -154,9 +144,4 @@ export class AccountPage extends AppPage { expect(tokenInfos).toContain(token.tokenName); expect(tokenInfos).toContain(token.tokenTicker); } - - @step("navigate to token in account") - async navigateToTokenInAccount(token: Token) { - await this.tokenRow(token.tokenTicker).click(); - } } diff --git a/apps/ledger-live-desktop/tests/page/drawer/drawer.ts b/apps/ledger-live-desktop/tests/page/drawer/drawer.ts index f399d24346cc..84eb97c0681b 100644 --- a/apps/ledger-live-desktop/tests/page/drawer/drawer.ts +++ b/apps/ledger-live-desktop/tests/page/drawer/drawer.ts @@ -1,6 +1,4 @@ import { Component } from "tests/page/abstractClasses"; -import { expect } from "@playwright/test"; -import { BasicTransaction } from "tests/models/Transaction"; export class Drawer extends Component { readonly content = this.page.getByTestId("drawer-content"); @@ -9,10 +7,6 @@ export class Drawer extends Component { private closeButton = this.page.getByTestId("drawer-close-button"); private currencyButton = (currency: string) => this.page.getByTestId(`currency-row-${currency.toLowerCase()}`).first(); - private addressValue = (address: string) => - this.page.locator('[data-test-id="drawer-content"]').locator(`text=${address}`); - private amountValue = (amount: string) => - this.page.locator('[data-test-id="drawer-content"]').locator(`text=${amount}`); readonly selectAssetTitle = this.page.getByTestId("select-asset-drawer-title").first(); readonly selectAccountTitle = this.page.getByTestId("select-account-drawer-title").first(); readonly swapAmountFrom = this.page.getByTestId("swap-amount-from").first(); @@ -25,20 +19,6 @@ export class Drawer extends Component { await this.continueButton.click(); } - async adressValueIsVisible(address: string) { - await this.addressValue(address).waitFor({ state: "visible" }); - } - - async amoutValueIsVisible(amount: string) { - await this.amountValue(amount).waitFor({ state: "visible" }); - } - - async expectReceiverInfos(tx: BasicTransaction) { - await expect(this.addressValue(tx.accountToDebit.address)).toBeVisible(); - await expect(this.addressValue(tx.accountToCredit.address)).toBeVisible(); - await expect(this.amountValue(tx.amount)).toBeVisible(); - } - async waitForDrawerToBeVisible() { await this.content.waitFor({ state: "visible" }); await this.closeButton.waitFor({ state: "visible" }); diff --git a/apps/ledger-live-desktop/tests/page/index.ts b/apps/ledger-live-desktop/tests/page/index.ts index 7f92e95332f7..718baf5d2823 100644 --- a/apps/ledger-live-desktop/tests/page/index.ts +++ b/apps/ledger-live-desktop/tests/page/index.ts @@ -8,11 +8,9 @@ import { Modal } from "../component/modal.component"; import { ReceiveModal } from "../page/modal/receive.modal"; import { SpeculosPage } from "tests/page/speculos.page"; import { SendModal } from "tests/page/modal/send.modal"; -import { Drawer } from "tests/page/drawer/drawer"; export class Application extends PageHolder { public account = new AccountPage(this.page); - public drawer = new Drawer(this.page); public accounts = new AccountsPage(this.page); public portfolio = new PortfolioPage(this.page); public addAccount = new AddAccountModal(this.page); diff --git a/apps/ledger-live-desktop/tests/page/modal/add.account.modal.ts b/apps/ledger-live-desktop/tests/page/modal/add.account.modal.ts index 2c7ddcf8785d..9ec2ef4b3187 100644 --- a/apps/ledger-live-desktop/tests/page/modal/add.account.modal.ts +++ b/apps/ledger-live-desktop/tests/page/modal/add.account.modal.ts @@ -1,7 +1,7 @@ import { expect } from "@playwright/test"; import { Modal } from "../../component/modal.component"; import { step } from "tests/misc/reporters/step"; -import { Token } from "tests/enum/Token"; +import { Token } from "tests/enum/Tokens"; export class AddAccountModal extends Modal { private selectAccount = this.page.locator("text=Choose a crypto asset"); // FIXME: I need an id diff --git a/apps/ledger-live-desktop/tests/page/modal/receive.modal.ts b/apps/ledger-live-desktop/tests/page/modal/receive.modal.ts index 82ff7eb95923..d7f4268e5e63 100644 --- a/apps/ledger-live-desktop/tests/page/modal/receive.modal.ts +++ b/apps/ledger-live-desktop/tests/page/modal/receive.modal.ts @@ -1,7 +1,7 @@ import { expect } from "@playwright/test"; import { Modal } from "../../component/modal.component"; import { step } from "tests/misc/reporters/step"; -import { Token } from "tests/enum/Token"; +import { Token } from "tests/enum/Tokens"; export class ReceiveModal extends Modal { private skipDeviceButton = this.page.getByTestId("receive-connect-device-skip-device-button"); diff --git a/apps/ledger-live-desktop/tests/page/modal/send.modal.ts b/apps/ledger-live-desktop/tests/page/modal/send.modal.ts index ace0ac7de775..deb7189d50fb 100644 --- a/apps/ledger-live-desktop/tests/page/modal/send.modal.ts +++ b/apps/ledger-live-desktop/tests/page/modal/send.modal.ts @@ -5,20 +5,19 @@ import { Transaction } from "../../models/Transaction"; export class SendModal extends Modal { private drowdownAccount = this.page.locator('[data-test-id="modal-content"] svg').nth(1); - readonly recipientInput = this.page.locator('[id="send-recipient-input"]'); - readonly continueButton = this.page.getByRole("button", { name: "continue" }); + readonly recipientInput = this.page.getByPlaceholder("Enter"); + private continueRecipientButton = this.page.getByRole("button", { name: "continue" }); private totalDebitValue = this.page.locator("text=Total to debit"); private checkDeviceLabel = this.page.locator( "text=Double-check the transaction details on your Ledger device before signing.", ); private checkTransactionbroadcastLabel = this.page.locator("text=Transaction sent"); - private recipientAddressDisplayedValue = this.page.locator("data-test-id=recipient-address"); - private amountDisplayedValue = this.page.locator("data-test-id=transaction-amount"); - private ASAErrorMessage = this.page.getByText( - "Recipient account has not opted in the selected ASA.", - ); - private invalidAddressErrorMessage = (network: string) => - this.page.getByText(`This is not a valid ${network} address`); + private addressValue = (address: string) => + this.page.getByTestId("modal-content").locator(`text=${address}`); + private amountValue = (amount: string, currency: string) => + this.page.locator(`text=${amount} ${currency}`).first(); + private recipientAddressDisplayedValue = this.page.getByTestId("recipient-address"); + private amountDisplayedValue = this.page.getByTestId("transaction-amount"); async selectAccount(name: string) { await this.drowdownAccount.click(); @@ -30,8 +29,8 @@ export class SendModal extends Modal { } @step("Click `Continue` button") - async clickContinueToDevice() { - await this.continueButton.click(); + async clickContinue() { + await this.continueRecipientButton.click(); await expect(this.checkDeviceLabel).toBeVisible(); } @@ -43,8 +42,8 @@ export class SendModal extends Modal { @step("Fill tx information") async fillTxInfo(tx: Transaction) { - await this.fillRecipient(tx.accountToCredit.address); - await this.continueButton.click(); + await this.fillRecipient(tx.recipient); + await this.continueRecipientButton.click(); await this.cryptoAmountField.fill(tx.amount); await this.countinueSendAmount(); } @@ -52,9 +51,11 @@ export class SendModal extends Modal { @step("Verify tx information before confirming") async expectTxInfoValidity(tx: Transaction) { await expect(this.totalDebitValue).toBeVisible(); + await expect(this.addressValue(tx.recipient)).toBeVisible(); const displayedReceiveAddress = await this.recipientAddressDisplayedValue.innerText(); - expect(displayedReceiveAddress).toEqual(tx.accountToCredit.address); + expect(displayedReceiveAddress).toEqual(tx.recipient); + await expect(this.amountValue(tx.amount, tx.accountToDebit.currency.uiLabel)).toBeVisible(); const displayedAmount = await this.amountDisplayedValue.innerText(); expect(displayedAmount).toEqual(expect.stringContaining(tx.amount)); } @@ -63,42 +64,4 @@ export class SendModal extends Modal { async expectTxSent() { await expect(this.checkTransactionbroadcastLabel).toBeVisible(); } - - @step("Check continue button disable and ASA error message visible") - async checkASAError() { - await expect(this.continueButton).toBeDisabled(); - await expect(this.ASAErrorMessage).toBeVisible(); - } - - @step("Check invalid address error message") - async checkInvalidAddressError(tx: Transaction) { - await expect(this.continueButton).toBeDisabled(); - await expect( - this.invalidAddressErrorMessage(tx.accountToDebit.currency.deviceLabel), - ).toBeVisible(); - } - - @step("Check continue button enable") - async checkContinueButtonEnable() { - await expect(this.continueButton).toBeEnabled(); - } - - @step("Fill amount") - async fillAmount(tx: Transaction) { - if (tx.amount == "send max") { - await this.toggleMaxAmount(); - } else { - await this.cryptoAmountField.fill(tx.amount); - } - } - - @step("Click `Continue` button") - async clickContinue() { - await this.continueButton.click(); - } - - @step("Check continue button disabled") - async checkContinueButtonDisabled() { - await expect(this.continueButton).toBeDisabled(); - } } diff --git a/apps/ledger-live-desktop/tests/page/speculos.page.ts b/apps/ledger-live-desktop/tests/page/speculos.page.ts index 211608910e21..a2fa47fdd0e1 100644 --- a/apps/ledger-live-desktop/tests/page/speculos.page.ts +++ b/apps/ledger-live-desktop/tests/page/speculos.page.ts @@ -28,7 +28,7 @@ export class SpeculosPage extends AppPage { const amountScreen = await pressRightUntil(DeviceLabels.AMOUT); expect(verifyAmount(tx.amount, amountScreen)).toBe(true); const addressScreen = await pressRightUntil(DeviceLabels.ADDRESS); - expect(assertAddressesEquality(tx.accountToCredit.address, addressScreen)).toBe(true); + expect(assertAddressesEquality(tx.recipient, addressScreen)).toBe(true); await pressRightUntil(tx.accountToDebit.currency.sendPattern[2]); await pressBoth(); if (tx.accountToDebit.currency.uiName === Currency.tBTC.uiName) { diff --git a/apps/ledger-live-desktop/tests/specs/speculos/send.tx.spec.ts b/apps/ledger-live-desktop/tests/specs/speculos/send.tx.spec.ts index 287d003a235d..42455199c869 100644 --- a/apps/ledger-live-desktop/tests/specs/speculos/send.tx.spec.ts +++ b/apps/ledger-live-desktop/tests/specs/speculos/send.tx.spec.ts @@ -1,217 +1,29 @@ import { test } from "../../fixtures/common"; import { Account } from "../../enum/Account"; -import { Token } from "../../enum/Token"; -import { Fee } from "../../enum/Fee"; -import { BasicTransaction, TokenTransaction } from "../../models/Transaction"; +import { Transaction } from "../../models/Transaction"; import { specs } from "../../utils/speculos"; import { addTmsLink } from "tests/utils/allureUtils"; import { getDescription } from "../../utils/customJsonReporter"; -const transaction = new BasicTransaction( - Account.sep_ETH_1, - Account.sep_ETH_2, - "0.00001", - Fee.MEDIUM, -); - -const transactionETH_BTC = new BasicTransaction( - Account.ETH_1, - Account.BTC_1, - "0.00001", - Fee.MEDIUM, -); - -const transactionsToken = new TokenTransaction( - Account.ALGO_1, - Account.ALGO_2, - Account.ALGO_3, - "0.1", - Fee.MEDIUM, - Token.ALGO_USDT, -); - -const transactionInputValid = [ - new BasicTransaction(Account.ETH_1, Account.ETH_2, "send max", Fee.MEDIUM), - new BasicTransaction(Account.ETH_1, Account.ETH_2, "0.00001", Fee.MEDIUM), +// ONLY TESTNET (SEND WILL BE APPROVED ON DEVICE) +const transactions = [ + //TODO: Reactivate when fees will be stable + //new Transaction(Account.tBTC_1, Account.tBTC_2, "0.00001", "medium"), + new Transaction(Account.sep_ETH_1, Account.sep_ETH_2.address, "0.00001", "medium"), ]; -const transactionsInputsInvalid = [ - { - transaction: new BasicTransaction(Account.ETH_1, Account.ETH_2, "", Fee.MEDIUM), - expectedErrorMessage: null, - }, - { - transaction: new BasicTransaction(Account.ETH_1, Account.ETH_2, "0", Fee.MEDIUM), - expectedErrorMessage: null, - }, - { - transaction: new BasicTransaction(Account.XRP_1, Account.XRP_2, "1", Fee.MEDIUM), - expectedErrorMessage: "Recipient address is inactive. Send at least 10 XRP to activate it", - }, - { - transaction: new BasicTransaction(Account.DOT_1, Account.DOT_2, "1.2", Fee.MEDIUM), - expectedErrorMessage: "Balance cannot be below 1 DOT. Send max to empty account.", - }, - { - transaction: new BasicTransaction(Account.DOT_1, Account.DOT_3, "0.5", Fee.MEDIUM), - expectedErrorMessage: "Recipient address is inactive. Send at least 1 DOT to activate it", - }, - { - transaction: new BasicTransaction(Account.ETH_1, Account.ETH_2, "100", Fee.MEDIUM), - expectedErrorMessage: "Sorry, insufficient funds", - }, -]; - -//Warning 🚨: Test may fail due to the GetAppAndVersion issue - Jira: LIVE-12581 or insufficient funds - -test.describe("Send from 1 account to another", () => { - test.use({ - userdata: "speculos-tests-app", - testName: `sendApprove_${transaction.accountToDebit.currency.uiName}`, - speculosCurrency: specs[transaction.accountToDebit.currency.deviceLabel.replace(/ /g, "_")], - speculosOffset: 0, - }); - - test( - `Send [${transaction.accountToDebit.accountName}] to [${transaction.accountToCredit.accountName}]`, - { - annotation: { - type: "TMS", - description: "B2CQA-473", - }, - }, - async ({ app }) => { - await addTmsLink(getDescription(test.info().annotations).split(", ")); - - await app.layout.goToAccounts(); - await app.accounts.navigateToAccountByName(transaction.accountToDebit.accountName); - - await app.account.clickSend(); - await app.send.fillTxInfo(transaction); - await app.send.expectTxInfoValidity(transaction); - await app.send.clickContinueToDevice(); - - await app.speculos.expectValidTxInfo(transaction); - await app.send.expectTxSent(); - await app.account.navigateToViewDetails(); - await app.drawer.adressValueIsVisible(transaction.accountToDebit.address); - await app.drawer.adressValueIsVisible(transaction.accountToCredit.address); - await app.drawer.close(); - - await app.layout.goToAccounts(); - await app.accounts.navigateToAccountByName(transaction.accountToCredit.accountName); - await app.layout.syncAccounts(); - await app.account.clickOnLastOperation(); - await app.drawer.expectReceiverInfos(transaction); - }, - ); -}); - -test.describe("Send token (subAccount) from 1 account to another", () => { - test.use({ - userdata: "speculos-subAccount", - testName: `sendToken_${transactionsToken.accountToDebit.currency.uiName}`, - speculosCurrency: - specs[transactionsToken.accountToDebit.currency.deviceLabel.replace(/ /g, "_")], - speculosOffset: 0, - }); - - test( - `Send [${transactionsToken.accountToCredit1.accountName}] (${transactionsToken.token.tokenTicker}) to [${transactionsToken.accountToCredit2.accountName}]`, - { - annotation: { - type: "TMS", - description: "B2CQA-479", - }, - }, - async ({ app }) => { - await app.layout.goToAccounts(); - await app.accounts.navigateToAccountByName(transactionsToken.accountToDebit.accountName); - await app.account.navigateToTokenInAccount(transactionsToken.token); - await app.account.clickSend(); - await app.send.fillRecipient(transactionsToken.accountToCredit1.address); - await app.send.checkASAError(); - await app.send.fillRecipient(transactionsToken.accountToCredit2.address); - await app.send.checkContinueButtonEnable(); - await app.layout.checkInputErrorNotVisible(); - }, - ); -}); - -test.describe("Check ETH input error", () => { - test.use({ - userdata: "speculos-tests-app", - testName: `ETH_input_error_${transactionETH_BTC.accountToDebit.currency.uiName}`, - speculosCurrency: - specs[transactionETH_BTC.accountToDebit.currency.deviceLabel.replace(/ /g, "_")], - speculosOffset: 0, - }); - - test( - `Check [${transactionETH_BTC.accountToDebit.currency}] input error`, - { - annotation: { - type: "TMS", - description: "B2CQA-1904", - }, - }, - async ({ app }) => { - await app.layout.goToAccounts(); - await app.accounts.navigateToAccountByName(transactionETH_BTC.accountToDebit.accountName); - - await app.account.clickSend(); - await app.send.fillRecipient(transactionETH_BTC.accountToCredit.address); - await app.send.checkInvalidAddressError(transactionETH_BTC); - }, - ); -}); - -for (const [i, transaction] of transactionsInputsInvalid.entries()) { - test.describe("Check error message for send test (invalid input)", () => { +//Warning 🚨: Test may fail due to the GetAppAndVersion issue - Jira: LIVE-12581 +for (const [i, transaction] of transactions.entries()) { + test.describe("Send Approve", () => { test.use({ userdata: "speculos-tests-app", - testName: `Send_test_invalid_input_${transaction.transaction.accountToDebit.currency.uiName}`, - speculosCurrency: - specs[transaction.transaction.accountToDebit.currency.deviceLabel.replace(/ /g, "_")], - speculosOffset: i, - }); - - test( - `Check [${transaction.expectedErrorMessage}] for [${transaction.transaction.accountToDebit.currency.uiName}] - Send test invalid input - ${i} `, - { - annotation: { - type: "TMS", - description: "B2CQA-473", - }, - }, - async ({ app }) => { - await app.layout.goToAccounts(); - await app.accounts.navigateToAccountByName( - transaction.transaction.accountToDebit.accountName, - ); - - await app.account.clickSend(); - await app.send.fillRecipient(transaction.transaction.accountToCredit.address); - await app.send.clickContinue(); - await app.send.fillAmount(transaction.transaction); - await app.send.checkContinueButtonDisabled(); - await app.layout.checkErrorMessage(transaction.expectedErrorMessage); - }, - ); - }); -} - -for (const [i, transaction] of transactionInputValid.entries()) { - test.describe("Check valid input for send test", () => { - test.use({ - userdata: "speculos-tests-app", - testName: `Send_test_valid_input_${transaction.accountToDebit.currency.uiName}`, + testName: `sendApprove_${transaction.accountToDebit.currency.uiName}`, speculosCurrency: specs[transaction.accountToDebit.currency.deviceLabel.replace(/ /g, "_")], speculosOffset: i, }); test( - `Check Valid amount input [${transaction.amount}] for send tests`, + `[${transaction.accountToDebit.accountName}] send Approve`, { annotation: { type: "TMS", @@ -219,15 +31,18 @@ for (const [i, transaction] of transactionInputValid.entries()) { }, }, async ({ app }) => { + await addTmsLink(getDescription(test.info().annotations).split(", ")); + await app.layout.goToAccounts(); await app.accounts.navigateToAccountByName(transaction.accountToDebit.accountName); await app.account.clickSend(); - await app.send.fillRecipient(transaction.accountToCredit.address); + await app.send.fillTxInfo(transaction); + await app.send.expectTxInfoValidity(transaction); await app.send.clickContinue(); - await app.send.fillAmount(transaction); - await app.send.checkContinueButtonEnable(); - await app.layout.checkInputErrorNotVisible(); + + await app.speculos.expectValidTxInfo(transaction); + await app.send.expectTxSent(); }, ); }); diff --git a/apps/ledger-live-desktop/tests/specs/speculos/subAccount.spec.ts b/apps/ledger-live-desktop/tests/specs/speculos/subAccount.spec.ts index 7aa4ddad0590..4b050676efe0 100644 --- a/apps/ledger-live-desktop/tests/specs/speculos/subAccount.spec.ts +++ b/apps/ledger-live-desktop/tests/specs/speculos/subAccount.spec.ts @@ -1,5 +1,5 @@ import { test } from "../../fixtures/common"; -import { Token } from "../../enum/Token"; +import { Token } from "../../enum/Tokens"; import { specs } from "../../utils/speculos"; import { addTmsLink } from "tests/utils/allureUtils"; import { getDescription } from "../../utils/customJsonReporter";