Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[🐛 Bug]: An error of 'Timeout 30000ms exceeded.' occurred in Docker mode But Correct in non Docker mode #851

Open
4 tasks done
jimxyz opened this issue Aug 27, 2023 · 12 comments
Labels
bug 🐛 Something isn't working needs triaging ⏳

Comments

@jimxyz
Copy link

jimxyz commented Aug 27, 2023

🔎 Have you searched existing issues to avoid duplicates?

  • I have made sure that my issue is not a duplicate.

🧪 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?

  • I can provide enough details to reproduce my issue on local environment.

Synpress version

3.7.2-beta.4

Node.js version

v20.0.0

Operating system

Docker base on synthetixio/docker-e2e:20.0-ubuntu

Run mode

Cypress + Synpress (as plugin)

CI platform (if applicable)

No response

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

  • This issue could be related to docker.

What happened?

An error of 'Timeout 30000ms exceeded.' occurred in Docker mode But Correct in non Docker mode

What is your expected behavior?

No response

How to reproduce the bug.

The original code

https://github.com/synpress-io/synpress-examples/tree/master/synpress/with-docker

Modified code

Dockerfile

FROM cypress/browsers:node-18.16.0-chrome-114.0.5735.133-1-ff-114.0.2-edge-114.0.1823.51-1
 
WORKDIR /app
COPY . /app
RUN cd /app
RUN npm install

package.json

{
  "name": "@synpress-io/synpress-in-docker-example",
  "version": "1.0.0",
  "repository": "git@github.com:synpress-io/synpress-examples.git",
  "author": "Jakub Mucha <jakub.mucha@icloud.com>",
  "license": "MIT",
  "devDependencies": {
    "@metamask/test-dapp": "^7.0.1",
    "@synthetixio/synpress": "3.7.2-beta.4",
    "serve": "^14.2.0",
    "start-server-and-test": "^2.0.0"
  },
  "scripts": {
    "synpress:run": "./node_modules/.bin/synpress run --config baseUrl=http://localhost:3000 --headless",
    "start:server": "serve ./node_modules/@metamask/test-dapp/dist -p 3000",
    "test": "export NODE_OPTIONS=\"--openssl-legacy-provider --no-experimental-fetch\" && ./node_modules/.bin/start-server-and-test 'yarn start:server' http-get://localhost:3000 'npm run synpress:run'",
    "test:headless": "export NODE_OPTIONS=\"--openssl-legacy-provider --no-experimental-fetch\" && ./node_modules/.bin/start-server-and-test 'npm run start:server' http-get://localhost:3000 'npm run synpress:run --headless'"
  }
}

### Relevant log output

