-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Added ability to add console log to allure and spec reporters (fix for #7001) #7134
Conversation
@christian-bromann i am not able to understand how to write unit test for spec reporter , could you have a look at : https://github.com/webdriverio/webdriverio/pull/7134/files#diff-cfe87f6281a8a4048d929804c6a8caf9eae3031fe3af66296e2f58d0a46cbde5 Its not live report , it seems like the result are being mocked so i am not sure how to mock presence of console.log |
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.
tmpReporter.onSuiteStart(suiteEnd()) was corrected to tmpReporter.onSuiteEnd()
@@ -45,6 +50,11 @@ export default class SpecReporter extends WDIOReporter { | |||
this._sauceLabsSharableLinks = 'sauceLabsSharableLinks' in options | |||
? options.sauceLabsSharableLinks as boolean | |||
: this._sauceLabsSharableLinks | |||
let processObj: any = process |
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.
let processObj: any = process | |
let processObj = process |
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.
Why closing the PR? |
@christian-bromann making changes didn't wanted each push to trigger the work flow and spam your inbox , thanks for the detailed review |
Don't worry about that 😉 |
@christian-bromann , i done all i could i am not able to increase statement coverage Jest: "global" coverage threshold for statements (98%) not met: 97.98% 😢 |
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.
Couple more comments, feel free to drop the coverage by 1% 😉
@@ -45,6 +50,16 @@ export default class SpecReporter extends WDIOReporter { | |||
this._sauceLabsSharableLinks = 'sauceLabsSharableLinks' in options | |||
? options.sauceLabsSharableLinks as boolean | |||
: this._sauceLabsSharableLinks | |||
let processObj:any = process |
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.
let processObj:any = process | |
let processObj = process |
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.
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.
@christian-bromann could you have a look at this , what type should i give
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.
@christian-bromann If no changes needs to be done for this comment then could you retrigger the workflow it looks like an intermittent failure. sleep(100) was 99 something, Thank you so much for your time and detailed reviews learned a lot
@christian-bromann i saw light at the end of the tunnel 😆 all green uff thank you Christian |
Good job @praveendvd |
@praveendvd we're using this in our runs, but the console logs are not added to the failing step. Our dev was able to fix it but unable to jump through the submission hooks. I wonder if you could look into fixing it? if you haven't already |
Could you add an reproducible example |
Hi @praveendvd not without completely deconstructing our repo, I'd need to build one from scratch. I have asked my dev if he'd be able to comment on here as to how he fixed it - would that be of help? It will take me a couple of days before I will have time to build a small example, but will do so as the failing step is where we really need the logs :) - great work btw - its really useful! |
@starbuck251 Glad it's helpful , could you add one example code where Yoh explicitly add some console log and explicitly make the code fail but the log not getting added to the report |
sure thing @praveendvd , will work on that over next couple of days and send a link to it :) |
@starbuck251 is the issue with cucumber ? |
yes, we use the cucumber framework for our project |
attachConsoleLogs(this._consoleOutput, this._allure) moving this to top of onTestFail fixes the issue, was that the fix the dev team suggested ? |
I believe it might be something like that, I'll slack him to confirm :) |
|
Just raise a issue will create a pull request today thank you |
Thanks, that's amazingly helpful and kind of you :) |
Proposed changes
This commit allows to add cosnole logs to spec and allure reporters , all webdriverio logs containing mwebdriver will be ignored to avoid overloading the console log being logged (fix for #7001)
Types of changes
Checklist
Further comments
Reviewers: @webdriverio/project-committers
@christian-bromann