-
Notifications
You must be signed in to change notification settings - Fork 0
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
Ensure console logging works #4
Comments
This needs to be addressed, current dynamic console output gets messed up when anything else logs in-between. Addressing this could also remove the need for requiring wdio-slick-reporter/src/reporter.js Line 17 in 5a2305a
|
The possible solution I have in mind would be to listen to process.stdout.on('data', ...) |
Turns out this isn't that straight-forward because the process in which the reporter runs is different than the process in which the tests run. Therefore, it's not possible to listen to stdout/stderr of the tests in the reporter. I'll leave this issue open, maybe someone has a solution. |
To clarify, the problem is the following. Instead of always printing more and more lines after the previous output whenever the state of the suite changes (e.g. a test passes -> should now show "1 passed" instead of "0 passed"), this reporter clears N lines in the console and then just prints the lines that changed compared to the last state. This works perfectly when nothing but this reporter's output is printed to the console, but it breaks whenever something else logs to the console. Example: Reporter first prints this:
Then some random process, or the currently running test, or wdio, etc. prints something:
Now, the next time the reporter receives an update, it clears N lines based on its internal state, disregarding the outsider FOOBAR-line. In this case the line that changed is line 2, so 3 lines are cleared before printing the changed lines, and this is the broken result:
|
I haven't tested if this reporter overwrites manual console.logs, and if it does, that should be prevented so that it's possible to log stuff from the tests.
The text was updated successfully, but these errors were encountered: