Skip to content

Commit 1e11058

Browse files
committed
extract editRecipientAddress
1 parent eb7442a commit 1e11058

2 files changed

Lines changed: 25 additions & 19 deletions

File tree

test/helpers/actions.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1382,6 +1382,28 @@ export async function typeRecipientInput(
13821382
}
13831383
}
13841384

1385+
export async function editRecipientAddress(address: string) {
1386+
if (driver.isIOS) {
1387+
await tap('SendConfirmToggleDetails');
1388+
}
1389+
await tap('ReviewUri');
1390+
await sleep(2000);
1391+
await elementById('RecipientInput').waitForDisplayed();
1392+
await sleep(500);
1393+
try {
1394+
console.info('Typing on the RecipientInput...');
1395+
console.info({ address });
1396+
await typeRecipientInput(address);
1397+
await elementById('AddressContinue').waitForEnabled();
1398+
await sleep(500);
1399+
} catch {
1400+
console.warn('Typing on the RecipientInput failed, trying again...');
1401+
await typeRecipientInput(address);
1402+
await elementById('AddressContinue').waitForEnabled();
1403+
await sleep(500);
1404+
}
1405+
}
1406+
13851407
export async function typeAddressAndVerifyContinue({
13861408
address,
13871409
reverse = false,

test/specs/send.e2e.ts

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,12 @@ import {
2222
handleAndroidAlert,
2323
dismissBackgroundPaymentsTimedSheet,
2424
acknowledgeReceivedPayment,
25+
editRecipientAddress,
2526
typeRecipientInput,
27+
tap,
2628
} from '../helpers/actions';
2729
import { lndConfig } from '../helpers/constants';
2830
import { reinstallApp } from '../helpers/setup';
29-
import { confirmInputOnKeyboard, tap, typeText } from '../helpers/actions';
3031
import {
3132
connectToLND,
3233
getLDKNodeID,
@@ -284,24 +285,7 @@ describe('@send - Send', () => {
284285
const reviewAmt = await elementByIdWithin('ReviewAmount-primary', 'MoneyText');
285286
await reviewAmt.waitForDisplayed();
286287
await expect(reviewAmt).toHaveText('2 000');
287-
await tap('ReviewUri');
288-
await sleep(2000);
289-
await elementById('RecipientInput').waitForDisplayed();
290-
await sleep(500);
291-
try {
292-
console.info('Typing on the RecipientInput...');
293-
console.info({ onchainAddress });
294-
await typeText('RecipientInput', onchainAddress);
295-
await confirmInputOnKeyboard();
296-
await elementById('AddressContinue').waitForEnabled();
297-
await sleep(500);
298-
} catch {
299-
console.warn('Typing on the RecipientInput failed, trying again...');
300-
await typeText('RecipientInput', onchainAddress);
301-
await confirmInputOnKeyboard();
302-
await elementById('AddressContinue').waitForEnabled();
303-
await sleep(500);
304-
}
288+
await editRecipientAddress(onchainAddress);
305289
await tap('AddressContinue');
306290
await elementById('AssetButton-savings').waitForDisplayed();
307291
await tap('N2');

0 commit comments

Comments
 (0)