From 37705ca721355e77136f3afcbc1bcfae2d420a10 Mon Sep 17 00:00:00 2001 From: Petr Knetl Date: Mon, 7 Oct 2024 19:17:42 +0200 Subject: [PATCH] test(suite-native): regtest poc removed --- .../e2e/pageObjects/accountDetailActions.ts | 2 - .../app/e2e/pageObjects/alertSheetActions.ts | 16 +++---- suite-native/app/e2e/tests/regtestPOC.test.ts | 48 ------------------- suite-native/app/e2e/tests/send.test.ts | 1 - 4 files changed, 8 insertions(+), 59 deletions(-) delete mode 100644 suite-native/app/e2e/tests/regtestPOC.test.ts diff --git a/suite-native/app/e2e/pageObjects/accountDetailActions.ts b/suite-native/app/e2e/pageObjects/accountDetailActions.ts index 9396e38a151..9e2de003803 100644 --- a/suite-native/app/e2e/pageObjects/accountDetailActions.ts +++ b/suite-native/app/e2e/pageObjects/accountDetailActions.ts @@ -15,8 +15,6 @@ class AccountDetailActions { async openSend() { await element(by.id('@account-detail/send-button')).tap(); - - await detoxExpect(element(by.id('@screen/SendOutputs'))).toBeVisible(); } } diff --git a/suite-native/app/e2e/pageObjects/alertSheetActions.ts b/suite-native/app/e2e/pageObjects/alertSheetActions.ts index b6c3b110c69..b7ddc79050e 100644 --- a/suite-native/app/e2e/pageObjects/alertSheetActions.ts +++ b/suite-native/app/e2e/pageObjects/alertSheetActions.ts @@ -1,16 +1,16 @@ class AlertSheetActions { async tapPrimaryButton() { - await waitFor(element(by.id('@alert-sheet/primary-button'))) - .toBeVisible() - .withTimeout(10000); - await element(by.id('@alert-sheet/primary-button')).tap(); + const primaryButtonElement = element(by.id('@alert-sheet/primary-button')); + + await waitFor(primaryButtonElement).toBeVisible().withTimeout(10000); + await primaryButtonElement.tap(); } async tapSecondaryButton() { - await waitFor(element(by.id('@alert-sheet/secondary-button'))) - .toBeVisible() - .withTimeout(10000); - await element(by.id('@alert-sheet/secondary-button')).tap(); + const secondaryButtonElement = element(by.id('@alert-sheet/secondary-button')); + + await waitFor(secondaryButtonElement).toBeVisible().withTimeout(10000); + await secondaryButtonElement.tap(); } } diff --git a/suite-native/app/e2e/tests/regtestPOC.test.ts b/suite-native/app/e2e/tests/regtestPOC.test.ts deleted file mode 100644 index 80592468b76..00000000000 --- a/suite-native/app/e2e/tests/regtestPOC.test.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { expect as detoxExpect } from 'detox'; - -import { TrezorUserEnvLink } from '@trezor/trezor-user-env-link'; - -import { appIsFullyLoaded, openApp, restartApp } from '../utils'; -import { xpubs } from '../fixtures/xpubs'; -import { onAccountImport } from '../pageObjects/accountImportActions'; -import { onMyAssets } from '../pageObjects/myAssetsActions'; -import { onOnboarding } from '../pageObjects/onboardingActions'; -import { onHome } from '../pageObjects/homeActions'; - -// TODO: This is not a full test suite, just a proof of concept of regtest <---> suite-native integration. -// The suite will be extended/modified in the future by the QA team. -describe('Regtest integration proof of concept.', () => { - beforeAll(async () => { - await openApp({ newInstance: true }); - await onOnboarding.finishOnboarding(); - }); - - beforeEach(async () => { - await restartApp(); - await appIsFullyLoaded(); - }); - - it('Mine regtest transaction and check that it is present in the account transaction list.', async () => { - const amountToSend = 42; - - // send transaction of 42 BTC and mine it - await TrezorUserEnvLink.sendToAddressAndMineBlock({ - address: 'bcrt1qjf6qnquchwl6drvrf2ar73l6p9m3gzwlev9qd4', - btc_amount: amountToSend, - }); - - await onHome.tapSyncCoinsButton(); - - const accountName = 'Regtest #1'; - await onAccountImport.importAccount({ - networkSymbol: 'regtest', - xpub: xpubs.regtest, - accountName, - }); - - await onMyAssets.openAccountDetail({ accountName }); - - // Check if the transaction is present in the account transaction list. - await detoxExpect(element(by.text(`${amountToSend} BTC REGTEST`)).atIndex(0)).toBeVisible(); - }); -}); diff --git a/suite-native/app/e2e/tests/send.test.ts b/suite-native/app/e2e/tests/send.test.ts index 64505655e55..745978b543b 100644 --- a/suite-native/app/e2e/tests/send.test.ts +++ b/suite-native/app/e2e/tests/send.test.ts @@ -43,7 +43,6 @@ const prepareTransactionForOnDeviceReview = async (isFormEmpty: boolean = true) await onSendOutputsForm.submitForm(); - await onSendFees.selectFee('normal'); await onSendFees.submitFee(); };