Skip to content

Commit

Permalink
fix: android tests
Browse files Browse the repository at this point in the history
  • Loading branch information
limpbrains committed Jun 14, 2024
1 parent e108563 commit 19557b1
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 15 deletions.
2 changes: 1 addition & 1 deletion e2e/backup.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ d('Backup', () => {
await element(by.id('TagInput')).replaceText(tag);
await element(by.id('TagInput')).tapReturnKey();
await sleep(200); // animation
await element(by.id('NavigationClose')).tap();
await element(by.id('NavigationClose')).atIndex(0).tap();

// change currency to GBP
await element(by.id('TotalBalance')).tap(); // switch to local currency
Expand Down
2 changes: 1 addition & 1 deletion e2e/numberpad.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ d('NumberPad', () => {
await element(by.id('GeneralSettings')).tap();
await element(by.id('UnitSettings')).tap();
await element(by.id('DenominationClassic')).tap();
await element(by.id('NavigationClose')).tap();
await element(by.id('NavigationClose')).atIndex(0).tap();

await element(by.id('Receive')).tap();
await element(by.id('SpecifyInvoiceButton')).tap();
Expand Down
6 changes: 6 additions & 0 deletions e2e/security.e2e.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import BitcoinJsonRpc from 'bitcoin-json-rpc';
import { device } from 'detox';

import {
sleep,
Expand Down Expand Up @@ -68,6 +69,11 @@ d('Settings Security And Privacy', () => {
return;
}

// skip test on Android we don't support bitometrics there
if (device.getPlatform() === 'android') {
return;
}

await device.setBiometricEnrollment(true);

await element(by.id('Settings')).tap();
Expand Down
32 changes: 19 additions & 13 deletions e2e/settings.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ d('Settings', () => {
// switch back to sats
await element(by.id('TotalBalance')).tap();

// switch to USD
await element(by.id('Settings')).tap();
await element(by.id('GeneralSettings')).tap();
await element(by.id('CurrenciesSettings')).tap();
await element(by.text('USD ($)')).tap();

markComplete('settings-currency');
});

Expand All @@ -94,33 +100,33 @@ d('Settings', () => {
// check default unit
await expect(unitRow).toHaveText('Bitcoin');

// switch to GBP
// switch to USD
await element(by.id('UnitSettings')).tap();
await element(by.id('GBP')).tap();
await element(by.id('NavigationBack')).tap();
await expect(unitRow).toHaveText('GBP');
await element(by.id('NavigationClose')).tap();
await expect(fiatSymbol).toHaveText('£');
await element(by.id('USD')).tap();
await element(by.id('NavigationBack')).atIndex(0).tap();
await expect(unitRow).toHaveText('USD');
await element(by.id('NavigationClose')).atIndex(0).tap();
await expect(fiatSymbol).toHaveText('$');
await expect(balance).toHaveText('0.00');

// switch back to BTC
await element(by.id('Settings')).tap();
await element(by.id('GeneralSettings')).tap();
await element(by.id('UnitSettings')).tap();
await element(by.id('Bitcoin')).tap();
await element(by.id('NavigationBack')).tap();
await element(by.id('NavigationBack')).atIndex(0).tap();
await expect(unitRow).toHaveText('Bitcoin');
await element(by.id('NavigationClose')).tap();
await element(by.id('NavigationClose')).atIndex(0).tap();
await expect(balance).toHaveText('0');

// switch to classic denomination
await element(by.id('Settings')).tap();
await element(by.id('GeneralSettings')).tap();
await element(by.id('UnitSettings')).tap();
await element(by.id('DenominationClassic')).tap();
await element(by.id('NavigationBack')).tap();
await element(by.id('NavigationBack')).atIndex(0).tap();
await expect(unitRow).toHaveText('Bitcoin');
await element(by.id('NavigationClose')).tap();
await element(by.id('NavigationClose')).atIndex(0).tap();
await expect(balance).toHaveText('0.00000000');

markComplete('settings-unit');
Expand Down Expand Up @@ -239,7 +245,7 @@ d('Settings', () => {
await element(by.id('Settings')).tap();
await element(by.id('SecuritySettings')).tap();
await element(by.id('SwipeBalanceToHide')).tap();
await element(by.id('NavigationClose')).tap();
await element(by.id('NavigationClose')).atIndex(0).tap();

// Balance should be visible
await expect(element(by.id('ShowBalance'))).not.toBeVisible();
Expand Down Expand Up @@ -410,7 +416,7 @@ d('Settings', () => {
await waitFor(element(by.id('NavigationBack')).atIndex(0))
.toBeVisible()
.withTimeout(5000);
await element(by.id('NavigationBack')).tap();
await element(by.id('NavigationBack')).atIndex(0).tap();

await element(by.id('LightningNodeInfo')).tap();
// TODO: this fails too often on CI
Expand Down Expand Up @@ -666,7 +672,7 @@ d('Settings', () => {
await expect(element(by.id('Status-lightning_connection'))).toBeVisible();
await expect(element(by.id('Status-full_backup'))).toBeVisible();

await element(by.id('NavigationClose')).tap();
await element(by.id('NavigationClose')).atIndex(0).tap();

markComplete('settings-support-status');
});
Expand Down

0 comments on commit 19557b1

Please sign in to comment.