Update bluewallet.spec.js

This commit is contained in:
Marcos Rodriguez Velez 2024-08-11 20:39:05 -04:00
parent b4b7adbea6
commit b1e8182d27

View File

@ -250,12 +250,14 @@ describe('BlueWallet UI Tests - no wallets', () => {
// first, trying to mistype second password:
await element(by.type('android.widget.CompoundButton')).tap(); // thats a switch lol. lets tap it
await element(by.id('IUnderstandButton')).tap();
if (process.env.TRAVIS) await sleep(3000); // hopefully helps prevent crash
await element(by.id('PasswordInput')).typeText('08902');
await element(by.id('PasswordInput')).tapReturnKey();
await element(by.id('ConfirmPasswordInput')).typeText('666');
await element(by.id('ConfirmPasswordInput')).tapReturnKey();
await element(by.id('OKButton')).tap();
if (process.env.TRAVIS) await sleep(3000); // hopefully helps prevent crash
// now, lets put correct passwords and encrypt the storage
await element(by.id('PasswordInput')).clearText();
@ -265,6 +267,7 @@ describe('BlueWallet UI Tests - no wallets', () => {
await element(by.id('ConfirmPasswordInput')).typeText('qqq');
await element(by.id('ConfirmPasswordInput')).tapReturnKey();
await element(by.id('OKButton')).tap();
if (process.env.TRAVIS) await sleep(3000); // hopefully helps prevent crash
// relaunch app
await device.launchApp({ newInstance: true });
@ -298,8 +301,10 @@ describe('BlueWallet UI Tests - no wallets', () => {
// trying to enable plausible denability
await element(by.id('CreateFakeStorageButton')).tap();
if (process.env.TRAVIS) await sleep(3000); // hopefully helps prevent crash
await expect(element(by.text('Password for the fake storage should not match the password for your main storage.'))).toBeVisible();
await element(by.id('IUnderstandButton')).tap();
if (process.env.TRAVIS) await sleep(3000); // hopefully helps prevent crash
// trying MAIN password: should fail, obviously
await element(by.id('PasswordInput')).typeText('qqq');
@ -307,6 +312,7 @@ describe('BlueWallet UI Tests - no wallets', () => {
await element(by.id('ConfirmPasswordInput')).typeText('qqq');
await element(by.id('ConfirmPasswordInput')).tapReturnKey();
await element(by.id('OKButton')).tap();
if (process.env.TRAVIS) await sleep(3000); // hopefully helps prevent crash
await expect(element(by.text('Password is currently in use. Please try a different password.'))).toBeVisible();
if (process.env.TRAVIS) await sleep(3000); // hopefully helps prevent crash
await element(by.text('OK')).tap();
@ -321,6 +327,7 @@ describe('BlueWallet UI Tests - no wallets', () => {
await element(by.id('ConfirmPasswordInput')).typeText('passwordForFakeStorageWithTypo'); // retyping with typo
await element(by.id('ConfirmPasswordInput')).tapReturnKey();
await element(by.id('OKButton')).tap();
if (process.env.TRAVIS) await sleep(3000); // hopefully helps prevent crash
// trying new password
await element(by.id('PasswordInput')).clearText();
@ -330,6 +337,7 @@ describe('BlueWallet UI Tests - no wallets', () => {
await element(by.id('ConfirmPasswordInput')).typeText('passwordForFakeStorage'); // retyping
await element(by.id('ConfirmPasswordInput')).tapReturnKey();
await element(by.id('OKButton')).tap();
if (process.env.TRAVIS) await sleep(3000); // hopefully helps prevent crash
// created fake storage.
// creating a wallet inside this fake storage
@ -372,6 +380,7 @@ describe('BlueWallet UI Tests - no wallets', () => {
await element(by.text('OK')).tap();
await element(by.id('PasswordInput')).typeText('passwordForFakeStorage');
await element(by.id('OKButton')).tap();
if (process.env.TRAVIS) await sleep(3000); // hopefully helps prevent crash
await helperDeleteWallet('fake_wallet');
@ -396,24 +405,29 @@ describe('BlueWallet UI Tests - no wallets', () => {
// lets encrypt the storage.
// lets put correct passwords and encrypt the storage
await element(by.type('android.widget.CompoundButton')).tap(); // thats a switch lol
if (process.env.TRAVIS) await sleep(3000); // hopefully helps prevent crash
await element(by.id('IUnderstandButton')).tap();
if (process.env.TRAVIS) await sleep(3000); // hopefully helps prevent crash
await element(by.id('PasswordInput')).clearText();
await element(by.id('PasswordInput')).typeText('pass');
await element(by.id('PasswordInput')).tapReturnKey();
await element(by.id('ConfirmPasswordInput')).typeText('pass');
await element(by.id('ConfirmPasswordInput')).tapReturnKey();
await element(by.id('OKButton')).tap();
if (process.env.TRAVIS) await sleep(3000); // hopefully helps prevent crash
await element(by.id('PlausibleDeniabilityButton')).tap();
// trying to enable plausible denability
await element(by.id('CreateFakeStorageButton')).tap();
if (process.env.TRAVIS) await sleep(3000); // hopefully helps prevent crash
await element(by.id('IUnderstandButton')).tap();
if (process.env.TRAVIS) await sleep(3000); // hopefully helps prevent crash
await element(by.id('PasswordInput')).typeText('fake');
await element(by.id('PasswordInput')).tapReturnKey();
await element(by.id('ConfirmPasswordInput')).typeText('fake'); // retyping
await element(by.id('ConfirmPasswordInput')).tapReturnKey();
await element(by.id('OKButton')).tap();
if (process.env.TRAVIS) await sleep(3000); // hopefully helps prevent crash
// created fake storage.
// creating a wallet inside this fake storage
await helperCreateWallet('fake_wallet');
@ -442,11 +456,13 @@ describe('BlueWallet UI Tests - no wallets', () => {
await element(by.id('PasswordInput')).typeText('fake');
await element(by.id('PasswordInput')).tapReturnKey();
await element(by.id('OKButton')).tap();
if (process.env.TRAVIS) await sleep(3000); // hopefully helps prevent crash
// correct password
await element(by.ic('PasswordInput')).clearText();
await element(by.id('PasswordInput')).typeText('pass');
await element(by.id('PasswordInput')).tapReturnKey();
await element(by.id('OKButton')).tap();
if (process.env.TRAVIS) await sleep(3000); // hopefully helps prevent crash
// relaunch app
await device.launchApp({ newInstance: true });