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.

Show warning messages in command log

See original GitHub issue

It would be useful to allow commands to print a warning instead of an error in the command log.

This would allow commands to alert the user something they have done may lead to unexpected behavior, such as pressing the {home} key while we cannot preform the default action of scrolling. Or calling a cy.wait after a cy.visit.

We could have:

  • If there’s a soft error during a command, allow a config value to turn it into a warning.
  • If there’s a warning during a command, add an icon to the command and allow it to be clicked and expanded
  • Ability to add a new command log message / event for warnings/errors not linked directly to a command

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:13
  • Comments:14 (9 by maintainers)

github_iconTop GitHub Comments

20reactions
Cleudicommented, Jul 3, 2020

I also see the need for cy.warn. We maintain an extended cypress custom command library which is used by various applications. No one will ever notice eg. deprecation notes in the console log. In contrast, having (orange) warnings in the command log will be noticed for sure (as long as the functionality is not abused).

Maybe useful as well (or instead of cy.warn). Allow passing a custom color to cy.log - so there can be visual distinction between different use cases (eg. deprecation vs. anti-pattern vs. … ).

4reactions
chrispepper1989commented, Feb 28, 2022

This would be fantastic for the new access accessibility tests I want to bring in. Having tests fail at the moment would be a nightmare as there is a long list of legacy issues. But warnings would put us on the right track to fix them!

Read more comments on GitHub >

github_iconTop Results From Across the Web

SHOW WARNINGS - MariaDB Knowledge Base
The SHOW COUNT(*) WARNINGS statement displays the total number of errors, warnings, and notes. You can also retrieve this number from the warning_count...
Read more >
Logging, Warnings, and Error Messages · GitBook
Logging allows us to use "rules" to say what information should be shown. ... setLevel("WARN") shows messages from logger.warn and logger.error`; logger.
Read more >
Logging a warning message (Command Stage) - Forums - IBM
I tried using a Command stage to call DSLogWarn but this gives the error: Command failed to execute - Verb "LOGWARNINGMSG("RECONCILIATION" is not...
Read more >
13.7.7.42 SHOW WARNINGS Statement
In the mysql client, you can enable and disable automatic warnings display using the warnings and nowarning commands, respectively, or their shortcuts, \W...
Read more >
A Utility Program for Quickly Identifying LOG Error or Warning ...
ABSTRACT. This paper will show you how to create and install a utility program that will allow Windows users to find SAS® error...
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