From 77d940329a366b5e0ddf0ff81ee432f21393fdeb Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Thu, 23 Jul 2026 12:54:46 +0200 Subject: [PATCH 1/7] test: remove ContactsSaveToast, ContactUpdatedToast --- test/helpers/actions.ts | 2 -- test/helpers/profile.ts | 4 ---- 2 files changed, 6 deletions(-) diff --git a/test/helpers/actions.ts b/test/helpers/actions.ts index 6b8437a..8c3a7e0 100644 --- a/test/helpers/actions.ts +++ b/test/helpers/actions.ts @@ -1216,8 +1216,6 @@ export type ToastId = | 'InsufficientSavingsToast' | 'ProfilePubkyCopiedToast' | 'ProfileUpdatedToast' - | 'ContactSavedToast' - | 'ContactUpdatedToast' | 'ContactDeletedToast' | 'SendAmountExceededToast'; diff --git a/test/helpers/profile.ts b/test/helpers/profile.ts index 977c154..eed39a1 100644 --- a/test/helpers/profile.ts +++ b/test/helpers/profile.ts @@ -125,7 +125,6 @@ export async function saveEditProfile() { export async function saveEditContact() { await swipeFullScreen('up'); await tap('ProfileEditSave'); - await waitForToast('ContactUpdatedToast', { waitToDisappear: driver.isIOS }); await elementById('ContactEdit').waitForDisplayed({ timeout: 60_000 }); } @@ -151,12 +150,10 @@ export async function addContact({ pubky, save = true, firstContact = false, - waitToastToDisappear: waitToDisappear = driver.isIOS, }: { pubky: string; save?: boolean; firstContact?: boolean; - waitToastToDisappear?: boolean; }): Promise { await openContacts(); await sleep(500); @@ -186,7 +183,6 @@ export async function addContact({ await tap('AddContactAdd'); await elementById('AddContactSave').waitForDisplayed(); await tap('AddContactSave'); - await waitForToast('ContactSavedToast', { waitToDisappear }); await elementById('ContactsAddButton').waitForDisplayed(); } From 868f9521aa6029bd327f87a026dc2d946feb83d9 Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Thu, 23 Jul 2026 13:23:49 +0200 Subject: [PATCH 2/7] test: land on contact details after adding contact --- test/helpers/profile.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/helpers/profile.ts b/test/helpers/profile.ts index eed39a1..8dd3b83 100644 --- a/test/helpers/profile.ts +++ b/test/helpers/profile.ts @@ -183,7 +183,14 @@ export async function addContact({ await tap('AddContactAdd'); await elementById('AddContactSave').waitForDisplayed(); await tap('AddContactSave'); - await elementById('ContactsAddButton').waitForDisplayed(); + // Landing on contact details screen + await elementById('ContactViewName').waitForDisplayed(); + await elementById('ContactPay').waitForDisplayed(); + await elementById('ContactActivity').waitForDisplayed(); + await elementById('ContactCopy').waitForDisplayed(); + await elementById('ContactShare').waitForDisplayed(); + await elementById('ContactDelete').waitForDisplayed(); + await elementById('ContactAddTag').waitForDisplayed(); } export async function verifyAddContactRoute( From 335564a7fbaae02717bf3f787560ce04c4bf9dcd Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Thu, 23 Jul 2026 14:06:38 +0200 Subject: [PATCH 3/7] test: remove discardAddCountactRoute --- test/helpers/actions.ts | 4 ++-- test/helpers/profile.ts | 5 ----- test/specs/paykit.e2e.ts | 6 ++---- test/specs/pubky-profile.e2e.ts | 5 ++--- 4 files changed, 6 insertions(+), 14 deletions(-) diff --git a/test/helpers/actions.ts b/test/helpers/actions.ts index 8c3a7e0..69e34cc 100644 --- a/test/helpers/actions.ts +++ b/test/helpers/actions.ts @@ -477,9 +477,9 @@ export async function pasteIOSText(testId: string, text: string) { export async function typeText(testId: string, text: string) { const el = await elementById(testId); await el.waitForDisplayed(); - await sleep(500); // Allow time for the element to settle + await sleep(1000); // Allow time for the element to settle await el.clearValue(); - await sleep(500); // Allow time for the clear action to propagate + await sleep(1000); // Allow time for the clear action to propagate await el.setValue(text); } diff --git a/test/helpers/profile.ts b/test/helpers/profile.ts index 8dd3b83..6c33671 100644 --- a/test/helpers/profile.ts +++ b/test/helpers/profile.ts @@ -224,11 +224,6 @@ export async function verifyAddContactRoute( }); } -export async function discardAddContactRoute() { - await elementById('AddContactDiscard').waitForDisplayed(); - await tap('AddContactDiscard'); -} - /** Opens Contacts and waits for a row with test id `Contact_`. */ export async function verifyContactRowDisplayed(publicKey: string) { await openContacts(); diff --git a/test/specs/paykit.e2e.ts b/test/specs/paykit.e2e.ts index d107acf..0190ab6 100644 --- a/test/specs/paykit.e2e.ts +++ b/test/specs/paykit.e2e.ts @@ -17,7 +17,6 @@ import { addContact, cleanupProfile, createProfile, - discardAddContactRoute, verifyAddContactRoute, verifyContactRowDisplayed, } from '../helpers/profile'; @@ -81,7 +80,7 @@ describe('@pubky @paykit - Public payments', () => { await verifyAddContactRoute(unsavedPaykitContact.pubky, { ableToPay: unsavedPaykitContact.ableToPay, }); - await discardAddContactRoute(); + await doNavigationClose(); await enterAddressViaScanPrompt(unsavedPaykitContact.pubky, { acceptCameraPermission: false, @@ -89,12 +88,11 @@ describe('@pubky @paykit - Public payments', () => { await verifyAddContactRoute(unsavedPaykitContact.pubky, { ableToPay: unsavedPaykitContact.ableToPay, }); - await discardAddContactRoute(); + await doNavigationClose(); await addContact({ pubky: savedPaykitContact.pubky, firstContact: true, - waitToastToDisappear: true, }); await verifyContactRowDisplayed(savedPaykitContact.pubky); await tap(`Contact_${savedPaykitContact.pubky}`); diff --git a/test/specs/pubky-profile.e2e.ts b/test/specs/pubky-profile.e2e.ts index 858d885..8f61604 100644 --- a/test/specs/pubky-profile.e2e.ts +++ b/test/specs/pubky-profile.e2e.ts @@ -24,7 +24,6 @@ import { cleanupProfile, deleteContact, deleteProfile, - discardAddContactRoute, openEditProfile, readPubkyFromProfileCopy, removeEditProfileLinkAt, @@ -199,7 +198,7 @@ describe('@pubky @pubky_profile - Pubky profile', () => { await verifyAddContactRoute(firstStagingContact.pubky, { ableToPay: firstStagingContact.ableToPay, }); - await discardAddContactRoute(); + await doNavigationClose(); // route unsaved pubky from QR scanner prompt await enterAddressViaScanPrompt(firstStagingContact.pubky, { @@ -208,7 +207,7 @@ describe('@pubky @pubky_profile - Pubky profile', () => { await verifyAddContactRoute(firstStagingContact.pubky, { ableToPay: firstStagingContact.ableToPay, }); - await discardAddContactRoute(); + await doNavigationClose(); // add valid contacts for (const [i, stagingContact] of STAGING_TEST_CONTACTS.entries()) { From 4749c30889577a1c0937ee42ee54b4f1843ff16c Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Thu, 23 Jul 2026 14:38:55 +0200 Subject: [PATCH 4/7] test: bring back ContactUpdatedToast --- test/helpers/actions.ts | 1 + test/helpers/profile.ts | 1 + test/specs/pubky-profile.e2e.ts | 3 +++ 3 files changed, 5 insertions(+) diff --git a/test/helpers/actions.ts b/test/helpers/actions.ts index 69e34cc..3a0a6d0 100644 --- a/test/helpers/actions.ts +++ b/test/helpers/actions.ts @@ -1217,6 +1217,7 @@ export type ToastId = | 'ProfilePubkyCopiedToast' | 'ProfileUpdatedToast' | 'ContactDeletedToast' + | 'ContactUpdatedToast' | 'SendAmountExceededToast'; /** Wait for a toast by test id. Prefer `waitToDisappear` for iOS: success toasts live in a separate diff --git a/test/helpers/profile.ts b/test/helpers/profile.ts index 6c33671..241b4b1 100644 --- a/test/helpers/profile.ts +++ b/test/helpers/profile.ts @@ -125,6 +125,7 @@ export async function saveEditProfile() { export async function saveEditContact() { await swipeFullScreen('up'); await tap('ProfileEditSave'); + await waitForToast('ContactUpdatedToast', { waitToDisappear: driver.isIOS }); await elementById('ContactEdit').waitForDisplayed({ timeout: 60_000 }); } diff --git a/test/specs/pubky-profile.e2e.ts b/test/specs/pubky-profile.e2e.ts index 8f61604..35e83c4 100644 --- a/test/specs/pubky-profile.e2e.ts +++ b/test/specs/pubky-profile.e2e.ts @@ -250,6 +250,7 @@ describe('@pubky @pubky_profile - Pubky profile', () => { try { // Wallet A: create and customize profile, then capture seed. + console.log('Wallet A: create and customize profile, then capture seed.'); const { pubky: pubkyA } = await createProfile({ name: 'Alice Wallet A' }); currentWallet = 'A'; await updateMyProfile(detailsA); @@ -257,6 +258,7 @@ describe('@pubky @pubky_profile - Pubky profile', () => { seedA = await getSeed(); // Wallet B: fresh install + onboarding, create profile, then add wallet A as contact. + console.log('Wallet B: fresh install + onboarding, create profile, then add wallet A as contact.'); await reinstallApp(); currentWallet = null; await completeOnboarding(); @@ -281,6 +283,7 @@ describe('@pubky @pubky_profile - Pubky profile', () => { currentWallet = null; // Restore wallet A and verify wallet A profile is unchanged by wallet B contact edits. + console.log('Wallet A: restore wallet A and verify wallet A profile is unchanged by wallet B contact edits.'); await restoreWallet(seedA); await enablePaykitUi(); currentWallet = 'A'; From d52294799d0abf6d4ce88aafa6030707108cee36 Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Thu, 23 Jul 2026 14:55:53 +0200 Subject: [PATCH 5/7] test: fail on deleteProfile in @pubky_profile_4 --- test/helpers/profile.ts | 2 +- test/specs/pubky-profile.e2e.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/helpers/profile.ts b/test/helpers/profile.ts index 241b4b1..ba91820 100644 --- a/test/helpers/profile.ts +++ b/test/helpers/profile.ts @@ -67,7 +67,7 @@ export async function cleanupProfile(label: string) { await deleteProfile(); console.info(`Cleaned up Pubky profile for ${label}`); } catch (error) { - console.warn(`Could not cleanup Pubky profile for ${label}:`, error); + console.error(`Could not cleanup Pubky profile for ${label}:`, error); } } diff --git a/test/specs/pubky-profile.e2e.ts b/test/specs/pubky-profile.e2e.ts index 35e83c4..a1f8156 100644 --- a/test/specs/pubky-profile.e2e.ts +++ b/test/specs/pubky-profile.e2e.ts @@ -279,7 +279,7 @@ describe('@pubky @pubky_profile - Pubky profile', () => { await updateContactProfile({ pubky: pubkyA, details: detailsAUpdated }); await verifyContactDetails({ pubky: pubkyA, details: detailsAUpdated }); - await cleanupProfile('@pubky_profile_4 wallet B'); + await deleteProfile(); currentWallet = null; // Restore wallet A and verify wallet A profile is unchanged by wallet B contact edits. @@ -299,7 +299,7 @@ describe('@pubky @pubky_profile - Pubky profile', () => { await enablePaykitUi(); await cleanupProfile('@pubky_profile_4 wallet A'); } catch (error) { - console.warn('Could not restore and cleanup wallet A profile:', error); + console.error('Could not restore and cleanup wallet A profile:', error); } } } From 402f427fb672a8be02fdfb8f4e75bf82e0accbd8 Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Fri, 24 Jul 2026 11:42:19 +0200 Subject: [PATCH 6/7] refactor: formatting --- test/helpers/hardware-wallet.ts | 2 -- test/specs/hardware-wallet.e2e.ts | 33 +++++++++++++++++-------------- test/specs/pubky-profile.e2e.ts | 8 ++++++-- 3 files changed, 24 insertions(+), 19 deletions(-) diff --git a/test/helpers/hardware-wallet.ts b/test/helpers/hardware-wallet.ts index 00efacb..f7339ba 100644 --- a/test/helpers/hardware-wallet.ts +++ b/test/helpers/hardware-wallet.ts @@ -150,7 +150,6 @@ export async function renameHardwareWalletFromSettings(currentLabel: string, new }); await expectHardwareWalletInSettings(newLabel, { visible: true }); await expectHardwareWalletInSettings(currentLabel, { visible: false }); - } export async function expectHardwareSuggestion({ visible }: { visible: boolean }) { @@ -333,4 +332,3 @@ async function dismissSpendingBalanceToastIfShown() { console.info('→ SpendingBalanceReadyToast not shown after hardware transfer.'); } } - diff --git a/test/specs/hardware-wallet.e2e.ts b/test/specs/hardware-wallet.e2e.ts index 5f285f3..26fd195 100644 --- a/test/specs/hardware-wallet.e2e.ts +++ b/test/specs/hardware-wallet.e2e.ts @@ -52,21 +52,24 @@ describe('@hardware_wallet - Hardware Wallet', () => { stopTrezorEmulator(); }); - ciIt('@hardware_wallet_1 - Can connect, rename, show, and remove a Trezor emulator wallet', async () => { - await expectHardwareSuggestion({ visible: true }); - await startHardwareWalletFlowFromSuggestion(); - await completeHardwareWalletFlow(walletLabel); - await expectHardwareSuggestion({ visible: false }); - await openHardwareWalletSettings(); - await expectHardwareWalletInSettings(walletLabel, { visible: true }); - await expectHardwareWalletOnHome(walletLabel, { visible: true }); - await openHardwareWalletSettings(); - await renameHardwareWalletFromSettings(walletLabel, renamedWalletLabel); - await expectHardwareWalletOnHome(renamedWalletLabel, { visible: true }); - await removeHardwareWalletFromSettings(renamedWalletLabel); - await expectHardwareWalletInSettings(renamedWalletLabel, { visible: false }); - await expectHardwareWalletOnHome(renamedWalletLabel, { visible: false }); - }); + ciIt( + '@hardware_wallet_1 - Can connect, rename, show, and remove a Trezor emulator wallet', + async () => { + await expectHardwareSuggestion({ visible: true }); + await startHardwareWalletFlowFromSuggestion(); + await completeHardwareWalletFlow(walletLabel); + await expectHardwareSuggestion({ visible: false }); + await openHardwareWalletSettings(); + await expectHardwareWalletInSettings(walletLabel, { visible: true }); + await expectHardwareWalletOnHome(walletLabel, { visible: true }); + await openHardwareWalletSettings(); + await renameHardwareWalletFromSettings(walletLabel, renamedWalletLabel); + await expectHardwareWalletOnHome(renamedWalletLabel, { visible: true }); + await removeHardwareWalletFromSettings(renamedWalletLabel); + await expectHardwareWalletInSettings(renamedWalletLabel, { visible: false }); + await expectHardwareWalletOnHome(renamedWalletLabel, { visible: false }); + } + ); ciIt('@hardware_wallet_2 - Can receive onchain funds to hardware wallet', async () => { const sats = 15_000; diff --git a/test/specs/pubky-profile.e2e.ts b/test/specs/pubky-profile.e2e.ts index a1f8156..9c71fff 100644 --- a/test/specs/pubky-profile.e2e.ts +++ b/test/specs/pubky-profile.e2e.ts @@ -258,7 +258,9 @@ describe('@pubky @pubky_profile - Pubky profile', () => { seedA = await getSeed(); // Wallet B: fresh install + onboarding, create profile, then add wallet A as contact. - console.log('Wallet B: fresh install + onboarding, create profile, then add wallet A as contact.'); + console.log( + 'Wallet B: fresh install + onboarding, create profile, then add wallet A as contact.' + ); await reinstallApp(); currentWallet = null; await completeOnboarding(); @@ -283,7 +285,9 @@ describe('@pubky @pubky_profile - Pubky profile', () => { currentWallet = null; // Restore wallet A and verify wallet A profile is unchanged by wallet B contact edits. - console.log('Wallet A: restore wallet A and verify wallet A profile is unchanged by wallet B contact edits.'); + console.log( + 'Wallet A: restore wallet A and verify wallet A profile is unchanged by wallet B contact edits.' + ); await restoreWallet(seedA); await enablePaykitUi(); currentWallet = 'A'; From 2db3ac849e7370366fee8a6f9960f200fee2f511 Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Fri, 24 Jul 2026 11:54:26 +0200 Subject: [PATCH 7/7] temp: don't delete profile --- test/specs/pubky-profile.e2e.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/specs/pubky-profile.e2e.ts b/test/specs/pubky-profile.e2e.ts index 9c71fff..10e5160 100644 --- a/test/specs/pubky-profile.e2e.ts +++ b/test/specs/pubky-profile.e2e.ts @@ -281,8 +281,11 @@ describe('@pubky @pubky_profile - Pubky profile', () => { await updateContactProfile({ pubky: pubkyA, details: detailsAUpdated }); await verifyContactDetails({ pubky: pubkyA, details: detailsAUpdated }); - await deleteProfile(); - currentWallet = null; + // temp: turn on after fix + // https://github.com/synonymdev/bitkit-android/pull/1108 + // https://github.com/synonymdev/bitkit-ios/pull/640 + // await deleteProfile(); + // currentWallet = null; // Restore wallet A and verify wallet A profile is unchanged by wallet B contact edits. console.log(