-
Notifications
You must be signed in to change notification settings - Fork 668
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
TestCafe prepends assets in the DOM with Test IP #4169
Comments
Hello, @Robdel12. Indeed, TestCafe uses the URL rewriting proxy to monitor a page state and simulate user actions. All page's resources are proxied during test execution. I inspected the scenario you provided and found out that likely, the issue is related to the fact that the Percy server cannot receive content by the proxied URL. It happens because it is running on the user's machine and is unavailable due to NAT. In this case, if the user's machine has a public IP address, it can be specified using the hostname option for TestCafe. To solve the problem in a more general case, we need to load the resources specified via CSS directly from the source server. This is quite possible, because the pictures specified by the |
Hei! We are working on a POC with Percy/Testcafe and run into this issue. |
Hey @mlukjanska (and anyone else that might come across this)! I've found this seems to work pretty well: # macOS method for grabbing the local IP
percy exec -h `ipconfig getifaddr en0` -- testcafe What this does is add your computers local ip to Percy's SDK additional hostname config. That will tell the Percy SDK to capture assets that come from your local IP (and not just the hostname of the URL you're testing) |
Hey @Robdel12, Thanks for replying here and for my support request! [Updated 10-08-2020]
In order to debug the percy calls, as per @Robdel12 suggestion, I've set the Finally, it seems that the But adding
|
TestCafe has utility functions that allow getting original asset URLs on the client (browser) or server (node.js) side. |
This issue was automatically closed because there was no response to our request for more information from the original author. Currently, we don't have enough information to take action. Please reach out to us if you find the necessary information and are able to share it. We are also eager to know if you resolved the issue on your own and can share your findings with everyone. |
What is this?
Hey y'all! 👋
I'm an SDK + Support engineer for Percy.io. We're in the process of building an SDK for TestCafe 🎉 (It's released, but unannounced due to this issue)
One of the most common issues folks reach out to us about with our TestCafe SDK is missing assets in their snapshots. When we debug these snapshots in Percy, the assets always seem to get the test server IP (+ the pages host name sometimes) prepended in the DOM. This breaks snapshots in Percy because it's not a valid URL that can be reached by our browsers. For example, given this DOM:
TestCafe will change it to something like:
Which is what we capture when taking a snapshot, and it breaks the page from rendering correctly.
Hopefully that explains what's going on well! My question is, how do we disable that test URL from being prepended to assets in the DOM? We need the unaltered path to the asset for Percy to work. Presumably TestCafe is prepending this because you're doing some proxy work within the test framework?
Super curious to hear how we can work around this :)
The text was updated successfully, but these errors were encountered: