question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Self.location on Worker returns the testcafe proxy url

See original GitHub issue

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:

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
wentwrongcommented, Jun 26, 2020

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.

1reaction
Ogurechercommented, Jun 29, 2020

Hello,

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to remove hostname and port (added by testcafe ... - GitHub
I am using wifi and the Proxy server is off on my machine. So you mean the application will have 2 URLs: Testcafe...
Read more >
Configuration File | API | Docs - TestCafe
Location. On startup, TestCafe looks for a configuration file ( .testcaferc.js or .testcaferc.json ) in the current working directory.
Read more >
Command Line Interface | API | Docs - TestCafe
TestCafe displays URLs you should open in browsers on your remote device. ... only for installed and portable browsers located on the current...
Read more >
FAQ - TestCafe
TestCafe uses a URL-rewriting proxy which allows it to work without the WebDriver. This proxy injects the driver script that emulates user actions...
Read more >
Client Functions and Script Injection for Page Interaction
The test code runs in a Node.js process (server) and uses a proxy server to interact with the browser (client). TestCafe's client-server ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found