From 35fd560702e23f8827f3d70d69cac47b49dcbaa8 Mon Sep 17 00:00:00 2001 From: marcosrdz Date: Fri, 22 Jan 2021 23:50:52 -0500 Subject: [PATCH] TST: e2e: create bip84 -> receive (& receive with amount) --- BlueComponents.js | 2 +- screen/receive/details.js | 16 +++++++++++----- screen/wallets/transactions.js | 1 + tests/e2e/bluewallet.spec.js | 18 +++++++++++++++++- 4 files changed, 30 insertions(+), 7 deletions(-) diff --git a/BlueComponents.js b/BlueComponents.js index 33e693711..4efcfa048 100644 --- a/BlueComponents.js +++ b/BlueComponents.js @@ -574,7 +574,7 @@ export class BlueCopyTextToClipboard extends Component { render() { return ( - + {this.state.address} diff --git a/screen/receive/details.js b/screen/receive/details.js index 4f6e9231a..58d455707 100644 --- a/screen/receive/details.js +++ b/screen/receive/details.js @@ -138,15 +138,15 @@ const ReceiveDetails = () => { {isCustom && ( <> - + {getDisplayAmount()} - + {customLabel} )} - + { - + @@ -302,11 +302,17 @@ const ReceiveDetails = () => { value={customLabel || ''} numberOfLines={1} style={styles.customAmountText} + testID="CustomAmountDescription" /> - + diff --git a/screen/wallets/transactions.js b/screen/wallets/transactions.js index ac7b73c2b..a1074c3ae 100644 --- a/screen/wallets/transactions.js +++ b/screen/wallets/transactions.js @@ -678,6 +678,7 @@ const WalletTransactions = () => { {wallet.current.allowReceive() && ( { if (wallet.current.chain === Chain.OFFCHAIN) { diff --git a/tests/e2e/bluewallet.spec.js b/tests/e2e/bluewallet.spec.js index 49cb48ac9..f58073ee9 100644 --- a/tests/e2e/bluewallet.spec.js +++ b/tests/e2e/bluewallet.spec.js @@ -31,7 +31,7 @@ describe('BlueWallet UI Tests', () => { process.env.TRAVIS && require('fs').writeFileSync(lockFile, '1'); }); - it('can create wallet, reload app and it persists', async () => { + it('can create wallet, reload app and it persists. then go to receive screen, set custom amount and label.', async () => { const lockFile = '/tmp/travislock.' + hashIt(jasmine.currentTest.fullName); if (process.env.TRAVIS) { if (require('fs').existsSync(lockFile)) @@ -44,6 +44,22 @@ describe('BlueWallet UI Tests', () => { await device.launchApp({ newInstance: true }); await yo('WalletsList'); await expect(element(by.id('cr34t3d'))).toBeVisible(); + await element(by.id('cr34t3d')).tap(); + await element(by.id('ReceiveButton')).tap(); + await element(by.text('Yes, I have')).tap(); + await element(by.text(`No, and don't ask me again`)).tap(); + await yo('BitcoinAddressQRCodeContainer'); + await yo('BlueCopyTextToClipboard'); + await element(by.id('SetCustomAmountButton')).tap(); + await element(by.id('BitcoinAmountInput')).typeText('1'); + await element(by.id('CustomAmountDescription')).typeText('test'); + await element(by.id('CustomAmountSaveButton')).tap(); + await sup('1 BTC'); + await sup('test'); + await yo('BitcoinAddressQRCodeContainer'); + await yo('BlueCopyTextToClipboard'); + await device.pressBack(); + await device.pressBack(); process.env.TRAVIS && require('fs').writeFileSync(lockFile, '1'); });