diff --git a/suite-native/app/e2e/pageObjects/accountDetailActions.ts b/suite-native/app/e2e/pageObjects/accountDetailActions.ts index 9e2de003803..17891c4cecc 100644 --- a/suite-native/app/e2e/pageObjects/accountDetailActions.ts +++ b/suite-native/app/e2e/pageObjects/accountDetailActions.ts @@ -16,6 +16,10 @@ class AccountDetailActions { async openSend() { await element(by.id('@account-detail/send-button')).tap(); } + + async openReceive() { + await element(by.id('@account-detail/receive-button')).tap(); + } } export const onAccountDetail = new AccountDetailActions(); diff --git a/suite-native/app/e2e/pageObjects/accountReceiveActions.ts b/suite-native/app/e2e/pageObjects/accountReceiveActions.ts new file mode 100644 index 00000000000..bbc122e2f9c --- /dev/null +++ b/suite-native/app/e2e/pageObjects/accountReceiveActions.ts @@ -0,0 +1,26 @@ +import { expect as detoxExpect } from 'detox'; + +class accountReceiveActions { + async waitForScreen() { + await waitFor(element(by.id('@screen/ReceiveAccount'))).toBeVisible(); + } + + async clickShowAddressButton() { + const showAddressButton = element(by.id('@receive/show-address-button')); + + await waitFor(showAddressButton).toBeVisible().withTimeout(30000); + await showAddressButton.tap(); + + // button should be hidden after tap + await waitFor(showAddressButton).not.toBeVisible().withTimeout(30000); + } + + async verifyReceiveAddress(address: string) { + const receiveAddressText = element(by.id('@receive/confirmed-receive-address')); + + await waitFor(receiveAddressText).toBeVisible().withTimeout(30000); + detoxExpect(receiveAddressText).toHaveText(address); + } +} + +export const onAccountReceive = new accountReceiveActions(); diff --git a/suite-native/app/e2e/tests/receive.test.ts b/suite-native/app/e2e/tests/receive.test.ts new file mode 100644 index 00000000000..1e986893f31 --- /dev/null +++ b/suite-native/app/e2e/tests/receive.test.ts @@ -0,0 +1,39 @@ +import { conditionalDescribe } from '@suite-common/test-utils'; +import { TrezorUserEnvLink } from '@trezor/trezor-user-env-link'; + +import { onAccountDetail } from '../pageObjects/accountDetailActions'; +import { onAccountReceive } from '../pageObjects/accountReceiveActions'; +import { onAlertSheet } from '../pageObjects/alertSheetActions'; +import { onCoinEnablingInit } from '../pageObjects/coinEnablingActions'; +import { onHome } from '../pageObjects/homeActions'; +import { onMyAssets } from '../pageObjects/myAssetsActions'; +import { onOnboarding } from '../pageObjects/onboardingActions'; +import { onTabBar } from '../pageObjects/tabBarActions'; +import { disconnectTrezorUserEnv, openApp, prepareTrezorEmulator } from '../utils'; + +conditionalDescribe(device.getPlatform() === 'android', 'Receive', () => { + it('Generate device confirmed receive address.', async () => { + await prepareTrezorEmulator(); + await openApp({ newInstance: true }); + await onOnboarding.skipOnboarding(); + + await onCoinEnablingInit.waitForScreen(); + await onCoinEnablingInit.enableNetwork('btc'); + await onCoinEnablingInit.clickOnConfirmButton(); + await onAlertSheet.skipViewOnlyMode(); + + await onHome.waitForScreen(); + await onTabBar.navigateToMyAssets(); + + await onMyAssets.openAccountDetail({ accountName: 'Bitcoin #1' }); + + await onAccountDetail.openReceive(); + await onAccountReceive.waitForScreen(); + + await onAccountReceive.clickShowAddressButton(); + await TrezorUserEnvLink.pressYes(); + await onAccountReceive.verifyReceiveAddress('bc1qa55m6kz3crfse5xg2rukulyap4eyp75w0puawz'); + + disconnectTrezorUserEnv(); + }); +}); diff --git a/suite-native/qr-code/src/components/AddressQRCode.tsx b/suite-native/qr-code/src/components/AddressQRCode.tsx index cbe9e6a6cdc..1ed3b9e5cdb 100644 --- a/suite-native/qr-code/src/components/AddressQRCode.tsx +++ b/suite-native/qr-code/src/components/AddressQRCode.tsx @@ -39,7 +39,11 @@ export const AddressQRCode = ({ address }: AddressQRCodeProps) => { - + {address} diff --git a/suite-native/receive/src/components/ShowAddressButtons.tsx b/suite-native/receive/src/components/ShowAddressButtons.tsx index b9e40df2e85..b914b0fd57e 100644 --- a/suite-native/receive/src/components/ShowAddressButtons.tsx +++ b/suite-native/receive/src/components/ShowAddressButtons.tsx @@ -37,7 +37,12 @@ export const ShowAddressButtons = ({ onShowAddress }: ShowAddressButtonsProps) = return ( -