diff --git a/.changeset/pink-bats-attack.md b/.changeset/pink-bats-attack.md new file mode 100644 index 000000000000..fef896bbbc55 --- /dev/null +++ b/.changeset/pink-bats-attack.md @@ -0,0 +1,6 @@ +--- +"ledger-live-desktop": minor +"@ledgerhq/live-common": minor +--- + +Updating method to get Speculos app - e2e testing 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 49aa1e12a1c3..347202f83a3a 100644 --- a/apps/ledger-live-desktop/tests/specs/speculos/delegate.spec.ts +++ b/apps/ledger-live-desktop/tests/specs/speculos/delegate.spec.ts @@ -10,7 +10,7 @@ const e2eDelegationAccounts = [ { delegate: new Delegate(Account.ATOM_1, "0.001", "Ledger"), xrayTicket: "B2CQA-2740, B2CQA-2770", - bugLing: "LIVE-14501", + bugTicket: "LIVE-14501", }, { delegate: new Delegate(Account.SOL_1, "0.001", "Ledger by Figment"), @@ -38,6 +38,7 @@ const validators = [ { delegate: new Delegate(Account.ADA_1, "0.01", "LBF3 - Ledger by Figment 3"), xrayTicket: "B2CQA-2766", + bugTicket: "LIVE-15536", }, { delegate: new Delegate(Account.MULTIVERS_X_1, "1", "Ledger by Figment"), @@ -72,12 +73,12 @@ test.describe("Delegate flows", () => { { annotation: [ { type: "TMS", description: account.xrayTicket }, - { type: "BUG", description: account.bugLing }, + { type: "BUG", description: account.bugTicket }, ], }, async ({ app }) => { await addTmsLink(getDescription(test.info().annotations, "TMS").split(", ")); - if (account.bugLing) { + if (account.bugTicket) { await addBugLink(getDescription(test.info().annotations, "BUG").split(", ")); } @@ -133,10 +134,16 @@ test.describe("Delegate flows", () => { test( `[${validator.delegate.account.currency.name}] - Select validator`, { - annotation: { type: "TMS", description: validator.xrayTicket }, + annotation: [ + { type: "TMS", description: validator.xrayTicket }, + { type: "BUG", description: validator.bugTicket }, + ], }, async ({ app }) => { await addTmsLink(getDescription(test.info().annotations, "TMS").split(", ")); + if (validator.bugTicket) { + await addBugLink(getDescription(test.info().annotations, "BUG").split(", ")); + } await app.layout.goToAccounts(); await app.accounts.navigateToAccountByName(validator.delegate.account.accountName); diff --git a/libs/ledger-live-common/src/e2e/speculos.ts b/libs/ledger-live-common/src/e2e/speculos.ts index ccbe257fa5d5..967631d11206 100644 --- a/libs/ledger-live-common/src/e2e/speculos.ts +++ b/libs/ledger-live-common/src/e2e/speculos.ts @@ -291,7 +291,11 @@ export async function startSpeculos( const { model } = appQuery; const { dependencies } = spec; const newAppQuery = dependencies?.map(dep => { - return findLatestAppCandidate(appCandidates, { model, appName: dep.name }); + return findLatestAppCandidate(appCandidates, { + model, + appName: dep.name, + firmware: appCandidate?.firmware, + }); }); const appVersionMap = new Map(newAppQuery?.map(app => [app?.appName, app?.appVersion])); dependencies?.forEach(dependency => { diff --git a/libs/ledger-live-common/src/load/speculos.ts b/libs/ledger-live-common/src/load/speculos.ts index 8ede263d7a9b..a4c23cc6dd5d 100644 --- a/libs/ledger-live-common/src/load/speculos.ts +++ b/libs/ledger-live-common/src/load/speculos.ts @@ -132,8 +132,7 @@ export const findLatestAppCandidate = ( if (apps.length === 0) { return null; } - - apps = apps.sort((a, b) => semver.rcompare(a.appVersion, b.appVersion)); + apps = apps.sort((a, b) => semver.compare(b.appVersion, a.appVersion)); return apps[0]; };