-
Notifications
You must be signed in to change notification settings - Fork 324
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[QAA-261] Adding E2E delegation scenario for LLD (NEAR, SOLANA, COSMO…
…S) (#8033) * test: ✅ Adding delegate E2E test scenario * style: 🚚 Rename variable + answer PR coms * test: ♻️ Refacto modal and drawer components for e2e tests
- Loading branch information
Showing
26 changed files
with
277 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { Account } from "../enum/Account"; | ||
|
||
export class Delegate { | ||
constructor( | ||
public account: Account, | ||
public amount: string, | ||
public provider: string, | ||
) {} | ||
} |
50 changes: 50 additions & 0 deletions
50
apps/ledger-live-desktop/tests/page/drawer/delegate.drawer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { step } from "tests/misc/reporters/step"; | ||
import { Drawer } from "tests/component/drawer.component"; | ||
import { Currency } from "tests/enum/Currency"; | ||
import { Delegate } from "tests/models/Delegate"; | ||
import { expect } from "@playwright/test"; | ||
import { Transaction } from "tests/models/Transaction"; | ||
|
||
export class DelegateDrawer extends Drawer { | ||
private provider = (provider: string) => | ||
this.page.getByTestId("drawer-content").locator(`text=${provider}`); | ||
private amountValue = this.page.getByTestId("amountReceived-drawer"); | ||
private transactionType = this.page.getByTestId("transaction-type"); | ||
private addressValue = (address: string) => | ||
this.page.locator('[data-testid="drawer-content"]').locator(`text=${address}`); | ||
|
||
@step("Verify address $0 is visible") | ||
async addressValueIsVisible(address: string) { | ||
await expect(this.addressValue(address)).toBeVisible(); | ||
} | ||
|
||
@step("Verify provider is visible") | ||
async providerIsVisible(account: Delegate) { | ||
if (account.account.currency === Currency.ATOM) { | ||
await expect(this.provider(account.provider)).toBeVisible(); | ||
} | ||
} | ||
|
||
@step("Verify amount is visible") | ||
async amountValueIsVisible() { | ||
await expect(this.amountValue).toBeVisible(); | ||
} | ||
|
||
@step("Verify transaction type is correct") | ||
async transactionTypeIsVisible() { | ||
await expect(this.transactionType).toBeVisible(); | ||
} | ||
|
||
@step("Verify that the information of the transaction is visible") | ||
async expectReceiverInfos(tx: Transaction) { | ||
await expect(this.addressValue(tx.accountToCredit.address)).toBeVisible(); | ||
await expect(this.amountValue).toBeVisible(); | ||
} | ||
|
||
@step("Verify that the information of the delegation is visible") | ||
async expectDelegationInfos(delegationInfo: Delegate) { | ||
await this.providerIsVisible(delegationInfo); | ||
await this.amountValueIsVisible(); | ||
await this.transactionTypeIsVisible(); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
apps/ledger-live-desktop/tests/page/drawer/ledger.sync.drawer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { step } from "tests/misc/reporters/step"; | ||
import { Drawer } from "tests/component/drawer.component"; | ||
import { expect } from "@playwright/test"; | ||
import { Transaction } from "tests/models/Transaction"; | ||
|
||
export class SendDrawer extends Drawer { | ||
private addressValue = (address: string) => | ||
this.page.locator('[data-testid="drawer-content"]').locator(`text=${address}`); | ||
private amountValue = this.page.getByTestId("amountReceived-drawer"); | ||
|
||
@step("Verify address is visible") | ||
async addressValueIsVisible(address: string) { | ||
await expect(this.addressValue(address)).toBeVisible(); | ||
} | ||
|
||
@step("Verify that the information of the transaction is visible") | ||
async expectReceiverInfos(tx: Transaction) { | ||
await expect(this.addressValue(tx.accountToCredit.address)).toBeVisible(); | ||
await expect(this.amountValue).toBeVisible(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.