Skip to content

Commit

Permalink
Merge pull request #8500 from LedgerHQ/support/fix-ci
Browse files Browse the repository at this point in the history
[QAA] fixing Nightly E2E CI + improving Receive E2E test
  • Loading branch information
KVNLS authored Nov 27, 2024
2 parents bc63735 + faef7ed commit f65035f
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 8 deletions.
6 changes: 6 additions & 0 deletions .changeset/rotten-horses-shop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"ledger-live-desktop": minor
"@ledgerhq/live-common": minor
---

Fix Speculos CI + Update checks on receive and subAccount tests"
6 changes: 6 additions & 0 deletions apps/ledger-live-desktop/tests/page/modal/receive.modal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ export class ReceiveModal extends Modal {
await this.skipDeviceButton.click();
}

@step("Retrieve fees amount value")
async getAddressDisplayed() {
const text = await this.addressDisplayedValue.textContent();
return text ? text?.split(" ")[0] : "";
}

@step("Verify receive address correctness $0")
async expectValidReceiveAddress(address: string) {
await expect(this.verifyAddressOnDeviceLabel).toBeVisible();
Expand Down
4 changes: 2 additions & 2 deletions apps/ledger-live-desktop/tests/page/speculos.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { delegateCosmos, sendCosmos } from "tests/families/cosmos";
import { delegateSolana, sendSolana } from "tests/families/solana";
export class SpeculosPage extends AppPage {
@step("Verify receive address correctness on device")
async expectValidAddressDevice(account: Account) {
async expectValidAddressDevice(account: Account, addressDisplayed: string) {
let deviceLabels: string[];

switch (account.currency) {
Expand All @@ -46,7 +46,7 @@ export class SpeculosPage extends AppPage {

await waitFor(deviceLabels[0]);
const events = await pressUntilTextFound(deviceLabels[1]);
const isAddressCorrect = containsSubstringInEvent(account.address, events);
const isAddressCorrect = containsSubstringInEvent(addressDisplayed, events);
expect(isAddressCorrect).toBeTruthy();
await pressBoth();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,10 @@ for (const account of accounts) {
break;
}
await app.modal.continue();
await app.receive.expectValidReceiveAddress(account.account.address);
const displayedAddress = await app.receive.getAddressDisplayed();
await app.receive.expectValidReceiveAddress(displayedAddress);

await app.speculos.expectValidAddressDevice(account.account);
await app.speculos.expectValidAddressDevice(account.account, displayedAddress);
await app.receive.expectApproveLabel();
},
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ test.describe("Send flows", () => {
}

test.describe("send NFT to ENS address", () => {
const transaction = new NFTTransaction(Account.ETH_1, Account.ETH_MC, "NY la muse", Fee.SLOW);
const transaction = new NFTTransaction(Account.ETH_1, Account.ETH_MC, "Podium", Fee.SLOW);
test.beforeAll(async () => {
process.env.DISABLE_TRANSACTION_BROADCAST = "true";
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,11 @@ for (const token of subAccountReceive) {
await app.receive.selectToken(token.account);

await app.modal.continue();
await app.receive.expectValidReceiveAddress(token.account.address);

await app.speculos.expectValidAddressDevice(token.account);
const displayedAddress = await app.receive.getAddressDisplayed();
await app.receive.expectValidReceiveAddress(displayedAddress);

await app.speculos.expectValidAddressDevice(token.account, displayedAddress);
await app.receive.expectApproveLabel();
},
);
Expand Down
2 changes: 1 addition & 1 deletion libs/ledger-live-common/src/e2e/enum/Account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export class Account {
static readonly BTC_NATIVE_SEGWIT_1 = new Account(
Currency.BTC,
"Bitcoin 1",
"bc1qm4mm7usmutz9sryheuytjpzj0yuy83pkg49qzk",
"bc1qd0jevdq89hlcazal9cak8t850t6nn9fmn5flnj",
undefined,
0,
undefined,
Expand Down

0 comments on commit f65035f

Please sign in to comment.