synpress icon indicating copy to clipboard operation
synpress copied to clipboard

Can't run synpress tests inside docker container

Open parkhomenko opened this issue 2 years ago • 1 comments

Discussed in https://github.com/Synthetixio/synpress/discussions/786

Originally posted by parkhomenko June 13, 2023 I followed the guides for creating a docker-compose file inside this repository, but I always have an issue, that my tests are frozen on a "setupMetamask" step: image

Could you please show me what I can do wrong? The same tests work perfectly if I run them on my local machine without docker, so the setup should be the same. My synpress.config.ts is:

module.exports = defineConfig({
  e2e: {
    baseUrl: 'https://my-app-url',
    specPattern: 'tests/e2e/specs',
    supportFile: 'tests/support/index.ts',
    videosFolder: 'tests/e2e/videos',
    screenshotsFolder: 'tests/e2e/screenshots',
    video: true,
    chromeWebSecurity: false,
    screenshotOnRunFailure: true,
    defaultCommandTimeout: 30000,
    pageLoadTimeout: 30000,
    requestTimeout: 30000,
    setupNodeEvents(on, config) {
      synpressPlugins(on, config)
      return config
    },
  },
})

Environment variables I use:

- DISPLAY=display:0.0
- PRIVATE_KEY=${PRIVATE_KEY}
- DEBUG=${DEBUG}
- CYPRESS_DOCKER_RUN=true

and a base docker image that I use to run the tests is "synthetixio/docker-e2e:18.16-ubuntu"

parkhomenko avatar Jun 21 '23 13:06 parkhomenko

I do confirm I am facing exactly the same problem. It happens both while using docker-compose in my GitLab CI as well as docker-e2e.

aziolek avatar Jul 05 '23 08:07 aziolek