Skip to content

Commit 7080f52

Browse files
committed
adjust settings_10
1 parent 08a779c commit 7080f52

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

test/helpers/actions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ export async function receiveOnchainFunds(
673673
}
674674
}
675675

676-
type ToastId =
676+
export type ToastId =
677677
| 'RgsUpdatedToast'
678678
| 'RgsErrorToast'
679679
| 'ElectrumErrorToast'
@@ -687,7 +687,7 @@ type ToastId =
687687
export async function waitForToast(toastId: ToastId, { waitToDisappear = true } = {}) {
688688
await elementById(toastId).waitForDisplayed();
689689
if (waitToDisappear) {
690-
await elementById(toastId).waitForDisplayed({ reverse: true, timeout: 15_000 });
690+
await elementById(toastId).waitForDisplayed({ reverse: true });
691691
}
692692
}
693693

test/specs/settings.e2e.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import {
1616
getAccessibleText,
1717
doNavigationClose,
1818
waitForToast,
19+
ToastId,
1920
} from '../helpers/actions';
2021
import { electrumHost, electrumPort } from '../helpers/constants';
2122
import { launchFreshApp, reinstallApp } from '../helpers/setup';
@@ -389,12 +390,14 @@ describe('@settings - Settings', () => {
389390
expectedHost: electrumHost,
390391
expectedPort: electrumPort.toString(),
391392
expectedProtocol: 'TCP',
393+
expectedToastMessage: 'ElectrumUpdatedToast',
392394
};
393395
const umbrel2 = {
394396
url: `${electrumHost}:${electrumPort}:s`,
395397
expectedHost: electrumHost,
396398
expectedPort: electrumPort.toString(),
397399
expectedProtocol: 'TLS',
400+
expectedToastMessage: driver.isAndroid ? 'ElectrumErrorToast' : 'ElectrumUpdatedToast',
398401
};
399402

400403
// HTTP URL
@@ -403,17 +406,20 @@ describe('@settings - Settings', () => {
403406
expectedHost: electrumHost,
404407
expectedPort: electrumPort.toString(),
405408
expectedProtocol: 'TCP',
409+
expectedToastMessage: 'ElectrumUpdatedToast',
406410
};
407411
const http2 = {
408412
url: `https://${electrumHost}:${electrumPort}`,
409413
expectedHost: electrumHost,
410414
expectedPort: electrumPort.toString(),
411415
expectedProtocol: 'TLS',
416+
expectedToastMessage: driver.isAndroid ? 'ElectrumErrorToast' : 'ElectrumUpdatedToast',
412417
};
413418

414419
const conns = [umbrel1, umbrel2, http1, http2];
415420
let i = 0;
416421
for (const conn of conns) {
422+
console.info(`Testing Electrum connection format #${i + 1}: ${conn.url}`);
417423
await sleep(1000);
418424
await tap('NavigationAction');
419425
// on the first time we need to accept the notifications permission dialog to use camera
@@ -423,7 +429,7 @@ describe('@settings - Settings', () => {
423429
await tap('ScanPrompt');
424430
await typeText('QRInput', conn.url);
425431
await tap('DialogConfirm');
426-
await waitForToast('ElectrumUpdatedToast');
432+
await waitForToast(conn.expectedToastMessage as ToastId);
427433
await expect(await elementById('HostInput')).toHaveText(conn.expectedHost);
428434
expect(await elementById('PortInput')).toHaveText(conn.expectedPort);
429435
// await expectTextWithin('ElectrumProtocol', conn.expectedProtocol);
@@ -434,7 +440,9 @@ describe('@settings - Settings', () => {
434440
await elementById('ResetToDefault').waitForEnabled();
435441
await tap('ResetToDefault');
436442
await tap('ConnectToHost');
437-
await waitForToast('ElectrumUpdatedToast', { waitToDisappear: false });
443+
if (driver.isIOS) {
444+
await waitForToast('ElectrumUpdatedToast', { waitToDisappear: false });
445+
}
438446
await elementById('Connected').waitForDisplayed();
439447
await sleep(1000);
440448
});

0 commit comments

Comments
 (0)