Skip to content

Commit

Permalink
fix: updating Solana delegation + nft test
Browse files Browse the repository at this point in the history
  • Loading branch information
VicAlbr committed Dec 17, 2024
1 parent 2b68cf2 commit a6b4f07
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
4 changes: 4 additions & 0 deletions apps/ledger-live-desktop/tests/page/account.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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-']");
Expand Down Expand Up @@ -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();
}
}
Expand Down
15 changes: 13 additions & 2 deletions apps/ledger-live-desktop/tests/page/modal/delegate.modal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string> {
Expand Down Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
{
Expand All @@ -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",
},
{
Expand Down

0 comments on commit a6b4f07

Please sign in to comment.