Search code examples
testingautomated-testsamazon-cloudfronte2e-testingtestcafe

Testcafe proxy is lost after calling window.location.assign() method when the website is hosted on amazon cloudfront


The whole url gets replaced and I don't see the testcafe frame anymore. It happens when the test is ran against the website being hosted on amazon cloudfront, but if I run the test against the website hosted on localhost, then the redirection works, it doesn't replace the whole url and I can still see the testcafe frame.

Redirect on localhost looks like: http://<testcafe-ip>:38279/I2zW8XmMh*tOCn5CTOd/<some-new-url>

Redirect on cloudfront looks like: <some-new-url>

Do you know if amazon cloudfront has some security integrated which might be preventing the website from being embedded into testcafe?


Solution

  • I had the same issue. It works after setting the flag "disablehttp2" https://testcafe.io/documentation/402638/reference/configuration-file#disablehttp2

    It seems testcafe-hammerhead has issues with redirection and http2. For me disabling http2 is fine, but there might be cases where it's not. Hope they fix this in hammerhead.