forked from LedgerHQ/ledger-live
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request LedgerHQ#8796 from LedgerHQ/support/qaa_377_detox_…
…speculos_send [QAA-377][Speculos][Detox] Adapt LLM send test
- Loading branch information
Showing
40 changed files
with
396 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { Currency } from "@ledgerhq/live-common/e2e/enum/Currency"; | ||
import { Application } from "../page"; | ||
import { Transaction } from "@ledgerhq/live-common/e2e/models/Transaction"; | ||
|
||
export async function verifyAppValidationSendInfo( | ||
app: Application, | ||
transaction: Transaction, | ||
amount: string, | ||
) { | ||
const currenciesForValidationAmount = [ | ||
Currency.sepETH, | ||
Currency.DOT, | ||
Currency.POL, | ||
Currency.ALGO, | ||
Currency.ADA, | ||
Currency.DOGE, | ||
Currency.SOL, | ||
Currency.TRX, | ||
Currency.XLM, | ||
Currency.XRP, | ||
Currency.ATOM, | ||
Currency.BCH, | ||
]; | ||
|
||
const currenciesForValidationRecipient = [Currency.sepETH, Currency.POL]; | ||
const currenciesForValidationSender = [Currency.ATOM]; | ||
|
||
const currency = transaction.accountToCredit.currency; | ||
const addressRecipient = transaction.accountToCredit.address; | ||
const addressSender = transaction.accountToDebit.address; | ||
|
||
if (currenciesForValidationAmount.includes(currency)) { | ||
await app.send.expectValidationAmount(amount); | ||
} | ||
|
||
if (currenciesForValidationRecipient.includes(currency)) { | ||
await app.send.expectValidationAddress(addressRecipient); | ||
} | ||
|
||
if (currenciesForValidationSender.includes(currency)) { | ||
await app.send.expectValidationAddress(addressSender); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,15 @@ | ||
import { expectValidAddressDevice } from "@ledgerhq/live-common/e2e/speculos"; | ||
import { expectValidAddressDevice, signSendTransaction } from "@ledgerhq/live-common/e2e/speculos"; | ||
import { Account } from "@ledgerhq/live-common/e2e/enum/Account"; | ||
import { Transaction } from "@ledgerhq/live-common/e2e/models/Transaction"; | ||
|
||
export default class SpeculosPage { | ||
@Step("Verify receive address correctness on device") | ||
async expectValidAddressDevice(account: Account, addressDisplayed: string) { | ||
await expectValidAddressDevice(account, addressDisplayed); | ||
} | ||
|
||
@Step("Sign Send Transaction") | ||
async signSendTransaction(tx: Transaction) { | ||
await signSendTransaction(tx); | ||
} | ||
} |
18 changes: 16 additions & 2 deletions
18
apps/ledger-live-mobile/e2e/page/trade/operationDetails.page.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,34 @@ | ||
import { getElementById } from "../../helpers"; | ||
import { getElementById, scrollToId, waitForElementById } from "../../helpers"; | ||
import { expect } from "detox"; | ||
|
||
export default class OperationDetailsPage { | ||
title = () => getElementById("operationDetails-title"); | ||
titleId = "operationDetails-title"; | ||
title = () => getElementById(this.titleId); | ||
account = () => getElementById("operationDetails-account"); | ||
amount = () => getElementById("operationDetails-amount"); | ||
recipientId = "operationDetails-recipient0"; | ||
|
||
async isOpened() { | ||
await expect(this.title()).toBeVisible(); | ||
} | ||
|
||
@Step("Wait for operation details") | ||
async waitForOperationDetails() { | ||
await waitForElementById(this.titleId); | ||
} | ||
|
||
@Step("Check account details") | ||
async checkAccount(account: string) { | ||
await expect(this.account()).toHaveText(account); | ||
} | ||
|
||
async checkAmount(amount: string) { | ||
await expect(this.amount()).toHaveText(amount); | ||
} | ||
|
||
@Step("Check recipient details") | ||
async checkRecipient(recipient: string) { | ||
await scrollToId(this.recipientId); | ||
await expect(getElementById(this.recipientId)).toHaveText(recipient); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.