Skip to content

Commit 4bf24ed

Browse files
authored
Merge pull request #54 from synonymdev/test/backup
Test/backup
2 parents d1ea055 + bc19c47 commit 4bf24ed

File tree

4 files changed

+25
-33
lines changed

4 files changed

+25
-33
lines changed

test/helpers/actions.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -832,8 +832,7 @@ export async function waitForBackup() {
832832
await tap('HeaderMenu');
833833
await tap('DrawerSettings');
834834
await tap('BackupSettings');
835-
const allSynced = await elementById('AllSynced');
836-
await allSynced.waitForDisplayed();
835+
await elementById('AllSynced').waitForDisplayed();
837836
await doNavigationClose();
838837
}
839838

test/specs/backup.e2e.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import {
1616
sleep,
1717
tap,
1818
typeText,
19+
waitForBackup,
1920
} from '../helpers/actions';
2021
import { ciIt } from '../helpers/suite';
2122

@@ -66,9 +67,11 @@ describe('@backup - Backup', () => {
6667
await typeText('TagInput', tag);
6768
await tap('ActivityTagsSubmit');
6869
// workaround for Android keyboard not hiding (only in emulator)
69-
await confirmInputOnKeyboard();
70+
if (driver.isAndroid) {
71+
await confirmInputOnKeyboard();
72+
}
7073
await sleep(200);
71-
await doNavigationClose();
74+
await tap('NavigationBack');
7275
await tap('NavigationBack');
7376

7477
// - change settings (currency to GBP) //
@@ -82,6 +85,7 @@ describe('@backup - Backup', () => {
8285
await doNavigationClose();
8386

8487
// - add widgets (add PriceWidget) //
88+
await sleep(1000); // wait for the app to settle
8589
await deleteAllDefaultWidgets();
8690
await tap('WidgetsAdd');
8791
await tap('WidgetsOnboarding-button');
@@ -99,8 +103,7 @@ describe('@backup - Backup', () => {
99103

100104
// - backup seed and restore wallet //
101105
const seed = await getSeed();
102-
// await waitForBackup();
103-
await sleep(10_000); //temp wait (until we have a proper event for backup completion)
106+
await waitForBackup();
104107
await restoreWallet(seed);
105108

106109
// - check if everything was restored
@@ -111,12 +114,9 @@ describe('@backup - Backup', () => {
111114
// check widget
112115
await elementById('PriceWidget').waitForDisplayed();
113116
// check metadata
114-
115-
// data backup not fully functional yet
116-
// https://github.com/synonymdev/bitkit-android/issues/321
117-
// await tap('ActivitySavings');
118-
// await tap('Activity-1');
119-
// const tagElement = await elementById('Tag-${tag}');
120-
// await tagElement.waitForDisplayed();
117+
await tap('ActivitySavings');
118+
await tap('Activity-1');
119+
const tagElement = await elementById(`Tag-${tag}-delete`);
120+
await tagElement.waitForDisplayed();
121121
});
122122
});

test/specs/boost.e2e.ts

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ import {
1717
mineBlocks,
1818
attemptRefreshOnHomeScreen,
1919
doNavigationClose,
20+
getSeed,
21+
waitForBackup,
22+
restoreWallet,
2023
} from '../helpers/actions';
2124
import { bitcoinURL } from '../helpers/constants';
2225
import initElectrum from '../helpers/electrum';
@@ -120,16 +123,10 @@ describe('@boost - Boost', () => {
120123
await doNavigationClose();
121124
}
122125

123-
// --- skip due to: https://github.com/synonymdev/bitkit-android/issues/321 --- //
124-
125-
// boost & transfers backup not working yet
126-
// // wipe & restore
127-
// const seed = await getSeed();
128-
// // await waitForBackup();
129-
// await sleep(10_000); //temp wait (until we have a proper event for backup completion)
130-
// await restoreWallet(seed);
131-
132-
// --- skip due to: https://github.com/synonymdev/bitkit-android/issues/321 --- //
126+
// wipe & restore
127+
const seed = await getSeed();
128+
await waitForBackup();
129+
await restoreWallet(seed);
133130

134131
// check activity after restore
135132
await swipeFullScreen('up');
@@ -257,16 +254,10 @@ describe('@boost - Boost', () => {
257254
await elementById('RBFBoosted').waitForDisplayed();
258255
await doNavigationClose();
259256

260-
// --- skip due to: https://github.com/synonymdev/bitkit-android/issues/321 --- //
261-
262-
// boost & transfers backup not working yet
263-
// // wipe & restore
264-
// const seed = await getSeed();
265-
// // await waitForBackup();
266-
// await sleep(10_000); //temp wait (until we have a proper event for backup completion)
267-
// await restoreWallet(seed);
268-
269-
// --- skip due to: https://github.com/synonymdev/bitkit-android/issues/321 --- //
257+
// wipe & restore
258+
const seed = await getSeed();
259+
await waitForBackup();
260+
await restoreWallet(seed);
270261

271262
// check activity after restore
272263
await swipeFullScreen('up');

test/specs/onchain.e2e.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,8 @@ describe('@onchain - Onchain', () => {
239239
await elementById('CalendarApplyButton').waitForDisplayed();
240240
await sleep(1000);
241241
await tap('CalendarClearButton');
242+
await sleep(500);
243+
await swipeFullScreen('down'); // hide calendar
242244
await elementById('Activity-1').waitForDisplayed();
243245
await elementById('Activity-2').waitForDisplayed();
244246
await elementById('Activity-3').waitForDisplayed();

0 commit comments

Comments
 (0)