This thread is trying to answer question "How can I resolve the 'SELF_SIGNED_CERT_IN_CHAIN' error in my '@playwright/test' package?"
Export the cert from your machine into PEM file, then set an environment variable named NODE_EXTRA_CA_CERTS
with the file path (on your machine or the env file) https://nodejs.org/api/cli.html#node_extra_ca_certsfile
Related Ask AI answer for "What steps can I take to fix the 'self_signed_cert_in_chain' error in the '@playwright/test' package?".
If you're encountering a 'self_signed_cert_in_chain' error with your '@playwright/test' package, here's how you can tackle it:
If your proxy's requests are intercepted with an untrusted certificate authority (CA), causing the error, you need to set your custom root certificates. Use the NODE_EXTRA_CA_CERTS
environment variable before installing the browsers. Here's how you do it in Bash:
Slow network? Increase the connection timeout in milliseconds with the PLAYWRIGHT_DOWNLOAD_CONNECTION_TIMEOUT
environment variable. Here's an example:
Playwright downloads browsers from Microsoft's CDN by default. If your company hosts browser binaries in an internal artifact repository, you can configure Playwright to download from there using the PLAYWRIGHT_DOWNLOAD_HOST
environment variable.
If your company uses an internal proxy that blocks direct access to public resources, you can configure Playwright to download browsers via a proxy server by setting HTTPS_PROXY
environment variables.
Remember, these steps are specific to the 'self_signed_cert_in_chain' error and may not cover all '@playwright/test' issues. Always refer to the official documentation or seek further assistance for specific problems.
Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email luc@ray.run.