From a6b4f07c0e4835077dc15bfb994c072f6adc9ca7 Mon Sep 17 00:00:00 2001 From: Victor Alber Date: Tue, 17 Dec 2024 14:59:36 +0100 Subject: [PATCH] fix: updating Solana delegation + nft test --- .../tests/page/account.page.ts | 4 ++++ .../tests/page/modal/delegate.modal.ts | 15 +++++++++++++-- .../tests/specs/speculos/delegate.spec.ts | 4 ++-- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/apps/ledger-live-desktop/tests/page/account.page.ts b/apps/ledger-live-desktop/tests/page/account.page.ts index 869476d40682..d2e921115137 100644 --- a/apps/ledger-live-desktop/tests/page/account.page.ts +++ b/apps/ledger-live-desktop/tests/page/account.page.ts @@ -23,6 +23,7 @@ export class AccountPage extends AppPage { private accountBalance = this.page.getByTestId("total-balance"); private operationList = this.page.locator("id=operation-list"); private showMoreButton = this.page.getByText("Show more"); + private seeMoreCollectionsButton = this.page.getByText("See more collections"); private advancedButton = this.page.getByText("Advanced"); private accountAdvancedLogs = this.page.getByTestId("Advanced_Logs"); private operationRows = this.page.locator("[data-testid^='operation-row-']"); @@ -187,6 +188,9 @@ export class AccountPage extends AppPage { for (const nft of account.nft) { const nftLocator = this.nftList(nft.collectionName); + if (await this.seeMoreCollectionsButton.isVisible()) { + await this.seeMoreCollectionsButton.click(); + } await expect(nftLocator).toBeVisible(); } } diff --git a/apps/ledger-live-desktop/tests/page/modal/delegate.modal.ts b/apps/ledger-live-desktop/tests/page/modal/delegate.modal.ts index 3fd06964e7e9..5e6287221e71 100644 --- a/apps/ledger-live-desktop/tests/page/modal/delegate.modal.ts +++ b/apps/ledger-live-desktop/tests/page/modal/delegate.modal.ts @@ -14,7 +14,9 @@ export class delegateModal extends Modal { this.page.getByTestId(`stake-provider-container-${stakeProviderID}`); private detailsButton = this.page.getByRole("button", { name: "View details" }); private validatorTC = this.page.getByTestId("ledger-validator-tc"); - private checkIcon = this.page.getByTestId("check-icon"); + private checkIcon = this.page + .getByTestId("check-icon") + .locator('path[fill]:not([fill="transparent"])'); @step("Get title provider on row $0") async getTitleProvider(row: number): Promise { @@ -83,11 +85,20 @@ export class delegateModal extends Modal { await this.inputSearchField.fill(provider); } + @step("Get selected provider name ") + async getSelectedProviderName() { + const selectedProviderElement = await this.rowProvider.filter({ + has: this.checkIcon, + }); + const providerName = await selectedProviderElement.locator(this.titleProvider).textContent(); + return providerName; + } + @step("Check selected provider is displayed when closing list") async closeProviderList(providerRow: number) { const selectedfProvider = await this.getTitleProvider(providerRow); await this.searchCloseButton.click(); - expect(await this.getTitleProvider(1)).toContain(selectedfProvider); + expect(await this.getSelectedProviderName()).toContain(selectedfProvider); } @step("Click on chosen stake provider $0") diff --git a/apps/ledger-live-desktop/tests/specs/speculos/delegate.spec.ts b/apps/ledger-live-desktop/tests/specs/speculos/delegate.spec.ts index 2d6f5ee619c1..e17fc08a97d6 100644 --- a/apps/ledger-live-desktop/tests/specs/speculos/delegate.spec.ts +++ b/apps/ledger-live-desktop/tests/specs/speculos/delegate.spec.ts @@ -13,7 +13,7 @@ const e2eDelegationAccounts = [ xrayTicket: "B2CQA-2740, B2CQA-2770", }, { - delegate: new Delegate(Account.SOL_1, "0.001", "Ledger by Chorus One"), + delegate: new Delegate(Account.SOL_1, "0.001", "Ledger by Figment"), xrayTicket: "B2CQA-2742", }, { @@ -28,7 +28,7 @@ const validators = [ xrayTicket: "B2CQA-2731, B2CQA-2763", }, { - delegate: new Delegate(Account.SOL_2, "0.001", "Ledger by Chorus One"), + delegate: new Delegate(Account.SOL_2, "0.001", "Ledger by Figment"), xrayTicket: "B2CQA-2730, B2CQA-2764", }, {