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
Question: hammerhead.js:277 Uncaught (in promise) TypeError: Wa.global.location.toString is not a function
#2716
Comments
Thank you for submitting this issue. We would love to assist you and diagnose it. However, we need a simple sample that we can easily run on our side in order to replicate the issue and research its cause. Without a sample, we are not able to figure out what's going on and why this issue occurs. Refer to this article to create the best example: How To: Create a Minimal Working Example When You Submit an Issue. We look forward to your response. |
Updated with a reference to the requested test case. I think what may be happening here is that the TestCafe iframe is getting removed from the dom during React's render loop. |
Hello, I reproduced the |
Note: Also happens in same exact scenario with |
What is your Scenario?
Not asserting that this is a bug: This is a question about observed TypeError in
hammerhead.js
, to get more info.Scenario: Running a test that, prior to the test target system being changed to React from vanilla/jQuery js, worked.
What is the Current behavior?
The application test is failing due to a TypeError in hammerhead: The failing line is:
And the part that fails there is the call to
toString
.(The line numbers are from a formatting, to be able to inspect)
This is in the top-level web browser window.
In the web app window,
window
isnull
and so isdocument.location
. This indicates that the window has no browser context object.Going back in the call stack, I see an http request, initiated by the web app being tested, going outbound to a url that is a 404.
Inspecting the TestCafe app test code in Chrome DevTools (nodejs debugging), I see that the issue happens before the test's
requestHooks
statement executes, and possibly, before all of thebefore
statement has finished.To simplify in this scenario, only one test is being run.
TestCafe runner options are as follows:
What is the Expected behavior?
There should be no such TypeError as described, or at least, it should not fail the app test.
What is your public website URL? (or attach your complete example)
Please see this test case that should reproduce the exact same error: #2178
What is your TestCafe test code?
Cannot share
Your complete configuration file
No response
Your complete test report
No response
Screenshots
No response
Steps to Reproduce
TestCafe version
1.16.0
Node.js version
v16.10.0
Command-line arguments
Started programmatically.
Browser name(s) and version(s)
Chrome 96
Platform(s) and version(s)
macOS Monterey
Other
No response
The text was updated successfully, but these errors were encountered: