-
Notifications
You must be signed in to change notification settings - Fork 43
Make nightwatch err and warn visible in stdout #289
Make nightwatch err and warn visible in stdout #289
Conversation
Codecov Report
@@ Coverage Diff @@
## master #289 +/- ##
==========================================
- Coverage 97.26% 96.99% -0.28%
==========================================
Files 31 31
Lines 988 997 +9
==========================================
+ Hits 961 967 +6
- Misses 27 30 +3
Continue to review full report at Codecov.
|
chiahrens
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
src/cli.js
Outdated
| rootWorkingDirectory: process.cwd() | ||
| }); | ||
| } | ||
| if (settings.framework === 'testarmada-magellan-nightwatch-plugin') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought we were just gonna pass this in as a command-line arg? This is sorta ugly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the whole idea it to make this the "new" default..
we are not being fully verbose in our magellan log, in the child process we are filtering out the "verbose" stuff and only shinning a light on the errors and warns
so this should be the default, its the whole point...
opts.argv.debug = true. just tells niughtwatch to be verbose...
i guess we can say if the (opts.argv.debug) is already true then we dont filter out anything in the child process...
you know what im saying?
src/util/childProcess.js
Outdated
| const STDOUT_WHITE_LIST = ['ERROR', 'WARN', 'Test Suite', '✖'] | ||
|
|
||
| // we slice the VERBOSE nighwatch stdout stream on the purple INFO text that has black background | ||
| const SLICE_ON_TEXT = '\033[1;35m\033[40mINFO\033[0m' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you know if this works for both nightwatch .9 and 1.x?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good question.
looking at their logger in the master:
https://github.com/nightwatchjs/nightwatch/blob/master/lib/utils/logger.js
it seems it should work just fine cause they havent changed the logger INFO coloring at all
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| } | ||
| } | ||
|
|
||
| isTextWhiteListed(text) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return STDOUT_WHITE_LIST.some(item => text.includes(item))
| isTextWhiteListed(text) { | |
| isTextWhiteListed(text) { | |
| return STDOUT_WHITE_LIST.some(item => text.includes(item)) | |
| } | |
| } |
?
This reverts commit b5854b7.
Currently the "ERROR" and "WARN" logs from nightwatch are suppressed when the
debugflag is turned OFF..and our customers ALWAYS use the
debugoff, because if you turn it on your log will be filled with base64 screenshot gobbledegook...Also, the approach i took, we will see all the "ERROR-ed" selenium request/response logs in our magellan log
BEFORE LOG
AFTER LOG
in the example above i modified the nightwatch code in my node_modules to have this code
Logger.warn('__EXAMPLE_WORKING__ Success saving screenshot 200 ok');Previously, this code would not have been logged to the magellan stdout.
in the AFTER LOG you can see that it is working GREAT :)
the
âis really the red X .. its just my terminal settings are making it show up asâinstead of the fancyX