diff --git a/e2e/slashtags.e2e.js b/e2e/slashtags.e2e.js index 778c5a015..b72dec418 100644 --- a/e2e/slashtags.e2e.js +++ b/e2e/slashtags.e2e.js @@ -1,4 +1,5 @@ import BitcoinJsonRpc from 'bitcoin-json-rpc'; +import { device } from 'detox'; import { bitcoinURL, @@ -76,6 +77,8 @@ d('Profile and Contacts', () => { return; } + const isIos = device.getPlatform() === 'ios'; + // CREATE NEW PROFILE await element(by.id('Header')).tap(); await element(by.id('OnboardingContinue')).tap(); @@ -121,7 +124,9 @@ d('Profile and Contacts', () => { await element(by.id('DetailsButton')).tap(); await expect(element(by.text('some@email.value'))).toExist(); await expect(element(by.text('link-value'))).not.toExist(); - await element(by.id('NavigationClose')).atIndex(1).tap(); + await element(by.id('NavigationClose')) + .atIndex(isIos ? 1 : 0) + .tap(); // ADD CONTACTS await element(by.id('HeaderContactsButton')).tap(); @@ -129,8 +134,10 @@ d('Profile and Contacts', () => { // self await element(by.id('AddContact')).tap(); - await element(by.id('ContactURLInput')).typeText(slashtagsUrl + '\n'); - await expect(element(by.id('ContactError'))).toBeVisible(); + await element(by.id('ContactURLInput')).replaceText(slashtagsUrl + '\n'); + await waitFor(element(by.id('ContactError'))) + .toBeVisible() + .withTimeout(30000); // Satoshi await element(by.id('ContactURLInput')).replaceText(satoshi.url); @@ -142,7 +149,9 @@ d('Profile and Contacts', () => { await element(by.id('SaveContactButton')).tap(); await expect(element(by.text('WEBSITE'))).toExist(); await expect(element(by.text(satoshi.website))).toExist(); - await element(by.id('NavigationBack')).atIndex(2).tap(); + await element(by.id('NavigationBack')) + .atIndex(isIos ? 2 : 0) + .tap(); // ios // Hal await element(by.id('AddContact')).tap(); @@ -154,7 +163,9 @@ d('Profile and Contacts', () => { await element(by.id('NameInput')).replaceText(hal.name2); await element(by.id('SaveContactButton')).tap(); await expect(element(by.text(hal.name2))).toExist(); - await element(by.id('NavigationClose')).atIndex(2).tap(); + await element(by.id('NavigationClose')) + .atIndex(isIos ? 2 : 0) + .tap(); // FILTER CONTACTS await element(by.id('HeaderContactsButton')).tap();