synpress icon indicating copy to clipboard operation
synpress copied to clipboard

How can I add/import a token

Open blackpintz opened this issue 3 years ago • 3 comments

Hi, is there a function that I can use to add/import a token?

blackpintz avatar Feb 09 '22 18:02 blackpintz

Hey @blackpintz. Sadly there is no such function yet, but I will try to implement it until end of this week. Expect it to be included in next synpress release, which is expected until Monday.

Cheers, Jakub.

drptbl avatar Feb 10 '22 12:02 drptbl

@drptbl Okay, thank you. Another issue I am having is trying to call confirmMetamaskTransaction(). I keep getting this error:

     CypressError: `cy.task('confirmMetamaskTransaction')` failed with the following error:

> waiting for function failed: timeout 30000ms exceeded

Not sure if it is me calling it wrongly. You can find my code for this here: https://github.com/blackpintz/FE-Challenge/tree/e2e-tests And I am using synpress run. Please advise.

blackpintz avatar Feb 10 '22 13:02 blackpintz

@drptbl Okay, thank you. Another issue I am having is trying to call confirmMetamaskTransaction(). I keep getting this error:

     CypressError: `cy.task('confirmMetamaskTransaction')` failed with the following error:

> waiting for function failed: timeout 30000ms exceeded

Not sure if it is me calling it wrongly. You can find my code for this here: https://github.com/blackpintz/FE-Challenge/tree/e2e-tests And I am using synpress run. Please advise.

It worked when I used cy.confirmMetamaskPermissionToSpend() instead.

blackpintz avatar Feb 15 '22 15:02 blackpintz

Hey @blackpintz, this has been added in latest synpress version which is @synthetixio/[email protected].

  • cy.confirmMetamaskAddToken() (to confirm adding a new custom token)
  • cy.importMetamaskToken('0x509ee0d083ddf8ac028f2a56731412edd63223b9') (to import new token) or
  • cy.importMetamaskToken({ address: '0x509ee0d083ddf8ac028f2a56731412edd63223b9', symbol: 'USDT'}) (to set custom symbol)

Thanks, Jakub.

drptbl avatar Nov 11 '22 23:11 drptbl