@@ -26,12 +26,14 @@ export class TransactionPage extends BasePage {
2626 private readonly generatedPublicKeys : string [ ] ; // Store generated public keys
2727 public generatedAccounts : string [ ] ; // Store generated accounts from create account transaction
2828 private readonly generatedFiles : Record < string , { text : string ; publicKey : string } > ; // Store generated files from create file transaction with key-value pairs
29+ private hasLoggedFirstCreateTransactionPayer : boolean ;
2930
3031 constructor ( window : Page ) {
3132 super ( window ) ;
3233 this . generatedPublicKeys = [ ] ;
3334 this . generatedAccounts = [ ] ;
3435 this . generatedFiles = { } ;
36+ this . hasLoggedFirstCreateTransactionPayer = false ;
3537 }
3638
3739 /* Selectors */
@@ -178,7 +180,7 @@ export class TransactionPage extends BasePage {
178180 async verifyConfirmTransactionInformation ( typeTransaction : string ) {
179181 await this . window . waitForSelector (
180182 '[data-testid="modal-confirm-transaction"][style*="display: block"]' ,
181- { state : 'visible' , timeout : 10000 } ,
183+ { state : 'visible' , timeout : this . LONG_TIMEOUT * 2 } ,
182184 ) ;
183185 const regex = / ^ \d + \. \d + \. \d + @ \d + \. \d + $ / ;
184186 const transactionId = await this . getText ( this . textTransactionIdSelector ) ;
@@ -244,7 +246,7 @@ export class TransactionPage extends BasePage {
244246 } catch ( error ) {
245247 if ( attempt === 2 ) throw error ;
246248 await this . window . keyboard . press ( 'Escape' ) ;
247- await this . window . waitForTimeout ( 300 ) ;
249+ await this . window . waitForTimeout ( this . SHORT_TIMEOUT ) ;
248250 }
249251 }
250252 }
@@ -263,38 +265,60 @@ export class TransactionPage extends BasePage {
263265
264266 async clickOnCreateAccountTransaction ( ) {
265267 await this . click ( this . createAccountSublinkSelector ) ;
268+ await this . logPayerOnFirstCreateTransactionScreen ( ) ;
266269 }
267270
268271 async clickOnDeleteAccountTransaction ( ) {
269272 await this . click ( this . deleteAccountSublinkSelector ) ;
273+ await this . logPayerOnFirstCreateTransactionScreen ( ) ;
270274 }
271275
272276 async clickOnUpdateAccountTransaction ( ) {
273277 await this . click ( this . updateAccountSublinkSelector ) ;
278+ await this . logPayerOnFirstCreateTransactionScreen ( ) ;
274279 }
275280
276281 async clickOnApproveAllowanceTransaction ( ) {
277282 await this . click ( this . allowanceSublinkSelector ) ;
283+ await this . logPayerOnFirstCreateTransactionScreen ( ) ;
278284 }
279285
280286 async clickOnTransferTokensTransaction ( ) {
281287 await this . click ( this . transferTokensSublinkSelector ) ;
288+ await this . logPayerOnFirstCreateTransactionScreen ( ) ;
282289 }
283290
284291 async clickOnFileCreateTransaction ( ) {
285292 await this . click ( this . createFileSublinkSelector ) ;
293+ await this . logPayerOnFirstCreateTransactionScreen ( ) ;
286294 }
287295
288296 async clickOnReadCreateTransaction ( ) {
289297 await this . click ( this . readFileSublinkSelector ) ;
298+ await this . logPayerOnFirstCreateTransactionScreen ( ) ;
290299 }
291300
292301 async clickOnUpdateFileSublink ( ) {
293302 await this . click ( this . updateFileSublinkSelector ) ;
303+ await this . logPayerOnFirstCreateTransactionScreen ( ) ;
294304 }
295305
296306 async clickOnAppendFileSublink ( ) {
297307 await this . click ( this . appendFileSublinkSelector ) ;
308+ await this . logPayerOnFirstCreateTransactionScreen ( ) ;
309+ }
310+
311+ private async logPayerOnFirstCreateTransactionScreen ( ) {
312+ if ( this . hasLoggedFirstCreateTransactionPayer ) {
313+ return ;
314+ }
315+
316+ await this . waitForElementToBeVisible ( this . payerAccountInputSelector , this . LONG_TIMEOUT ) ;
317+ await this . window . waitForTimeout ( this . SHORT_TIMEOUT ) ;
318+
319+ const payerValue = await this . getTextFromInputField ( this . payerAccountInputSelector ) ;
320+ console . log ( '[first-create-transaction-screen] payer account ID:' , payerValue ) ;
321+ this . hasLoggedFirstCreateTransactionPayer = true ;
298322 }
299323
300324 async verifyTransactionExists ( transactionId : string , transactionType : string ) {
@@ -796,18 +820,14 @@ export class TransactionPage extends BasePage {
796820 await this . click ( this . backButtonSelector , null , this . LONG_TIMEOUT * 2 ) ;
797821 }
798822
799- async clickOnSignAndSubmitButton ( forceLocalNetPayerHandling = true ) {
823+ async clickOnSignAndSubmitButton ( forceLocalNetPayerHandling = false ) {
800824 // For LOCALNET, or when explicitly requested, use the LOCALNET payer fallback.
801825 // Mirror Node doesn't return accounts there, so Payer ID is empty.
802826 if ( forceLocalNetPayerHandling || process . env . ENVIRONMENT ?. toUpperCase ( ) === 'LOCALNET' ) {
803827 const currentValue = await this . getTextFromInputField ( this . payerAccountInputSelector ) ;
804828 console . log ( 'Current payer account ID:' , currentValue ) ;
805- if ( forceLocalNetPayerHandling || ! currentValue || currentValue . trim ( ) === '' ) {
806- console . log (
807- forceLocalNetPayerHandling
808- ? 'Force filling payer account ID using LOCALNET fallback'
809- : 'Filling in payer account ID using LOCALNET fallback' ,
810- ) ;
829+ if ( ! currentValue || currentValue . trim ( ) === '' ) {
830+ console . log ( 'Filling in payer account ID using LOCALNET fallback' ) ;
811831 await this . fillInPayerAccountId ( LOCALNET_PAYER_ACCOUNT_ID ) ;
812832 const payerInput = this . getElement ( this . payerAccountInputSelector ) ;
813833 await payerInput . blur ( ) ;
0 commit comments