diff --git a/.changeset/hot-cameras-fly.md b/.changeset/hot-cameras-fly.md deleted file mode 100644 index af48f850ead9..000000000000 --- a/.changeset/hot-cameras-fly.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"ledger-live-desktop": minor ---- - -broadcasting on e2e tests only on scheduled workflows on Monday diff --git a/.github/workflows/test-ui-e2e-only-desktop.yml b/.github/workflows/test-ui-e2e-only-desktop.yml index 8e6fd7839ed4..d800be14f6cd 100644 --- a/.github/workflows/test-ui-e2e-only-desktop.yml +++ b/.github/workflows/test-ui-e2e-only-desktop.yml @@ -37,6 +37,11 @@ on: required: false type: string default: "B2CQA-2461" + enable_send_test: + description: Enable broadcast + required: false + type: boolean + default: false concurrency: group: ${{ github.workflow }}-${{ github.ref_name != 'develop' && github.ref || github.run_id }} @@ -56,6 +61,7 @@ jobs: CI_OS: "ubuntu-latest" PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 SPECULOS_IMAGE_TAG: ghcr.io/ledgerhq/speculos:0.11 + ENABLE_BROADCAST_TEST: ${{ inputs.enable_send_test }} runs-on: [ledger-live-4xlarge] strategy: fail-fast: false @@ -67,6 +73,16 @@ jobs: with: ref: ${{ inputs.ref || github.sha }} + - name: Setup broadcast environment variables + id: set-env + run: | + day=$(date +%u) + if [ $day -eq 1 ] || "$ENABLE_BROADCAST_TEST" = "1" ; then + echo "ENABLE_TRANSACTION_BROADCAST=1" >> $GITHUB_ENV + else + echo "DISABLE_TRANSACTION_BROADCAST=1" >> $GITHUB_ENV + fi + - name: Setup caches id: caches uses: LedgerHQ/ledger-live/tools/actions/composites/setup-caches@develop diff --git a/apps/ledger-live-desktop/tests/fixtures/common.ts b/apps/ledger-live-desktop/tests/fixtures/common.ts index abc8522a502d..c8e1ea39e646 100644 --- a/apps/ledger-live-desktop/tests/fixtures/common.ts +++ b/apps/ledger-live-desktop/tests/fixtures/common.ts @@ -152,7 +152,8 @@ export const test = base.extend({ FEATURE_FLAGS: JSON.stringify(featureFlags), MANAGER_DEV_MODE: IS_NOT_MOCK ? true : undefined, SPECULOS_API_PORT: IS_NOT_MOCK ? getEnv("SPECULOS_API_PORT")?.toString() : undefined, - DISABLE_TRANSACTION_BROADCAST: !IS_NOT_MOCK ? undefined : 1, + DISABLE_TRANSACTION_BROADCAST: + process.env.ENABLE_TRANSACTION_BROADCAST == "1" || !IS_NOT_MOCK ? undefined : 1, }, env, ); diff --git a/apps/ledger-live-desktop/tests/specs/speculos/delegate.spec.ts b/apps/ledger-live-desktop/tests/specs/speculos/delegate.spec.ts index 58034272350e..d7258334afb2 100644 --- a/apps/ledger-live-desktop/tests/specs/speculos/delegate.spec.ts +++ b/apps/ledger-live-desktop/tests/specs/speculos/delegate.spec.ts @@ -4,7 +4,6 @@ import { Delegate } from "../../models/Delegate"; import { addTmsLink } from "tests/utils/allureUtils"; import { getDescription } from "../../utils/customJsonReporter"; import { commandCLI } from "tests/utils/cliUtils"; -import { isRunningInScheduledWorkflow } from "tests/utils/githubUtils"; const e2eDelegationAccounts = [ { @@ -48,120 +47,17 @@ const validators = [ }, ]; -test.describe("Delegate flows", () => { - test.beforeAll(async () => { - process.env.ENABLE_TRANSACTION_BROADCAST = - new Date().getDay() === 1 && isRunningInScheduledWorkflow() ? "1" : "0"; - }); - for (const account of e2eDelegationAccounts) { - test.describe("Delegate", () => { - test.use({ - userdata: "skip-onboarding", - speculosApp: account.delegate.account.currency.speculosApp, - cliCommands: [ - { - command: commandCLI.liveData, - args: { - currency: account.delegate.account.currency.ticker, - index: account.delegate.account.index, - add: true, - appjson: "", - }, - }, - ], - }); - - test( - `[${account.delegate.account.currency.name}] Delegate`, - { - annotation: { - type: "TMS", - description: account.xrayTicket, - }, - }, - async ({ app }) => { - await addTmsLink(getDescription(test.info().annotations).split(", ")); - await app.layout.goToAccounts(); - await app.accounts.navigateToAccountByName(account.delegate.account.accountName); - - await app.account.clickBannerCTA(); - await app.delegate.verifyProvider(account.delegate.provider); - - await app.delegate.continueDelegate(); - await app.delegate.fillAmount(account.delegate.amount); - await app.modal.countinueSendAmount(); - - await app.speculos.signDelegationTransaction(account.delegate); - await app.delegate.clickViewDetailsButton(); - - await app.drawer.waitForDrawerToBeVisible(); - await app.delegateDrawer.transactionTypeIsVisible(); - await app.delegateDrawer.providerIsVisible(account.delegate); - await app.delegateDrawer.amountValueIsVisible(); - await app.drawer.close(); - - await app.layout.syncAccounts(); - await app.account.clickOnLastOperation(); - await app.delegateDrawer.expectDelegationInfos(account.delegate); - }, - ); - }); - } - - for (const validator of validators) { - test.describe("Select a validator", () => { - test.use({ - userdata: "skip-onboarding", - speculosApp: validator.delegate.account.currency.speculosApp, - cliCommands: [ - { - command: commandCLI.liveData, - args: { - currency: validator.delegate.account.currency.ticker, - index: validator.delegate.account.index, - add: true, - appjson: "", - }, - }, - ], - }); - - test( - `[${validator.delegate.account.currency.name}] - Select validator`, - { - annotation: { - type: "TMS", - description: validator.xrayTicket, - }, - }, - async ({ app }) => { - await addTmsLink(getDescription(test.info().annotations).split(", ")); - await app.layout.goToAccounts(); - await app.accounts.navigateToAccountByName(validator.delegate.account.accountName); - - await app.account.startStakingFlowFromMainStakeButton(); - await app.modal.continue(); - - await app.delegate.verifyProvider(validator.delegate.provider); - await app.delegate.openSearchProviderModal(); - await app.delegate.checkValidatorListIsVisible(); - await app.delegate.selectProvider(1); - }, - ); - }); - } - - test.describe("Staking flow from different entry point", () => { - const delegateAccount = new Delegate(Account.ATOM_1, "0.001", "Ledger"); +for (const account of e2eDelegationAccounts) { + test.describe("Delegate", () => { test.use({ userdata: "skip-onboarding", - speculosApp: delegateAccount.account.currency.speculosApp, + speculosApp: account.delegate.account.currency.speculosApp, cliCommands: [ { command: commandCLI.liveData, args: { - currency: delegateAccount.account.currency.ticker, - index: delegateAccount.account.index, + currency: account.delegate.account.currency.ticker, + index: account.delegate.account.index, add: true, appjson: "", }, @@ -170,45 +66,142 @@ test.describe("Delegate flows", () => { }); test( - "Staking flow from portfolio entry point", + `[${account.delegate.account.currency.name}] Delegate`, { annotation: { type: "TMS", - description: "B2CQA-2769", + description: account.xrayTicket, }, }, async ({ app }) => { await addTmsLink(getDescription(test.info().annotations).split(", ")); - await app.layout.goToPortfolio(); - await app.portfolio.startStakeFlow(); + await app.layout.goToAccounts(); + await app.accounts.navigateToAccountByName(account.delegate.account.accountName); - await app.assetDrawer.selectAsset(delegateAccount.account.currency); - await app.assetDrawer.selectAccountByIndex(delegateAccount.account); + await app.account.clickBannerCTA(); + await app.delegate.verifyProvider(account.delegate.provider); - await app.delegate.verifyProvider(delegateAccount.provider); await app.delegate.continueDelegate(); + await app.delegate.fillAmount(account.delegate.amount); + await app.modal.countinueSendAmount(); + + await app.speculos.signDelegationTransaction(account.delegate); + await app.delegate.clickViewDetailsButton(); + + await app.drawer.waitForDrawerToBeVisible(); + await app.delegateDrawer.transactionTypeIsVisible(); + await app.delegateDrawer.providerIsVisible(account.delegate); + await app.delegateDrawer.amountValueIsVisible(); + await app.drawer.close(); + + await app.layout.syncAccounts(); + await app.account.clickOnLastOperation(); + await app.delegateDrawer.expectDelegationInfos(account.delegate); }, ); + }); +} + +for (const validator of validators) { + test.describe("Select a validator", () => { + test.use({ + userdata: "skip-onboarding", + speculosApp: validator.delegate.account.currency.speculosApp, + cliCommands: [ + { + command: commandCLI.liveData, + args: { + currency: validator.delegate.account.currency.ticker, + index: validator.delegate.account.index, + add: true, + appjson: "", + }, + }, + ], + }); test( - "Staking flow from market entry point", + `[${validator.delegate.account.currency.name}] - Select validator`, { annotation: { type: "TMS", - description: "B2CQA-2771", + description: validator.xrayTicket, }, }, async ({ app }) => { await addTmsLink(getDescription(test.info().annotations).split(", ")); - await app.layout.goToMarket(); - await app.market.search(delegateAccount.account.currency.name); - await app.market.stakeButtonClick(delegateAccount.account.currency.ticker); + await app.layout.goToAccounts(); + await app.accounts.navigateToAccountByName(validator.delegate.account.accountName); - await app.assetDrawer.selectAccountByIndex(delegateAccount.account); + await app.account.startStakingFlowFromMainStakeButton(); + await app.modal.continue(); - await app.delegate.verifyProvider(delegateAccount.provider); - await app.delegate.continueDelegate(); + await app.delegate.verifyProvider(validator.delegate.provider); + await app.delegate.openSearchProviderModal(); + await app.delegate.checkValidatorListIsVisible(); + await app.delegate.selectProvider(1); }, ); }); +} + +test.describe("Staking flow from different entry point", () => { + const delegateAccount = new Delegate(Account.ATOM_1, "0.001", "Ledger"); + test.use({ + userdata: "skip-onboarding", + speculosApp: delegateAccount.account.currency.speculosApp, + cliCommands: [ + { + command: commandCLI.liveData, + args: { + currency: delegateAccount.account.currency.ticker, + index: delegateAccount.account.index, + add: true, + appjson: "", + }, + }, + ], + }); + + test( + "Staking flow from portfolio entry point", + { + annotation: { + type: "TMS", + description: "B2CQA-2769", + }, + }, + async ({ app }) => { + await addTmsLink(getDescription(test.info().annotations).split(", ")); + await app.layout.goToPortfolio(); + await app.portfolio.startStakeFlow(); + + await app.assetDrawer.selectAsset(delegateAccount.account.currency); + await app.assetDrawer.selectAccountByIndex(delegateAccount.account); + + await app.delegate.verifyProvider(delegateAccount.provider); + await app.delegate.continueDelegate(); + }, + ); + + test( + "Staking flow from market entry point", + { + annotation: { + type: "TMS", + description: "B2CQA-2771", + }, + }, + async ({ app }) => { + await addTmsLink(getDescription(test.info().annotations).split(", ")); + await app.layout.goToMarket(); + await app.market.search(delegateAccount.account.currency.name); + await app.market.stakeButtonClick(delegateAccount.account.currency.ticker); + + await app.assetDrawer.selectAccountByIndex(delegateAccount.account); + + await app.delegate.verifyProvider(delegateAccount.provider); + await app.delegate.continueDelegate(); + }, + ); }); 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 829106f0d379..e2dda839c6da 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 @@ -5,7 +5,6 @@ import { Transaction, NFTTransaction } from "../../models/Transaction"; import { addTmsLink } from "tests/utils/allureUtils"; import { getDescription } from "../../utils/customJsonReporter"; import { commandCLI } from "tests/utils/cliUtils"; -import { isRunningInScheduledWorkflow } from "tests/utils/githubUtils"; //Warning 🚨: XRP Tests may fail due to API HTTP 429 issue - Jira: LIVE-14237 @@ -211,98 +210,28 @@ const tokenTransactionInvalid = [ }, ]; -test.describe("Send flows", () => { - test.beforeAll(async () => { - process.env.ENABLE_TRANSACTION_BROADCAST = - new Date().getDay() === 1 && isRunningInScheduledWorkflow() ? "1" : "0"; - }); - //Warning 🚨: Test may fail due to the GetAppAndVersion issue - Jira: LIVE-12581 or insufficient funds - - for (const transaction of transactionE2E) { - test.describe("Send from 1 account to another", () => { - test.use({ - userdata: "skip-onboarding", - speculosApp: transaction.transaction.accountToDebit.currency.speculosApp, - cliCommands: [ - { - command: commandCLI.liveData, - args: { - currency: transaction.transaction.accountToCredit.currency.currencyId, - index: transaction.transaction.accountToCredit.index, - add: true, - appjson: "", - }, - }, - { - command: commandCLI.liveData, - args: { - currency: transaction.transaction.accountToDebit.currency.currencyId, - index: transaction.transaction.accountToDebit.index, - add: true, - appjson: "", - }, - }, - ], - }); - - test( - `Send from ${transaction.transaction.accountToDebit.accountName} to ${transaction.transaction.accountToCredit.accountName}`, - { - annotation: { - type: "TMS", - description: transaction.xrayTicket, - }, - }, - async ({ app }) => { - await addTmsLink(getDescription(test.info().annotations).split(", ")); - - await app.layout.goToAccounts(); - await app.accounts.navigateToAccountByName( - transaction.transaction.accountToDebit.accountName, - ); - - await app.account.clickSend(); - await app.send.craftTx(transaction.transaction); - await app.send.expectTxInfoValidity(transaction.transaction); - await app.send.clickContinueToDevice(); - - await app.speculos.signSendTransaction(transaction.transaction); - await app.send.expectTxSent(); - await app.account.navigateToViewDetails(); - await app.sendDrawer.addressValueIsVisible( - 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); - }, - ); - }); - } - - test.describe("Send token (subAccount) - invalid address input", () => { - const tokenTransactionInvalid = { - transaction: new Transaction(Account.ALGO_USDT_1, Account.ALGO_USDT_2, "0.1", Fee.MEDIUM), - expectedErrorMessage: "Recipient account has not opted in the selected ASA.", - }; +//Warning 🚨: Test may fail due to the GetAppAndVersion issue - Jira: LIVE-12581 or insufficient funds +for (const transaction of transactionE2E) { + test.describe("Send from 1 account to another", () => { test.use({ userdata: "skip-onboarding", - speculosApp: tokenTransactionInvalid.transaction.accountToDebit.currency.speculosApp, + speculosApp: transaction.transaction.accountToDebit.currency.speculosApp, cliCommands: [ { command: commandCLI.liveData, args: { - currency: tokenTransactionInvalid.transaction.accountToDebit.currency.currencyId, - index: tokenTransactionInvalid.transaction.accountToDebit.index, + currency: transaction.transaction.accountToCredit.currency.currencyId, + index: transaction.transaction.accountToCredit.index, + add: true, + appjson: "", + }, + }, + { + command: commandCLI.liveData, + args: { + currency: transaction.transaction.accountToDebit.currency.currencyId, + index: transaction.transaction.accountToDebit.index, add: true, appjson: "", }, @@ -311,179 +240,191 @@ test.describe("Send flows", () => { }); test( - `Send from ${tokenTransactionInvalid.transaction.accountToDebit.accountName} to ${tokenTransactionInvalid.transaction.accountToCredit.accountName} - invalid address input`, + `Send from ${transaction.transaction.accountToDebit.accountName} to ${transaction.transaction.accountToCredit.accountName}`, { annotation: { type: "TMS", - description: "B2CQA-2702", + description: transaction.xrayTicket, }, }, async ({ app }) => { + await addTmsLink(getDescription(test.info().annotations).split(", ")); + await app.layout.goToAccounts(); await app.accounts.navigateToAccountByName( - tokenTransactionInvalid.transaction.accountToDebit.accountName, - ); - await app.account.navigateToTokenInAccount( - tokenTransactionInvalid.transaction.accountToDebit, + transaction.transaction.accountToDebit.accountName, ); + await app.account.clickSend(); - await app.send.fillRecipient(tokenTransactionInvalid.transaction.accountToCredit.address); - await app.send.checkContinueButtonDisabled(); - await app.layout.checkErrorMessage(tokenTransactionInvalid.expectedErrorMessage); + await app.send.craftTx(transaction.transaction); + await app.send.expectTxInfoValidity(transaction.transaction); + await app.send.clickContinueToDevice(); + + await app.speculos.signSendTransaction(transaction.transaction); + await app.send.expectTxSent(); + await app.account.navigateToViewDetails(); + await app.sendDrawer.addressValueIsVisible(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); }, ); }); - - for (const transaction of tokenTransactionInvalid) { - test.describe("Send token (subAccount) - invalid amount input", () => { - test.use({ - userdata: "skip-onboarding", - speculosApp: transaction.transaction.accountToDebit.currency.speculosApp, - cliCommands: [ - { - command: commandCLI.liveData, - args: { - currency: transaction.transaction.accountToDebit.currency.currencyId, - index: transaction.transaction.accountToDebit.index, - add: true, - appjson: "", - }, - }, - ], - }); - test( - `Send from ${transaction.transaction.accountToDebit.accountName} to ${transaction.transaction.accountToCredit.accountName} - invalid amount input`, - { - annotation: { - type: "TMS", - description: transaction.xrayTicket, - }, - }, - async ({ app }) => { - await app.layout.goToAccounts(); - await app.accounts.navigateToAccountByName( - transaction.transaction.accountToDebit.accountName, - ); - await app.account.navigateToTokenInAccount(transaction.transaction.accountToDebit); - await app.account.clickSend(); - await app.send.fillRecipient(transaction.transaction.accountToCredit.address); - await app.send.clickContinue(); - await app.send.fillAmount(transaction.transaction.amount); - await app.send.checkContinueButtonDisabled(); - await app.layout.checkAmoutWarningMessage(transaction.expectedWarningMessage); +} + +test.describe("Send token (subAccount) - invalid address input", () => { + const tokenTransactionInvalid = { + transaction: new Transaction(Account.ALGO_USDT_1, Account.ALGO_USDT_2, "0.1", Fee.MEDIUM), + expectedErrorMessage: "Recipient account has not opted in the selected ASA.", + }; + + test.use({ + userdata: "skip-onboarding", + speculosApp: tokenTransactionInvalid.transaction.accountToDebit.currency.speculosApp, + cliCommands: [ + { + command: commandCLI.liveData, + args: { + currency: tokenTransactionInvalid.transaction.accountToDebit.currency.currencyId, + index: tokenTransactionInvalid.transaction.accountToDebit.index, + add: true, + appjson: "", }, + }, + ], + }); + + test( + `Send from ${tokenTransactionInvalid.transaction.accountToDebit.accountName} to ${tokenTransactionInvalid.transaction.accountToCredit.accountName} - invalid address input`, + { + annotation: { + type: "TMS", + description: "B2CQA-2702", + }, + }, + async ({ app }) => { + await app.layout.goToAccounts(); + await app.accounts.navigateToAccountByName( + tokenTransactionInvalid.transaction.accountToDebit.accountName, ); - }); - } + await app.account.navigateToTokenInAccount( + tokenTransactionInvalid.transaction.accountToDebit, + ); + await app.account.clickSend(); + await app.send.fillRecipient(tokenTransactionInvalid.transaction.accountToCredit.address); + await app.send.checkContinueButtonDisabled(); + await app.layout.checkErrorMessage(tokenTransactionInvalid.expectedErrorMessage); + }, + ); +}); - test.describe("Send token (subAccount) - valid address & amount input", () => { - const tokenTransactionValid = new Transaction( - Account.ETH_USDT_1, - Account.ETH_USDT_2, - "1", - Fee.MEDIUM, - ); +for (const transaction of tokenTransactionInvalid) { + test.describe("Send token (subAccount) - invalid amount input", () => { test.use({ userdata: "skip-onboarding", - speculosApp: tokenTransactionValid.accountToDebit.currency.speculosApp, + speculosApp: transaction.transaction.accountToDebit.currency.speculosApp, cliCommands: [ { command: commandCLI.liveData, args: { - currency: tokenTransactionValid.accountToDebit.currency.currencyId, - index: tokenTransactionValid.accountToDebit.index, + currency: transaction.transaction.accountToDebit.currency.currencyId, + index: transaction.transaction.accountToDebit.index, add: true, appjson: "", }, }, ], }); - test( - `Send from ${tokenTransactionValid.accountToDebit.accountName} to ${tokenTransactionValid.accountToCredit.accountName} - valid address & amount input`, + `Send from ${transaction.transaction.accountToDebit.accountName} to ${transaction.transaction.accountToCredit.accountName} - invalid amount input`, { annotation: { type: "TMS", - description: "B2CQA-2703, B2CQA-475", + description: transaction.xrayTicket, }, }, async ({ app }) => { await app.layout.goToAccounts(); await app.accounts.navigateToAccountByName( - tokenTransactionValid.accountToDebit.accountName, + transaction.transaction.accountToDebit.accountName, ); - await app.account.navigateToTokenInAccount(tokenTransactionValid.accountToDebit); + await app.account.navigateToTokenInAccount(transaction.transaction.accountToDebit); await app.account.clickSend(); - await app.send.fillRecipient(tokenTransactionValid.accountToCredit.address); - await app.send.checkContinueButtonEnable(); - await app.layout.checkInputErrorVisibibility("hidden"); + await app.send.fillRecipient(transaction.transaction.accountToCredit.address); await app.send.clickContinue(); - await app.send.fillAmount(tokenTransactionValid.amount); - await app.send.checkContinueButtonEnable(); + await app.send.fillAmount(transaction.transaction.amount); + await app.send.checkContinueButtonDisabled(); + await app.layout.checkAmoutWarningMessage(transaction.expectedWarningMessage); }, ); }); - - for (const transaction of transactionsAmountInvalid) { - test.describe("Check invalid amount input error", () => { - test.use({ - userdata: "skip-onboarding", - speculosApp: transaction.transaction.accountToDebit.currency.speculosApp, - cliCommands: [ - { - command: commandCLI.liveData, - args: { - currency: transaction.transaction.accountToDebit.currency.currencyId, - index: transaction.transaction.accountToDebit.index, - add: true, - appjson: "", - }, - }, - ], - }); - - test( - `Check "${transaction.expectedErrorMessage}" for ${transaction.transaction.accountToDebit.currency.name} - invalid amount ${transaction.transaction.amount} input error`, - { - annotation: { - type: "TMS", - description: transaction.xrayTicket, - }, - }, - 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.amount); - await app.send.checkContinueButtonDisabled(); - await app.layout.checkErrorMessage(transaction.expectedErrorMessage); +} + +test.describe("Send token (subAccount) - valid address & amount input", () => { + const tokenTransactionValid = new Transaction( + Account.ETH_USDT_1, + Account.ETH_USDT_2, + "1", + Fee.MEDIUM, + ); + test.use({ + userdata: "skip-onboarding", + speculosApp: tokenTransactionValid.accountToDebit.currency.speculosApp, + cliCommands: [ + { + command: commandCLI.liveData, + args: { + currency: tokenTransactionValid.accountToDebit.currency.currencyId, + index: tokenTransactionValid.accountToDebit.index, + add: true, + appjson: "", }, - ); - }); - } + }, + ], + }); - test.describe("Verify send max user flow", () => { - const transactionInputValid = new Transaction( - Account.ETH_1, - Account.ETH_2, - "send max", - Fee.MEDIUM, - ); + test( + `Send from ${tokenTransactionValid.accountToDebit.accountName} to ${tokenTransactionValid.accountToCredit.accountName} - valid address & amount input`, + { + annotation: { + type: "TMS", + description: "B2CQA-2703, B2CQA-475", + }, + }, + async ({ app }) => { + await app.layout.goToAccounts(); + await app.accounts.navigateToAccountByName(tokenTransactionValid.accountToDebit.accountName); + await app.account.navigateToTokenInAccount(tokenTransactionValid.accountToDebit); + await app.account.clickSend(); + await app.send.fillRecipient(tokenTransactionValid.accountToCredit.address); + await app.send.checkContinueButtonEnable(); + await app.layout.checkInputErrorVisibibility("hidden"); + await app.send.clickContinue(); + await app.send.fillAmount(tokenTransactionValid.amount); + await app.send.checkContinueButtonEnable(); + }, + ); +}); +for (const transaction of transactionsAmountInvalid) { + test.describe("Check invalid amount input error", () => { test.use({ userdata: "skip-onboarding", - speculosApp: transactionInputValid.accountToDebit.currency.speculosApp, + speculosApp: transaction.transaction.accountToDebit.currency.speculosApp, cliCommands: [ { command: commandCLI.liveData, args: { - currency: transactionInputValid.accountToDebit.currency.currencyId, - index: transactionInputValid.accountToDebit.index, + currency: transaction.transaction.accountToDebit.currency.currencyId, + index: transaction.transaction.accountToDebit.index, add: true, appjson: "", }, @@ -492,164 +433,210 @@ test.describe("Send flows", () => { }); test( - `Check Valid amount input (${transactionInputValid.amount})`, + `Check "${transaction.expectedErrorMessage}" for ${transaction.transaction.accountToDebit.currency.name} - invalid amount ${transaction.transaction.amount} input error`, { annotation: { type: "TMS", - description: "B2CQA-473", + description: transaction.xrayTicket, }, }, async ({ app }) => { - await addTmsLink(getDescription(test.info().annotations).split(", ")); await app.layout.goToAccounts(); await app.accounts.navigateToAccountByName( - transactionInputValid.accountToDebit.accountName, + transaction.transaction.accountToDebit.accountName, ); await app.account.clickSend(); - await app.send.fillRecipient(transactionInputValid.accountToCredit.address); + await app.send.fillRecipient(transaction.transaction.accountToCredit.address); await app.send.clickContinue(); - await app.send.fillAmount(transactionInputValid.amount); - await app.send.checkContinueButtonEnable(); - await app.layout.checkInputErrorVisibibility("hidden"); + await app.send.fillAmount(transaction.transaction.amount); + await app.send.checkContinueButtonDisabled(); + await app.layout.checkErrorMessage(transaction.expectedErrorMessage); }, ); }); +} + +test.describe("Verify send max user flow", () => { + const transactionInputValid = new Transaction( + Account.ETH_1, + Account.ETH_2, + "send max", + Fee.MEDIUM, + ); + + test.use({ + userdata: "skip-onboarding", + speculosApp: transactionInputValid.accountToDebit.currency.speculosApp, + cliCommands: [ + { + command: commandCLI.liveData, + args: { + currency: transactionInputValid.accountToDebit.currency.currencyId, + index: transactionInputValid.accountToDebit.index, + add: true, + appjson: "", + }, + }, + ], + }); - for (const transaction of transactionAddressValid) { - test.describe("Send funds step 1 (Recipient) - positive cases (Button enabled)", () => { - test.use({ - userdata: "skip-onboarding", - speculosApp: transaction.transaction.accountToDebit.currency.speculosApp, - cliCommands: [ - { - command: commandCLI.liveData, - args: { - currency: transaction.transaction.accountToDebit.currency.currencyId, - index: transaction.transaction.accountToDebit.index, - scheme: transaction.transaction.accountToDebit.derivationMode, - add: true, - appjson: "", - }, - }, - ], - }); + test( + `Check Valid amount input (${transactionInputValid.amount})`, + { + annotation: { + type: "TMS", + description: "B2CQA-473", + }, + }, + async ({ app }) => { + await addTmsLink(getDescription(test.info().annotations).split(", ")); + await app.layout.goToAccounts(); + await app.accounts.navigateToAccountByName(transactionInputValid.accountToDebit.accountName); + + await app.account.clickSend(); + await app.send.fillRecipient(transactionInputValid.accountToCredit.address); + await app.send.clickContinue(); + await app.send.fillAmount(transactionInputValid.amount); + await app.send.checkContinueButtonEnable(); + await app.layout.checkInputErrorVisibibility("hidden"); + }, + ); +}); - test( - `Check button enabled (${transaction.transaction.amount} from ${transaction.transaction.accountToDebit.accountName} to ${transaction.transaction.accountToCredit.accountName}) - valid address input (${transaction.transaction.accountToDebit.address})`, +for (const transaction of transactionAddressValid) { + test.describe("Send funds step 1 (Recipient) - positive cases (Button enabled)", () => { + test.use({ + userdata: "skip-onboarding", + speculosApp: transaction.transaction.accountToDebit.currency.speculosApp, + cliCommands: [ { - annotation: { - type: "TMS", - description: transaction.xrayTicket, + command: commandCLI.liveData, + args: { + currency: transaction.transaction.accountToDebit.currency.currencyId, + index: transaction.transaction.accountToDebit.index, + scheme: transaction.transaction.accountToDebit.derivationMode, + add: true, + appjson: "", }, }, - async ({ app }) => { - await addTmsLink(getDescription(test.info().annotations).split(", ")); - await app.layout.goToAccounts(); - await app.accounts.navigateToAccountByName( - transaction.transaction.accountToDebit.accountName, - ); - - await app.account.clickSend(); - await app.send.fillRecipientInfo(transaction.transaction); - await app.layout.checkInputWarningMessage(transaction.expectedWarningMessage); - await app.send.checkContinueButtonEnable(); - }, - ); + ], }); - } - - for (const transaction of transactionsAddressInvalid) { - test.describe("Send funds step 1 (Recipient) - negative cases (Button disabled)", () => { - test.use({ - userdata: "skip-onboarding", - speculosApp: transaction.transaction.accountToDebit.currency.speculosApp, - cliCommands: [ - { - command: commandCLI.liveData, - args: { - currency: transaction.transaction.accountToDebit.currency.currencyId, - index: transaction.transaction.accountToDebit.index, - add: true, - appjson: "", - }, - }, - ], - }); - test( - `Check "${transaction.expectedErrorMessage}" (from ${transaction.transaction.accountToDebit.accountName} to ${transaction.transaction.accountToCredit.accountName}) - invalid address input error`, - { - annotation: { - type: "TMS", - description: transaction.xrayTicket, - }, - }, - async ({ app }) => { - await addTmsLink(getDescription(test.info().annotations).split(", ")); - await app.layout.goToAccounts(); - await app.accounts.navigateToAccountByName( - transaction.transaction.accountToDebit.accountName, - ); - - await app.account.clickSend(); - await app.send.fillRecipientInfo(transaction.transaction); - await app.layout.checkErrorMessage(transaction.expectedErrorMessage); - await app.send.checkContinueButtonDisabled(); + test( + `Check button enabled (${transaction.transaction.amount} from ${transaction.transaction.accountToDebit.accountName} to ${transaction.transaction.accountToCredit.accountName}) - valid address input (${transaction.transaction.accountToDebit.address})`, + { + annotation: { + type: "TMS", + description: transaction.xrayTicket, }, - ); - }); - } + }, + async ({ app }) => { + await addTmsLink(getDescription(test.info().annotations).split(", ")); + await app.layout.goToAccounts(); + await app.accounts.navigateToAccountByName( + transaction.transaction.accountToDebit.accountName, + ); - test.describe("send NFT to ENS address", () => { - const transaction = new NFTTransaction(Account.ETH_1, Account.ETH_MC, "NY la muse", Fee.SLOW); - test.beforeAll(async () => { - process.env.DISABLE_TRANSACTION_BROADCAST = "true"; - }); - test.afterAll(async () => { - delete process.env.DISABLE_TRANSACTION_BROADCAST; - }); + await app.account.clickSend(); + await app.send.fillRecipientInfo(transaction.transaction); + await app.layout.checkInputWarningMessage(transaction.expectedWarningMessage); + await app.send.checkContinueButtonEnable(); + }, + ); + }); +} + +for (const transaction of transactionsAddressInvalid) { + test.describe("Send funds step 1 (Recipient) - negative cases (Button disabled)", () => { test.use({ userdata: "skip-onboarding", + speculosApp: transaction.transaction.accountToDebit.currency.speculosApp, cliCommands: [ { command: commandCLI.liveData, args: { - currency: transaction.accountToDebit.currency.currencyId, - index: transaction.accountToDebit.index, - appjson: "", + currency: transaction.transaction.accountToDebit.currency.currencyId, + index: transaction.transaction.accountToDebit.index, add: true, + appjson: "", }, }, ], - speculosApp: transaction.accountToDebit.currency.speculosApp, }); test( - "Send NFT to ENS address", + `Check "${transaction.expectedErrorMessage}" (from ${transaction.transaction.accountToDebit.accountName} to ${transaction.transaction.accountToCredit.accountName}) - invalid address input error`, { annotation: { type: "TMS", - description: "B2CQA-2203", + description: transaction.xrayTicket, }, }, async ({ app }) => { await addTmsLink(getDescription(test.info().annotations).split(", ")); await app.layout.goToAccounts(); - await app.accounts.navigateToAccountByName(transaction.accountToDebit.accountName); - await app.account.navigateToNFTGallery(); - await app.account.selectNFT(transaction.nftName); - await app.nftDrawer.expectNftNameIsVisible(transaction.nftName); - await app.nftDrawer.clickSend(); - await app.send.craftNFTTx(transaction); - await app.send.expectNFTTxInfoValidity(transaction); - await app.speculos.signSendNFTTransaction(transaction); - await app.send.expectTxSent(); - await app.account.navigateToViewDetails(); - await app.drawer.close(); - await app.account.navigateToNFTOperation(); - await app.sendDrawer.expectNftInfos(transaction); + await app.accounts.navigateToAccountByName( + transaction.transaction.accountToDebit.accountName, + ); + + await app.account.clickSend(); + await app.send.fillRecipientInfo(transaction.transaction); + await app.layout.checkErrorMessage(transaction.expectedErrorMessage); + await app.send.checkContinueButtonDisabled(); }, ); }); +} + +test.describe("send NFT to ENS address", () => { + const transaction = new NFTTransaction(Account.ETH_1, Account.ETH_MC, "NY la muse", Fee.SLOW); + test.beforeAll(async () => { + process.env.DISABLE_TRANSACTION_BROADCAST = "true"; + }); + test.afterAll(async () => { + delete process.env.DISABLE_TRANSACTION_BROADCAST; + }); + test.use({ + userdata: "skip-onboarding", + cliCommands: [ + { + command: commandCLI.liveData, + args: { + currency: transaction.accountToDebit.currency.currencyId, + index: transaction.accountToDebit.index, + appjson: "", + add: true, + }, + }, + ], + speculosApp: transaction.accountToDebit.currency.speculosApp, + }); + + test( + "Send NFT to ENS address", + { + annotation: { + type: "TMS", + description: "B2CQA-2203", + }, + }, + async ({ app }) => { + await addTmsLink(getDescription(test.info().annotations).split(", ")); + await app.layout.goToAccounts(); + await app.accounts.navigateToAccountByName(transaction.accountToDebit.accountName); + await app.account.navigateToNFTGallery(); + await app.account.selectNFT(transaction.nftName); + await app.nftDrawer.expectNftNameIsVisible(transaction.nftName); + await app.nftDrawer.clickSend(); + await app.send.craftNFTTx(transaction); + await app.send.expectNFTTxInfoValidity(transaction); + await app.speculos.signSendNFTTransaction(transaction); + await app.send.expectTxSent(); + await app.account.navigateToViewDetails(); + await app.drawer.close(); + await app.account.navigateToNFTOperation(); + await app.sendDrawer.expectNftInfos(transaction); + }, + ); }); diff --git a/apps/ledger-live-desktop/tests/utils/githubUtils.ts b/apps/ledger-live-desktop/tests/utils/githubUtils.ts deleted file mode 100644 index 89703fe0bb56..000000000000 --- a/apps/ledger-live-desktop/tests/utils/githubUtils.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function isRunningInScheduledWorkflow(): boolean { - return process.env.GITHUB_ACTIONS === "true" && process.env.GITHUB_EVENT_NAME === "schedule"; -}