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.

Allow formatting cy.log() text

See original GitHub issue

Current behavior:

cy.log() prints grey text to the left column: screen shot 2018-07-12 at 10 48 26

Desired behavior:

cy.log() takes an option for formatting, e.g. color, bold:

cy.log('Given I am logged in', { color: 'blue' })
screen shot 2018-07-12 at 10 49 49

Steps to reproduce:

N/A

Versions

3.x

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:16
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

70reactions
chrisbreidingcommented, Jul 16, 2018

You can use markdown in the cy.log message and it will be formatted. It looks like we don’t have this documented, so I’ve created an issue.

While you can’t specify a color for the text, if you want blue text at least, you can trick it by making the message a link 😃

cy.log('normal')
cy.log('**bold**')
cy.log('_italic_')
cy.log('[blue](http://example.com)')

cy.log markdown example output

12reactions
vijayfelixrajcommented, Apr 27, 2020

I just wanted to apply color other than the Bule and not to link. I just wanted to apply in normal text. Please do advice.

Read more comments on GitHub >

github_iconTop Results From Across the Web

log - Cypress Documentation
Print a message to the Cypress Command Log. ... Accepts a Markdown formatted message. args. ... Assertions. cy.log() cannot have any assertions chained....
Read more >
cypress-io/cypress - Gitter
Anyone know how to convert a string from invoke('text') to a number? I am trying to grab a number from a span that...
Read more >
cy.log color - Code Examples & Solutions For This Technical ...
cy.log color. Add Answer | View In TPC Matrix. Technical Problem Cluster First Answered On December 9, 2020 Popularity 3/ ...
Read more >
Cypress log Command - ProgramsBuzz
If a message needs to be printed for our reference in the command log of cypress, then the log command is used. Syntax...
Read more >
Why cy.log Prints Nothing - Gleb Bahmutov
You would like to print the text from the element #username to Cypress Command Log. You know that Cypress commands are asynchronous, ...
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