Giter Site home page Giter Site logo

[🐛 Bug]: Sometimes calling metamask.confirmPermissionToApproveAll() method on Metamask approve window is failing using Playwright + Synpress as plugin about synpress HOT 7 CLOSED

DavitMkhitaryan avatar DavitMkhitaryan commented on June 11, 2024
[🐛 Bug]: Sometimes calling metamask.confirmPermissionToApproveAll() method on Metamask approve window is failing using Playwright + Synpress as plugin

from synpress.

Comments (7)

DavitMkhitaryan avatar DavitMkhitaryan commented on June 11, 2024

@duckception Please, take a look at this when you have time. This is currently blocking me and possibly other people using this method in Playwright + Synpress as a plugin setup. Thanks

from synpress.

DavitMkhitaryan avatar DavitMkhitaryan commented on June 11, 2024

Here is the method which is failing:

async confirmPermissionToApproveAll() {
    const notificationPage = await playwright.switchToMetamaskNotification();
    await playwright.waitAndClick(
      notificationPageElements.allowToSpendButton,
      notificationPage,
    );
    await playwright.waitAndClick(
      notificationPageElements.approveWarningToSpendButton,
      notificationPage,
      { waitForEvent: 'close' },
    );
    return true;
  }

When commenting out the second part it started working successfully:

await playwright.waitAndClick(
      notificationPageElements.approveWarningToSpendButton,
      notificationPage,
      { waitForEvent: 'close' },
    );

Maybe this part of the code should be executed optionally based on some condition in Metamask, or it is extra at all. Please, take a look at this and update as it is a blocking issue. @duckception

from synpress.

duckception avatar duckception commented on June 11, 2024

Hey! You're using an incorrect function here 😅 For token approvals, you should be using confirmMetamaskPermissionToSpend. The confirmPermissionToApproveAll function is meant for NFT all approvals. Sorry for the confusion, I know this is a bit messy. The upcoming version of Synpress will have a simpler and more intuitive API 🫡

Please, let me know if it helps 🙏

from synpress.

DavitMkhitaryan avatar DavitMkhitaryan commented on June 11, 2024

Thank you for a quick response @duckception ! But I cannot find a method called "confirmMetamaskPermissionToSpend" though, can you please suggest how to find it? I am using version ^3.7.2-beta.9

from synpress.

DavitMkhitaryan avatar DavitMkhitaryan commented on June 11, 2024

Ok, found it, the name of the method now is "confirmPermissionToSpend" FYI @duckception. Thanks! Closing the issue

from synpress.

DavitMkhitaryan avatar DavitMkhitaryan commented on June 11, 2024

Closing as not an issue. The correct method to use in this case is "confirmPermissionToSpend".

from synpress.

duckception avatar duckception commented on June 11, 2024

My bad, I've copied it over from our Cypress tests that have this additional Metamask word in it.

from synpress.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.