@@ -20,6 +20,7 @@ import {
2020 dismissQuickPayIntro ,
2121 doNavigationClose ,
2222 waitForToast ,
23+ getTextUnder ,
2324} from '../helpers/actions' ;
2425import {
2526 checkChannelStatus ,
@@ -83,40 +84,36 @@ describe('@transfer - Transfer', () => {
8384 await elementByText ( 'EUR (€)' ) . click ( ) ;
8485 await doNavigationClose ( ) ;
8586
86- await launchFreshApp ( ) ;
87+ if ( driver . isAndroid ) await launchFreshApp ( ) ;
8788 await tap ( 'Suggestion-lightning' ) ;
8889 await tap ( 'TransferIntro-button' ) ;
8990 await tap ( 'FundTransfer' ) ;
9091 await tap ( 'SpendingIntro-button' ) ;
9192 await sleep ( 3000 ) ; // let the animation finish
9293
93- //--- skip due to: https://github.com/synonymdev/bitkit-android/issues/425 ---//
94- //// can continue with default client balance (0)
95- //await tap('SpendingAmountContinue');
96- //await sleep(100);
97- //await tap('SpendingConfirmAdvanced');
98- //await tap('SpendingAdvancedMin');
99- //await expectTextVisible('100 000');
100- //await tap('SpendingAdvancedDefault');
101- //await tap('SpendingAdvancedNumberField'); // change to fiat
102- //const label = await getTextUnder('SpendingAdvancedNumberField');
103- //const eurBalance = Number.parseInt(label, 10);
104- //await expect(eurBalance).toBeGreaterThan(440);
105- //await expect(eurBalance).toBeLessThan(460);
106- //await tap('SpendingAdvancedNumberField'); // change back to sats
107- //await tap('SpendingAdvancedContinue');
108- //await tap('NavigationBack');
109- //--- skip due to: https://github.com/synonymdev/bitkit-android/issues/425 ---//
110-
111- //--- skip due to: https://github.com/synonymdev/bitkit-android/issues/424 ---//
94+ // can continue with default client balance (0)
95+ await tap ( 'SpendingAmountContinue' ) ;
96+ await sleep ( 100 ) ;
97+ await tap ( 'SpendingConfirmAdvanced' ) ;
98+ await tap ( 'SpendingAdvancedMin' ) ;
99+ await expectText ( '100 000' , { strategy : 'contains' } ) ;
100+ await tap ( 'SpendingAdvancedDefault' ) ;
101+ await tap ( 'SpendingAdvancedNumberField' ) ; // change to fiat
102+ const label = await getTextUnder ( 'SpendingAdvancedNumberField' ) ;
103+ const eurBalance = Number . parseInt ( label , 10 ) ;
104+ await expect ( eurBalance ) . toBeGreaterThan ( 440 ) ;
105+ await expect ( eurBalance ) . toBeLessThan ( 460 ) ;
106+ await tap ( 'SpendingAdvancedNumberField' ) ; // change back to sats
107+ await tap ( 'SpendingAdvancedContinue' ) ;
108+ await tap ( 'NavigationBack' ) ;
109+
112110 // can continue with max client balance
113- //await tap('SpendingAmountMax');
114- //await elementById('SpendingAmountContinue').waitForEnabled();
115- //await sleep(500);
116- //await tap('SpendingAmountContinue');
117- //await elementById('SpendingConfirmAdvanced').waitForDisplayed();
118- //await tap('NavigationBack');
119- //--- skip due to: https://github.com/synonymdev/bitkit-android/issues/424 ---//
111+ await tap ( 'SpendingAmountMax' ) ;
112+ await elementById ( 'SpendingAmountContinue' ) . waitForEnabled ( ) ;
113+ await sleep ( 500 ) ;
114+ await tap ( 'SpendingAmountContinue' ) ;
115+ await elementById ( 'SpendingConfirmAdvanced' ) . waitForDisplayed ( ) ;
116+ await tap ( 'NavigationBack' ) ;
120117
121118 // can continue with 25% client balance
122119 await elementById ( 'SpendingAmountQuarter' ) . waitForEnabled ( ) ;
@@ -133,7 +130,7 @@ describe('@transfer - Transfer', () => {
133130 await tap ( 'N2' ) ;
134131 await multiTap ( 'N0' , 5 ) ;
135132 await tap ( 'SpendingAmountContinue' ) ;
136- await expectText ( '200 000' ) ;
133+ await expectText ( '200 000' , { strategy : 'contains' } ) ;
137134 await tap ( 'SpendingConfirmMore' ) ;
138135 await expectText ( '200 000' ) ;
139136 await tap ( 'LiquidityContinue' ) ;
@@ -145,6 +142,7 @@ describe('@transfer - Transfer', () => {
145142 // verify transfer activity on savings
146143 await tap ( 'ActivitySavings' ) ;
147144 await elementById ( 'Activity-1' ) . waitForDisplayed ( ) ;
145+ await elementById ( 'Activity-2' ) . waitForDisplayed ( ) ;
148146 await expectTextWithin ( 'Activity-1' , 'Transfer' , { timeout : 60_000 } ) ;
149147 await expectTextWithin ( 'Activity-1' , '-' ) ;
150148 await tap ( 'NavigationBack' ) ;
@@ -158,7 +156,7 @@ describe('@transfer - Transfer', () => {
158156 await tap ( 'N1' ) ;
159157 await multiTap ( 'N0' , 5 ) ;
160158 await tap ( 'SpendingAmountContinue' ) ;
161- await expectText ( '100 000' ) ;
159+ await expectText ( '100 000' , { strategy : 'contains' } ) ;
162160 await sleep ( 500 ) ;
163161 await tap ( 'SpendingConfirmAdvanced' ) ;
164162 await sleep ( 500 ) ;
@@ -213,6 +211,8 @@ describe('@transfer - Transfer', () => {
213211 // verify both transfers activities on savings
214212 await tap ( 'ActivitySavings' ) ;
215213 await elementById ( 'Activity-1' ) . waitForDisplayed ( ) ;
214+ await elementById ( 'Activity-2' ) . waitForDisplayed ( ) ;
215+ await elementById ( 'Activity-3' ) . waitForDisplayed ( ) ;
216216 await expectTextWithin ( 'Activity-1' , 'Transfer' ) ;
217217 await expectTextWithin ( 'Activity-1' , '-' ) ;
218218 await elementById ( 'Activity-2' ) . waitForDisplayed ( ) ;
@@ -228,7 +228,7 @@ describe('@transfer - Transfer', () => {
228228 await tap ( 'AdvancedSettings' ) ;
229229 await tap ( 'Channels' ) ;
230230 const channels = await elementsById ( 'Channel' ) ;
231- channels [ 1 ] . click ( ) ;
231+ channels [ driver . isAndroid ? 1 : 0 ] . click ( ) ;
232232 await expectTextWithin ( 'TotalSize' , '₿ 250 000' ) ;
233233 await expectText ( 'Processing payment' ) ;
234234 await doNavigationClose ( ) ;
0 commit comments