diff --git a/apps/ledger-live-mobile/e2e/specs/speculos/deeplinks.spec.ts b/apps/ledger-live-mobile/e2e/specs/speculos/deeplinks.spec.ts new file mode 100644 index 000000000000..a28b710604c8 --- /dev/null +++ b/apps/ledger-live-mobile/e2e/specs/speculos/deeplinks.spec.ts @@ -0,0 +1,102 @@ +import { AppInfos } from "@ledgerhq/live-common/e2e/enum/AppInfos"; +import { Application } from "../../page"; +import { CLI } from "../../utils/cliUtils"; + +const app = new Application(); +const nanoApp = AppInfos.ETHEREUM; + +const ethereumLong = "ethereum"; +const bitcoinLong = "bitcoin"; +const arbitrumLong = "arbitrum"; +const bobaLong = "boba"; + +$TmsLink("B2CQA-1837"); +describe("DeepLinks Tests", () => { + beforeAll(async () => { + await app.init({ + speculosApp: nanoApp, + cliCommands: [ + async () => { + return CLI.liveData({ + currency: nanoApp.name, + index: 0, + appjson: app.userdataPath, + add: true, + }); + }, + ], + }); + await app.portfolio.waitForPortfolioPageToLoad(); + }); + + it("should open My Ledger page", async () => { + await app.manager.openViaDeeplink(); + await app.manager.expectManagerPage(); + }); + + it("should open Account page", async () => { + await app.assetAccountsPage.openViaDeeplink(); + await app.accounts.waitForAccountsPageToLoad(); + }); + + it("should open Add Account drawer", async () => { + await app.addAccount.openViaDeeplink(); + await app.addAccount.selectCurrency(ethereumLong); + }); + + it("should open ETH Account Asset page when given currency param", async () => { + await app.assetAccountsPage.openViaDeeplink(ethereumLong); + await app.assetAccountsPage.waitForAccountAssetsToLoad(ethereumLong); + }); + + it("should open BTC Account Asset page when given currency param", async () => { + await app.assetAccountsPage.openViaDeeplink(bitcoinLong); + await app.assetAccountsPage.waitForAccountAssetsToLoad(bitcoinLong); + }); + + it("should open Custom Lock Screen page", async () => { + await app.customLockscreen.openViaDeeplink(); + await app.customLockscreen.expectCustomLockscreenPage(); + }); + + it("should open the Discover page", async () => { + await app.discover.openViaDeeplink(); + await app.discover.expectDiscoverPage(); + }); + + it(`should open discovery to random live App`, async () => { + // Opening only one random liveApp to avoid flakiness + const randomLiveApp = app.discover.getRandomLiveApp(); + await app.discover.openViaDeeplink(randomLiveApp); + await app.discover.expectApp(randomLiveApp); + }); + + it("should open NFT Gallery", async () => { + await app.nftGallery.openViaDeeplink(); + await app.nftGallery.expectGalleryVisible(); + }); + + it("should open Swap Form page", async () => { + await app.swap.openViaDeeplink(); + await app.swap.expectSwapPage(); + }); + + it("should open Send pages", async () => { + await app.send.openViaDeeplink(); + await app.send.expectFirstStep(); + await app.portfolio.openViaDeeplink(); + await app.portfolio.waitForPortfolioPageToLoad(); + await app.send.sendViaDeeplink(ethereumLong); + await app.send.expectFirstStep(); + await app.common.expectSearch(ethereumLong); + }); + + it("should open Receive pages", async () => { + await app.receive.openViaDeeplink(); + await app.receive.expectFirstStep(); + await app.portfolio.openViaDeeplink(); + await app.portfolio.waitForPortfolioPageToLoad(); + await app.receive.receiveViaDeeplink(ethereumLong); + await app.receive.expectSecondStepNetworks([ethereumLong, arbitrumLong, bobaLong]); + }); +}); diff --git a/apps/ledger-live-mobile/e2e/specs/speculos/languageChange.spec.ts b/apps/ledger-live-mobile/e2e/specs/speculos/languageChange.spec.ts new file mode 100644 index 000000000000..c56d55a66429 --- /dev/null +++ b/apps/ledger-live-mobile/e2e/specs/speculos/languageChange.spec.ts @@ -0,0 +1,57 @@ +import { AppInfos } from "@ledgerhq/live-common/e2e/enum/AppInfos"; +import { Application } from "../../page"; +import { CLI } from "../../utils/cliUtils"; + +const app = new Application(); +const nanoApp = AppInfos.ETHEREUM; + +const langButtonText = [ + { lang: "Français", localization: "Général" }, + { lang: "Español", localization: "General" }, + { lang: "Русский", localization: "Общие" }, + { lang: "Deutsch", localization: "Allgemeines" }, + { lang: "Português (Brasil)", localization: "Geral" }, + { lang: "Türkçe", localization: "Genel" }, + { lang: "简体中文", localization: "常规" }, + { lang: "한국어", localization: "일반" }, + { lang: "日本語", localization: "一般" }, + { lang: "English", localization: "General" }, +]; + +const verifyLanguageCanBeChanged = (l10n: { lang: string; localization: string }) => { + it(`should change selected language to ${l10n.lang}`, async () => { + await app.settingsGeneral.navigateToLanguageSelect(); + await app.settingsGeneral.selectLanguage(l10n.lang); + await app.settingsGeneral.expectLocalizedText(l10n.localization); + }); +}; + +$TmsLink("B2CQA-2344"); +describe("Change Language", () => { + beforeAll(async () => { + await app.init({ + speculosApp: nanoApp, + cliCommands: [ + async () => { + return CLI.liveData({ + currency: nanoApp.name, + index: 0, + appjson: app.userdataPath, + add: true, + }); + }, + ], + }); + await app.portfolio.waitForPortfolioPageToLoad(); + }); + + it("should go to General Settings", async () => { + await app.portfolio.navigateToSettings(); + await app.settings.navigateToGeneralSettings(); + }); + + // test steps for each language + for (const l10n of langButtonText) { + verifyLanguageCanBeChanged(l10n); + } +}); diff --git a/apps/ledger-live-mobile/e2e/specs/speculos/market.spec.ts b/apps/ledger-live-mobile/e2e/specs/speculos/market.spec.ts new file mode 100644 index 000000000000..91dfd38e0259 --- /dev/null +++ b/apps/ledger-live-mobile/e2e/specs/speculos/market.spec.ts @@ -0,0 +1,42 @@ +import { AppInfos } from "@ledgerhq/live-common/e2e/enum/AppInfos"; +import { Application } from "../../page"; +import { CLI } from "../../utils/cliUtils"; + +const app = new Application(); +const nanoApp = AppInfos.ETHEREUM; +const asset = "Ethereum (ETH)"; + +describe("Market page for user with no device", () => { + beforeAll(async () => { + await app.init({ + speculosApp: nanoApp, + cliCommands: [ + async () => { + return CLI.liveData({ + currency: nanoApp.name, + index: 0, + appjson: app.userdataPath, + add: true, + }); + }, + ], + }); + await app.portfolio.waitForPortfolioPageToLoad(); + }); + + $TmsLink("B2CQA-1880"); + it("should find the researched crypto", async () => { + await app.walletTabNavigator.navigateToMarket(); + await app.market.searchAsset("eth"); + await app.market.expectMarketRowTitle(asset); + }); + + $TmsLink("B2CQA-1879"); + it("should filter starred asset in the list", async () => { + await app.market.openAssetPage(asset); + await app.market.starFavoriteCoin(); + await app.market.backToAssetList(); + await app.market.filterStaredAsset(); + await app.market.expectMarketRowTitle(asset); + }); +}); diff --git a/apps/ledger-live-mobile/e2e/specs/speculos/onboardingReadOnly.spec.ts b/apps/ledger-live-mobile/e2e/specs/speculos/onboardingReadOnly.spec.ts new file mode 100644 index 000000000000..992cd0dd3800 --- /dev/null +++ b/apps/ledger-live-mobile/e2e/specs/speculos/onboardingReadOnly.spec.ts @@ -0,0 +1,16 @@ +import { Application } from "../../page"; + +const app = new Application(); + +describe("Onboarding - Read Only", () => { + $TmsLink("B2CQA-370"); + $TmsLink("B2CQA-1753"); + $TmsLink("B2CQA-1806"); + it("goes through discover app and should see an empty portfolio page", async () => { + await app.onboarding.startOnboarding(); + await app.onboarding.chooseNoLedgerYet(); + await app.onboarding.chooseToExploreApp(); + await app.portfolio.waitForPortfolioPageToLoad(); + await app.portfolio.expectPortfolioReadOnly(); + }); +}); diff --git a/apps/ledger-live-mobile/e2e/specs/speculos/password.spec.ts b/apps/ledger-live-mobile/e2e/specs/speculos/password.spec.ts new file mode 100644 index 000000000000..3c0feaf55e58 --- /dev/null +++ b/apps/ledger-live-mobile/e2e/specs/speculos/password.spec.ts @@ -0,0 +1,55 @@ +import { device } from "detox"; +import { Application } from "../../page"; +import { AppInfos } from "@ledgerhq/live-common/e2e/enum/AppInfos"; +import { CLI } from "../../utils/cliUtils"; + +const app = new Application(); +const nanoApp = AppInfos.ETHEREUM; + +const CORRECT_PASSWORD = "passWORD$123!"; + +describe("Password Lock Screen", () => { + beforeAll(async () => { + await app.init({ + speculosApp: nanoApp, + cliCommands: [ + async () => { + return CLI.liveData({ + currency: nanoApp.name, + index: 0, + appjson: app.userdataPath, + add: true, + }); + }, + ], + }); + await app.portfolio.waitForPortfolioPageToLoad(); + }); + + $TmsLink("B2CQA-1763"); + it("should ask for the password when lock is toggled", async () => { + await app.portfolio.navigateToSettings(); + await app.settings.navigateToGeneralSettings(); + await app.settingsGeneral.togglePassword(); + await app.settingsGeneral.enterNewPassword(CORRECT_PASSWORD); + await app.settingsGeneral.enterNewPassword(CORRECT_PASSWORD); // confirm password step + await device.sendToHome(); + await device.launchApp(); // restart LLM + await app.passwordEntry.expectLock(); + }); + + $TmsLink("B2CQA-2343"); + it("should stay locked with incorrect password", async () => { + await app.passwordEntry.enterPassword("INCORRECT_PASSWORD"); + await app.passwordEntry.login(); + await app.passwordEntry.expectLock(); + }); + + $TmsLink("B2CQA-1763"); + it("should unlock with correct password", async () => { + await app.passwordEntry.enterPassword(CORRECT_PASSWORD); + await app.passwordEntry.login(); + await app.passwordEntry.expectNoLock(); + await app.settingsGeneral.expectpreferredCurrencyButton(); + }); +}); diff --git a/apps/ledger-live-mobile/e2e/specs/speculos/receive/receive.ts b/apps/ledger-live-mobile/e2e/specs/speculos/receive/receive.ts deleted file mode 100644 index 09180f3f67f2..000000000000 --- a/apps/ledger-live-mobile/e2e/specs/speculos/receive/receive.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { CLI } from "../../../utils/cliUtils"; -import { Application } from "../../../page"; -import { Account } from "@ledgerhq/live-common/e2e/enum/Account"; - -export async function runReceiveTest(account: Account, tmsLink: string) { - const app = new Application(); - - describe(`Receive - ${account.currency.name}`, () => { - beforeAll(async () => { - await app.init({ - speculosApp: account.currency.speculosApp, - cliCommands: [ - () => { - return CLI.liveData({ - currency: account.currency.currencyId, - index: account.index, - appjson: app.userdataPath, - add: true, - }); - }, - ], - }); - await app.portfolio.waitForPortfolioPageToLoad(); - }); - - $TmsLink(tmsLink); - it(`receive on ${account.currency.name} (through scanning)`, async () => { - await app.receive.openViaDeeplink(); - await app.common.performSearch(account.currency.name); - await app.receive.selectCurrency(account.currency.name); - await app.receive.selectAccount(account.accountName); - await app.receive.doNotVerifyAddress(); - await app.receive.expectReceivePageIsDisplayed(account.currency.ticker, account.accountName); - }); - - afterAll(async () => { - await app?.common.removeSpeculos(); - }); - }); -} diff --git a/apps/ledger-live-mobile/e2e/specs/speculos/receive/receiveBTC.spec.ts b/apps/ledger-live-mobile/e2e/specs/speculos/receive/receiveBTC.spec.ts deleted file mode 100644 index 008c3e98822f..000000000000 --- a/apps/ledger-live-mobile/e2e/specs/speculos/receive/receiveBTC.spec.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { runReceiveTest } from "./receive"; -import { Account } from "@ledgerhq/live-common/e2e/enum/Account"; - -runReceiveTest(Account.BTC_NATIVE_SEGWIT_1, "B2CQA-2559, B2CQA-2687"); diff --git a/apps/ledger-live-mobile/e2e/specs/speculos/verifyAddress/receiveFlowETH.spec.ts b/apps/ledger-live-mobile/e2e/specs/speculos/verifyAddress/receiveFlowETH.spec.ts new file mode 100644 index 000000000000..c74e26df13a2 --- /dev/null +++ b/apps/ledger-live-mobile/e2e/specs/speculos/verifyAddress/receiveFlowETH.spec.ts @@ -0,0 +1,62 @@ +import { Account } from "@ledgerhq/live-common/e2e/enum/Account"; +import { Application } from "../../../page"; + +const app = new Application(); +const account = Account.ETH_1; + +describe("Receive Flow", () => { + beforeAll(async () => { + app.userdataSpeculos = "EthAccountXrpAccountReadOnlyFalse"; + await app.init({ + speculosApp: account.currency.speculosApp, + }); + + await app.portfolio.waitForPortfolioPageToLoad(); + }); + + async function openReceive() { + await app.portfolio.openViaDeeplink(); + await app.portfolio.waitForPortfolioPageToLoad(); + await app.receive.openViaDeeplink(); + } + + $TmsLink("B2CQA-1858"); + $TmsLink("B2CQA-1860"); + it("Should display the number of account existing per networks", async () => { + await openReceive(); + await app.receive.selectAsset("ETH"); + await app.receive.expectNumberOfAccountInListIsDisplayed("ethereum", 3); + await app.receive.expectNumberOfAccountInListIsDisplayed("op mainnet", 1); + }); + + $TmsLink("B2CQA-1856"); + $TmsLink("B2CQA-1862"); + it("Should create an account on a network", async () => { + await openReceive(); + await app.receive.selectAsset("ETH"); + await app.receive.selectNetwork("op mainnet"); + await app.receive.createAccount(); + await app.receive.continueCreateAccount(); + await app.receive.expectAccountIsCreated("OP Mainnet 1"); + }); + + $TmsLink("B2CQA-650"); + it("Should access to receive after importing a cryptocurrency on a selected network", async () => { + await openReceive(); + await app.common.performSearch("Polygon"); + await app.receive.selectAsset("POL"); + await app.receive.selectNetwork("binance smart chain"); + await app.receive.selectAccount("Binance Smart Chain 1"); + await app.receive.doNotVerifyAddress(); + await app.receive.expectReceivePageIsDisplayed("BNB", "Binance Smart Chain 1"); + }); + + $TmsLink("B2CQA-1859"); + it("Should access to receive after selecting an existing account", async () => { + await openReceive(); + await app.receive.selectAsset("XRP"); + await app.receive.selectAccount("XRP 2"); + await app.receive.doNotVerifyAddress(); + await app.receive.expectReceivePageIsDisplayed("XRP", "XRP 2"); + }); +}); diff --git a/apps/ledger-live-mobile/e2e/specs/speculos/verifyAddress/verifyAddressBTC.spec.ts b/apps/ledger-live-mobile/e2e/specs/speculos/verifyAddress/verifyAddressBTC.spec.ts index 9fe21e854ce5..660f707f98aa 100644 --- a/apps/ledger-live-mobile/e2e/specs/speculos/verifyAddress/verifyAddressBTC.spec.ts +++ b/apps/ledger-live-mobile/e2e/specs/speculos/verifyAddress/verifyAddressBTC.spec.ts @@ -1,4 +1,4 @@ import { runVerifyAddressTest } from "./verifyAddress"; import { Account } from "@ledgerhq/live-common/e2e/enum/Account"; -runVerifyAddressTest(Account.BTC_NATIVE_SEGWIT_1, "B2CQA-2559, B2CQA-2687"); +runVerifyAddressTest(Account.BTC_NATIVE_SEGWIT_1, "B2CQA-2559, B2CQA-2687, B2CQA-1864");