Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[QAA] adding checks - B2CQA-2073 #8896

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,7 @@ const OperationD = (props: Props) => {
<Box mr={2}>
{hasFailed ? null : (
<CounterValue
data-testid="operation-amount"
alwaysShowSign
color="palette.text.shade60"
fontSize={3}
Expand Down Expand Up @@ -615,7 +616,9 @@ const OperationD = (props: Props) => {
</Box>

<TextEllipsis>
<Link onClick={goToMainAccount}>{name}</Link>
<Link data-testId="account-name" onClick={goToMainAccount}>
{name}
</Link>
</TextEllipsis>
<AccountTagDerivationMode account={account} />
</Box>
Expand All @@ -640,13 +643,13 @@ const OperationD = (props: Props) => {
{isNftOperation ? <NFTOperationDetails operation={operation} /> : null}
<OpDetailsSection>
<OpDetailsTitle>{t("operationDetails.date")}</OpDetailsTitle>
<OpDetailsData>{dateFormatted}</OpDetailsData>
<OpDetailsData data-testid="operation-date">{dateFormatted}</OpDetailsData>
</OpDetailsSection>
<B />
<OpDetailsSection>
<OpDetailsTitle>{t("operationDetails.identifier")}</OpDetailsTitle>
<OpDetailsData>
<HashContainer>
<HashContainer data-testid="operation-id">
<SplitAddress value={hash} />
</HashContainer>
<GradientHover>
Expand Down
39 changes: 39 additions & 0 deletions apps/ledger-live-desktop/tests/page/drawer/operation.drawer.ts
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 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();
}
}

@step("Close drawer")
async closeDrawer() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you don't need this method since it already exists in parent class

await this.close();
}
}
2 changes: 2 additions & 0 deletions apps/ledger-live-desktop/tests/page/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { NftGallery } from "./nftGallery.page";
import { AssetPage } from "./asset.page";
import { SettingsModal } from "tests/page/modal/settings.modal";
import { OnboardingPage } from "tests/page/onboarding.page";
import { OperationDrawer } from "./drawer/operation.drawer";

export class Application extends PageHolder {
public account = new AccountPage(this.page);
Expand Down Expand Up @@ -53,4 +54,5 @@ export class Application extends PageHolder {
public assetPage = new AssetPage(this.page);
public settingsModal = new SettingsModal(this.page);
public onboarding = new OnboardingPage(this.page);
public operationDrawer = new OperationDrawer(this.page);
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import { addTmsLink } from "tests/utils/allureUtils";
import { getDescription } from "../../utils/customJsonReporter";

const currencies = [
{ currency: Currency.BTC, xrayTicket: "B2CQA-2499, B2CQA-2644, B2CQA-2672, B2CQA-786" },
{
currency: Currency.BTC,
xrayTicket: "B2CQA-2499, B2CQA-2644, B2CQA-2672, B2CQA-786, B2CQA-2073",
},
{ currency: Currency.ETH, xrayTicket: "B2CQA-2503, B2CQA-929, B2CQA-2645, B2CQA-2673" },
{ currency: Currency.ETC, xrayTicket: "B2CQA-2502, B2CQA-2646, B2CQA-2674" },
{ currency: Currency.XRP, xrayTicket: "B2CQA-2505, B2CQA-2647, B2CQA-2675" },
Expand Down Expand Up @@ -53,6 +56,9 @@ for (const currency of currencies) {
await app.account.expectAccountVisibility(firstAccountName);
await app.account.expectAccountBalance();
await app.account.expectLastOperationsVisibility();
await app.account.clickOnLastOperation();
await app.operationDrawer.expectDrawerInfos(firstAccountName);
await app.operationDrawer.closeDrawer();
await app.account.expectAddressIndex(0);
await app.account.expectShowMoreButton();
},
Expand Down
Loading