Skip to content

Commit

Permalink
test: adding steps
Browse files Browse the repository at this point in the history
  • Loading branch information
abdurrahman-ledger committed Dec 10, 2024
1 parent 3f0fcfe commit be061dc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion apps/ledger-live-mobile/e2e/page/speculos.page.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { expectValidAddressDevice } from "@ledgerhq/live-common/e2e/speculos";
import { Account } from "@ledgerhq/live-common/e2e/enum/Account";

export default class PasswordEntryPage {
export default class SpeculosPage {
@Step("Verify receive address correctness on device")
async expectValidAddressDevice(account: Account, addressDisplayed: string) {
await expectValidAddressDevice(account, addressDisplayed);
Expand Down
5 changes: 5 additions & 0 deletions apps/ledger-live-mobile/e2e/page/trade/receive.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ export default class ReceivePage {
await tapById(CurrencyRowId);
}

@Step("Accept to verify address")
async selectVerifyAddress() {
await waitForElementById(this.buttonVerifyAddressId);
await tapById(this.buttonVerifyAddressId);
Expand All @@ -102,6 +103,7 @@ export default class ReceivePage {
jestExpect(await getTextOfElement(this.accountAddress)).toEqual(address);
}

@Step("Get the fresh address displayed")
async getFreshAddressDisplayed() {
await waitForElementById(this.accountFreshAddress);
return await getTextOfElement(this.accountFreshAddress);
Expand Down Expand Up @@ -150,6 +152,7 @@ export default class ReceivePage {
return tapById(this.noVerifyValidateButton);
}

@Step("Expect account receive page is displayed")
async expectReceivePageIsDisplayed(tickerName: string, accountName: string) {
const receiveTitleTickerId = this.titleReceiveConfirmationPageId(tickerName);
const accountNameId = this.accountNameReceiveId(accountName);
Expand All @@ -159,6 +162,7 @@ export default class ReceivePage {
await expect(getElementById(accountNameId)).toBeVisible();
}

@Step("Expect given address is displayed on receive page")
async expectAdressIsCorrect(address: string) {
await expect(getElementById(this.accountAddress)).toHaveText(address);
}
Expand All @@ -168,6 +172,7 @@ export default class ReceivePage {
await expect(this.tronNewAddressWarning()).toHaveText(this.tronNewAddressWarningText);
}

@Step("Refuse to verify address")
async doNotVerifyAddress() {
await this.selectDontVerifyAddress();
await this.selectReconfirmDontVerify();
Expand Down

0 comments on commit be061dc

Please sign in to comment.