Skip to content

Commit

Permalink
fix: capitalization of testID in new_wallet test
Browse files Browse the repository at this point in the history
  • Loading branch information
dorianvp committed Sep 26, 2024
1 parent 29d2ff2 commit 9b20738
Showing 1 changed file with 38 additions and 14 deletions.
52 changes: 38 additions & 14 deletions e2e/new_wallet.test.js
Original file line number Diff line number Diff line change
@@ -1,40 +1,62 @@
const { log, device, by, element } = require('detox');

const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
const sleep = ms => new Promise(r => setTimeout(r, ms));

describe('New Wallet', () => {
it('New wallet creation flow works.', async () => {
//await sleep(5000);

// go to setting modal screen
await waitFor(element(by.id('header.drawmenu'))).toBeVisible().withTimeout(sync_timeout);
await waitFor(element(by.id('header.drawmenu')))
.toBeVisible()
.withTimeout(sync_timeout);
await element(by.id('header.drawmenu')).tap();
await waitFor(element(by.id('menu.settings'))).toBeVisible().withTimeout(sync_timeout);
await waitFor(element(by.id('menu.settings')))
.toBeVisible()
.withTimeout(sync_timeout);
await element(by.id('menu.settings')).tap();

// first we need to change the App to advanced mode
await waitFor(element(by.id('settings.mode-advanced'))).toBeVisible().withTimeout(sync_timeout);
await waitFor(element(by.id('settings.mode-advanced')))
.toBeVisible()
.withTimeout(sync_timeout);
await element(by.id('settings.mode-advanced')).tap();
await waitFor(element(by.id('settings.button.save'))).toBeVisible().withTimeout(sync_timeout);
await waitFor(element(by.id('settings.button.save')))
.toBeVisible()
.withTimeout(sync_timeout);
await element(by.id('settings.button.save')).tap();

// change to another wallet -> new wallet
await waitFor(element(by.id('header.drawmenu'))).toBeVisible().withTimeout(sync_timeout);
await waitFor(element(by.id('header.drawmenu')))
.toBeVisible()
.withTimeout(sync_timeout);
await element(by.id('header.drawmenu')).tap();
await waitFor(element(by.id('menu.changewallet'))).toBeVisible().withTimeout(sync_timeout);
await waitFor(element(by.id('menu.changewallet')))
.toBeVisible()
.withTimeout(sync_timeout);
await element(by.id('menu.changewallet')).tap();
await waitFor(element(by.id('seed.button.ok'))).toBeVisible().withTimeout(sync_timeout);
await waitFor(element(by.id('seed.button.ok')))
.toBeVisible()
.withTimeout(sync_timeout);
await element(by.id('seed.button.ok')).tap();
await waitFor(element(by.text('CONFIRM'))).toBeVisible().withTimeout(sync_timeout);
await waitFor(element(by.text('CONFIRM')))
.toBeVisible()
.withTimeout(sync_timeout);
await element(by.text('CONFIRM')).tap();

await waitFor(element(by.id('loadingapp.createnewwallet'))).toBeVisible().withTimeout(sync_timeout);
await waitFor(element(by.id('loadingapp.createnewwallet')))
.toBeVisible()
.withTimeout(sync_timeout);
await element(by.id('loadingapp.createnewwallet')).tap();
await waitFor(element(by.id('seed.button.ok'))).toBeVisible().withTimeout(sync_timeout);
await waitFor(element(by.id('seed.button.ok')))
.toBeVisible()
.withTimeout(sync_timeout);
await element(by.id('seed.button.ok')).tap();

await waitFor(element(by.id('ValueTransfer text'))).toBeVisible().withTimeout(sync_timeout);
let text = element(by.id('ValueTransfer text'));
await waitFor(element(by.id('valuetransfer text')))
.toBeVisible()
.withTimeout(sync_timeout);
let text = element(by.id('valuetransfer text'));
let attributes = await text.getAttributes();
log.info(attributes);
log.info('Value:', attributes.value);
Expand All @@ -46,6 +68,8 @@ describe('New Wallet', () => {
await expect(text).toHaveText('History');

// waiting new wallet fully synced
await waitFor(element(by.id('header.checkicon'))).toBeVisible().withTimeout(sync_timeout);
await waitFor(element(by.id('header.checkicon')))
.toBeVisible()
.withTimeout(sync_timeout);
});
});

0 comments on commit 9b20738

Please sign in to comment.