Testcafe-hammerhead: Self.location on Worker returns the testcafe proxy url

Created on 25 Jun 2020  路  3Comments  路  Source: DevExpress/testcafe-hammerhead

What is your Test Scenario?


We are making tests over a product which uses workers. One of which fetches an url with a location grabbed by self.location.origin.

What is the Current behavior?


As testcafe works over the proxy, that self.location.origin returns the testcafe proxy url and not the host of where the website is at. I believe testcafe overrides most window.location methods to return the real host of where the page is located, but it seems self.location were not overriden.

What is the Expected behavior?


self.location.origin should return the real hosts origin where the testing page is being tested.

Your Environment details:

  • testcafe version: 1.7.0
  • node.js version: 8.16
  • command-line arguments:
  • browser name and version: Chrome 83
  • platform and version: Mac & Saucelabs Windows 10
  • other:
client level 1 workers bug

Most helpful comment

I've reproduced the issue. It looks like we don't override WorkerLocation. Thank you for bringing this issue to our attention.

For team:

Steps for reproducing the issue:

  1. Open the page that registers the service worker, via Hammerhead Playground
  2. Take a look to the console and you should see ServiceWorkerGlobalScope instance with WorkerLocation properties that are not overwritten:

issueWithServiceWorkers

This is the repository with the code.

All 3 comments

I've reproduced the issue. It looks like we don't override WorkerLocation. Thank you for bringing this issue to our attention.

For team:

Steps for reproducing the issue:

  1. Open the page that registers the service worker, via Hammerhead Playground
  2. Take a look to the console and you should see ServiceWorkerGlobalScope instance with WorkerLocation properties that are not overwritten:

issueWithServiceWorkers

This is the repository with the code.

Thanks!! Just checked also and that seems to be the problem , thanks for the fast response!
We upgraded to testcafe 1.8.7 to be prepared for future updates though we faced a problem upgrading.
On 1.8.6 everything worked just fine but on 1.8.7 one of our main website components failed to load with a script error.

I created issue : https://github.com/DevExpress/testcafe-hammerhead/issues/2368 for the same matter

Thanks for the support!

Hello,

Thank you for the update and for creating an issue for the bug you found. We appreciate your contribution.

Was this page helpful?
0 / 5 - 0 ratings