Synthetixio / synpress

Synpress is e2e testing framework based on Cypress.io and playwright with support for metamask.

Home Page:https://synpress.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add gas control on token allowance

hernandoagf opened this issue · comments

Is your feature request related to a problem? Please describe.
The library I'm using to handle the contract interactions and token allowances does not make a correct calculation of gas in the local testnet. I noticed there's an option to set custom gas for Metamask transactions using Synpress, but not on token allowances.

Describe the solution you'd like
I'd like to be able to customize the gas to use on the cy.confirmMetamaskPermissionToSpend() function.

Describe alternatives you've considered
I tried using the cy.confirmMetamaskPermissionToSpend() function to approve a token allowance, but that does not work.
Another way to fix this could be by setting a global gas object for all of the transactions during the tests.

Additional context
I'm getting this error when trying to approve spending a token, and I have no way to increase the gas.
Screenshot 2023-06-19 at 19 52 35

cy.activateAdvancedGasControlInMetamask()`

Activate ability (in metamask settings) to specify custom gas price and limit while doing transactions in metamask.

noticed this in the docs

@stavares843 Thank you for your reply. That seems to work only for the cy.confirmMetamaskTransaction() function, there doesn't seem to be a way to set up a global gas config, and the cy.confirmMetamaskPermissionToSpend() function only accepts an allowance amount, no gas config