-
Notifications
You must be signed in to change notification settings - Fork 355
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Adding checks - add Account - B2CQA-2073
- Loading branch information
Showing
4 changed files
with
54 additions
and
4 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
39 changes: 39 additions & 0 deletions
39
apps/ledger-live-desktop/tests/page/drawer/operation.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,39 @@ | ||
import { step } from "tests/misc/reporters/step"; | ||
import { Drawer } from "tests/component/drawer.component"; | ||
import { expect } from "@playwright/test"; | ||
|
||
export class OperationDrawer extends Drawer { | ||
readonly drawer = this.page.getByTestId("drawer-content"); | ||
readonly transactionIdLabel = this.page.getByText("Transaction ID"); | ||
readonly transactionIdValue = this.page.getByTestId("operation-id"); | ||
readonly dateLabel = this.page.getByText("Date"); | ||
readonly dateValue = this.page.getByTestId("operation-date"); | ||
readonly amountLabel = this.page.getByText("Amount", { exact: true }); | ||
readonly amountValue = this.page.getByTestId("operation-amount"); | ||
readonly transactionType = this.page.getByTestId("transaction-type"); | ||
readonly drawerCloseButton = this.page.getByTestId("drawer-close-button"); | ||
readonly accountName = this.page.getByTestId("account-name"); | ||
|
||
@step("Verify drawer information") | ||
async expectDrawerInfos(accountName: string) { | ||
await expect(this.drawer).toBeVisible(); | ||
const transactionType = await this.transactionType.textContent(); | ||
await expect(this.transactionType).toBeVisible(); | ||
await expect(this.accountName).toHaveText(accountName); | ||
await expect(this.dateLabel).toBeVisible(); | ||
expect(await this.dateValue.textContent()).toMatch( | ||
/^\d{1,2}\/\d{1,2}\/\d{4}, \d{1,2}:\d{2} (AM|PM)$/, | ||
); | ||
await expect(this.transactionIdLabel).toBeVisible(); | ||
expect(await this.transactionIdValue.textContent()).toMatch(/^[a-zA-Z0-9+/=]{40,}$/); | ||
if (transactionType !== "NFT Received") { | ||
await expect(this.amountLabel).toBeVisible(); | ||
expect(await this.amountValue.textContent()).toMatch(/^[+-]?\$\d+\.\d{2}$/); | ||
} | ||
} | ||
|
||
@step("Close drawer") | ||
async closeDrawer() { | ||
await this.drawerCloseButton.click(); | ||
} | ||
} |
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