diff --git a/apps/ledger-live-desktop/tests/page/account.page.ts b/apps/ledger-live-desktop/tests/page/account.page.ts index 4d645c0a8913..869476d40682 100644 --- a/apps/ledger-live-desktop/tests/page/account.page.ts +++ b/apps/ledger-live-desktop/tests/page/account.page.ts @@ -83,11 +83,16 @@ export class AccountPage extends AppPage { await this.viewDetailsButton.click(); } - @step("Click on last operation ($0)") + @step("Click on selected ($0) last operation") async selectAndClickOnLastOperation(operation: string) { await this.selectSpecificOperation(operation).first().click(); } + @step("Click on last operation") + async clickOnLastOperation() { + await this.operationRows.first().click(); + } + @step("Click Stake button on banner") async clickBannerCTA() { await this.stakeBannerButton.scrollIntoViewIfNeeded(); diff --git a/apps/ledger-live-desktop/tests/page/drawer/swap.confirmation.drawer.ts b/apps/ledger-live-desktop/tests/page/drawer/swap.confirmation.drawer.ts index 4431becc7005..964f79473a1c 100644 --- a/apps/ledger-live-desktop/tests/page/drawer/swap.confirmation.drawer.ts +++ b/apps/ledger-live-desktop/tests/page/drawer/swap.confirmation.drawer.ts @@ -56,9 +56,12 @@ export class SwapConfirmationDrawer extends Drawer { @step("Verify swap completion: $0") async verifyExchangeCompletedTextContent(currencyToReceive: string) { - await expect(this.swapCompletedMessage).toHaveText("Transaction broadcast successfully"); + await expect(this.swapCompletedMessage).toHaveText("Transaction broadcast successfully", { + timeout: 60000, + }); await expect(this.swapCompletedDescription).toHaveText( `Your Swap operation has been sent to the network for confirmation. Please wait for your transaction to be confirmed and for the provider to process and send your ${currencyToReceive}.`, + { timeout: 60000 }, ); } } diff --git a/apps/ledger-live-desktop/tests/specs/speculos/add.account.spec.ts b/apps/ledger-live-desktop/tests/specs/speculos/add.account.spec.ts index 5e5b002ad819..fc286dd85e6e 100644 --- a/apps/ledger-live-desktop/tests/specs/speculos/add.account.spec.ts +++ b/apps/ledger-live-desktop/tests/specs/speculos/add.account.spec.ts @@ -37,7 +37,7 @@ for (const currency of currencies) { }, }, async ({ app }) => { - await addTmsLink(getDescription(test.info().annotations).split(", ")); + await addTmsLink(getDescription(test.info().annotations, "TMS").split(", ")); await app.portfolio.openAddAccountModal(); await app.addAccount.expectModalVisiblity(); 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 61973dc73f40..2d6f5ee619c1 100644 --- a/apps/ledger-live-desktop/tests/specs/speculos/delegate.spec.ts +++ b/apps/ledger-live-desktop/tests/specs/speculos/delegate.spec.ts @@ -1,6 +1,5 @@ import { test } from "../../fixtures/common"; import { Account } from "@ledgerhq/live-common/e2e/enum/Account"; -import { OperationType } from "@ledgerhq/live-common/e2e/enum/OperationType"; import { Delegate } from "../../models/Delegate"; import { addTmsLink } from "tests/utils/allureUtils"; import { getDescription } from "../../utils/customJsonReporter"; @@ -29,7 +28,7 @@ const validators = [ xrayTicket: "B2CQA-2731, B2CQA-2763", }, { - delegate: new Delegate(Account.SOL_2, "0.001", "Ledger by Chorus One"), //Issue with the provider - CI ✅ because failling code is commented - LIVE-14500 + delegate: new Delegate(Account.SOL_2, "0.001", "Ledger by Chorus One"), xrayTicket: "B2CQA-2730, B2CQA-2764", }, { @@ -37,7 +36,7 @@ const validators = [ xrayTicket: "B2CQA-2732, B2CQA-2765", }, { - delegate: new Delegate(Account.ADA_1, "0.01", "LBF3 - Ledger by Figment 3"), //Issue with the provider - CI ✅ because failling code is commented - LIVE-14500 + delegate: new Delegate(Account.ADA_1, "0.01", "LBF3 - Ledger by Figment 3"), xrayTicket: "B2CQA-2766", }, { @@ -78,7 +77,7 @@ test.describe("Delegate flows", () => { annotation: { type: "TMS", description: account.xrayTicket }, }, async ({ app }) => { - await addTmsLink(getDescription(test.info().annotations).split(", ")); + await addTmsLink(getDescription(test.info().annotations, "TMS").split(", ")); await app.layout.goToAccounts(); await app.accounts.navigateToAccountByName(account.delegate.account.accountName); @@ -105,7 +104,7 @@ test.describe("Delegate flows", () => { await app.drawer.close(); await app.layout.syncAccounts(); - await app.account.selectAndClickOnLastOperation(OperationType.DELEGATED); + await app.account.clickOnLastOperation(); await app.delegateDrawer.expectDelegationInfos(account.delegate); }, ); @@ -135,7 +134,7 @@ test.describe("Delegate flows", () => { annotation: { type: "TMS", description: validator.xrayTicket }, }, async ({ app }) => { - await addTmsLink(getDescription(test.info().annotations).split(", ")); + await addTmsLink(getDescription(test.info().annotations, "TMS").split(", ")); await app.layout.goToAccounts(); await app.accounts.navigateToAccountByName(validator.delegate.account.accountName); @@ -153,13 +152,7 @@ test.describe("Delegate flows", () => { await app.delegate.openSearchProviderModal(); await app.delegate.checkValidatorListIsVisible(); await app.delegate.selectProviderOnRow(2); - // TODO: verification skipped due to bug (Clicking 'Show less' does not select the validator that was chosen previously) - LIVE-14500 - if ( - ![Currency.SOL.name, Currency.ADA.name].includes( - validator.delegate.account.currency.name, - ) - ) - await app.delegate.closeProviderList(2); + await app.delegate.closeProviderList(2); }, ); }); @@ -191,7 +184,7 @@ test.describe("Delegate flows", () => { }, }, async ({ app }) => { - await addTmsLink(getDescription(test.info().annotations).split(", ")); + await addTmsLink(getDescription(test.info().annotations, "TMS").split(", ")); await app.layout.goToPortfolio(); await app.portfolio.startStakeFlow(); @@ -213,7 +206,7 @@ test.describe("Delegate flows", () => { }, }, async ({ app }) => { - await addTmsLink(getDescription(test.info().annotations).split(", ")); + await addTmsLink(getDescription(test.info().annotations, "TMS").split(", ")); await app.layout.goToMarket(); await app.market.search(delegateAccount.account.currency.name); diff --git a/apps/ledger-live-desktop/tests/specs/speculos/delete.account.spec.ts b/apps/ledger-live-desktop/tests/specs/speculos/delete.account.spec.ts index 52002a31dee9..9b267dc34fd0 100644 --- a/apps/ledger-live-desktop/tests/specs/speculos/delete.account.spec.ts +++ b/apps/ledger-live-desktop/tests/specs/speculos/delete.account.spec.ts @@ -45,7 +45,7 @@ for (const account of accounts) { }, }, async ({ app }) => { - await addTmsLink(getDescription(test.info().annotations).split(", ")); + await addTmsLink(getDescription(test.info().annotations, "TMS").split(", ")); await app.layout.goToAccounts(); await app.accounts.navigateToAccountByName(account.account.accountName); diff --git a/apps/ledger-live-desktop/tests/specs/speculos/ledgerSync.spec.ts b/apps/ledger-live-desktop/tests/specs/speculos/ledgerSync.spec.ts index faa97500d294..a5fce72d4f23 100644 --- a/apps/ledger-live-desktop/tests/specs/speculos/ledgerSync.spec.ts +++ b/apps/ledger-live-desktop/tests/specs/speculos/ledgerSync.spec.ts @@ -74,7 +74,7 @@ test.describe(`[${app.name}] Sync Accounts`, () => { }, }, async ({ app }) => { - await addTmsLink(getDescription(test.info().annotations).split(", ")); + await addTmsLink(getDescription(test.info().annotations, "TMS").split(", ")); await app.layout.goToAccounts(); await app.accounts.expectAccountsCount(0); diff --git a/apps/ledger-live-desktop/tests/specs/speculos/nft.spec.ts b/apps/ledger-live-desktop/tests/specs/speculos/nft.spec.ts index b3f8f1dc1723..cfbdc14fe90c 100644 --- a/apps/ledger-live-desktop/tests/specs/speculos/nft.spec.ts +++ b/apps/ledger-live-desktop/tests/specs/speculos/nft.spec.ts @@ -40,7 +40,7 @@ test.describe("send NFT to ENS address", () => { }, }, async ({ app }) => { - await addTmsLink(getDescription(test.info().annotations).split(", ")); + await addTmsLink(getDescription(test.info().annotations, "TMS").split(", ")); await app.layout.goToAccounts(); await app.accounts.navigateToAccountByName(transaction.accountToDebit.accountName); await app.account.navigateToNFTGallery(); @@ -87,7 +87,7 @@ test.describe("The user can see his NFT floor price", () => { }, }, async ({ app }) => { - await addTmsLink(getDescription(test.info().annotations).split(", ")); + await addTmsLink(getDescription(test.info().annotations, "TMS").split(", ")); await app.layout.goToAccounts(); await app.accounts.navigateToAccountByName(account.accountName); await app.account.navigateToNFTGallery(); @@ -135,7 +135,7 @@ for (const account of accounts) { }, }, async ({ app }) => { - await addTmsLink(getDescription(test.info().annotations).split(", ")); + await addTmsLink(getDescription(test.info().annotations, "TMS").split(", ")); await app.layout.goToAccounts(); await app.accounts.navigateToAccountByName(account.account.accountName); await app.account.checkNftListInAccount(account.account); @@ -170,7 +170,7 @@ for (const account of accounts) { }, }, async ({ app }) => { - await addTmsLink(getDescription(test.info().annotations).split(", ")); + await addTmsLink(getDescription(test.info().annotations, "TMS").split(", ")); await app.layout.goToAccounts(); await app.accounts.navigateToAccountByName(account.account.accountName); await app.account.navigateToNFTGallery(); diff --git a/apps/ledger-live-desktop/tests/specs/speculos/portfolio.spec.ts b/apps/ledger-live-desktop/tests/specs/speculos/portfolio.spec.ts index d5d27c862fdb..b37ecb37e6d6 100644 --- a/apps/ledger-live-desktop/tests/specs/speculos/portfolio.spec.ts +++ b/apps/ledger-live-desktop/tests/specs/speculos/portfolio.spec.ts @@ -15,7 +15,7 @@ test.describe("Portfolio", () => { }, }, async ({ app }) => { - await addTmsLink(getDescription(test.info().annotations).split(", ")); + await addTmsLink(getDescription(test.info().annotations, "TMS").split(", ")); await app.layout.goToPortfolio(); await app.portfolio.checkBuySellButtonVisibility(); diff --git a/apps/ledger-live-desktop/tests/specs/speculos/receive.address.spec.ts b/apps/ledger-live-desktop/tests/specs/speculos/receive.address.spec.ts index c19f5aa0de29..81c0bad33e0f 100644 --- a/apps/ledger-live-desktop/tests/specs/speculos/receive.address.spec.ts +++ b/apps/ledger-live-desktop/tests/specs/speculos/receive.address.spec.ts @@ -44,7 +44,7 @@ for (const account of accounts) { }, }, async ({ app }) => { - await addTmsLink(getDescription(test.info().annotations).split(", ")); + await addTmsLink(getDescription(test.info().annotations, "TMS").split(", ")); await app.layout.goToAccounts(); await app.accounts.navigateToAccountByName(account.account.accountName); @@ -100,7 +100,7 @@ test.describe("Receive", () => { }, }, async ({ app }) => { - await addTmsLink(getDescription(test.info().annotations).split(", ")); + await addTmsLink(getDescription(test.info().annotations, "TMS").split(", ")); await app.layout.goToAccounts(); await app.accounts.navigateToAccountByName(account.accountName); 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 1b06cbaffece..035a3af7a1e6 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 @@ -3,7 +3,7 @@ import { Account } from "@ledgerhq/live-common/e2e/enum/Account"; import { Fee } from "@ledgerhq/live-common/e2e/enum/Fee"; import { OperationType } from "@ledgerhq/live-common/e2e/enum/OperationType"; import { Transaction } from "../../models/Transaction"; -import { addTmsLink } from "tests/utils/allureUtils"; +import { addTmsLink, addBugLink } from "tests/utils/allureUtils"; import { getDescription } from "../../utils/customJsonReporter"; import { CLI } from "tests/utils/cliUtils"; import { isRunningInScheduledWorkflow } from "tests/utils/githubUtils"; @@ -153,6 +153,7 @@ const transactionE2E = [ { transaction: new Transaction(Account.POL_1, Account.POL_2, "0.001", Fee.SLOW), xrayTicket: "B2CQA-2807", + bugTicket: "BACK-8150", }, { transaction: new Transaction(Account.DOGE_1, Account.DOGE_2, "0.01", Fee.SLOW), @@ -187,7 +188,7 @@ const transactionE2E = [ xrayTicket: "B2CQA-2814", }, { - transaction: new Transaction(Account.ADA_1, Account.ADA_1, "1", undefined, "noTag"), + transaction: new Transaction(Account.ADA_1, Account.ADA_2, "1", undefined, "noTag"), xrayTicket: "B2CQA-2815", }, { @@ -248,10 +249,16 @@ test.describe("Send flows", () => { test( `Send from ${transaction.transaction.accountToDebit.accountName} to ${transaction.transaction.accountToCredit.accountName}`, { - annotation: { type: "TMS", description: transaction.xrayTicket }, + annotation: [ + { type: "TMS", description: transaction.xrayTicket }, + { type: "BUG", description: transaction.bugTicket }, + ], }, async ({ app }) => { - await addTmsLink(getDescription(test.info().annotations).split(", ")); + await addTmsLink(getDescription(test.info().annotations, "TMS").split(", ")); + if (transaction.bugTicket) { + await addBugLink(getDescription(test.info().annotations, "BUG").split(", ")); + } await app.layout.goToAccounts(); await app.accounts.navigateToAccountByName( @@ -318,7 +325,7 @@ test.describe("Send flows", () => { }, }, async ({ app }) => { - await addTmsLink(getDescription(test.info().annotations).split(", ")); + await addTmsLink(getDescription(test.info().annotations, "TMS").split(", ")); await app.layout.goToAccounts(); await app.accounts.navigateToAccountByName( @@ -360,7 +367,7 @@ test.describe("Send flows", () => { }, }, async ({ app }) => { - await addTmsLink(getDescription(test.info().annotations).split(", ")); + await addTmsLink(getDescription(test.info().annotations, "TMS").split(", ")); await app.layout.goToAccounts(); await app.accounts.navigateToAccountByName( @@ -409,7 +416,7 @@ test.describe("Send flows", () => { }, }, async ({ app }) => { - await addTmsLink(getDescription(test.info().annotations).split(", ")); + await addTmsLink(getDescription(test.info().annotations, "TMS").split(", ")); await app.layout.goToAccounts(); await app.accounts.navigateToAccountByName( @@ -450,7 +457,7 @@ test.describe("Send flows", () => { annotation: { type: "TMS", description: transaction.xrayTicket }, }, async ({ app }) => { - await addTmsLink(getDescription(test.info().annotations).split(", ")); + await addTmsLink(getDescription(test.info().annotations, "TMS").split(", ")); await app.layout.goToAccounts(); await app.accounts.navigateToAccountByName( @@ -498,7 +505,7 @@ test.describe("Send flows", () => { }, }, async ({ app }) => { - await addTmsLink(getDescription(test.info().annotations).split(", ")); + await addTmsLink(getDescription(test.info().annotations, "TMS").split(", ")); await app.layout.goToAccounts(); await app.accounts.navigateToAccountByName( @@ -542,7 +549,7 @@ test.describe("Send flows", () => { }, }, async ({ app }) => { - await addTmsLink(getDescription(test.info().annotations).split(", ")); + await addTmsLink(getDescription(test.info().annotations, "TMS").split(", ")); await app.layout.goToAccounts(); await app.accounts.navigateToAccountByName( @@ -584,7 +591,7 @@ test.describe("Send flows", () => { }, }, async ({ app }) => { - await addTmsLink(getDescription(test.info().annotations).split(", ")); + await addTmsLink(getDescription(test.info().annotations, "TMS").split(", ")); await app.layout.goToAccounts(); await app.accounts.navigateToAccountByName( diff --git a/apps/ledger-live-desktop/tests/specs/speculos/settings.spec.ts b/apps/ledger-live-desktop/tests/specs/speculos/settings.spec.ts index 80cfe136bc8d..2b49b4806094 100644 --- a/apps/ledger-live-desktop/tests/specs/speculos/settings.spec.ts +++ b/apps/ledger-live-desktop/tests/specs/speculos/settings.spec.ts @@ -15,7 +15,7 @@ test.describe("Settings", () => { annotation: [{ type: "TMS", description: "B2CQA-817" }], }, async ({ app }) => { - await addTmsLink(getDescription(test.info().annotations).split(", ")); + await addTmsLink(getDescription(test.info().annotations, "TMS").split(", ")); await app.layout.goToAccounts(); await app.accounts.showParentAccountTokens(Account.ETH_1.accountName); @@ -62,7 +62,7 @@ test.describe("Password", () => { }, }, async ({ app }) => { - await addTmsLink(getDescription(test.info().annotations).split(", ")); + await addTmsLink(getDescription(test.info().annotations, "TMS").split(", ")); await app.layout.goToAccounts(); const countBeforeLock = await app.accounts.countAccounts(); @@ -108,7 +108,7 @@ test.describe("counter value selection", () => { }, }, async ({ app }) => { - await addTmsLink(getDescription(test.info().annotations).split(", ")); + await addTmsLink(getDescription(test.info().annotations, "TMS").split(", ")); await app.layout.goToSettings(); await app.settings.changeCounterValue("euro"); 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 13289d392c6d..840c298b9893 100644 --- a/apps/ledger-live-desktop/tests/specs/speculos/subAccount.spec.ts +++ b/apps/ledger-live-desktop/tests/specs/speculos/subAccount.spec.ts @@ -38,7 +38,7 @@ for (const token of subAccounts) { }, }, async ({ app }) => { - await addTmsLink(getDescription(test.info().annotations).split(", ")); + await addTmsLink(getDescription(test.info().annotations, "TMS").split(", ")); await app.portfolio.openAddAccountModal(); await app.addAccount.expectModalVisiblity(); @@ -74,7 +74,7 @@ for (const token of subAccountReceive) { }, }, async ({ app }) => { - await addTmsLink(getDescription(test.info().annotations).split(", ")); + await addTmsLink(getDescription(test.info().annotations, "TMS").split(", ")); await app.layout.goToAccounts(); await app.accounts.navigateToAccountByName(token.account.accountName); @@ -110,7 +110,7 @@ for (const token of subAccounts) { }, }, async ({ app }) => { - await addTmsLink(getDescription(test.info().annotations).split(", ")); + await addTmsLink(getDescription(test.info().annotations, "TMS").split(", ")); await app.layout.goToAccounts(); await app.accounts.navigateToAccountByName(token.account.accountName); diff --git a/apps/ledger-live-desktop/tests/specs/speculos/swap.spec.ts b/apps/ledger-live-desktop/tests/specs/speculos/swap.spec.ts index 197c4d5c34c9..67a4a7bbcff2 100644 --- a/apps/ledger-live-desktop/tests/specs/speculos/swap.spec.ts +++ b/apps/ledger-live-desktop/tests/specs/speculos/swap.spec.ts @@ -112,8 +112,7 @@ const swaps = [ ), xrayTicket: "B2CQA-2751", }, - //todo: flaky balance retrieval, reactivate after LIVE-14410 - /*{ + { swap: new Swap( Account.SOL_1, Account.ETH_1, @@ -146,7 +145,7 @@ const swaps = [ ), xrayTicket: "B2CQA-2829", }, - { + /*{ swap: new Swap( Account.ETH_USDC_1, Account.ETH_1, @@ -221,7 +220,7 @@ for (const { swap, xrayTicket } of swaps) { }, }, async ({ app, electronApp }) => { - await addTmsLink(getDescription(test.info().annotations).split(", ")); + await addTmsLink(getDescription(test.info().annotations, "TMS").split(", ")); await performSwapUntilQuoteSelectionStep(app, electronApp, swap); await app.swap.selectQuote(electronApp, swap.provider.name, swap.rate); @@ -285,7 +284,7 @@ for (const { swap, xrayTicket } of rejectedSwaps) { }, }, async ({ app, electronApp }) => { - await addTmsLink(getDescription(test.info().annotations).split(", ")); + await addTmsLink(getDescription(test.info().annotations, "TMS").split(", ")); await performSwapUntilQuoteSelectionStep(app, electronApp, swap); await app.swap.selectQuote(electronApp, swap.provider.name, swap.rate); @@ -331,11 +330,10 @@ const tooLowAmountForQuoteSwaps = [ ), xrayTicket: "B2CQA-2759", }, - //todo: flaky balance, reactivate after LIVE-14410 - /*{ + { swap: new Swap(Account.TRX_1, Account.ETH_1, "77", Fee.MEDIUM, Provider.CHANGELLY, Rate.FLOAT), xrayTicket: "B2CQA-2739", - },*/ + }, ]; for (const { swap, xrayTicket } of tooLowAmountForQuoteSwaps) { @@ -376,13 +374,13 @@ for (const { swap, xrayTicket } of tooLowAmountForQuoteSwaps) { }, }, async ({ app, electronApp }) => { - await addTmsLink(getDescription(test.info().annotations).split(", ")); + await addTmsLink(getDescription(test.info().annotations, "TMS").split(", ")); await performSwapUntilQuoteSelectionStep(app, electronApp, swap); const errorMessage = swap.accountToDebit.accountType ? "Not enough balance." : new RegExp( - `Minimum \\d+(\\.\\d{1,5})? ${swap.accountToDebit.currency.ticker} needed for quotes\\.\\s*$`, + `Minimum \\d+(\\.\\d{1,10})? ${swap.accountToDebit.currency.ticker} needed for quotes\\.\\s*$`, ); await app.swap.verifySwapAmountErrorMessageIsDisplayed( electronApp, @@ -426,6 +424,7 @@ async function performSwapUntilQuoteSelectionStep( await app.layout.goToAccounts(); await app.accounts.navigateToAccountByName(swap.accountToDebit.accountName); await app.layout.waitForPageDomContentLoadedState(); + await app.layout.waitForAccountsSyncToBeDone(); await app.swap.waitForPageNetworkIdleState(); await app.layout.goToSwap(); diff --git a/apps/ledger-live-desktop/tests/userdata/speculos-tests-app.json b/apps/ledger-live-desktop/tests/userdata/speculos-tests-app.json index b3b7afd6ea72..3e1be3e54d06 100644 --- a/apps/ledger-live-desktop/tests/userdata/speculos-tests-app.json +++ b/apps/ledger-live-desktop/tests/userdata/speculos-tests-app.json @@ -3373,8 +3373,8 @@ "pendingOperations": [], "currencyId": "tron", "lastSyncDate": "2024-08-23T12:46:56.250Z", - "balance": "0", - "spendableBalance": "0", + "balance": "77259507", + "spendableBalance": "77259507", "balanceHistoryCache": { "HOUR": { "balances": [], @@ -19770,7 +19770,7 @@ "currencyId": "solana", "lastSyncDate": "2024-08-01T09:07:02.214Z", "balance": "20000000", - "spendableBalance": "19109120", + "spendableBalance": "11119109120", "balanceHistoryCache": { "HOUR": { "balances": [ @@ -20287,8 +20287,8 @@ "pendingOperations": [], "currencyId": "tron", "lastSyncDate": "2024-08-01T09:06:57.118Z", - "balance": "1719000", - "spendableBalance": "1719000", + "balance": "77259507", + "spendableBalance": "77259507", "balanceHistoryCache": { "HOUR": { "balances": [ diff --git a/apps/ledger-live-desktop/tests/utils/customJsonReporter.ts b/apps/ledger-live-desktop/tests/utils/customJsonReporter.ts index d54c565c7c6e..cb3f45976df6 100644 --- a/apps/ledger-live-desktop/tests/utils/customJsonReporter.ts +++ b/apps/ledger-live-desktop/tests/utils/customJsonReporter.ts @@ -2,8 +2,8 @@ import { Reporter, TestCase, TestResult } from "@playwright/test/reporter"; import * as fs from "fs"; import * as path from "path"; -export function getDescription(annotations: any) { - const annotation = annotations.find((ann: any) => ann.type === "TMS" || ann.type === "BUG"); +export function getDescription(annotations: any, type: "TMS" | "BUG") { + const annotation = annotations.find((ann: any) => ann.type === type); return annotation ? annotation.description : "Type not found"; } @@ -29,7 +29,7 @@ class JsonReporter implements Reporter { } onTestEnd(test: TestCase, result: TestResult): void { - const testKeys = getDescription(test.annotations).split(", "); + const testKeys = getDescription(test.annotations, "TMS").split(", "); const status = result.status.toUpperCase(); testKeys.forEach((testKey: string) => { this.results.tests.push({ testKey, status });