Synthetixio / synpress

Synpress is e2e testing framework based on Cypress.io and playwright with support for metamask.
https://synpress.io
MIT License
565 stars 179 forks source link

[๐Ÿ› Bug]: Timeout 30000ms. while running cy.confirmMetamaskTransaction() method after latest update #1140

Open ZenoviyShulba opened 1 month ago

ZenoviyShulba commented 1 month ago

๐Ÿ”Ž Have you searched existing issues to avoid duplicates?

๐Ÿงช Have you tested your code using latest version of Synpress?

๐Ÿ’ก Are you able to provide enough information to be able to reproduce your issue locally?

Synpress version

3.7.3

Node.js version

16.16.0

Operating system

Windows 11

Run mode

Synpress (standalone)

CI platform (if applicable)

No response

Are you running your tests inside docker? (if applicable)

What happened?

I used to have an automation test which used confirmMetamaskTransaction() from the library @synthetixio/synpress. Everything was fine, but after the last update 6 days ago, the test constantly fails despite the transaction being successful. Transaction last more than 40s. and Cypress stoping after 30000ms

"The reason is a CypressError: cy.task('confirmMetamaskTransaction') failed with the following error: page.waitForSelector: Timeout 30000ms exceeded.

I'm trying almost everything I know:

Setting up the timeout in synpress.config to 90000ms. Adding a task with a timeout inside it: cy.task('confirmMetamaskTransaction', { timeout: 90000 }).than Adding .should('not.exist') to the task.

I`m using Node v16.16.0, Chrome extension MetaMask 11.15.0, @synthetixio/synpress 3.7.3. Running in --headless mode as well as e2e browser mode and Docker environment, the result is the same. image

What is your expected behavior?

I expect a successful transaction and the test to continue running, as it worked before.

How to reproduce the bug.

synpress run --noExit --configFile synpress.config.js --spec tests/e2e/specs/proposals.js

  1. login into MetaMask using cy.signInWithMetamask();
  2. init Metamask confirmation window: cy.confirmMetamaskTransaction()
  3. Popup shows the confirmation button (but nothing happened, need to manually click on it, it used to work automatically)
  4. After manually clicking it shows timeline 45s. countdown but after 30000ms. Synpress closed the test with a failure

Relevant log output

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

> page.waitForSelector: Timeout 30000ms exceeded.
Call log:
  - waiting for locator('.notification .confirm-page-container-content .custom-nonce-input input') to be visible

https://on.cypress.io/api/task
      at <unknown> (https://staging.tally.xyz/__cypress/runner/cypress_runner.js:151171:78)
      at tryCatcher (https://staging.tally.xyz/__cypress/runner/cypress_runner.js:18744:23)
      at Promise._settlePromiseFromHandler (https://staging.tally.xyz/__cypress/runner/cypress_runner.js:16679:31)
      at Promise._settlePromise (https://staging.tally.xyz/__cypress/runner/cypress_runner.js:16736:18)
      at Promise._settlePromise0 (https://staging.tally.xyz/__cypress/runner/cypress_runner.js:16781:10)
      at Promise._settlePromises (https://staging.tally.xyz/__cypress/runner/cypress_runner.js:16857:18)
      at _drainQueueStep (https://staging.tally.xyz/__cypress/runner/cypress_runner.js:13451:12)
      at _drainQueue (https://staging.tally.xyz/__cypress/runner/cypress_runner.js:13444:9)
      at ../../node_modules/bluebird/js/release/async.js.Async._drainQueues (https://staging.tally.xyz/__cypress/runner/cypress_runner.js:13460:5)
      at Async.drainQueues (https://staging.tally.xyz/__cypress/runner/cypress_runner.js:13330:14)
  From Your Spec Code:
      at Context.eval (webpack:///./tests/e2e/specs/draft-proposal.js:261:9)

  From Node.js Internals:
    TimeoutError: page.waitForSelector: Timeout 30000ms exceeded.
    Call log:
      - waiting for locator('.notification .confirm-page-container-content .custom-nonce-input input') to be visible

    page.waitForSelector: Timeout 30000ms exceeded.