```typescript
> @synpress-io/synpress-in-docker-example@1.0.0 test:headless
> export NODE_OPTIONS="--openssl-legacy-provider --no-experimental-fetch" && ./node_modules/.bin/start-server-and-test 'npm run start:server' http-get://localhost:5000 'npm run synpress:run --headless'

1: starting server using command "npm run start:server"
and when url "[ 'http-get://localhost:5000' ]" is responding with HTTP status code 200
running tests using command "npm run synpress:run --headless"


> @synpress-io/synpress-in-docker-example@1.0.0 start:server
> serve ./node_modules/@metamask/test-dapp/dist -p 5000

 ERROR  Cannot copy server address to clipboard: Couldn't find the `xsel` binary and fallback didn't work. On Debian/Ubuntu you can install xsel with: sudo apt install xsel.

   ┌────────────────────────────────────────┐
   │                                        │
   │   Serving!                             │
   │                                        │
   │   - Local:    http://localhost:5000    │
   │   - Network:  http://172.17.0.6:5000   │
   │                                        │
   └────────────────────────────────────────┘

 HTTP  8/27/2023 10:47:46 AM 127.0.0.1 GET /
 HTTP  8/27/2023 10:47:46 AM 127.0.0.1 Returned 200 in 18 ms

> @synpress-io/synpress-in-docker-example@1.0.0 synpress:run
> ./node_modules/.bin/synpress run --config baseUrl=http://localhost:5000

[4932:0827/104749.619732:ERROR:node_bindings.cc(279)] Most NODE_OPTIONs are not supported in packaged apps. See documentation for more details.
[4932:0827/104749.619845:ERROR:node_bindings.cc(279)] Most NODE_OPTIONs are not supported in packaged apps. See documentation for more details.
libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)
[5083:0827/104750.586522:ERROR:gpu_memory_buffer_support_x11.cc(44)] dri3 extension not supported.

====================================================================================================

  (Run Starting)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Cypress:        12.7.0                                                                         │
  │ Browser:        Chrome 113                                                                     │
  │ Node Version:   v20.0.0 (/usr/local/bin/node)                                                  │
  │ Specs:          1 found (connect-wallet-spec.js)                                               │
  │ Searched:       tests/e2e/specs/**/*.{js,jsx,ts,tsx}                                           │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘


────────────────────────────────────────────────────────────────────────────────────────────────────
                                                                                                    
  Running:  connect-wallet-spec.js                                                          (1 of 1)


  connect wallet spec
 HTTP  8/27/2023 10:48:26 AM 127.0.0.1 GET /
 HTTP  8/27/2023 10:48:26 AM 127.0.0.1 Returned 200 in 8 ms
 HTTP  8/27/2023 10:48:26 AM 127.0.0.1 GET /index.css
 HTTP  8/27/2023 10:48:26 AM 127.0.0.1 Returned 200 in 6 ms
 HTTP  8/27/2023 10:48:26 AM 127.0.0.1 GET /metamask-fox.svg
 HTTP  8/27/2023 10:48:26 AM 127.0.0.1 Returned 200 in 8 ms
 HTTP  8/27/2023 10:48:26 AM 127.0.0.1 GET /alert-red.svg
 HTTP  8/27/2023 10:48:26 AM 127.0.0.1 Returned 200 in 5 ms
 HTTP  8/27/2023 10:48:26 AM 127.0.0.1 GET /main.js
 HTTP  8/27/2023 10:48:26 AM 127.0.0.1 Returned 200 in 56 ms
 HTTP  8/27/2023 10:48:33 AM 127.0.0.1 GET /metamask-fox.svg
 HTTP  8/27/2023 10:48:33 AM 127.0.0.1 Returned 200 in 3 ms
    (Attempt 1 of 2) should connect wallet with success
    1) should connect wallet with success


  0 passing (2m)
  1 failing

  1) connect wallet spec
       should connect wallet with success:
     CypressError: `cy.task('acceptMetamaskAccess')` failed with the following error:

> page.waitForSelector: Timeout 30000ms exceeded.
=========================== logs ===========================
waiting for locator('.notification #app-content .app') to be visible
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
  locator resolved to hidden <div class="app os-linux">…</div>
============================================================

https://on.cypress.io/api/task
      at <unknown> (http://localhost:5000/__cypress/runner/cypress_runner.js:141557:78)
      at tryCatcher (http://localhost:5000/__cypress/runner/cypress_runner.js:8914:23)
      at Promise._settlePromiseFromHandler (http://localhost:5000/__cypress/runner/cypress_runner.js:6849:31)
      at Promise._settlePromise (http://localhost:5000/__cypress/runner/cypress_runner.js:6906:18)
      at Promise._settlePromise0 (http://localhost:5000/__cypress/runner/cypress_runner.js:6951:10)
      at Promise._settlePromises (http://localhost:5000/__cypress/runner/cypress_runner.js:7027:18)
      at _drainQueueStep (http://localhost:5000/__cypress/runner/cypress_runner.js:3621:12)
      at _drainQueue (http://localhost:5000/__cypress/runner/cypress_runner.js:3614:9)
      at ../../node_modules/bluebird/js/release/async.js.Async._drainQueues (http://localhost:5000/__cypress/runner/cypress_runner.js:3630:5)
      at Async.drainQueues (http://localhost:5000/__cypress/runner/cypress_runner.js:3500:14)
  From Your Spec Code:
      at Context.eval (webpack:///./support/commands.js:184:0)
  
  From Node.js Internals:
    TimeoutError: page.waitForSelector: Timeout 30000ms exceeded.
    =========================== logs ===========================
    waiting for locator('.notification #app-content .app') to be visible
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
    ============================================================
    page.waitForSelector: Timeout 30000ms exceeded.
    =========================== logs ===========================
    waiting for locator('.notification #app-content .app') to be visible
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
      locator resolved to hidden <div class="app os-linux">…</div>
    ============================================================
        at Object.waitFor (/app/node_modules/@synthetixio/synpress/commands/playwright.js:200:16)
        at Object.switchToMetamaskNotification (/app/node_modules/@synthetixio/synpress/commands/playwright.js:180:9)
        at acceptAccess (/app/node_modules/@synthetixio/synpress/commands/metamask.js:854:30)




  (Results)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Tests:        1                                                                                │
  │ Passing:      0                                                                                │
  │ Failing:      1                                                                                │
  │ Pending:      0                                                                                │
  │ Skipped:      0                                                                                │
  │ Screenshots:  2                                                                                │
  │ Video:        true                                                                             │
  │ Duration:     1 minute, 32 seconds                                                             │
  │ Spec Ran:     connect-wallet-spec.js                                                           │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘


  (Screenshots)

  -  /app/tests/e2e/screenshots/connect-wallet-spec.js/connect wallet spec -- should      (1050x884)
     connect wallet with success (failed).png                                                       
  -  /app/tests/e2e/screenshots/connect-wallet-spec.js/connect wallet spec -- should      (1050x884)
     connect wallet with success (failed) (attempt 2).png                                           


  (Video)

  -  Started processing:  Compressing to 32 CRF                                                     
    Compression progress:  63%
  -  Finished processing: 20 seconds                                                 

  -  Video output: /app/tests/e2e/videos/connect-wallet-spec.js.mp4

    Compression progress:  100%

====================================================================================================

  (Run Finished)


       Spec                                              Tests  Passing  Failing  Pending  Skipped  
  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ ✖  connect-wallet-spec.js                   01:32        1        -        1        -        - │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘
    ✖  1 of 1 failed (100%)                     01:32        1        -        1        -        -  

Cypress run results: 1 total tests, 0 passed, 1 failed

 INFO  Gracefully shutting down. Please wait...
Error: Command failed with exit code 1: npm run synpress:run --headless
    at makeError (/app/node_modules/start-server-and-test/node_modules/execa/lib/error.js:60:11)
    at handlePromise (/app/node_modules/start-server-and-test/node_modules/execa/index.js:118:26)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  shortMessage: 'Command failed with exit code 1: npm run synpress:run --headless',
  command: 'npm run synpress:run --headless',
  escapedCommand: '"npm run synpress:run --headless"',
  exitCode: 1,
  signal: undefined,
  signalDescription: undefined,
  stdout: undefined,
  stderr: undefined,
  failed: true,
  timedOut: false,
  isCanceled: false,
  killed: false
}
@jimxyz jimxyz added bug 🐛 Something isn't working needs triaging ⏳ labels Aug 27, 2023
@duckception
Copy link
Contributor

Hey!

There are a bunch of different things that might be failing here. I'd recommend using or building on top of the docker image we have provided in the examples repo.

However, if you'd still like to try to debug this further, I'd check the screenshots and recordings that are produced after you run the tests. They might contain useful clues as to why the tests are failing 🕵️‍♂️

@jimxyz
Copy link
Author

jimxyz commented Sep 18, 2023

UD spec -- should connect wallet with success (failed) (attempt 2)
UD spec -- should connect wallet with success (failed)

@duckception

ubuntu@ip-172-31-32-231:~/code/frontend-cypress$ docker-compose up
Creating network "frontend-cypress_default" with the default driver
Building frontend-cypress
Step 1/6 : FROM cypress/browsers:node-18.16.0-chrome-114.0.5735.133-1-ff-114.0.2-edge-114.0.1823.51-1
 ---> 7840cba986fe
Step 2/6 : WORKDIR /usr/src/app
 ---> Using cache
 ---> 4748e9ebf804
Step 3/6 : COPY package.json ./
 ---> Using cache
 ---> 1f146dbe433f
Step 4/6 : RUN npm install
 ---> Running in 90bd4f174858
npm WARN deprecated querystring@0.2.1: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated core-js@2.6.12: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.

added 1156 packages, and audited 1157 packages in 2m

183 packages are looking for funding
  run `npm fund` for details

8 vulnerabilities (5 moderate, 3 high)

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.
Removing intermediate container 90bd4f174858
 ---> bc2a9b735150
Step 5/6 : COPY . ./
 ---> 3ac8a8e3d36d
Step 6/6 : CMD ["npm", "run","synpress:run"]
 ---> Running in ec78b9f2f7c7
Removing intermediate container ec78b9f2f7c7
 ---> 34756e131a94

Successfully built 34756e131a94
Successfully tagged frontend-cypress_frontend-cypress:latest
WARNING: Image for service frontend-cypress was built because it did not already exist. To rebuild this image you must use `docker-compose build` or `docker-compose up --build`.
Creating frontend-cypress_frontend-cypress_1 ... done
Attaching to frontend-cypress_frontend-cypress_1
frontend-cypress_1  | 
frontend-cypress_1  | > @synpress-io/synpress-in-docker-example@1.0.0 synpress:run
frontend-cypress_1  | > ./node_modules/.bin/synpress run --config baseUrl=https://98ba-157-245-206-214.ngrok-free.app/ --headless
frontend-cypress_1  | 
frontend-cypress_1  | [STARTED] Task without title.
frontend-cypress_1  | [SUCCESS] Task without title.
frontend-cypress_1  | libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)
frontend-cypress_1  | 
frontend-cypress_1  | DevTools listening on ws://127.0.0.1:33929/devtools/browser/91a7b967-ec86-40b8-801f-3fad688ec0d6
frontend-cypress_1  | [399:0918/053822.973828:ERROR:gpu_memory_buffer_support_x11.cc(44)] dri3 extension not supported.
frontend-cypress_1  | 
frontend-cypress_1  | ====================================================================================================
frontend-cypress_1  | 
frontend-cypress_1  |   (Run Starting)
frontend-cypress_1  | 
frontend-cypress_1  |   ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
frontend-cypress_1  |    Cypress:        12.17.3                                                                        
frontend-cypress_1  |    Browser:        Chrome 114                                                                     
frontend-cypress_1  |    Node Version:   v18.16.0 (/usr/local/bin/node)                                                 
frontend-cypress_1  |    Specs:          1 found (UD-spec.js)                                                           
frontend-cypress_1  |    Searched:       tests/e2e/specs/**/*.{js,jsx,ts,tsx}                                           
frontend-cypress_1  |   └────────────────────────────────────────────────────────────────────────────────────────────────┘
frontend-cypress_1  | 
frontend-cypress_1  | 
frontend-cypress_1  | ────────────────────────────────────────────────────────────────────────────────────────────────────
frontend-cypress_1  |                                                                                                     
frontend-cypress_1  |   Running:  UD-spec.js                                                                      (1 of 1)
frontend-cypress_1  | 
frontend-cypress_1  | 
frontend-cypress_1  |   UD spec
frontend-cypress_1  |  WARNING: Warning: Middleware for RTK-Query API at reducerPath "api" has not been added to the store.
frontend-cypress_1  | Features like automatic cache collection, automatic refetching etc. will not be available. 
frontend-cypress_1  |  ERROR: Warning: Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.%s 
frontend-cypress_1  |     (Attempt 1 of 2) should connect wallet with success
frontend-cypress_1  |     1) should connect wallet with success
frontend-cypress_1  | 
frontend-cypress_1  | 
frontend-cypress_1  |   0 passing (2m)
frontend-cypress_1  |   1 failing
frontend-cypress_1  | 
frontend-cypress_1  |   1) UD spec
frontend-cypress_1  |        should connect wallet with success:
frontend-cypress_1  |      CypressError: `cy.task('importMetamaskAccount')` failed with the following error:
frontend-cypress_1  | 
frontend-cypress_1  | > page.waitForNavigation: Timeout 30000ms exceeded.
frontend-cypress_1  | =========================== logs ===========================
frontend-cypress_1  | waiting for navigation until "load"
frontend-cypress_1  | ============================================================
frontend-cypress_1  | 
frontend-cypress_1  | https://on.cypress.io/api/task
frontend-cypress_1  |       at <unknown> (https://98ba-157-245-206-214.ngrok-free.app/__cypress/runner/cypress_runner.js:151171:78)
frontend-cypress_1  |       at tryCatcher (https://98ba-157-245-206-214.ngrok-free.app/__cypress/runner/cypress_runner.js:18744:23)
frontend-cypress_1  |       at Promise._settlePromiseFromHandler (https://98ba-157-245-206-214.ngrok-free.app/__cypress/runner/cypress_runner.js:16679:31)
frontend-cypress_1  |       at Promise._settlePromise (https://98ba-157-245-206-214.ngrok-free.app/__cypress/runner/cypress_runner.js:16736:18)
frontend-cypress_1  |       at Promise._settlePromise0 (https://98ba-157-245-206-214.ngrok-free.app/__cypress/runner/cypress_runner.js:16781:10)
frontend-cypress_1  |       at Promise._settlePromises (https://98ba-157-245-206-214.ngrok-free.app/__cypress/runner/cypress_runner.js:16857:18)
frontend-cypress_1  |       at _drainQueueStep (https://98ba-157-245-206-214.ngrok-free.app/__cypress/runner/cypress_runner.js:13451:12)
frontend-cypress_1  |       at _drainQueue (https://98ba-157-245-206-214.ngrok-free.app/__cypress/runner/cypress_runner.js:13444:9)
frontend-cypress_1  |       at ../../node_modules/bluebird/js/release/async.js.Async._drainQueues (https://98ba-157-245-206-214.ngrok-free.app/__cypress/runner/cypress_runner.js:13460:5)
frontend-cypress_1  |       at Async.drainQueues (https://98ba-157-245-206-214.ngrok-free.app/__cypress/runner/cypress_runner.js:13330:14)
frontend-cypress_1  |   From Your Spec Code:
frontend-cypress_1  |       at Context.eval (webpack:///./support/commands.js:49:0)
frontend-cypress_1  |   
frontend-cypress_1  |   From Node.js Internals:
frontend-cypress_1  |     TimeoutError: page.waitForNavigation: Timeout 30000ms exceeded.
frontend-cypress_1  |     =========================== logs ===========================
frontend-cypress_1  |     waiting for navigation until "load"
frontend-cypress_1  |     ============================================================
frontend-cypress_1  |     page.waitForNavigation: Timeout 30000ms exceeded.
frontend-cypress_1  |     =========================== logs ===========================
frontend-cypress_1  |     waiting for navigation until "load"
frontend-cypress_1  |     ============================================================
frontend-cypress_1  |         at Object.waitAndClick (/usr/src/app/node_modules/@synthetixio/synpress/commands/playwright.js:228:16)
frontend-cypress_1  |         at async importAccount (/usr/src/app/node_modules/@synthetixio/synpress/commands/metamask.js:358:5)
frontend-cypress_1  | 
frontend-cypress_1  | 
frontend-cypress_1  | 
frontend-cypress_1  | 
frontend-cypress_1  |   (Results)
frontend-cypress_1  | 
frontend-cypress_1  |   ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
frontend-cypress_1  |    Tests:        1                                                                                
frontend-cypress_1  |    Passing:      0                                                                                
frontend-cypress_1  |    Failing:      1                                                                                
frontend-cypress_1  |    Pending:      0                                                                                
frontend-cypress_1  |    Skipped:      0                                                                                
frontend-cypress_1  |    Screenshots:  2                                                                                
frontend-cypress_1  |    Video:        true                                                                             
frontend-cypress_1  |    Duration:     1 minute, 48 seconds                                                             
frontend-cypress_1  |    Spec Ran:     UD-spec.js                                                                       
frontend-cypress_1  |   └────────────────────────────────────────────────────────────────────────────────────────────────┘
frontend-cypress_1  | 
frontend-cypress_1  | 
frontend-cypress_1  |   (Screenshots)
frontend-cypress_1  | 
frontend-cypress_1  |   -  /usr/src/app/tests/e2e/screenshots/UD-spec.js/UD spec -- should connect wallet w      (780x463)
frontend-cypress_1  |      ith success (failed).png                                                                       
frontend-cypress_1  |   -  /usr/src/app/tests/e2e/screenshots/UD-spec.js/UD spec -- should connect wallet w      (780x463)
frontend-cypress_1  |      ith success (failed) (attempt 2).png                                                           
frontend-cypress_1  | 
frontend-cypress_1  | 
frontend-cypress_1  |   (Video)
frontend-cypress_1  | 
frontend-cypress_1  |   -  Started compressing: Compressing to 32 CRF                                                     
frontend-cypress_1  |   -  Finished compressing: 10 seconds                                                
frontend-cypress_1  |     Compression progress:  100%
frontend-cypress_1  | 
frontend-cypress_1  |   -  Video output: /usr/src/app/tests/e2e/videos/UD-spec.js.mp4
frontend-cypress_1  | 
frontend-cypress_1  | 
frontend-cypress_1  | ====================================================================================================
frontend-cypress_1  | 
frontend-cypress_1  |   (Run Finished)
frontend-cypress_1  | 
frontend-cypress_1  | 
frontend-cypress_1  |        Spec                                              Tests  Passing  Failing  Pending  Skipped  
frontend-cypress_1  |   ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
frontend-cypress_1  |      UD-spec.js                               01:48        1        -        1        -        - 
frontend-cypress_1  |   └────────────────────────────────────────────────────────────────────────────────────────────────┘
frontend-cypress_1  |       1 of 1 failed (100%)                     01:48        1        -        1        -        -  
frontend-cypress_1  | 
frontend-cypress_1  | Cypress run results: 1 total tests, 0 passed, 1 failed
frontend-cypress_frontend-cypress_1 exited with code 1
ubuntu@ip-172-31-32-231:~/code/frontend-cypress$ 

@duckception
Copy link
Contributor

Can you provide a repository where I can reproduce this?

@duckception
Copy link
Contributor

You're trying to run it headlessly in docker which is not supported. You'll have to remove the --headless flag when running in docker. The headless mode works only in the local environment. Let me know if this fixes the issue 🫡

@jimxyz
Copy link
Author

jimxyz commented Sep 20, 2023

Remove the --headless flag.But the errors still exist.

Here are the running logs
https://github.com/jimxyz/synpress-docker-demo/blob/master/run-in-docker.log

@duckception
Copy link
Contributor

duckception commented Sep 20, 2023

I suspect that xvfb is not running for some reason, but I cannot even run this docker image on my machine. I get the Browser: chrome was not found on your system or is not supported by Cypress. error. Either way, since you're running Synpress in standalone mode don't use Cypress docker image, instead use our setup as described here.

@philpetrov
Copy link

philpetrov commented Sep 26, 2023

Hi! I Have the same problem Cypress 12.17.3 + Synpress ("@synthetixio/synpress": "^3.7.1",). When i start locally switchToMetamaskNotification method works, and test passed, but in the gitlub error:

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

page.waitForSelector: Timeout 30000ms exceeded.
=========================== logs ===========================
waiting for locator('.notification #app-content .app') to be visible
locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

https://on.cypress.io/api/task
at (https://dev.cryptoexchange.com/__cypress/runner/cypress_runner.js:151171:78)
at tryCatcher (https://dev.cryptoexchange.com/__cypress/runner/cypress_runner.js:18744:23)
at Promise._settlePromiseFromHandler (https://dev.cryptoexchange.com/__cypress/runner/cypress_runner.js:16679:31)
at Promise._settlePromise (https://dev.cryptoexchange.com/__cypress/runner/cypress_runner.js:16736:18)
at Promise._settlePromise0 (https://dev.cryptoexchange.com/__cypress/runner/cypress_runner.js:16781:10)
at Promise._settlePromises (https://dev.cryptoexchange.com/__cypress/runner/cypress_runner.js:16857:18)
at _drainQueueStep (https://dev.cryptoexchange.com/__cypress/runner/cypress_runner.js:13451:12)
at _drainQueue (https://dev.cryptoexchange.com/__cypress/runner/cypress_runner.js:13444:9)
at ../../node_modules/bluebird/js/release/async.js.Async._drainQueues (https://dev.cryptoexchange.com/__cypress/runner/cypress_runner.js:13460:5)
at Async.drainQueues (https://dev.cryptoexchange.com/__cypress/runner/cypress_runner.js:13330:14)
From Your Spec Code:
at Context.eval (webpack:///./node_modules/@synthetixio/synpress/support/commands.js:35:0)

From Node.js Internals:
TimeoutError: page.waitForSelector: Timeout 30000ms exceeded.
=========================== logs ===========================
waiting for locator('.notification #app-content .app') to be visible
locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

page.waitForSelector: Timeout 30000ms exceeded.
=========================== logs ===========================
waiting for locator('.notification #app-content .app') to be visible
locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

locator resolved to hidden

  at Object.waitFor (/app/node_modules/@synthetixio/synpress/commands/playwright.js:140:16)
  at Object.switchToMetamaskNotification (/app/node_modules/@synthetixio/synpress/commands/playwright.js:120:9)
  at switchToMetamaskNotification (/app/node_modules/@synthetixio/synpress/plugins/index.js:91:32)

_signUpPage.default.visitSignUpPage();
_headOfAllPage.default.checkProtocol();
_headOfAllPage.default.checkTitlePage('Create New Customer Account');
_loginPage.default.signUpDev(_locators.user.individualAccountTestEmail);
_headOfAllPage.default.clickConnectWalletAfterLoginBtn();
_headOfAllPage.default.clickMetamaskBtn();
cy.wait(15000);
cy.switchToMetamaskNotification();
cy.acceptMetamaskAccess({
confirmSignatureRequest: true
});
cy.readFile(_locators.fixturesInfo.cxCustomerToken).then(fixtureData => {
(0, _getCustomerRequest.getCustomerRequest)(fixtureData.cxCustomerToken).then(response => {
expect(response.status).to.eq(200);
// Check, that wallet value is NOT null (wallet connected)
assert.notStrictEqual(response.body.data.wallet, null);
});
});
_headOfAllPage.default.clickAccountHeadList();
_headOfAllPage.default.clickDisconnectWalletFromHeadList();
_headOfAllPage.default.clickDisconnectBtn();
cy.readFile(_locators.fixturesInfo.cxCustomerToken).then(fixtureData => {
(0, _getCustomerRequest.getCustomerRequest)(fixtureData.cxCustomerToken).then(response => {
expect(response.status).to.eq(200);
// Check, that wallet value is NULL (wallet disconnected)
assert.strictEqual(response.body.data.wallet, null);
});
});`

