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

feat: Display line break in cy.log #25467

Merged
merged 6 commits into from
Jan 24, 2023
Merged

feat: Display line break in cy.log #25467

merged 6 commits into from
Jan 24, 2023

Conversation

nilgaar
Copy link
Contributor

@nilgaar nilgaar commented Jan 14, 2023

User facing changelog

The cy.log() message will display a line breaks if containing \n.
Also, Cypress.log message will, of course, behave the same way.

Additional details

This feature enriches the cypress open functionality, by adding the line break to the log command.
Staking \n will be translated in a single line break.

Steps to test

cy.log

  1. Build up a cypress test, add a log like: cy.log('I am the first line! \n I am the second line!'
  2. Run your test with cypress open

Cypress.log

  1. Build up a cypress test, add a log like: Cypress.log({displayName:'I won\'t be \n broken!!', message:"but I \n will"})
  2. Run your test with cypress open

How has the user experience changed?

Not sure if this can be considered a user experience change but:
from this:
image

to this:
image

PR Tasks

  • [na] Have tests been added/updated?
  • [na] Has the original issue (or this PR, if no issue exists) been tagged with a release in ZenHub? (user-facing changes only)
  • [na] Has a PR for user-facing changes been opened in cypress-documentation?
  • [na] Have API changes been updated in the type definitions?

@CLAassistant
Copy link

CLAassistant commented Jan 14, 2023

CLA assistant check
All committers have signed the CLA.

@nilgaar nilgaar changed the title feature to add #24964 feat: Display line break in cy.log Jan 14, 2023
@nilgaar nilgaar marked this pull request as ready for review January 14, 2023 12:17
@cypress
Copy link

cypress bot commented Jan 14, 2023



Test summary

26420 0 1179 0Flakiness 45


Run details

Project cypress
Status Passed
Commit 42eb719
Started Jan 16, 2023 10:18 AM
Ended Jan 16, 2023 10:36 AM
Duration 17:33 💡
OS Linux Debian -
Browser Multiple

View run in Cypress Dashboard ➡️


Flakiness

create-from-component.cy.ts Flakiness
1 ... > runs generated spec
2 ... > runs generated spec
e2e/origin/commands/navigation.cy.ts Flakiness
1 cy.origin navigation > #consoleProps > .go()
commands/net_stubbing.cy.ts Flakiness
1 network stubbing > intercepting request > can delay and throttle a StaticResponse
2 ... > stops waiting when an fetch request is canceled
This comment includes only the first 5 flaky tests. See all 45 flaky tests in the Cypress Dashboard.

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

@nilgaar nilgaar marked this pull request as draft January 14, 2023 13:17
@nilgaar nilgaar marked this pull request as ready for review January 14, 2023 15:26
@nilgaar nilgaar marked this pull request as draft January 14, 2023 15:47
@nilgaar nilgaar marked this pull request as ready for review January 14, 2023 15:47
@nilgaar nilgaar marked this pull request as draft January 16, 2023 08:44
@nilgaar nilgaar marked this pull request as ready for review January 16, 2023 08:49
@nilgaar nilgaar marked this pull request as draft January 16, 2023 10:06
@nilgaar nilgaar marked this pull request as ready for review January 16, 2023 10:06
Copy link
Contributor

@AtofStryker AtofStryker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @nilgaar. Thank you for opening a PR! Nothing here stands out to me that would cause significant issues but are you able to add a test in the driver in log.cy.ts to verify the line break behavior?

@AtofStryker AtofStryker self-requested a review January 19, 2023 15:22
@AtofStryker
Copy link
Contributor

@mike-plummer are you able to take another look at this?

@lmiller1990
Copy link
Contributor

Two approvals, let's merge this up. Thanks for the contribution!

@lmiller1990 lmiller1990 merged commit c2e7b60 into cypress-io:develop Jan 24, 2023
@nilgaar nilgaar deleted the feature/24964 branch January 24, 2023 05:57
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jan 24, 2023

Released in 12.4.0.

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

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Jan 24, 2023
@AtofStryker AtofStryker removed their assignment Mar 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cypress.log to display line break
6 participants