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 configuration option to disable/enable multiple commands logging #8296

Closed
Max-Strick opened this issue Aug 17, 2020 · 4 comments
Closed
Labels
stage: proposal 💡 No work has been done of this issue type: enhancement Requested enhancement of existing feature

Comments

@Max-Strick
Copy link

Max-Strick commented Aug 17, 2020

This issue relates to the #3087

Current behavior:

I have many commands that are not desired to be logged: setting states, clearing fields, etc. Mostly it relates to the negative cases when I do smth repeatable. For example, iterate through the array with invalid characters and type them into the input field:

cy.get('@fullname').then(input => {
  credentials.invalid.fullname.IncorrectSymbolsArray.forEach((incorrectSymbol) => {
    cy.wrap(input, { log: false }).clear({ log: false }).type(`${credentials.valid.fullname.default}${incorrectSymbol}`)
  });
}).clear({ log: false })

(some assertions will be added)

In this case, if logging is not turned off, the left side log looks very "crowded". I need information only about characters that are typed.

So, about 70% of commands have {log: false} option in my tests. It takes time to add this option and code looks not so pretty.

Desired behavior:

I have a proposition:

  1. Provide a global logging setting in the configuration file. By default, it should be true.
  2. Provide {log: } option for context() and it().
  3. Priority order: command() > it() > context() > global configuration

So, then users have the ability to enable/disable logging in different scopes.

Versions

4.12.1

@jennifer-shehane
Copy link
Member

I don't think adding a global configuration would be something we would explore. Logging commands is a core part of our product, so turning them off completely would mean there is nothing shown in the test runner.

I could maybe see this being available in the test configuration (it() level), but I also see this as being a very small use case.

Assuming you are generating custom commands for each of these actions (which is what I would recommend), I could see allowing some kind of setting there to disable all logging of commands within it, as I see this as a pretty common use case. But also, I'm not sure how this would be implemented exactly with how the current API is designed.

We'll leave this open to see if there is any more support for this. It's not high priority now for us however.

@cypress-bot cypress-bot bot added the stage: proposal 💡 No work has been done of this issue label Aug 18, 2020
@jennifer-shehane jennifer-shehane changed the title Add configuration option for commands logging Add configuration option to disable/enable multiple commands logging Aug 18, 2020
@jennifer-shehane jennifer-shehane added the type: enhancement Requested enhancement of existing feature label Aug 18, 2020
@kumzme

This comment has been minimized.

@jennifer-shehane
Copy link
Member

Please be mindful of our Code of Conduct when interacting with our team and other commenters in our issues. https://github.com/cypress-io/cypress/blob/develop/CODE_OF_CONDUCT.md

@jennifer-shehane
Copy link
Member

Since this request hasn’t gotten a lot of interest over the years, we’ll close this issue.

@jennifer-shehane jennifer-shehane closed this as not planned Won't fix, can't repro, duplicate, stale Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage: proposal 💡 No work has been done of this issue type: enhancement Requested enhancement of existing feature
Projects
None yet
Development

No branches or pull requests

3 participants