Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a configuration option for suppressing Command Logs #3087

Closed
jonathanconway opened this issue Jan 8, 2019 · 4 comments
Closed

Add a configuration option for suppressing Command Logs #3087

jonathanconway opened this issue Jan 8, 2019 · 4 comments

Comments

@jonathanconway
Copy link

jonathanconway commented Jan 8, 2019

I want to turn off logging on all of my commands, in order to reduce clutter in the lefthand side of the Test Runner.

Current behavior:

In order to turn off logging, I have to set log to false in the options of every individual command.

For example:

const element1 = cy.get("#id", { log: false });
element1.should("be.visible");
const element2 = element1.find(".class", { log: false });
element1.should("be.visible");

Desired behavior:

I want to be able to set just one Cypress configuration option, to turn command logging off globally.

{
    ...
    "loggingOptions": {
        "commands": false
    }
}

Then I can omit log options from my command calls:

...
const element1 = cy.get("#id");
element1.should("be.visible");
const element2 = element1.find(".class");
element1.should("be.visible");

Versions

Cypress v3.1.0.

@jennifer-shehane
Copy link
Member

Hey @jonathanconway, I'm curious to hear what you find as the most useful part of the test runner without the commands being logged. Are you tracking XHR requests? url changes? Anything in the Command Log at all?

@jennifer-shehane jennifer-shehane added stage: proposal 💡 No work has been done of this issue pkg/driver This is due to an issue in the packages/driver directory difficulty: 1️⃣ labels Jan 8, 2019
@jonathanconway
Copy link
Author

jonathanconway commented Jan 8, 2019

Hi @jennifer-shehane, thanks for getting back to me about this. I had a think about it and actually I think this setting isn't necessary and would be inappropriate, because I only need to suppress logging for a sub-set of the tests I'm writing, not across-the-board using a global setting. If it's Ok with you, I'll close it for now, but you're free to re-open if you think it might be useful.

@jennifer-shehane jennifer-shehane removed difficulty: 1️⃣ pkg/driver This is due to an issue in the packages/driver directory stage: proposal 💡 No work has been done of this issue labels Jan 8, 2019
@damaon
Copy link

damaon commented Oct 18, 2019

@jennifer-shehane
I have similar request. But I don't want configuration option but API to do so.

Motivation:
I have my high level driver that is using cypress under the hood which looks like this:

$.PageA.enter()
$.PageA.doA():
$.PageA.doB();
$.PageA.assertFoo()

Which basically also generates log entries in command log automatically based on function called.
But these operations are complex and require a lot of clicking/filling forms etc. so to avoid spam I need to pass { log: false } to every basic operation like cy.get, should, click etc.

I would prefer to call Cypress.basicLogs(false) at start and only when I see failure I could go to definition of e.g. $PageA.assertFoo() and put there Cypress.basicLogs(true) for debugging.

@jennifer-shehane
Copy link
Member

jennifer-shehane commented Jan 3, 2020

@Machiaweliczny please open a new issue detailing your feature request.

@cypress-io cypress-io locked and limited conversation to collaborators Jan 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants