Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:LedgerHQ/ledger-live into feat/s…
Browse files Browse the repository at this point in the history
…upport-app-install
  • Loading branch information
chrisduma-ledger committed Nov 20, 2024
2 parents fa11bae + be83cab commit 7083655
Show file tree
Hide file tree
Showing 54 changed files with 540 additions and 78 deletions.
5 changes: 5 additions & 0 deletions .changeset/afraid-houses-grin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@ledgerhq/coin-xrp": minor
---

Xrp listOp returns only Payment method to avoid Destination value undefined
5 changes: 5 additions & 0 deletions .changeset/beige-baboons-share.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"ledger-live-desktop": minor
---

tests: adding new e2e test
7 changes: 7 additions & 0 deletions .changeset/famous-tables-mate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@ledgerhq/types-live": minor
"live-mobile": minor
"@ledgerhq/live-common": minor
---

Add llm Reborn II feature flag for A/B Test + analytics
6 changes: 6 additions & 0 deletions .changeset/orange-ducks-do.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@ledgerhq/react-ui": minor
"@ledgerhq/ui-shared": minor
---

Update the react-ui Carousel based on the portfolio content cards design
5 changes: 5 additions & 0 deletions .changeset/silent-planes-count.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"live-mobile": minor
---

Wait for fetchData from braze before open the app. The braze landing page weren't able to render anything if a user coming from a notification hadn't lockpin
7 changes: 7 additions & 0 deletions .changeset/two-apricots-prove.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@ledgerhq/coin-stacks": minor
"ledger-live-desktop": minor
"@ledgerhq/live-common": minor
---

