Cypress: Command Log not showing in test runner

Created on 6 Jul 2018  路  11Comments  路  Source: cypress-io/cypress

Current behavior:

When running a cypress integration test, the Test Runner navigates to the application specified in cy.visit(), but I can no longer see the Command Log on the left hand side. The Command Log shows for a brief second before the Test Runner is completely overtaken by the application. This occurs with Chrome 64. Electron 59 works fine and shows the Command Log when running tests.

Desired behavior:

Display the Command Log on the left hand side while Test Runner calls cy.visit()

Steps to reproduce:

Add a test called form-input.spec.js in cypress/integration folder with the following

/// <reference types="Cypress"/>

context("Form Input", () => {
  beforeEach(() => {
    cy.visit("localhost:3000");
    cy.log("Test");
  });

  it(".should() - assert that <title> is correct", function() {
    expect(true).to.equal(true);
  });
});,

Start a local development server for create react app

Run cypress open

Click the test name, you will see the Test Runner open up, the Command Log shows for a second, and then all you see is the Application.

Versions

Cypress.exe v3.0.2 and npm v3.0.2
Windows 7 Enterprise

Most helpful comment

Long story short: update to 3.1.5 version.

Long story:

  • when I started using Cypress (3.1.4) I faced this problem
  • then I realized that the problem wasn't easily replicable, in fact, I got it every now and then with a Create React App project...
  • I've temporary ignored it and, because of the #3008 issue, I downgraded to 3.1.3
  • I started re-investigating this issue yesterday night because I really need to use Chrome instead of Electron because of the React dev extensions
  • I then started with this React+React Router example
    (starting from now I'll call myapp my own app and exampleapp the downloaded one)
  • with a fresh installation of Cypress into exampleapp everything works fine
  • loading myapp from the fresh Cypress everything works fine
  • I remove everything from the Cypress configuration of myapp (plugins, commands, Typescript... everything) but the issue remained
  • I found that myapp goes 304 when loading the __/#/tests... URL, the __/ is the faulty one (when exampleapp goes 200 with the same route)
  • I double check that there aren't know issues with Express, in fact, EVERY other URL (_/, ______/, ___/asdasd, /asdasd, /asdasd/__/) goes 200
  • I download the Cypress sources, I find the __/ configuration, I try to recompile it without success (if you're interested I got the "/@packages/coffee/register: Not found" error)
  • I check the sources and I find the
if etag and (etag is clientVersion)
      res.sendStatus(304)

in client.coffee

  • I notice that the exampleapp, when loaded by Cypress, sends a cookie __cypress.unload=true to the server
  • I manually add the __cypress.unload=true cookie to myapp. The __/ route goes 200 instead of 304 but the command log panel doesn't show up
  • then I realized that exampleapp was running the 3.1.5 version, myapp the 3.1.3
  • I checked that the 3.1.5 fixed the #3008 issue
  • I updated to the 3.1.5 version, everything goes fine
  • I then restore all my custom Cypress configuration
  • everything works fine 馃槉

I hope my comment could help other people facing the same problem or the Cypress team for some eventual investigations

All 11 comments

The Command Log shows when running with Electron 59, but does not show when running with Chrome 64

@mcasey8540 Do you have any extra configuration set up, say in your cypress.json?

@jennifer-shehane

My cypress.json file only has "baseUrl": "http://localhost:3000"

Thanks.

Could you try visiting a different url to see that the command log displays properly within your system and browser and let me know what the result is? Like:

/// <reference types="Cypress"/>

context("Form Input", () => {
  beforeEach(() => {
    cy.visit("https://example.cypress.io/");
    cy.log("Test");
  });

  it(".should() - assert that <title> is correct", function() {
    expect(true).to.equal(true);
  });
});,

We've typically seen this behavior when the website under test is using frame-busting techniques, to prevent it from being rendered within an iframe, but we have fixed a lot of these issues to date, so this may be an outlier.

I can confirm the behavior above.
The log on the left is being displayed when the angular application is hosted in a staged environment.
The log disappears and tests are not run when the same application is hosted on localhost by angular CLI. The only difference is in the baseurl and authentication method.
This still happens on Chromium 73. Electron seems unaffected, however I can't use that because of another issue (crashes with white browser screen) but this is different story.

Long story short: update to 3.1.5 version.

Long story:

  • when I started using Cypress (3.1.4) I faced this problem
  • then I realized that the problem wasn't easily replicable, in fact, I got it every now and then with a Create React App project...
  • I've temporary ignored it and, because of the #3008 issue, I downgraded to 3.1.3
  • I started re-investigating this issue yesterday night because I really need to use Chrome instead of Electron because of the React dev extensions
  • I then started with this React+React Router example
    (starting from now I'll call myapp my own app and exampleapp the downloaded one)
  • with a fresh installation of Cypress into exampleapp everything works fine
  • loading myapp from the fresh Cypress everything works fine
  • I remove everything from the Cypress configuration of myapp (plugins, commands, Typescript... everything) but the issue remained
  • I found that myapp goes 304 when loading the __/#/tests... URL, the __/ is the faulty one (when exampleapp goes 200 with the same route)
  • I double check that there aren't know issues with Express, in fact, EVERY other URL (_/, ______/, ___/asdasd, /asdasd, /asdasd/__/) goes 200
  • I download the Cypress sources, I find the __/ configuration, I try to recompile it without success (if you're interested I got the "/@packages/coffee/register: Not found" error)
  • I check the sources and I find the
if etag and (etag is clientVersion)
      res.sendStatus(304)

in client.coffee

  • I notice that the exampleapp, when loaded by Cypress, sends a cookie __cypress.unload=true to the server
  • I manually add the __cypress.unload=true cookie to myapp. The __/ route goes 200 instead of 304 but the command log panel doesn't show up
  • then I realized that exampleapp was running the 3.1.5 version, myapp the 3.1.3
  • I checked that the 3.1.5 fixed the #3008 issue
  • I updated to the 3.1.5 version, everything goes fine
  • I then restore all my custom Cypress configuration
  • everything works fine 馃槉

I hope my comment could help other people facing the same problem or the Cypress team for some eventual investigations

@NoriSte - Yes, upgrading to 3.1.5 solved the issue for me, and I hope it helps others, too. I had forgotten to do that again when I scrapped my project to start again - thanks!

Closing as resolved in 3.1.5. Please leave a comment or open a new issue if you are experiencing a similar issue still after the update.

I accidentally closed the Command Log and now I have no idea how to reopen it. Help? @jennifer-shehane

Still facing the issue. But clearing the cache manually fixes the issue, but only until the next run.

You are likely facing this issue https://github.com/cypress-io/cypress/issues/2132#issuecomment-404561427

To clear out the app data that has this saved state:

  • Open Cypress via cypress open
  • Goto File -> View App Data
  • Delete everything in here
  • Close cypress and open it up again
Was this page helpful?
0 / 5 - 0 ratings

Related issues

EirikBirkeland picture EirikBirkeland  路  3Comments

carloscheddar picture carloscheddar  路  3Comments

weskor picture weskor  路  3Comments

egucciar picture egucciar  路  3Comments

brian-mann picture brian-mann  路  3Comments