-
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.
Merge pull request #8896 from LedgerHQ/support/addingChecks-addAccount
[QAA] adding checks - B2CQA-2073
- Loading branch information
Showing
10 changed files
with
56 additions
and
11 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
34 changes: 34 additions & 0 deletions
34
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,34 @@ | ||
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 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 accountName = this.page.getByTestId("account-name"); | ||
|
||
@step("Verify drawer information") | ||
async expectDrawerInfos(accountName: string) { | ||
await this.waitForDrawerToBeVisible(); | ||
const transactionType = await this.transactionType.textContent(); | ||
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}$/); | ||
} else { | ||
await expect(this.amountLabel).not.toBeVisible(); | ||
expect(this.amountValue).not.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
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