-
Notifications
You must be signed in to change notification settings - Fork 672
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
Allow to selectively suppress warnings #5544
Comments
Please move forward this issue. |
We are focused on implementing features from our Roadmap. Since this enhancement is not there, we cannot tell you any time frames on when we will be able to address it. If this feature is important for you, please submit a Pull Request with its implementation. See the Сontribution guide for more information. |
@AndreyBelym is there any way to not show I actually do not have any
Full content of
I believe my question partly matches this issue, but not 100% sure since I'm not confident that this warning should even show up because there is no |
Hi @di5ko It looks like a TestCafe issue. Please create a new issue and attach a full example to it. |
I would be also interested in this feature especially to supress the warning |
This would be super helpful since we need to manually scroll within shoelace components and that throws in a whole lot of unnecessary stuff at the end of our reports. |
Please get rid of these warnings... they are unnecessary, unwelcome and cloud actual results. |
Joining the request to add a flag or configuration option to remove the printouts of the warnings from the output. They clutter the log excessively, requiring a lot of scrolling to navigate through them, and we don't intend to fix them because the tests are working as expected. Currently, I can't find a solution to filter out these TestCafe warnings. |
Hi, The exact warning output depends on the reporter you are using. You can use the onBeforeWrite hook to prevent some text from being reported. Here is an example for the "spec" reporter: // .testcaferc.js
const warningHeadingRegexp = /Warnings (\(\d\)):/;
const warningSplitRegexp = /--/;
const whiteSpaceRegexp = /\s/g;
function isWarning (text, warnings) {
if (warningHeadingRegexp.test(text) || warningSplitRegexp.test(text))
return true;
return warnings.some(msg => msg.replace(whiteSpaceRegexp, '') === text.replace(whiteSpaceRegexp, ''));
}
function hideWarningsHook (writeInfo) {
if (writeInfo.initiator === 'reportWarnings')
writeInfo.formattedText = '';
if (writeInfo.initiator === 'reportTaskDone') {
const warnings = writeInfo.data.warnings || [];
if (!warnings.length)
return;
if (isWarning(writeInfo.formattedText, warnings))
writeInfo.formattedText = '';
}
}
module.exports = {
hooks: {
reporter: {
onBeforeWrite: {
'spec': hideWarningsHook,
},
},
},
}; Please also note that the configuration option override warning message is rendered twice - on TestCafe start (in the console) and in the reporter's reportTaskDone method. Using this approach, you can only prevent the reporter warning from being shown. This approach is a recommended way to hide warning messages. If it isn't suitable for you, feel free to reopen this issue and share your usage scenario. |
Thanks for the code @Artem-Babich! Using these hooks/functions I cannot get this to work. |
Hi @Jgrabenbauer, We need more details about your usage scenario in order to give you any recommendations. Please share a simple runnable project illustrating the problematic behavior and the exact steps required to reproduce it. |
@Artem-Babich this is why, there are more warnings than useful information about the results: |
@Jgrabenbauer Unfortunately, we cannot give you any recommendations based on this |
There is a mask, that overlaps interface In our app to deny interact during async operations. So, we have 1500+ such warnings right now. To fix it, I've created fork of testcafe-reporter-spec with warnings filter, execution time for each test and overall progress - testcafe-reporter-spec-plus. |
@gooddaytoday |
@gooddaytoday the testcafe-reporter-spec-plus works great! Is there an option to do the same but with xunit? This would be great to suppress these warnings while running in CircleCi too. |
We need to provide some way to disable warnings. Sometimes you can't change the situation reported by a warning, and should be able to just suppress it.
The text was updated successfully, but these errors were encountered: