cypress icon indicating copy to clipboard operation
cypress copied to clipboard

Chrome for Testing - we can't run your tests

Open alexsch01 opened this issue 2 years ago • 3 comments

Current behavior

npx cypress run --browser ~/chrome120/chrome --headed --no-exit

image image

Chrome for Testing version: 120.0.6099.109 from https://alexsch01.github.io/chromefortesting/

  • I am using https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/120.0.6099.109/linux64/chrome-linux64.zip

Test code to reproduce

cypress/e2e/spec.cy.js

$ mkdir cypress
$ mkdir cypress/e2e
$ touch cypress/e2e/spec.cy.js

cypress.config.js

const { defineConfig } = require('cypress')

module.exports = defineConfig({
	e2e: {
		supportFile: false,
	},
})

Cypress Version

13.6.1 **See Other

Node version

v20.10.0

Operating System

Linux 6.1.60 x86_64 GNU/Linux

Other

Same result testing with Cypress Version=10.0.0

alexsch01 avatar Dec 19 '23 20:12 alexsch01

Related: https://github.com/cypress-io/cypress/issues/28123

Definitely caused by the browser.majorVersion being equal to "for"

{
  name: 'chrome',
  family: 'chromium',
  channel: 'stable',
  displayName: 'Custom Chrome',
  version: 'for',
  path: 'PATH TO Chrome for Testing',
  minSupportedVersion: 64,
  majorVersion: 'for'
}

This allows user to launch browser with cypress open

const { defineConfig } = require("cypress");

module.exports = defineConfig({
  e2e: {
    setupNodeEvents(on, config) {
      config.browsers.push({
        name: 'chrome',
        family: 'chromium',
        channel: 'stable',
        displayName: 'Custom Chrome',
        version: 'for',
        path: 'PATH TO Chrome for Testing',
        minSupportedVersion: 64,
        majorVersion: '120',
      })
      return config
    },
  },
});

alexsch01 avatar Dec 20 '23 14:12 alexsch01

@alexsch01

I was able to reproduce your issue on Ubuntu 22.04.

Cypress running under Windows 11 does not have a problem to test using Chrome for Testing, and the name of the browser is parsed differently:

image

So it seems you have put your finger on the cause of the issue on Linux when you note that the browser name and version is incorrectly parsed.

Compare to Ubuntu where the version number is missing

image

MikeMcC399 avatar Dec 21 '23 16:12 MikeMcC399

  • PR https://github.com/cypress-io/cypress/pull/28243 would resolve this issue. Using this branch I was able to successfully run Cypress tests under Ubuntu 22.04 using Chrome for Testing r120.0.6099.109 installed with npx @puppeteer/browsers install chrome@stable

MikeMcC399 avatar Dec 22 '23 14:12 MikeMcC399

const { defineConfig } = require("cypress");

module.exports = defineConfig({
  e2e: {
    setupNodeEvents(on, config) {
      config.browsers.push({
        name: 'cft',
        family: 'chromium',
        channel: 'stable',
        displayName: 'Custom Chrome',
        version: 'for',
        path: 'PATH TO Chrome for Testing',
        minSupportedVersion: 64,
        majorVersion: '120',
      })
      return config
    },
  },
});

With the above, you can use npx cypress run --browser cft and it will launch correctly

  • so it's not just for cypress open

alexsch01 avatar Jan 23 '24 18:01 alexsch01

This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided.

cypress-app-bot avatar Jul 22 '24 01:07 cypress-app-bot

Still happening

alexsch01 avatar Jul 22 '24 01:07 alexsch01

  • The related PR https://github.com/cypress-io/cypress/pull/28243 has made no progress for many months

MikeMcC399 avatar Jul 22 '24 04:07 MikeMcC399

Pitty, I am now running into the same issue.

Roemer avatar Jul 24 '24 15:07 Roemer