-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
password visible in html output #3935
Comments
Thank you for setting this as an enhancement. One of the product folk will triage this again to help see when we can fit this in an upcoming sprint. |
okay so hiding the password field in the raw HTTP response is not that straight forward. We can either Just keep the password masking till test detail level (which is already done in above PR). @garg3133 can you suggest how I should proceed |
@dikwickley The requests are logged here: nightwatch/lib/http/request.js Line 243 in ae23267
So, if we can somehow know here that we want to redact the request args for the current command, we can do that here. The only thing to think about is how would we know that. |
This issue was earlier solved in #2672 but the solution present there no longer works because while earlier we used to call |
Here is what I have found till now. There is a provision to redact a HTTPRequest nightwatch/lib/http/request.js Line 129 in ae23267
But the problem is setting this As you can see in the Call stack trace, there is no way to propagate information from Moreover, there is a feature request at SeleniumHQ/selenium#12043 that addresses just this. But it's seems like it's not happening anytime soon. Meanwhile, I have found a very weird way to work around this. Will raise a PR for it soon. |
With the above linked PR merged now, we longer show the password text in raw HTTP logs but the password is still visible in the JSON and HTML reports, which is the only thing left to be fixed now. |
Description of the bug/issue
When using
setValue
in tests, and also ´setPassword`, the field is visible in the html, json and xml reports.I found an old issue regarding this that was closed with a reference to a Browserstack configuration. But as far as I understand, that is not applicable if you're not using Browserstack.
Here is the issue I refer to:
#758
Our solution to this was to do a string replace in the final report. We found it simpler than creating custom reporter since we wanted all the features of the standrad html report. Maybe there is a simpler more standard way of doing this? But ideally, Nightwatch shouldn't put values in the report if
setPassword
is used.Steps to reproduce
setValue
orsetPassword
etc in a testSample test
Command to run
Verbose Output
No response
Nightwatch Configuration
No response
Nightwatch.js Version
3.2.1
Node Version
19.9.0
Browser
Chrome 117.0.5938
Operating System
MacOS Ventura
Additional Information
No response
The text was updated successfully, but these errors were encountered: