Skip to content

Commit

Permalink
refactor(suite-native): e2e import tests
Browse files Browse the repository at this point in the history
  • Loading branch information
PeKne committed Oct 4, 2024
1 parent 112b9d9 commit 51cd1ca
Show file tree
Hide file tree
Showing 5 changed files with 117 additions and 120 deletions.
2 changes: 1 addition & 1 deletion suite-native/app/e2e/jest.setup.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
jest.retryTimes(2);
jest.retryTimes(2, { logErrorsBeforeRetry: true });
118 changes: 0 additions & 118 deletions suite-native/app/e2e/tests/accountsImport.test.ts

This file was deleted.

50 changes: 50 additions & 0 deletions suite-native/app/e2e/tests/bitcoinAccountsImport.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import { openApp } from '../utils';
import { xpubs } from '../fixtures/xpubs';
import { onAccountImport } from '../pageObjects/accountImportActions';
import { onMyAssets } from '../pageObjects/myAssetsActions';
import { onOnboarding } from '../pageObjects/onboardingActions';
import { onTabBar } from '../pageObjects/tabBarActions';

describe('Import Bitcoin network accounts.', () => {
beforeAll(async () => {
await openApp({ newInstance: true });
await onOnboarding.finishOnboarding();
await onTabBar.navigateToMyAssets();
});

beforeEach(async () => {
await onMyAssets.addAccount();
});

it('Import BTC SegWit account', async () => {
await onAccountImport.importAccount({
networkSymbol: 'btc',
xpub: xpubs.btc.segwit,
accountName: 'BTC SegWit',
});
});

it('Import BTC Legacy SegWit account', async () => {
await onAccountImport.importAccount({
networkSymbol: 'btc',
xpub: xpubs.btc.legacySegwit,
accountName: 'BTC Legacy SegWit',
});
});

it('Import BTC Taproot account', async () => {
await onAccountImport.importAccount({
networkSymbol: 'btc',
xpub: xpubs.btc.taproot,
accountName: 'BTC Taproot',
});
});

it('Import BTC Legacy account', async () => {
await onAccountImport.importAccount({
networkSymbol: 'btc',
xpub: xpubs.btc.legacy,
accountName: 'BTC Legacy',
});
});
});
65 changes: 65 additions & 0 deletions suite-native/app/e2e/tests/othersAccountsImport.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import { openApp } from '../utils';
import { xpubs } from '../fixtures/xpubs';
import { onAccountImport } from '../pageObjects/accountImportActions';
import { onMyAssets } from '../pageObjects/myAssetsActions';
import { onOnboarding } from '../pageObjects/onboardingActions';
import { onTabBar } from '../pageObjects/tabBarActions';

describe('Import accounts of other networks.', () => {
beforeAll(async () => {
await openApp({ newInstance: true });
await onOnboarding.finishOnboarding();
await onTabBar.navigateToMyAssets();
});

beforeEach(async () => {
await onMyAssets.addAccount();
});

it('Import LTC account', async () => {
await onAccountImport.importAccount({
networkSymbol: 'ltc',
xpub: xpubs.ltc,
accountName: 'Litecoin SegWit',
});
});

it('Import ZCash account', async () => {
await onAccountImport.importAccount({
networkSymbol: 'zec',
xpub: xpubs.zec,
accountName: 'Zcash #1',
});
});

it('Import DOGE account', async () => {
await onAccountImport.importAccount({
networkSymbol: 'doge',
xpub: xpubs.doge,
accountName: 'Dogecoin #1',
});
});

it('Import Cardano account', async () => {
await onAccountImport.importAccount({
networkSymbol: 'ada',
xpub: xpubs.ada,
accountName: 'Cardano #1',
});
});
it('Import XRP account', async () => {
await onAccountImport.importAccount({
networkSymbol: 'xrp',
xpub: xpubs.xrp,
accountName: 'Ripple #1',
});
});

it('Import ETH account', async () => {
await onAccountImport.importAccount({
networkSymbol: 'eth',
xpub: xpubs.eth,
accountName: 'Ethereum #1',
});
});
});
2 changes: 1 addition & 1 deletion suite-native/app/e2e/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,5 @@ export const scrollUntilVisible = async (matcher: Detox.NativeMatcher) => {
export const appIsFullyLoaded = async () => {
await waitFor(element(by.id('@screen/mainScrollView')))
.toBeVisible()
.withTimeout(20000);
.withTimeout(35000);
};

0 comments on commit 51cd1ca

Please sign in to comment.