From 3189ea6129886b4a35c8fd4d0dc5f830f11e3b18 Mon Sep 17 00:00:00 2001 From: marcosrdz Date: Sat, 23 Jan 2021 19:40:39 -0500 Subject: [PATCH 1/6] TST: e2e: watch-only -> receive (& receive with amount) --- tests/e2e/bluewallet.spec.js | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/tests/e2e/bluewallet.spec.js b/tests/e2e/bluewallet.spec.js index f58073ee9..047620508 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. then go to receive screen, set custom amount and label.', async () => { + it('can create wallet, reload app and it persists. then go to receive screen, set custom amount and label. Dismiss modal and go to WalletsList.', async () => { const lockFile = '/tmp/travislock.' + hashIt(jasmine.currentTest.fullName); if (process.env.TRAVIS) { if (require('fs').existsSync(lockFile)) @@ -547,6 +547,36 @@ describe('BlueWallet UI Tests', () => { process.env.TRAVIS && require('fs').writeFileSync(lockFile, '1'); }); + it('can import zpub as watch-only, go to transactions list, go into Receive modal, and set custom amount. Dismiss modal and go to WalletsList.', async () => { + const lockFile = '/tmp/travislock.' + hashIt(jasmine.currentTest.fullName); + if (process.env.TRAVIS) { + if (require('fs').existsSync(lockFile)) + return console.warn('skipping', JSON.stringify(jasmine.currentTest.fullName), 'as it previously passed on Travis'); + } + await helperImportWallet( + 'zpub6rDWXE4wbwefeCrHWehXJheXnti5F9PbpamDUeB5eFbqaY89x3jq86JADBuXpnJnSvRVwqkaTnyMaZERUg4BpxD9V4tSZfKeYh1ozPdL1xK', + 'Imported Watch-only', + '0.00030666 BTC', + ); + + await element(by.id('ReceiveButton')).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'); + }); + it('should handle URL successfully', async () => { const lockFile = '/tmp/travislock.' + hashIt(jasmine.currentTest.fullName); if (process.env.TRAVIS) { From 512fbe86e65c5f4e078101df7fb5e83178180600 Mon Sep 17 00:00:00 2001 From: marcosrdz Date: Thu, 28 Jan 2021 00:55:42 -0500 Subject: [PATCH 2/6] Update bluewallet.spec.js --- tests/e2e/bluewallet.spec.js | 45 +++++++++++------------------------- 1 file changed, 14 insertions(+), 31 deletions(-) diff --git a/tests/e2e/bluewallet.spec.js b/tests/e2e/bluewallet.spec.js index 070ab09b1..0015e178b 100644 --- a/tests/e2e/bluewallet.spec.js +++ b/tests/e2e/bluewallet.spec.js @@ -512,6 +512,19 @@ describe('BlueWallet UI Tests', () => { '0.00030666 BTC', ); + await element(by.id('ReceiveButton')).tap(); + await element(by.text(`No, and don't ask me again`)).tap(); + await element(by.id('BlueCopyTextToClipboard')).toHaveText('bc1qtc9zquvq7lgq87kzsgltvv4etwm9uxphfkvkay'); + 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 element(by.id('BlueCopyTextToClipboard')).toHaveText('bitcoin:bc1qtc9zquvq7lgq87kzsgltvv4etwm9uxphfkvkay?amount=1&label=Test'); + await device.pressBack(); + await element(by.id('SendButton')).tap(); await element(by.text('OK')).tap(); @@ -550,37 +563,7 @@ describe('BlueWallet UI Tests', () => { process.env.TRAVIS && require('fs').writeFileSync(lockFile, '1'); }); - - it('can import zpub as watch-only, go to transactions list, go into Receive modal, and set custom amount. Dismiss modal and go to WalletsList.', async () => { - const lockFile = '/tmp/travislock.' + hashIt(jasmine.currentTest.fullName); - if (process.env.TRAVIS) { - if (require('fs').existsSync(lockFile)) - return console.warn('skipping', JSON.stringify(jasmine.currentTest.fullName), 'as it previously passed on Travis'); - } - await helperImportWallet( - 'zpub6rDWXE4wbwefeCrHWehXJheXnti5F9PbpamDUeB5eFbqaY89x3jq86JADBuXpnJnSvRVwqkaTnyMaZERUg4BpxD9V4tSZfKeYh1ozPdL1xK', - 'Imported Watch-only', - '0.00030666 BTC', - ); - - await element(by.id('ReceiveButton')).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'); - }); - + it('should handle URL successfully', async () => { const lockFile = '/tmp/travislock.' + hashIt(jasmine.currentTest.fullName); if (process.env.TRAVIS) { From e91c3686ffa21acc17100b2f6e546d9e7d7fb535 Mon Sep 17 00:00:00 2001 From: marcosrdz Date: Thu, 28 Jan 2021 03:50:55 -0500 Subject: [PATCH 3/6] Update bluewallet.spec.js --- tests/e2e/bluewallet.spec.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/e2e/bluewallet.spec.js b/tests/e2e/bluewallet.spec.js index 0015e178b..9c4d050e1 100644 --- a/tests/e2e/bluewallet.spec.js +++ b/tests/e2e/bluewallet.spec.js @@ -513,7 +513,11 @@ describe('BlueWallet UI Tests', () => { ); await element(by.id('ReceiveButton')).tap(); - await element(by.text(`No, and don't ask me again`)).tap(); + try { + // in case emulator has no google services and doesnt support pushes + // we just dont show this popup + await element(by.text(`No, and don't ask me again`)).tap(); + } catch (_) {} await element(by.id('BlueCopyTextToClipboard')).toHaveText('bc1qtc9zquvq7lgq87kzsgltvv4etwm9uxphfkvkay'); await element(by.id('SetCustomAmountButton')).tap(); await element(by.id('BitcoinAmountInput')).typeText('1'); From 30fd47ab1153f46d52e7dad91d62b0b75319841b Mon Sep 17 00:00:00 2001 From: marcosrdz Date: Thu, 28 Jan 2021 04:52:18 -0500 Subject: [PATCH 4/6] Update bluewallet.spec.js --- tests/e2e/bluewallet.spec.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/e2e/bluewallet.spec.js b/tests/e2e/bluewallet.spec.js index 9c4d050e1..a9e6e7a8a 100644 --- a/tests/e2e/bluewallet.spec.js +++ b/tests/e2e/bluewallet.spec.js @@ -518,7 +518,7 @@ describe('BlueWallet UI Tests', () => { // we just dont show this popup await element(by.text(`No, and don't ask me again`)).tap(); } catch (_) {} - await element(by.id('BlueCopyTextToClipboard')).toHaveText('bc1qtc9zquvq7lgq87kzsgltvv4etwm9uxphfkvkay'); + await expect(element(by.id('BlueCopyTextToClipboard'))).toHaveText('bitcoin:bc1qtc9zquvq7lgq87kzsgltvv4etwm9uxphfkvkay'); await element(by.id('SetCustomAmountButton')).tap(); await element(by.id('BitcoinAmountInput')).typeText('1'); await element(by.id('CustomAmountDescription')).typeText('test'); @@ -526,7 +526,10 @@ describe('BlueWallet UI Tests', () => { await sup('1 BTC'); await sup('Test'); await yo('BitcoinAddressQRCodeContainer'); - await element(by.id('BlueCopyTextToClipboard')).toHaveText('bitcoin:bc1qtc9zquvq7lgq87kzsgltvv4etwm9uxphfkvkay?amount=1&label=Test'); + + await expect(element(by.id('BlueCopyTextToClipboard'))).toHaveText( + 'bitcoin:bc1qtc9zquvq7lgq87kzsgltvv4etwm9uxphfkvkay?amount=1&label=Test', + ); await device.pressBack(); await element(by.id('SendButton')).tap(); @@ -567,7 +570,7 @@ describe('BlueWallet UI Tests', () => { process.env.TRAVIS && require('fs').writeFileSync(lockFile, '1'); }); - + it('should handle URL successfully', async () => { const lockFile = '/tmp/travislock.' + hashIt(jasmine.currentTest.fullName); if (process.env.TRAVIS) { From ca082aa93ac13bc77fddb420878e2126de7b5756 Mon Sep 17 00:00:00 2001 From: marcosrdz Date: Thu, 28 Jan 2021 14:34:45 -0500 Subject: [PATCH 5/6] Update bluewallet.spec.js --- tests/e2e/bluewallet.spec.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/tests/e2e/bluewallet.spec.js b/tests/e2e/bluewallet.spec.js index a9e6e7a8a..e41cba84c 100644 --- a/tests/e2e/bluewallet.spec.js +++ b/tests/e2e/bluewallet.spec.js @@ -518,18 +518,16 @@ describe('BlueWallet UI Tests', () => { // we just dont show this popup await element(by.text(`No, and don't ask me again`)).tap(); } catch (_) {} - await expect(element(by.id('BlueCopyTextToClipboard'))).toHaveText('bitcoin:bc1qtc9zquvq7lgq87kzsgltvv4etwm9uxphfkvkay'); + await expect(element(by.text('bc1qtc9zquvq7lgq87kzsgltvv4etwm9uxphfkvkay'))).toBeVisible(); await element(by.id('SetCustomAmountButton')).tap(); await element(by.id('BitcoinAmountInput')).typeText('1'); - await element(by.id('CustomAmountDescription')).typeText('test'); + await element(by.id('CustomAmountDescription')).typeText('Test'); await element(by.id('CustomAmountSaveButton')).tap(); - await sup('1 BTC'); - await sup('Test'); + await expect(element(by.text('1 BTC'))).toBeVisible(); + await expect(element(by.text('Test'))).toBeVisible(); await yo('BitcoinAddressQRCodeContainer'); - await expect(element(by.id('BlueCopyTextToClipboard'))).toHaveText( - 'bitcoin:bc1qtc9zquvq7lgq87kzsgltvv4etwm9uxphfkvkay?amount=1&label=Test', - ); + await expect(element(by.text('bitcoin:bc1qtc9zquvq7lgq87kzsgltvv4etwm9uxphfkvkay?amount=1&label=Test'))).toBeVisible(); await device.pressBack(); await element(by.id('SendButton')).tap(); From 79d2c28ed88e42cec9d792f5ecb118e661401c52 Mon Sep 17 00:00:00 2001 From: marcosrdz Date: Thu, 28 Jan 2021 14:39:19 -0500 Subject: [PATCH 6/6] Update bluewallet.spec.js --- tests/e2e/bluewallet.spec.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/e2e/bluewallet.spec.js b/tests/e2e/bluewallet.spec.js index e41cba84c..387ea7185 100644 --- a/tests/e2e/bluewallet.spec.js +++ b/tests/e2e/bluewallet.spec.js @@ -518,6 +518,7 @@ describe('BlueWallet UI Tests', () => { // we just dont show this popup await element(by.text(`No, and don't ask me again`)).tap(); } catch (_) {} + await expect(element(by.id('BitcoinAddressQRCodeContainer'))).toBeVisible(); await expect(element(by.text('bc1qtc9zquvq7lgq87kzsgltvv4etwm9uxphfkvkay'))).toBeVisible(); await element(by.id('SetCustomAmountButton')).tap(); await element(by.id('BitcoinAmountInput')).typeText('1'); @@ -525,7 +526,8 @@ describe('BlueWallet UI Tests', () => { await element(by.id('CustomAmountSaveButton')).tap(); await expect(element(by.text('1 BTC'))).toBeVisible(); await expect(element(by.text('Test'))).toBeVisible(); - await yo('BitcoinAddressQRCodeContainer'); + await expect(element(by.id('BitcoinAddressQRCodeContainer'))).toBeVisible(); + await expect(element(by.text('bitcoin:bc1qtc9zquvq7lgq87kzsgltvv4etwm9uxphfkvkay?amount=1&label=Test'))).toBeVisible(); await device.pressBack();