Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

REPL for Capybara

I am trying to write some capybara cucumber scripts for my ROR app and find it very hard to get the scripts right by making change and running the full feature every time.

Is there a REPL (Read Eval Print Loop) for Capybara so that I can test small chunks of code for correctness faster?

like image 778
suDocker Avatar asked Feb 04 '26 18:02

suDocker


1 Answers

Ok, my teammate found it... We can use irb and load capybara, then we can visit a page and do all the capybara pattern matching to our hearts content!

    irb -r rubygems -r capybara -r capybara/dsl
    > Capybara.default_driver = :selenium
    > include Capybara::DSL
    > page = Capybara.page
    > page.visit("http://someurl.in")
like image 117
suDocker Avatar answered Feb 07 '26 18:02

suDocker



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!