GithubHelp home page GithubHelp logo

Error launching browser about synpress HOT 5 CLOSED

synthetixio avatar synthetixio commented on July 27, 2024
Error launching browser

from synpress.

Comments (5)

drptbl avatar drptbl commented on July 27, 2024

Hey @xanderjl, thanks for reporting.

I couldn't reproduce the issue, so it seems like setup/user error.

Could you please let me know which command do you use to run your tests?

Also, is your setup available on open web? I could take a quick look and see what's going on.

All Best,
Jakub.

from synpress.

xanderjl avatar xanderjl commented on July 27, 2024

It's most certainly a user error 😅

Unfortunately it's a closed repo, but I hope this info suffices!

using node v16.13.1
It's a next 12 project using a ./src dir, so I'm preloading my env vars from .env.local with dotenv-cli.

Cypress loads up just fine, but when I attempt to run the metamask test, I'm met with the error re: window width x height. I thought this may be a wsl2-related bug, but found the same behavior on an m1 mac.

script from my package.json:

"syn:open": "dotenv -e .env.local synpress open"

structure from root of project:

./tests
└── e2e
    ├── config.json
    ├── index.d.ts
    ├── specs
    │   └── metamask.ts
    └── tsconfig.json

files in e2e:

config.json

{
  "baseUrl": "http://localhost:3000",
  "userAgent": "synpress",
  "retries": { "runMode": 0, "openMode": 0 },
  "integrationFolder": "tests/e2e/specs",
  "screenshotsFolder": "tests/e2e/screenshots",
  "videosFolder": "tests/e2e/videos",
  "chromeWebSecurity": true,
  "viewportWidth": 1366,
  "viewportHeight": 768,
  "component": {
    "componentFolder": ".",
    "testFiles": "**/*spec.{js,jsx,ts,tsx}"
  },
  "env": {
    "coverage": false
  },
  "defaultCommandTimeout": 30000,
  "pageLoadTimeout": 30000,
  "requestTimeout": 30000
}
// eslintrc.js
const path = require('path')
const synpressPath = path.join(
  process.cwd(),
  '/node_modules/@synthetixio/synpress'
)

module.exports = {
  extends: `${synpressPath}/.eslintrc.js`
}
// info.d.ts is nearly 300 lines long, but is just copy-pasted from here
// more info: https://github.com/Synthetixio/synpress/blob/master/support/index.d.ts

tsconfig.json:

{
  "compilerOptions": {
    "allowJs": true,
    "baseUrl": "../../node_modules",
    "types": [
      "cypress",
      "@types/puppeteer-core",
      "@synthetixio/synpress/support",
      "cypress-wait-until",
      "@testing-library/cypress"
    ],
    "outDir": "./output"
  },
  "include": ["**/*.*"]
}
// e2e/specs/metamask.ts
describe('Metamask', () => {
  before(() => {
    cy.visit('/')
  })
})

from synpress.

ghardin1314 avatar ghardin1314 commented on July 27, 2024

Are you sure you have chrome installed? I had this issue also and I think it was because cypress was trying to use electron

if (browser.name === 'electron') {
arguments_['width'] = 1920;
arguments_['height'] = 1080;
arguments_['resizable'] = false;
return arguments_;
}

from synpress.

xanderjl avatar xanderjl commented on July 27, 2024

Oh my gosh. Switching to chrome fixed it 🤦

Totally was user error. Sorry for the fuss @drptbl and thanks for pointing me in the right direction @ghardin1314 😅

from synpress.

drptbl avatar drptbl commented on July 27, 2024

No worries @xanderjl, glad that you've sorted it out.

Thanks for helping out @ghardin1314!

Cheers,
Jakub.

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.