ChainSafe / dappeteer

[DEPRECATED]🏌🏼‍E2E testing for dApps using Puppeteer + MetaMask
Other
490 stars 152 forks source link

There's no 'Cancel' button more in signTypedData #295

Closed DANDROZAVR closed 1 year ago

DANDROZAVR commented 1 year ago

Describe the bug When signing TypedData message, there's no 'Cancel' button more, only 'Reject'. Moreover, there's no any data-test-id assigned to it.

To Reproduce Steps to reproduce the behavior:

  1. Go to any site, f.e. crew3
  2. Click on 'Connect'
  3. Approve connecting
  4. Try signing (verify part)

image image

In a code, this error is throwing: TimeoutError: Waiting for selector[data-testid="signature-cancel-button"]failed: Waiting failed: 30000ms exceeded

Going from clickOnLittleDownArrowIfNeeded function

I believe changing await page.waitForSelector('[data-testid="signature-cancel-button"]', { visible: true, }); to getElementByContent('Reject') will fix it

Arun9650 commented 1 year ago

hi l like to work on this issue

BeroBurny commented 1 year ago

Thanks for reaching out @DANDROZAVR, can you please provide a bit more information? Like dappeter version and a small code snippet?


@Arun9650 feel free to dig in, but the issue has too many unknowns to be worked on

DANDROZAVR commented 1 year ago

Thanks for reaching out @DANDROZAVR, can you please provide a bit more information? Like dappeter version and a small code snippet?

@Arun9650 feel free to dig in, but the issue has too many unknowns to be worked on

Of course. I'm using dappeteer 5.0.1. It's not only a problem with that function, but almost with every function where "datatest-id" is using (f.e confirmTransaction (edit button), signTypedData and even approve). Metamask is throwing away datatest-id and they are not exist in some tags anymore.

Here's example(don't worry about seed, there's nothing on it):

const dappeteer = require("@chainsafe/dappeteer");
const main = async () => {
    const {metaMask, browser, metaMaskPage} = await dappeteer.bootstrap({
        seed: "flight badge audit grass cool print report diesel verb announce girl vocal",
        password: "my-strong-password",
        browser: "chrome",
        headless: false,
    });
    const pagetemp = await browser.newPage()
    await pagetemp.goto('https://galxe.com/superprotocol')
    await metaMask.approve()
    await metaMask.signTypedData()
    await sleep(10000000)
    await setupCrew3(browser, metaMask)
}
main()
DANDROZAVR commented 1 year ago

Thank you a lot @BeroBurny for fixing it in the newest commit!