Skip to content

Commit

Permalink
test: separate coin by file
Browse files Browse the repository at this point in the history
  • Loading branch information
abdurrahman-ledger committed Oct 28, 2024
1 parent 6eb2980 commit d695400
Show file tree
Hide file tree
Showing 18 changed files with 92 additions and 53 deletions.
2 changes: 1 addition & 1 deletion apps/ledger-live-mobile/e2e/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export async function launchSpeculos(appName: string, proxyPort: number) {
}
const speculosPort = portCounter++;
const speculosPidOffset =
(speculosPort - BASE_PORT) * 1000 + parseInt(process.env.TEST_WORKER_INDEX || "0") * 100;
(speculosPort - BASE_PORT) * 1000 + parseInt(process.env.JEST_WORKER_ID || "0") * 100;
setEnv("SPECULOS_PID_OFFSET", speculosPidOffset);

const testName = expect.getState().testPath || "unknown";
Expand Down
51 changes: 0 additions & 51 deletions apps/ledger-live-mobile/e2e/specs/speculos/addAccount.spec.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { Application } from "../../../page";
import { Currency } from "@ledgerhq/live-common/e2e/enum/Currency";

export async function runAddAccountTest(currency: Currency, tmsLink: string) {
let app: Application;
let deviceNumber: number;

describe(`Add accounts - ${currency.name}`, () => {
beforeAll(async () => {
app = await Application.init("onboardingcompleted");
await app.portfolio.waitForPortfolioPageToLoad();
});

$TmsLink(tmsLink);
it(`Perform an add account`, async () => {
await app.addAccount.openViaDeeplink();
await app.common.performSearch(currency.name);
await app.addAccount.selectCurrency(currency.currencyId);

deviceNumber = await app.common.addSpeculos(currency.speculosApp.name);

await app.addAccount.startAccountsDiscovery();
await app.addAccount.expectAccountDiscovery(currency.name, currency.currencyId);
await app.addAccount.finishAccountsDiscovery();
await app.addAccount.tapSuccessCta();
await app.account.waitForAccountPageToLoad(currency.name);
await app.account.expectAccountBalanceVisible();
});

afterAll(async () => {
await app.common.removeSpeculos(deviceNumber);
});
});
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { runAddAccountTest } from "./AddAccount";
import { Currency } from "@ledgerhq/live-common/e2e/enum/Currency";

runAddAccountTest(Currency.ADA, "B2CQA-2500, B2CQA-2650, B2CQA-2678");
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { runAddAccountTest } from "./AddAccount";
import { Currency } from "@ledgerhq/live-common/e2e/enum/Currency";

runAddAccountTest(Currency.ALGO, "B2CQA-2497, B2CQA-2653, B2CQA-2681");
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { runAddAccountTest } from "./AddAccount";
import { Currency } from "@ledgerhq/live-common/e2e/enum/Currency";

runAddAccountTest(Currency.ATOM, "B2CQA-2501, B2CQA-2654, B2CQA-2682");
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { runAddAccountTest } from "./AddAccount";
import { Currency } from "@ledgerhq/live-common/e2e/enum/Currency";

runAddAccountTest(Currency.BCH, "B2CQA-2498, B2CQA-2652, B2CQA-2680");
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { runAddAccountTest } from "./AddAccount";
import { Currency } from "@ledgerhq/live-common/e2e/enum/Currency";

runAddAccountTest(Currency.BTC, "B2CQA-2499, B2CQA-2644, B2CQA-2672, B2CQA-786");
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { runAddAccountTest } from "./AddAccount";
import { Currency } from "@ledgerhq/live-common/e2e/enum/Currency";

runAddAccountTest(Currency.DOT, "B2CQA-2504, B2CQA-2648, B2CQA-2676");
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { runAddAccountTest } from "./AddAccount";
import { Currency } from "@ledgerhq/live-common/e2e/enum/Currency";

runAddAccountTest(Currency.ETC, "B2CQA-2502, B2CQA-2646, B2CQA-2674");
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { runAddAccountTest } from "./AddAccount";
import { Currency } from "@ledgerhq/live-common/e2e/enum/Currency";

runAddAccountTest(Currency.ETH, "B2CQA-2503, B2CQA-2645, B2CQA-26736");
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { runAddAccountTest } from "./AddAccount";
import { Currency } from "@ledgerhq/live-common/e2e/enum/Currency";

runAddAccountTest(Currency.SOL, "B2CQA-2642, B2CQA-2656, B2CQA-2684");
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { runAddAccountTest } from "./AddAccount";
import { Currency } from "@ledgerhq/live-common/e2e/enum/Currency";

runAddAccountTest(Currency.TON, "B2CQA-2643, B2CQA-2657, B2CQA-2685");
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { runAddAccountTest } from "./AddAccount";
import { Currency } from "@ledgerhq/live-common/e2e/enum/Currency";

runAddAccountTest(Currency.TRX, "B2CQA-2508, B2CQA-2649, B2CQA-2677");
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { runAddAccountTest } from "./AddAccount";
import { Currency } from "@ledgerhq/live-common/e2e/enum/Currency";

runAddAccountTest(Currency.XLM, "B2CQA-2506, B2CQA-2651, B2CQA-2679");
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { runAddAccountTest } from "./AddAccount";
import { Currency } from "@ledgerhq/live-common/e2e/enum/Currency";

runAddAccountTest(Currency.XRP, "B2CQA-2505, B2CQA-2647, B2CQA-2675");
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { runAddAccountTest } from "./AddAccount";
import { Currency } from "@ledgerhq/live-common/e2e/enum/Currency";

runAddAccountTest(Currency.XTZ, "B2CQA-2507, B2CQA-2655, B2CQA-2683");
2 changes: 1 addition & 1 deletion apps/ledger-live-mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"e2e:build": "pnpm detox build",
"e2e:ci": "zx ./scripts/e2e-ci.mjs",
"e2e:test": "export MOCK=1 && pnpm detox test",
"e2e:test:speculos": "export MOCK=0 && pnpm detox test --testMatch $(pwd)/e2e/specs/speculos/**/*.spec.ts",
"e2e:test:speculos": "export MOCK=0 && pnpm detox test --testMatch $(pwd)/e2e/specs/speculos/**/**/*.spec.ts",
"prebeta": "bundle install",
"debug:detox": "pnpm detox test -c ios.manual currencies.spec.ts",
"ios:staging": "ENVFILE=.env.ios.staging react-native run-ios --mode Staging",
Expand Down

0 comments on commit d695400

Please sign in to comment.