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:
export NODE_EXTRA_CA_CERTS="/path/to/cert.pem"
Slow network? Increase the connection timeout in milliseconds with the PLAYWRIGHT_DOWNLOAD_CONNECTION_TIMEOUT
environment variable. Here's an example:
PLAYWRIGHT_DOWNLOAD_CONNECTION_TIMEOUT=120000 npx playwright install
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.
If you still have questions, please ask a question and I will try to answer it.
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 [email protected].