Loccaly i start with:
`- docker-compose build synpress

  • docker-compose run synpress sh
  • npx synpress run --spec "cypress/e2e/specs/wallet/connectDisconnectMetamask.cy.js" --configFile synpress.config.js --browser chrome`

Using gitlab:

' - docker compose -f docker-compose.dev.yml build synpress # Сборка контейнера synpress
- docker compose -f docker-compose.dev.yml up -d synpress
- npx synpress run --spec "cypress/e2e/specs/wallet/connectDisconnectMetamask.cy.js" --configFile synpress.config.js --browser chrome '

Can you help me please?

@duckception
Copy link
Contributor

@philpetrov How does you docker-compose setup look like?

@philpetrov
Copy link

philpetrov commented Sep 27, 2023

@duckception
locally docker-compose.yml which works, contains:
`version: "3.9"

services:
test-app:
build:
context: .
dockerfile: docker/local/Dockerfile
environment:
- "TELEGRAM_BOT_TOKEN="
- "PWA_LOCAL_DEV_CHAT_ID="
deploy:
restart_policy:
condition: none
volumes:
- ./var/results:/app/cypress/results
networks:
- default

nginx:
image: nginx:latest
container_name: cryptoexchange_tests_nginx
deploy:
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
window: 120s
ports:
- "7777:80"
volumes:
- ./var/results:/opt/app
- ./nginx/conf.d:/etc/nginx/conf.d
networks:
- default

synpress:
volumes:
- /Users/lidiakarandasova/Documents/CX/cryptoexchange-test/synpress.config.js:/app/synpress.config.js
profiles:
- synpress
container_name: synpress
build: .
environment:
- DISPLAY=display:0.0
- CYPRESS_DOCKER_RUN=true
- CI=true
entrypoint: []
working_dir: /app
depends_on:
- display
networks:
- x11

display:
container_name: display
image: synthetixio/display:016121eafdfff448414894d0ca5a50b1d72b62eb-base
environment:
- RUN_XTERM=no
- DISPLAY_WIDTH=800
- DISPLAY_HEIGHT=600
ports:
- "8080:8080"
networks:
- x11

networks:
default:
driver: bridge
x11:
`

in gitlab docker-compose.dev.yml with error contains:

`version: "3.9"

services:
test-app:
image: "${IMAGE}"
deploy:
restart_policy:
condition: none
environment:
- "TELEGRAM_BOT_TOKEN=${TELEGRAM_BOT_TOKEN}"
- "PWA_LOCAL_DEV_CHAT_ID=${PWA_LOCAL_DEV_CHAT_ID}"
volumes:
- /var/www/cryptoexchange-tests/results:/app/cypress/results
networks:
- web

nginx:
image: nginx:latest
hostname: cryptoexchange_tests_nginx
deploy:
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
window: 120s
ports:
- "8080:80"
volumes:
- /var/www/cryptoexchange-tests/results:/opt/app
- /var/www/cryptoexchange-tests/nginx/conf.d:/etc/nginx/conf.d
networks:
- web

synpress:
volumes:
- /var/www/cryptoexchange-tests/results:/app/cypress/results
hostname: synpress
deploy:
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 5
window: 120s
image: "${SYNPRESS_IMAGE}"
environment:
- "TELEGRAM_BOT_TOKEN=${TELEGRAM_BOT_TOKEN}"
- "PWA_LOCAL_DEV_CHAT_ID=${PWA_LOCAL_DEV_CHAT_ID}"
- DISPLAY=display:0.0
- CYPRESS_DOCKER_RUN=true
- CI=true
networks:
- web

display:
hostname: display
image: synthetixio/display:016121eafdfff448414894d0ca5a50b1d72b62eb-base
environment:
- RUN_XTERM=no
- DISPLAY_WIDTH=800
- DISPLAY_HEIGHT=600
networks:
- web

networks:
web:`

@drptbl
Copy link
Member

drptbl commented Sep 27, 2023

Hey @philpetrov,

You've shared your env var secrets including TELEGRAM_BOT_TOKEN and PWA_LOCAL_DEV_CHAT_ID.

I have edited your post and removed them.

However, please rotate your variables, otherwise someone else could use it maliciously in future.

Thanks,
Jakub.

@gediminasInterCap
Copy link

any solutions - workarounds for this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working needs triaging ⏳
Projects
None yet
Development

No branches or pull requests

5 participants