TST: e2e tests for storage encryption

This commit is contained in:
Overtorment 2020-03-19 16:55:35 +00:00
parent fa71892525
commit 32d054d923
4 changed files with 9 additions and 18 deletions

View File

@ -20,4 +20,4 @@ jobs:
- node_modules
# run tests!
- run: npm run test
- run: npm t || npm t

View File

@ -57,10 +57,9 @@ describe('BlueWallet UI Tests', () => {
// relaunch app
await device.terminateApp();
await device.launchApp({ newInstance: true });
await sleep(2000);
await waitFor(element(by.text('OK')))
.toBeVisible()
.withTimeout(4000);
.withTimeout(33000);
// trying to decrypt with wrong password
await expect(element(by.text('Your storage is encrypted. Password is required to decrypt it'))).toBeVisible();
@ -126,10 +125,9 @@ describe('BlueWallet UI Tests', () => {
// relaunch app
await device.terminateApp();
await device.launchApp({ newInstance: true });
await sleep(2000);
await waitFor(element(by.text('OK')))
.toBeVisible()
.withTimeout(4000);
.withTimeout(33000);
//
await expect(element(by.text('Your storage is encrypted. Password is required to decrypt it'))).toBeVisible();
await element(by.type('android.widget.EditText')).typeText('qqq');
@ -169,7 +167,7 @@ async function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
async function yo(id, timeout = 10000) {
async function yo(id, timeout = 33000) {
return waitFor(element(by.id(id)))
.toBeVisible()
.withTimeout(timeout);
@ -178,23 +176,16 @@ async function yo(id, timeout = 10000) {
async function helperCreateWallet(walletName) {
await element(by.id('CreateAWallet')).tap();
await element(by.id('WalletNameInput')).typeText(walletName || 'cr34t3d');
await waitFor(element(by.id('ActivateBitcoinButton')))
.toBeVisible()
.withTimeout(5000);
await yo('ActivateBitcoinButton');
await element(by.id('ActivateBitcoinButton')).tap();
await element(by.id('ActivateBitcoinButton')).tap();
// why tf we need 2 taps for it to work..? mystery
await element(by.id('Create')).tap();
await waitFor(element(by.id('PleaseBackupScrollView')))
.toBeVisible()
.withTimeout(5000);
await yo('PleaseBackupScrollView');
await element(by.id('PleaseBackupScrollView')).swipe('up', 'fast', 1); // in case emu screen is small and it doesnt fit
await waitFor(element(by.id('PleasebackupOk')))
.toBeVisible()
.withTimeout(5000);
await yo('PleasebackupOk');
await element(by.id('PleasebackupOk')).tap();
await expect(element(by.id('WalletsList'))).toBeVisible();
await expect(element(by.id(walletName || 'cr34t3d'))).toBeVisible();

View File

@ -17,7 +17,7 @@ jasmine.getEnv().addReporter(specReporter);
jasmine.getEnv().addReporter(assignReporter);
// Set the default timeout
jest.setTimeout(180000);
jest.setTimeout(600000); // 10 min
beforeAll(async () => {
await detox.init(config, { launchApp: false });

View File

@ -30,7 +30,7 @@ describe('Watch only wallet', () => {
let w = new WatchOnlyWallet();
w.setSecret('167zK5iZrs1U6piDqubD3FjRqUTM2CZnb8');
await w.fetchTransactions();
assert.ok(w.getTransactions().length >= 215);
assert.ok(w.getTransactions().length >= 215, w.getTransactions().length);
// should be 233 but electrum server cant return huge transactions >.<
w = new WatchOnlyWallet();