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

Do not truncate cy.log() in Command Log #5625

Closed
pitgrap opened this issue Nov 7, 2019 · 4 comments · Fixed by #5630
Closed

Do not truncate cy.log() in Command Log #5625

pitgrap opened this issue Nov 7, 2019 · 4 comments · Fixed by #5630
Labels
good first issue Good for newcomers pkg/reporter This is due to an issue in the packages/reporter directory type: enhancement Requested enhancement of existing feature

Comments

@pitgrap
Copy link
Contributor

pitgrap commented Nov 7, 2019

This is a feature request.

Current behavior:

Long messages in cy.log() gets truncated to a single line. On screenshots the panel of cyress is always very narrow, so the log is almost never readable.

screenshot_165

Desired behavior:

It would be great to not truncate or at least support a flag to disable the truncation in cy.log(). Especially URLs and other import informations should be displayed.

screenshot_166

Steps to reproduce: (app code and test code)

  it("example", () => {
    cy.log("Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et");
    cy.log("https://docs.cypress.io/api/commands/log.html#Syntax");
  });

Versions

3.4.1 to 3.6.0
chrome78

Details

The following CSS rule is responsible for all message-types (cypress_runner.css:4016):

.reporter .command-message {
  white-space: nowrap;
   ...
}

Maybe add a style just for the log (or all entries like URLs in cy.request()?):

.reporter .command-name-log .command-message {
  white-space: initial;
  word-break: break-word;
}
@jennifer-shehane
Copy link
Member

This is something we agree should be changed.

CSS that requires changing: https://github.com/cypress-io/cypress/blob/develop/packages/reporter/src/commands/commands.scss#L251:L251

We would love an open PR. Check out our contributing doc .

@cypress-bot cypress-bot bot added the stage: ready for work The issue is reproducible and in scope label Nov 7, 2019
@jennifer-shehane jennifer-shehane added pkg/reporter This is due to an issue in the packages/reporter directory good first issue Good for newcomers type: enhancement Requested enhancement of existing feature labels Nov 7, 2019
@jennifer-shehane jennifer-shehane changed the title Do not truncate cy.log() Do not truncate cy.log() in Command Log Nov 7, 2019
@cypress-bot cypress-bot bot added stage: work in progress and removed stage: ready for work The issue is reproducible and in scope labels Nov 7, 2019
@pitgrap
Copy link
Contributor Author

pitgrap commented Nov 7, 2019

Hi @jennifer-shehane, I opened a PR for this small feature: #5630

@cypress-bot cypress-bot bot added stage: needs review The PR code is done & tested, needs review stage: work in progress and removed stage: work in progress stage: needs review The PR code is done & tested, needs review labels Nov 8, 2019
@cypress-bot cypress-bot bot added stage: needs review The PR code is done & tested, needs review and removed stage: work in progress labels Dec 20, 2019
@cypress-bot cypress-bot bot added stage: work in progress stage: needs review The PR code is done & tested, needs review and removed stage: needs review The PR code is done & tested, needs review stage: work in progress labels Jan 8, 2020
@cypress-bot cypress-bot bot added stage: pending release and removed stage: needs review The PR code is done & tested, needs review labels Jan 9, 2020
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jan 9, 2020

The code for this is done in cypress-io/cypress#5630, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jan 10, 2020

Released in 3.8.2.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v3.8.2, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Jan 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Good for newcomers pkg/reporter This is due to an issue in the packages/reporter directory type: enhancement Requested enhancement of existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants