GithubHelp home page GithubHelp logo

PercyAgent not defined about percy-capybara HOT 6 CLOSED

percy avatar percy commented on June 1, 2024
PercyAgent not defined

from percy-capybara.

Comments (6)

Robdel12 avatar Robdel12 commented on June 1, 2024 1

Hey @joekur, thanks for the issue! Does that spec have JS enabled? Or which driver is it using?

from percy-capybara.

joekur avatar joekur commented on June 1, 2024

Yes js is enabled, using selenium headless chrome.

Edit - for clarity most specs are snapshotting just fine (same js enabled / selenium headless chrome).

from percy-capybara.

Robdel12 avatar Robdel12 commented on June 1, 2024

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?

from percy-capybara.

joekur avatar joekur commented on June 1, 2024

@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

from percy-capybara.

joekur avatar joekur commented on June 1, 2024

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

from percy-capybara.

joekur avatar joekur commented on June 1, 2024

@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 😃

from percy-capybara.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.