Giter VIP home page Giter VIP logo

Comments (4)

chendo avatar chendo commented on May 25, 2024 1

Seems to work, thanks!

from knapsack_pro-ruby.

ArturT avatar ArturT commented on May 25, 2024

At this moment knapsack_pro has no hook like that and probably it might be a bit hard to provide after queue end hook because I know when queue is ended when I got no test files from Knapsack Pro API. It means I won't run more tests to hook into after(:suite) to set the knapsack pro after queue end hook.
Maybe I could find other workaround but I need to think more about it.

I looked at the documentation https://percy.io/docs/clients/ruby/capybara-rails
and probably this may work.

# spec_helper.rb or rails_helper.rb
unless ENV['KNAPSACK_PRO_RSPEC_PERCY_HOOKS_LOADED']
  ENV['KNAPSACK_PRO_RSPEC_PERCY_HOOKS_LOADED'] = 'true'
  Percy::Capybara.initialize_build
  at_exit { Percy::Capybara.finalize_build }
end

Could you check that?

from knapsack_pro-ruby.

ArturT avatar ArturT commented on May 25, 2024

Great! I've updated FAQ https://github.com/KnapsackPro/knapsack_pro-ruby#how-to-set-beforesuite-and-aftersuite-rspec-hooks-in-queue-mode-percyio-example

from knapsack_pro-ruby.

ArturT avatar ArturT commented on May 25, 2024

I think the example can be even more simplified:

# spec_helper.rb or rails_helper.rb

# executes before Queue Mode starts work
Percy::Capybara.initialize_build

# executes after Queue Mode finishes work
at_exit { Percy::Capybara.finalize_build }

I tested that and this should be executed only once at the beginning and at the end.

from knapsack_pro-ruby.

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.