question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Command Log not showing in test runner

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:4
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
NoriStecommented, Feb 7, 2019

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

2reactions
andrasivacsoncommented, Jan 18, 2019

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Test Runner class does not log anything - Stack Overflow
The first issue that I have found in your code is you are using both Junit as well as testng in your runner....
Read more >
Unit Test Runner does not show console output – Rider Support
Hello,. Rider does not output any logs in the Unit Test window. When I run the tests using the CLI it does output...
Read more >
Cypress App
Cypress runs tests interactively, allowing you to see commands as they execute while also viewing the Application or Component Under Test, and exploring...
Read more >
How to view log output while tests are running in VS 2019 ...
My goal is to view log output in Visual Studio 2019 Pro, for all unit tests, while the tests are running. I tried...
Read more >
Improve your custom command logs in Cypress - Filip Hric
If not, we'll say that right inside our test runner. Cypress. ... Custom log - new board name is displayed in command log....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found