fix: import from stacks, playwright test selecting 7d timerange
2 changes: 1 addition & 1 deletion .github/workflows/test-mobile-e2e-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ jobs:
AVD_CORES: 4
AVD_RAM_SIZE: 4096M
AVD_OPTIONS: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
SPECULOS_IMAGE_TAG: ghcr.io/ledgerhq/speculos:0.9.5
SPECULOS_IMAGE_TAG: ghcr.io/ledgerhq/speculos:0.11
COINAPPS: ${{ github.workspace }}/coin-apps
outputs:
status: ${{ steps.detox.outcome }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-ui-e2e-only-desktop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
FORCE_COLOR: 3
CI_OS: "ubuntu-latest"
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
SPECULOS_IMAGE_TAG: ghcr.io/ledgerhq/speculos:0.9.5
SPECULOS_IMAGE_TAG: ghcr.io/ledgerhq/speculos:0.11
ENABLE_BROADCAST_TEST: ${{ inputs.enable_send_test }}
runs-on: [ledger-live-4xlarge]
strategy:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ const NFTViewerDrawer = ({ account, nftId, height }: NFTViewerDrawerProps) => {
</Skeleton>
</Text>
<Text
data-testId="nft-name-sendDrawer"
ff="Inter|SemiBold"
fontSize={7}
lineHeight="29px"
Expand Down Expand Up @@ -278,6 +279,7 @@ const NFTViewerDrawer = ({ account, nftId, height }: NFTViewerDrawerProps) => {
</Skeleton>
<NFTActions>
<Button
data-testId="nft-send-button-sendDrawer"
style={{
flex: 1,
justifyContent: "center",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,13 @@ const OperationD = (props: Props) => {
) : (
<Box flex={1} mb={2} alignItems="center">
<Skeleton show={show} width={160} barHeight={16} minHeight={32}>
<Text ff="Inter|SemiBold" textAlign="center" fontSize={7} color="palette.text.shade80">
<Text
data-testId="nft-name-operationDrawer"
ff="Inter|SemiBold"
textAlign="center"
fontSize={7}
color="palette.text.shade80"
>
{(metadata as NFTMetadata)?.nftName || "-"}
</Text>
</Skeleton>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ const RecipientFieldDomainService = <T extends Transaction, TS extends Transacti
</Text>
</Box>
<Box>
<Text ff="Inter|SemiBold" fontSize={3}>
<Text data-testId="ens-address-sendModal" ff="Inter|SemiBold" fontSize={3}>
{transaction.recipientDomain.address}
</Text>
</Box>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,12 @@ const StepSummary = (props: StepProps) => {
<Trans i18nKey="send.steps.details.to" />
</Text>
{transaction.recipientDomain && (
<Text ff="Inter|Bold" color="palette.text.shade100" fontSize={4}>
<Text
data-testId="transaction-recipient-ens"
ff="Inter|Bold"
color="palette.text.shade100"
fontSize={4}
>
{transaction.recipientDomain.domain}
</Text>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ const Collections = ({ account }: Props) => {
<Box>{t("NFT.collections.receiveCTA")}</Box>
</Box>
</Button>
<Button primary onClick={onOpenGallery}>
<Button primary onClick={onOpenGallery} data-testId="see-gallery-button">
{t("NFT.collections.galleryCTA")}
</Button>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,12 @@ const Summary = ({ transaction }: Props) => {
<Box horizontal>
<Box mr={3} alignItems="flex-end">
<Skeleton width={42} minHeight={18} barHeight={6} show={show}>
<Text ff="Inter|Medium" color="palette.text.shade100" fontSize={4}>
<Text
data-testId="transaction-nft-name"
ff="Inter|Medium"
color="palette.text.shade100"
fontSize={4}
>
{(nftName as string) || "-"}
</Text>
</Skeleton>
Expand Down
17 changes: 17 additions & 0 deletions apps/ledger-live-desktop/tests/enum/Account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export class Account {
public readonly address: string,
public readonly accountType?: AccountType,
public readonly index?: number,
public readonly ensName?: string,
) {}

static readonly BTC_NATIVE_SEGWIT_1 = new Account(
Expand Down Expand Up @@ -122,6 +123,15 @@ export class Account {
1,
);

static readonly ETH_MC = new Account(
Currency.ETH,
"Ethereum MC",
"0x4258A05DBA420A398bcdFB389E4250759b4223ea",
undefined,
undefined,
"ldgrqamco.eth",
);

static readonly ETH_3 = new Account(
Currency.ETH,
"Ethereum 3",
Expand Down Expand Up @@ -409,6 +419,13 @@ export class Account {
1,
);

static readonly ETH_USDC_1 = new Account(
Currency.ETH_USDC,
"Ethereum 1",
"0xB9051f83AC6e147924377BBEebd1Aa7aB43a67F6",
AccountType.ERC20,
);

static readonly ETH_LIDO = new Account(
Currency.ETH_LIDO,
"Ethereum 1",
Expand Down
1 change: 1 addition & 0 deletions apps/ledger-live-desktop/tests/enum/Currency.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export class Currency {
);
static readonly TON = new Currency("Ton", "TON", "ton", AppInfos.TON);
static readonly ETH_USDT = new Currency("Tether USD", "USDT", "ethereum", AppInfos.ETHEREUM);
static readonly ETH_USDC = new Currency("USD Coin", "USDC", "ethereum", AppInfos.ETHEREUM);
static readonly ETH_LIDO = new Currency(
"LIDO Staked ETH",
"STETH",
Expand Down
1 change: 1 addition & 0 deletions apps/ledger-live-desktop/tests/enum/DeviceLabels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,5 @@ export enum DeviceLabels {
NEW_ORDINARY_TRANSACTION = "New ordinary transaction",
SEND_TO_ADDRESS_2 = "Send to address (2/2)",
CONFIRM_TRANSACTION = "Confirm transaction",
REVIEW_TRANSACTION = "Review transaction",
}
11 changes: 10 additions & 1 deletion apps/ledger-live-desktop/tests/families/evm.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { expect } from "@playwright/test";
import { Transaction } from "tests/models/Transaction";
import { NFTTransaction, Transaction } from "tests/models/Transaction";
import {
pressBoth,
pressUntilTextFound,
containsSubstringInEvent,
waitFor,
} from "@ledgerhq/live-common/e2e/speculos";
import { DeviceLabels } from "tests/enum/DeviceLabels";

Expand All @@ -16,3 +17,11 @@ export async function sendEVM(tx: Transaction) {

await pressBoth();
}

export async function sendEvmNFT(tx: NFTTransaction) {
await waitFor(DeviceLabels.REVIEW_TRANSACTION);
const events = await pressUntilTextFound(DeviceLabels.ACCEPT);
const isAddressCorrect = containsSubstringInEvent(tx.accountToCredit.address, events);
expect(isAddressCorrect).toBeTruthy();
await pressBoth();
}
12 changes: 12 additions & 0 deletions apps/ledger-live-desktop/tests/models/Transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,15 @@ export class Transaction {
public memoTag?: string,
) {}
}

export class NFTTransaction extends Transaction {
constructor(
accountToDebit: Account,
accountToCredit: Account,
public nftName: string,
speed?: Fee,
memoTag?: string,
) {
super(accountToDebit, accountToCredit, "0", speed, memoTag);
}
}
18 changes: 18 additions & 0 deletions apps/ledger-live-desktop/tests/page/account.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ export class AccountPage extends AppPage {
private tokenRow = (tokenTicker: string) => this.page.getByTestId(`token-row-${tokenTicker}`);
private addTokenButton = this.page.getByRole("button", { name: "Add token" });
private viewDetailsButton = this.page.getByText("View details");
private seeGalleryButton = this.page.getByTestId("see-gallery-button");
private nft = (nftName: string) => this.page.locator(`text=${nftName}`);
private nftOperation = this.page.getByText("NFT Sent");

@step("Navigate to token")
async navigateToToken(SubAccount: Account) {
Expand Down Expand Up @@ -159,4 +162,19 @@ export class AccountPage extends AppPage {
async navigateToTokenInAccount(SubAccount: Account) {
await this.tokenRow(SubAccount.currency.ticker).click();
}

@step("Navigate to NFT gallery")
async navigateToNFTGallery() {
await this.seeGalleryButton.click();
}

@step("Select NFT $0")
async selectNFT(nftName: string) {
await this.nft(nftName).click();
}

@step("Navigate to NFT operation")
async navigateToNFTOperation() {
await this.nftOperation.click();
}
}
18 changes: 18 additions & 0 deletions apps/ledger-live-desktop/tests/page/drawer/nft.drawer.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { step } from "tests/misc/reporters/step";
import { Drawer } from "tests/component/drawer.component";
import { expect } from "@playwright/test";

export class NFTDrawer extends Drawer {
private nftName = this.page.getByTestId("nft-name-sendDrawer");
private sendButton = this.page.getByTestId("nft-send-button-sendDrawer");

@step("Verify nft name is visible")
async expectNftNameIsVisible(nft: string) {
await expect(this.nftName).toHaveText(nft);
}

@step("click on send button")
async clickSend() {
await this.sendButton.click();
}
}
14 changes: 13 additions & 1 deletion apps/ledger-live-desktop/tests/page/drawer/send.drawer.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { step } from "tests/misc/reporters/step";
import { Drawer } from "tests/component/drawer.component";
import { expect } from "@playwright/test";
import { Transaction } from "tests/models/Transaction";
import { NFTTransaction, Transaction } from "tests/models/Transaction";

export class SendDrawer extends Drawer {
private addressValue = (address: string) =>
this.page.locator('[data-testid="drawer-content"]').locator(`text=${address}`);
private amountValue = this.page.getByTestId("amountReceived-drawer");
private transactionType = this.page.getByTestId("transaction-type");
private nftName = this.page.getByTestId("nft-name-operationDrawer");

@step("Verify address is visible")
async addressValueIsVisible(address: string) {
Expand All @@ -18,4 +20,14 @@ export class SendDrawer extends Drawer {
await expect(this.addressValue(tx.accountToCredit.address)).toBeVisible();
await expect(this.amountValue).toBeVisible();
}

@step("Verify Send NFT information")
async expectNftInfos(tx: NFTTransaction) {
const transactionType = await this.transactionType.textContent();
expect(transactionType).toMatch("Sending");
const NFTName = await this.nftName.textContent();
expect(NFTName).toBe(tx.nftName);
const address = await this.addressValue(tx.accountToCredit.address).textContent();
expect(address).toBe(tx.accountToCredit.address);
}
}
2 changes: 2 additions & 0 deletions apps/ledger-live-desktop/tests/page/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { SendDrawer } from "./drawer/send.drawer";
import { AssetDrawer } from "./drawer/asset.drawer";
import { PasswordlockModal } from "./modal/passwordlock.modal";
import { LockscreenPage } from "tests/page/lockscreen.page";
import { NFTDrawer } from "./drawer/nft.drawer";

export class Application extends PageHolder {
public account = new AccountPage(this.page);
Expand All @@ -43,4 +44,5 @@ export class Application extends PageHolder {
public assetDrawer = new AssetDrawer(this.page);
public password = new PasswordlockModal(this.page);
public LockscreenPage = new LockscreenPage(this.page);
public nftDrawer = new NFTDrawer(this.page);
}
5 changes: 3 additions & 2 deletions apps/ledger-live-desktop/tests/page/market.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ export class MarketPage extends AppPage {
@step("Switch market range for $0")
async switchMarketRange(range: string) {
await this.marketRangeSelect.click();
// TODO: For some reason need to hack selects like that
await this.page.click(`text=${range}`);
await this.page.click(`#react-select-3-listbox >> text=${range}`);
// NOTE: this.page.click(`text=${range}`);
// won't work on 7th row if the coin starts with d (e.g. "dogecoin")
}

@step("Toggle star filter")
Expand Down
Loading

0 comments on commit 7083655

Please sign in to comment.