-
Notifications
You must be signed in to change notification settings - Fork 327
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
61c4a4d
commit d01fe4d
Showing
17 changed files
with
158 additions
and
53 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
55 changes: 26 additions & 29 deletions
55
apps/ledger-live-mobile/e2e/page/accounts/account.page.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 |
---|---|---|
@@ -1,43 +1,40 @@ | ||
import { getElementById, getTextOfElement, scrollToId, tapByElement } from "../../helpers"; | ||
import { expect } from "detox"; | ||
import { | ||
currencyParam, | ||
openDeeplink, | ||
waitForElementById, | ||
getElementById, | ||
tapByElement, | ||
} from "../../helpers"; | ||
|
||
const baseLink = "account"; | ||
import jestExpect from "expect"; | ||
|
||
export default class AccountPage { | ||
accountSettingsButton = () => getElementById("accounts-settings"); | ||
assetBalance = () => getElementById("asset-graph-balance"); | ||
accountTitleId = (assetName: string) => `accounts-title-${assetName}`; | ||
accountAssetId = (assetName: string) => `account-assets-${assetName}`; | ||
|
||
async waitForAccountPageToLoad(assetName: string) { | ||
await waitForElementById(this.accountTitleId(assetName.toLowerCase())); | ||
} | ||
accountGraph = (accountId: string) => getElementById(`account-graph-${accountId}`); | ||
accountBalance = (accountId: string) => getElementById(`account-balance-${accountId}`); | ||
accountSettingsButton = () => getElementById("account-settings-button"); | ||
accountAdvancedLogRow = () => getElementById("account-advanced-log-row"); | ||
operationHistorySectionId = (accountId: string) => `operations-history-${accountId}`; | ||
accountScreenScrollView = "account-screen-scrollView"; | ||
accountAdvancedLogsId = "account-advanced-logs"; | ||
|
||
async expectAccountBalanceVisible() { | ||
await expect(this.assetBalance()).toBeVisible(); | ||
async openAccountSettings() { | ||
await tapByElement(this.accountSettingsButton()); | ||
} | ||
|
||
async expectAccountBalance(expectedBalance: string) { | ||
await expect(this.assetBalance()).toHaveText(expectedBalance); | ||
async openAccountAdvancedLogs() { | ||
await tapByElement(this.accountAdvancedLogRow()); | ||
} | ||
|
||
async waitForAccountAssetsToLoad(assetName: string) { | ||
await waitForElementById(this.accountTitleId(assetName)); | ||
await waitForElementById(this.accountAssetId(assetName)); | ||
async expectOperationHistoryVisible(accountId: string) { | ||
const id = this.operationHistorySectionId(accountId); | ||
await scrollToId(id, this.accountScreenScrollView); | ||
await expect(getElementById(id)).toBeVisible(); | ||
} | ||
|
||
async openViaDeeplink(currencyLong?: string) { | ||
const link = currencyLong ? baseLink + currencyParam + currencyLong : baseLink; | ||
await openDeeplink(link); | ||
async expectAccountBalanceVisible(accountId: string) { | ||
await expect(this.accountGraph(accountId)).toBeVisible(); | ||
await expect(this.accountBalance(accountId)).toBeVisible(); | ||
} | ||
|
||
async openAccountSettings() { | ||
await tapByElement(this.accountSettingsButton()); | ||
async expectAddressIndex(indexNumber: number) { | ||
await this.openAccountSettings(); | ||
await this.openAccountAdvancedLogs(); | ||
const advancedLogsText = await getTextOfElement(this.accountAdvancedLogsId); | ||
const advancedLogsJson = advancedLogsText ? JSON.parse(advancedLogsText) : null; | ||
jestExpect(advancedLogsJson).toHaveProperty("index", indexNumber); | ||
} | ||
} |
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
46 changes: 46 additions & 0 deletions
46
apps/ledger-live-mobile/e2e/page/accounts/assetAccounts.page.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,46 @@ | ||
import { expect } from "detox"; | ||
import { | ||
currencyParam, | ||
openDeeplink, | ||
waitForElementById, | ||
getElementById, | ||
scrollToId, | ||
tapById, | ||
} from "../../helpers"; | ||
|
||
const baseLink = "account"; | ||
|
||
export default class AssetAccountsPage { | ||
assetBalance = () => getElementById("asset-graph-balance"); | ||
titleId = (assetName: string) => `accounts-title-${assetName}`; | ||
accountAssetId = (assetName: string) => `account-assets-${assetName}`; | ||
accountRowId = (accountId: string) => `account-row-${accountId}`; | ||
accountNameRegExp = /account-row-name-.*/; | ||
|
||
async waitForAccountPageToLoad(assetName: string) { | ||
await waitForElementById(this.titleId(assetName.toLowerCase())); | ||
} | ||
|
||
async expectAccountsBalanceVisible() { | ||
await expect(this.assetBalance()).toBeVisible(); | ||
} | ||
|
||
async expectAccountsBalance(expectedBalance: string) { | ||
await expect(this.assetBalance()).toHaveText(expectedBalance); | ||
} | ||
|
||
async waitForAccountAssetsToLoad(assetName: string) { | ||
await waitForElementById(this.titleId(assetName)); | ||
await waitForElementById(this.accountAssetId(assetName)); | ||
} | ||
|
||
async openViaDeeplink(currencyLong?: string) { | ||
const link = currencyLong ? baseLink + currencyParam + currencyLong : baseLink; | ||
await openDeeplink(link); | ||
} | ||
|
||
async goToAccount(accountId: string) { | ||
await scrollToId(this.accountNameRegExp); | ||
await tapById(this.accountRowId(accountId)); | ||
} | ||
} |
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
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
Oops, something went wrong.