Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for subdomains in our public script #536

Open
adriaanvanrossum opened this issue Feb 26, 2021 · 0 comments
Open

Add tests for subdomains in our public script #536

adriaanvanrossum opened this issue Feb 26, 2021 · 0 comments
Labels
public script Public JavaScript to collect data

Comments

@adriaanvanrossum
Copy link
Contributor

On our automated tests we run in a few situation where we can't test certain features. For example when we detect a unique page view we compare the referrer with the current hostname. We need to test if that works with www subdomains. In BrowserStack we can only run the tests from localhost. To fix this we need to overwrite the readonly variables:

Object.defineProperty(document, "referrer", { get: () => "https://www.duckduckgo.com" });

Although this does not work for hostname:

Object.defineProperty(location, "hostname", { get: () => "www.example.com" });

image

@adriaanvanrossum adriaanvanrossum added the public script Public JavaScript to collect data label Feb 26, 2021
@adriaanvanrossum adriaanvanrossum added this to Features & bugs in Public roadmap via automation Feb 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
public script Public JavaScript to collect data
Projects
Public roadmap
  
Features & bugs
Development

No branches or pull requests

1 participant