-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
DOM snapshots not displayed due to ad displayed. #1403
Comments
@gpenafib - I’d recommend checking out |
but how can I fix it then? if I blacklist www.wordreference.com, Cypress will not run the test, as traffic will be blocked to this website. |
I'm not totally experiencing what you are when I run the tests - I think that specific ad has some weird behavior that is breaking the snapshots, but I was able to improve the loading of the page and block some of the ads by setting this in my cypress.json: {
"blacklistHosts": ["http://ads**"]
} You should keep adding any third party requests (the ones requesting the ads) in the array of Alternatively, the best solution would be to run your tests in a testing environment and turn off the ad behavior/requests altogether when testing, but I know this doesn't fit everyone's needs. |
@gpenafib - I was able to prevent the ads from appearing by blacklisting Below was the {
"blacklistHosts": "s.gweini.com"
} |
Hi guys, thanks for your support! Any other idea how to fix it? |
So, when this happens, try opening your console and going to the Network tab. There should be a url that this specific ad is loading from that you'll need to track down, this is the domain that you need to add to your |
I followed your last comment and it seems to be fixed now, many thanks! |
Is this a Feature or Bug?
Bug
Current behavior:
When I run my tests, at the end of the run, in the app preview section, where the DOM snapshots should be displayed, I just get an ad, as can be viewed in the attached screenshot. This ad is part of the webpage I am testing, but it is not displayed if I execute manually the same commands in the original website.
This prevents me from viewing any DOM snapshot although all the test pass.
This issue doe not happen every single time, but occasionally.
Desired behavior:
Ad is not displyed and I can view the DOM snapshots of the run.
How to reproduce:
Run the code added to this issue. This issue happens when visiting the webpage: www.wordreference.com
Test code:
Additional Info (images, stack traces, etc)
The text was updated successfully, but these errors were encountered: