Cypress: My test passes `cypress open` but fails with `cypress run`

Created on 5 Dec 2017  路  9Comments  路  Source: cypress-io/cypress

  • Operating System: macOS 10.13.1
  • Cypress Version: 1.1.3
  • Browser Version: Chrome 62.0.3202.94

Is this a Feature or Bug?

bug

Current behavior:

My test passes when I launch it with cypress open but fails with cypress run.

Desired behavior:

My test passes both cypress open and cypress run.

How to reproduce:

Repository: https://github.com/vince91/cypress-react-select

yarn install
yarn cypress:run
yarn cypress:open

Test code:

describe('react-select', () => {
    it('should be able to select an item', () => {
        cy.visit('http://jedwatson.github.io/react-select/');
        cy.get('.Select').first().click();
        cy.get('.Select-option').first().click();
        cy.get('.Select-value-label').first().should('contain', 'Australian Capital Territory');
    });
});

Additional Info (images, stack traces, etc)

image

image

Most helpful comment

One is running in Chrome, the other is running in Chromium (Electron). There are differences in these browsers.

Either...

1) run it in chrome from the CLI
2) run electron in headed mode

https://docs.cypress.io/guides/guides/launching-browsers.html#Electron-Browser

All 9 comments

One is running in Chrome, the other is running in Chromium (Electron). There are differences in these browsers.

Either...

1) run it in chrome from the CLI
2) run electron in headed mode

https://docs.cypress.io/guides/guides/launching-browsers.html#Electron-Browser

Thanks!

I have the exact same issue. If I have to run it using:
cypress run --browser chrome
or
cypress run --headed

Does that mean I can no longer record videos?

@datpham23 You can only record video in Electron headless today. https://github.com/cypress-io/cypress/issues/1140#issuecomment-355667640

If your issue includes react-select like mine, I found the solution on https://github.com/cypress-io/cypress/issues/549#issuecomment-323315225.

cy
        .get('div.Select-control input')
        .first()
        .click({ force: true })
        .get('.Select-option')
        .first()
        .click({ force: true });

I got error message while i m using "cypress run --headed" .Can i use "yarn run cypress:open --headed" ?

Released in 2.0.0.

Command cypress open can open cypress with default electron chrome 59.
Our web application only supports browser above chrome 64.
So that I would like to cypress run with system chrome, not default chrome59.
Run 'cypress run --browser chrome'
....
Can't run because you've entered an invalid browser.
Browser: 'chrome' was not found on your system.
Available browsers found are: electron

NOTES:
win 7
chrome 71 in my system

Hey @chli283, you correctly commented on this issue https://github.com/cypress-io/cypress/issues/2834 We need a reproducible example in order to address it though.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

igorpavlov picture igorpavlov  路  3Comments

scottcrowe picture scottcrowe  路  3Comments

egucciar picture egucciar  路  3Comments

rbung picture rbung  路  3Comments

weskor picture weskor  路  3Comments