synpress icon indicating copy to clipboard operation
synpress copied to clipboard

[💡 Feature]: Autoconnect a newly switched account to the dapp if one was connected previously

Open dalechyn opened this issue 2 years ago • 1 comments

Is your feature request related to a problem?

With metamask, with one account connected to a dApp it's possible to connect another account straight away, specifically replacing the previous account with a new one.

https://github.com/Synthetixio/synpress/assets/35642018/26eb57eb-b2fd-4501-bdcf-914072f11e43

But apparently, it's not available to do with Synpress.

Such specifically blocks me from testing the dApp behaviour when an account is replaced

Describe the solution you'd like.

Adding a parameter that would control the account replacement behaviour would be nice to have within the switchMetamaskAccount function.

Current API:

    switchMetamaskAccount(
      accountNameOrAccountNumber: string | number,
    ): Chainable<boolean>;

Proposed API:

    switchMetamaskAccount(
      accountNameOrAccountNumber: string | number,
      autoConnect?: boolean
    ): Chainable<boolean>;

Describe alternatives you've considered.

No response

Additional context

No response

dalechyn avatar Oct 04 '23 17:10 dalechyn

i'm facing same issue, any resolve have?

mehmetcansahin avatar Oct 17 '23 09:10 mehmetcansahin