Closed joekur closed 4 years ago
Hey @joekur, thanks for the issue! Does that spec have JS enabled? Or which driver is it using?
Yes js is enabled, using selenium headless chrome.
Edit - for clarity most specs are snapshotting just fine (same js enabled / selenium headless chrome).
Gotcha, good to know. It's nice that it's a single test that fails consistently. This is what is failing: https://github.com/percy/percy-capybara/blob/master/lib/percy.rb#L83-L92 Which means the JS was never ran on the page: https://github.com/percy/percy-capybara/blob/master/lib/percy.rb#L65-L72
Does this test happen to have any VCR/network mocking going on?
@Robdel12 yes there is plenty of network mocking going on. I'm not seeing the Could not load...
error in the logs like the Snapshotting failed..
one I do see. So I wonder if the error would be in the js execute? https://github.com/percy/percy-capybara/blob/master/lib/percy.rb#L84
I did some monkeypatching to ensure I could see what was being returned by that JS fetch, and confirmed I received window.PercyAgent=function(e){...
, before seeing the snapshot failure PercyAgent is not defined
@Robdel12 thank you for your help! I have found that this is happening because there is a race condition of redirection to a new url in this spec. I believe we injecting the percy agent, the page location changes (with window.PercyAgent
no longer defined), and then we try to take a snapshot and fail. Consider this a user error 😃
I'm seeing some intermittent issues when using selenium / headless chrome / percy-capybara / rspec / CircleCI. Error output:
We are running via
npx percy exec -- rspec
Any idea how this might happen, or how to better track down the root issue? It's pretty consistently one particular spec.