Skip to content

Commit

Permalink
Adjusting new code to the changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ypolishchuk-ledger committed Jun 26, 2024
1 parent c32a6a5 commit 9b53819
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 17 deletions.
3 changes: 1 addition & 2 deletions apps/ledger-live-desktop/tests/page/account.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ export class AccountPage extends AppPage {
private closeModal = this.page.getByTestId("modal-close-button");
private accountbutton = (accountName: string) =>
this.page.getByRole("button", { name: `${accountName}` });
private tokenRow = (tokenTicker: string) =>
this.page.locator(`data-test-id=token-row-${tokenTicker}`);
private tokenRow = (tokenTicker: string) => this.page.getByTestId(`token-row-${tokenTicker}`);
private addTokenButton = this.page.getByRole("button", { name: "Add token" });

@step("Navigate to token $0")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ export class AddAccountModal extends Modal {
private accountsList = this.page.getByTestId("add-accounts-step-import-accounts-list");
private stopButton = this.page.getByTestId("add-accounts-import-stop-button");
private doneButton = this.page.getByTestId("add-accounts-finish-close-button");
readonly closeButton = this.page.locator("data-test-id=modal-close-button");
private infoBox = this.page.locator("data-test-id=add-token-infoBox");
readonly closeButton = this.page.getByTestId("modal-close-button");
private infoBox = this.page.getByTestId("add-token-infoBox");
private successAddLabel = this.page.locator("text=Account added successfully");
private selectTokenNetwork = (token: Token) =>
this.page
.getByRole("option", {
name: `${token.tokenName} (${token.tokenTicker}) ${token.tokenNetwork}`,
})
.locator("span");
readonly continueButton = this.page.locator("data-test-id=modal-continue-button");
readonly continueButton = this.page.getByTestId("modal-continue-button");

@step("Select token $0")
async selectToken(token: Token) {
Expand Down
Empty file.
17 changes: 5 additions & 12 deletions apps/ledger-live-desktop/tests/specs/speculos/subAccount.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import test from "../../fixtures/common";
import { Token } from "../../enum/Tokens";
import { specs } from "../../utils/speculos";
import { Application } from "tests/page";
import { addTmsLink } from "tests/fixtures/common";

const tokens: Token[] = [
Expand All @@ -25,7 +24,7 @@ const tokensReceive: Token[] = [
];

for (const [i, token] of tokens.entries()) {
test.describe.parallel("Add subAccount without parent", () => {
test.describe("Add subAccount without parent", () => {
test.use({
userdata: "skip-onboarding",
testName: `add subAccount without parent (${token.tokenName})`,
Expand All @@ -34,12 +33,10 @@ for (const [i, token] of tokens.entries()) {
});

test(`Add Sub Account without parent (${token.parentAccount.currency.uiName})`, async ({
page,
app,
}) => {
addTmsLink(["B2CQA-2448", "B2CQA-1079"]);

const app = new Application(page);

await app.portfolio.openAddAccountModal();
await app.addAccount.expectModalVisiblity();

Expand Down Expand Up @@ -67,12 +64,10 @@ for (const [i, token] of tokensReceive.entries()) {
});

test(`[${token.tokenName}] Add subAccount when parent exists (${token.tokenNetwork})`, async ({
page,
app,
}) => {
addTmsLink(["B2CQA-640"]);

const app = new Application(page);

await app.layout.goToAccounts();
await app.accounts.navigateToAccountByName(token.parentAccount.accountName);
await app.account.expectAccountVisibility(token.parentAccount.accountName);
Expand All @@ -90,7 +85,7 @@ for (const [i, token] of tokensReceive.entries()) {
}

for (const [i, token] of tokens.entries()) {
test.describe.parallel("Token visible in parent account", () => {
test.describe("Token visible in parent account", () => {
test.use({
userdata: "speculos-subAccount",
testName: `Token visible in parent account (${token.parentAccount.currency.uiName})`,
Expand All @@ -99,12 +94,10 @@ for (const [i, token] of tokens.entries()) {
});

test(`Token visible in parent account (${token.parentAccount.currency.uiName})`, async ({
page,
app,
}) => {
addTmsLink(["B2CQA-1425"]);

const app = new Application(page);

await app.layout.goToAccounts();
await app.accounts.navigateToAccountByName(token.parentAccount.accountName);
await app.account.expectTokenToBePresent(token);
Expand Down

0 comments on commit 9b53819

Please sign in to comment.