Download the provided test repo and execute the notification test in Chrome Headless with SSL (TestCafe HTTPS mode)
We have a push notification bar/prompt that works only in TestCafe HTTPS mode (see screenshot). Tests run fine in Chrome with SSL certs. But TestCafe fails to run in Chrome Headless with SSL certs.
Tests should run fine in Chrome Headless with SSL certs. I tried passing '--allow-insecure-localhost --ignore-certificate-errors' flags. Didn't help. Any suggestions how to make the tests run in Chrome Headless with SSL?
Your website URL (or attach your complete example):
Download this repo - https://github.com/sijosyn/testcafe-syntests and run the notification test from test suite.
Your complete test code (or attach your test files):
testcafe 'chrome:headless --allow-insecure-localhost --ignore-certificate-errors' desktop/notification.js --ssl 'key=./node_modules/openssl-self-signed-certificate/key.pem;cert=./node_modules/openssl-self-signed-certificate/cert.pem'
Your complete test report:

Screenshots:


I was able to reproduce the issue. It seems it's related to Chrome Headless, not to TestCafe.
Chrome Headless does not support the --ignore-certificate-errors flag. Please refer to the following thread https://groups.google.com/a/chromium.org/forum/#!msg/headless-dev/eiudRsYdc3A/BLuLMTX_BgAJ
In theory, it's possible to overcome the issue聽using the Chrome debug protocol
I've聽discussed the issue with the聽team and we will consider implementing it in the future, so for now I recommend you use Chrome without the enabled Headless mode.
Greetings! Is there any movement or status on this issue, please?
@SteveSonoa
Hello,
I cannot give you any additional information about this issue. We will update this thread once we have any news regarding this.
Hello there!
Is there any news regarding this you can share? The issue is really _bugging_ me out. Thanks :)
Once we get any results, we will post them here. You are also welcome to submit your PR to address this issue.
Hi, I am able to run tests with ssl certificate and chrome flags --allow-insecure-localhost --ignore-certificate-errors', however testcafe is too slow with xhr and other requests keep pending for longer times. Can someone help ?
testcafe 'chrome --autoplay-policy=no-user-gesture-required --allow-insecure-localhost --ignore-certificate-errors' src/hotstar/playabilityTests.js --ssl 'key=./node_modules/openssl-self-signed-certificate/key.pem;cert=./node_modules/openssl-self-signed-certificate/cert.pem' --assertion-timeout '25000' --market=$1 --test-meta sanity=true --reporter html:html/index.html
Operating system : MacOS Catalina 10.15.1
Website : https://www.hotstar.com/in/tv/chuni-panna/s-2387/chuni-tortures-nirbhik/1000246551
test
.meta({ sanity: 'true' })
('Play Vip content', async t => {
await t.useRole(roles.premiumUserRole);
const obj = { uri: config.baseUrl + '/' + config.vipContentId };
await PageRouter.goTo(obj);});
Hi @star-kashyap,
Thank you for sharing your experience. Since XHR performance is not related to the topic of this discussion, I believe it would be better to open a separate issue here on GitHub or ask a question on StackOverflow - an amazing platform for users to ask and answer questions.
Most helpful comment
I was able to reproduce the issue. It seems it's related to Chrome Headless, not to TestCafe.
Chrome Headless does not support the
--ignore-certificate-errorsflag. Please refer to the following thread https://groups.google.com/a/chromium.org/forum/#!msg/headless-dev/eiudRsYdc3A/BLuLMTX_BgAJIn theory, it's possible to overcome the issue聽using the Chrome debug protocol
I've聽discussed the issue with the聽team and we will consider implementing it in the future, so for now I recommend you use Chrome without the enabled Headless mode.