diff --git a/e2e/02_preexisting.test.js b/e2e/02_preexisting.test.js index 47cfbc887..19fd585f5 100644 --- a/e2e/02_preexisting.test.js +++ b/e2e/02_preexisting.test.js @@ -1,27 +1,12 @@ -const { log, device, by, element } = require('detox'); - -describe('Example', () => { - beforeAll(async () => { - await device.launchApp(); - }); - - beforeEach(async () => { - await device.reloadReactNative(); - }); +import { loadTestWallet } from "./loadTestWallet.js"; +describe('Renders wallet data correctly.', () => { // i just pulled this seed out of thin air - it('loads my test wallet', async () => { - await element(by.id("loadingapp.restorewalletseed")).tap(); - await element(by.id("seed.seedplaceholder")).replaceText( - 'lottery multiply patient simple ivory leisure swift square west despair beauty match crowd margin reject box always title photo remind word diet ecology badge' - ); - await element(by.id("birthdayinput")).replaceText('1994579'); - await element(by.text("RESTORE WALLET")).tap(); - }); + it('loads my test wallet', loadTestWallet); // there is a transaction in this plant at 1994580, 1 block after the "birthday". it('synks 1 block and renders a transaction. this should take less than a minute, but will time out after 16 minutes', async () => { - await waitFor(element(by.id("transactionList.1"))).toBeVisible().withTimeout(1000000) + await waitFor(element(by.id("transactionList.1"))).toBeVisible().withTimeout(sync_timeout) await element(by.id("transactionList.1")).tap(); // we will test various attributes of this transaction once we testID them }); diff --git a/e2e/03_new_wallet.test.js b/e2e/03_new_wallet.test.js index c54b4dbf2..d06f4b780 100644 --- a/e2e/03_new_wallet.test.js +++ b/e2e/03_new_wallet.test.js @@ -1,9 +1,6 @@ const { log, device, by, element } = require('detox'); describe('Example', () => { - beforeAll(async () => { - await device.launchApp(); - }); it('New wallet button works', async () => { let newWalletButton = element(by.text('CREATE NEW WALLET (NEW SEED)')); diff --git a/e2e/jest.config.js b/e2e/jest.config.js index 4f980203f..b2cbe6442 100644 --- a/e2e/jest.config.js +++ b/e2e/jest.config.js @@ -2,11 +2,15 @@ module.exports = { rootDir: '..', testMatch: ['/e2e/**/*.test.js'], - testTimeout: 120000, + testTimeout: 1000000, maxWorkers: 1, globalSetup: 'detox/runners/jest/globalSetup', globalTeardown: 'detox/runners/jest/globalTeardown', reporters: ['detox/runners/jest/reporter'], testEnvironment: 'detox/runners/jest/testEnvironment', verbose: true, + globals: { + sync_timeout: 1000000 + }, + setupFilesAfterEnv: ['/e2e/setup-jest.js'] }; diff --git a/e2e/loadTestWallet.js b/e2e/loadTestWallet.js new file mode 100644 index 000000000..a03fe9114 --- /dev/null +++ b/e2e/loadTestWallet.js @@ -0,0 +1,11 @@ + +let loadTestWallet = async () => { + await element(by.id("loadingapp.restorewalletseed")).tap(); + await element(by.id("seed.seedplaceholder")).replaceText( + 'lottery multiply patient simple ivory leisure swift square west despair beauty match crowd margin reject box always title photo remind word diet ecology badge' + ); + await element(by.id("birthdayinput")).replaceText('1994579'); + await element(by.text("RESTORE WALLET")).tap(); +} + +export { loadTestWallet }; \ No newline at end of file diff --git a/e2e/new_checkbox_send.test.js b/e2e/new_checkbox_send.test.js index 93fa30871..0ef32a0fc 100644 --- a/e2e/new_checkbox_send.test.js +++ b/e2e/new_checkbox_send.test.js @@ -1,22 +1,13 @@ const { log, device, by, element } = require('detox'); -describe('Example', () => { - beforeAll(async () => { - await device.launchApp(); - }); +import { loadTestWallet } from "./loadTestWallet.js"; - beforeEach(async () => { - // await device.reloadReactNative(); - }); - it('Checkbox send screen -> include UA in memo field', async () => { - await element(by.id('loadingapp.restorewalletseed')).tap(); - await element(by.id('seed.seedplaceholder')).replaceText( - 'lottery multiply patient simple ivory leisure swift square west despair beauty match crowd margin reject box always title photo remind word diet ecology badge', - ); - await element(by.id('birthdayinput')).replaceText('1985000'); - await element(by.text('RESTORE WALLET')).tap(); +describe('Example', () => { + it('loads a test wallet', loadTestWallet); + + it('Checkbox send screen -> include UA in memo field', async () => { await element(by.text('SEND')).tap(); await element(by.id('send.addressplaceholder')).replaceText( 'u1lx7nlnqqqs7p4hcqz4hyjgnw7h8zskcgr2f8dfhm96np0gnfdzu7jtms7q2pxd7ufy96wxzdsdy65jvp3td7fj2ltcz0jpak86ddyszl9ykn5s86q3xataya5867z3tj2x8cw0ljyrenymr2gcqmjf50gmexqj233yn3kdaxn2yukwcx87emurufakf82wapgnu5h3fvae6aw9uus2r', diff --git a/e2e/setup-jest.js b/e2e/setup-jest.js new file mode 100644 index 000000000..27c5efd46 --- /dev/null +++ b/e2e/setup-jest.js @@ -0,0 +1,7 @@ +beforeAll(async () => { + await device.launchApp(); +}); + +beforeEach(async () => { + await device.reloadReactNative(); +});