Skip to content

Commit

Permalink
test: improved earn test and skipping stability test
Browse files Browse the repository at this point in the history
test(lld): update screenshots (ubuntu-latest)

lld, test, screenshot

test(lld): update screenshots (macos-latest)

lld, test, screenshot

test(lld): update screenshots (windows-latest)

lld, test, screenshot
  • Loading branch information
ggilchrist-ledger committed Jul 13, 2023
1 parent 2fb2f3f commit 9e58137
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import { AccountsPage } from "../../models/AccountsPage";

test.use({ userdata: "bot-accounts" });

test("Stability of the app with numerous real accounts", async ({ page }) => {
// skipping as this as it's not valid for functional UI tests
test.skip("Stability of the app with numerous real accounts", async ({ page }) => {
const layout = new Layout(page);
const accountsPage = new AccountsPage(page);

Expand Down
43 changes: 38 additions & 5 deletions apps/ledger-live-desktop/tests/specs/services/earn.smoke.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import test from "../../fixtures/common";
import { expect } from "@playwright/test";
import { Layout } from "../../models/Layout";
import { LiveAppWebview } from "../../models/LiveAppWebview";

test.use({
userdata: "1AccountBTC1AccountETH",
Expand All @@ -11,13 +12,45 @@ test.use({
},
});

test("Add accounts via Swap page", async ({ page }) => {
let testServerIsRunning = false;

test.beforeAll(async () => {
// Check that dummy app in libs/test-utils/dummy-ptx-app has been started successfully
testServerIsRunning = await LiveAppWebview.startLiveApp("dummy-ptx-app/public", {
name: "Earn",
id: "earn",
apiVersion: "^2.0.0",
permissions: [
{
method: "account.list",
},
],
});

if (!testServerIsRunning) {
console.warn("Stopping Earn test setup");
return;
}
});

test.afterAll(async () => {
await LiveAppWebview.stopLiveApp();
});

test("Earn", async ({ page }) => {
// Don't run test if server is not running
if (!testServerIsRunning) return;

const layout = new Layout(page);
const liveAppWebview = new LiveAppWebview(page);

await test.step("Navigate to earn page", async () => {
await test.step("Navigate to Buy app from portfolio banner", async () => {
await layout.goToEarn();
await expect.soft(page).toHaveScreenshot("earn-app-opened.png", {
mask: [page.locator("data-test-id=earn-app-container")],
});
await expect(await liveAppWebview.waitForCorrectTextInWebview("theme: dark")).toBe(true);
await expect(await liveAppWebview.waitForCorrectTextInWebview("lang: en")).toBe(true);
await expect(await liveAppWebview.waitForCorrectTextInWebview("currencyTicker: USD")).toBe(
true,
);
await expect.soft(page).toHaveScreenshot("earn-app-opened.png");
});
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 0 additions & 1 deletion apps/ledger-live-mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
"@ledgerhq/react-native-hid": "workspace:^",
"@ledgerhq/react-native-hw-transport-ble": "workspace:^",
"@ledgerhq/react-native-passcode-auth": "^2.1.0",
"@ledgerhq/test-utils": "workspace:^",
"@ledgerhq/types-cryptoassets": "workspace:^",
"@ledgerhq/types-devices": "workspace:^",
"@ledgerhq/types-live": "workspace:^",
Expand Down
6 changes: 3 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9e58137

Please sign in to comment.