Questions tagged [capybara]

Capybara is a web application testing framework for Rack applications, such as Rails, Sinatra and Merb.

Capybara aims to simplify the process of integration testing Rack applications, such as Rails, Sinatra or Merb. Capybara simulates how a real user would interact with a web application. It is agnostic about the driver running your tests and currently comes bundled with rack-test, Culerity, Celerity and Selenium support built in.

A complete reference is available at rubydoc.info.
A great capybara cheat sheet is available here.

5916 questions
2
votes
1 answer

How to keep puma server running between rspec tests

I am using rspec and capybara for testing of features specs that contain javascript. Each time I run a test, a separate instance of the puma server is started e.g. Capybara starting Puma... * Version 3.11.0 , codename: Love Song * Min threads: 0,…
Obromios
  • 15,408
  • 15
  • 72
  • 127
2
votes
1 answer

Clicking checkbox using capybara

Currently I have a checkbox wrapped by a label.
AllenC
  • 2,754
  • 1
  • 41
  • 74
2
votes
1 answer

Capybara selenium chrome get cookies

We use :cookie_store for our Rails sessions (Rails 5.1.3), see http://api.rubyonrails.org/classes/ActionDispatch/Session/CookieStore.html Using Capybara::RackTest::Driver in a test, I can get the current session and cookies…
23tux
  • 14,104
  • 15
  • 88
  • 187
2
votes
1 answer

How do I force Capybara to download to the directory I specify and not the default download directory in Firefox?

When I run my test, Firefox downloads the file into the default download directory, USER\Downloads. However, I'm telling it to download into the PROJECT\tmp directory. How do I make it listen to me? spec/config/capybara.rb DOWNLOAD_DIRECTORY =…
Chloe
  • 25,162
  • 40
  • 190
  • 357
2
votes
1 answer

Capybara, Cucumber, GWT problem asserting the text with inline styles

I was to check to see if a text with inline styles exist. For example page.should have_content(text) works for raw text such as "Time out", however it does not work for the text "Time out. Please Click here to retry". Also I have…
user_1357
  • 7,766
  • 13
  • 63
  • 106
2
votes
1 answer

How to detect element is present within viewport? (Capybara, ruby)

I have a step that checks for the footer visibility here And (/^the footer appears$/) do within("div.footer") do assert_selector "a", :text=> "About" ... end end Basically I load the page and scroll to the bottom then do this…
chasethesunnn
  • 2,149
  • 5
  • 25
  • 42
2
votes
1 answer

Force ruby selenium to work with untrusted certificates

For context I'm running ruby-rspec with selenium and capybara. When I navigate to the app_host I'm getting an InsecureCertificateError in the browser. How do I load a profile into selenium so that it will ignore the untrusted certificates? Below is…
Zack
  • 2,377
  • 4
  • 25
  • 51
2
votes
1 answer

finding download box element with capybara in cucumber test

I have a link that downloads a file. As I click the link it displays dialog box with "save" and "open" option and "Cancel" and "OK" button. I want to find "OK" and "Cancel" button for cucumber test. I took help from below link but didn't helped…
ashisrai_
  • 6,438
  • 2
  • 26
  • 42
2
votes
1 answer

RSpec: How to run the feature specs after all other specs

We have a rather complex integration spec setup with capybara and chrome. This leads to slow feature specs. It would be nice if the feature specs would be executed after all other specs. Because it takes rather long time for a integration test to…
phortx
  • 849
  • 5
  • 21
2
votes
1 answer

Rails 5, Rspec-rails, Capybara, Selenium-webdriver - Unable to find Mozilla geckodriver

I try test my new gem, with use js. But got errors rails 5.1.5 rspec-rails 3.7.2 capybara 2.18.0 selenium-webdriver 3.10.0 app/spec/rails_helper.rb require 'spec_helper' ... require 'rspec/rails' require 'capybara/rspec' require…
Nikolay Lipovtsev
  • 657
  • 1
  • 6
  • 15
2
votes
1 answer

Using capybara to select a bootstrap radio button

I have a set of radio buttons using bootstrap and want to use Capybara to select them using either id or value. For my rspec tests. For some reason it's not seeing the radio buttons and I wonder if anyone can have a look and suggest something. Error…
I Durrani
  • 81
  • 1
  • 5
2
votes
1 answer

Rails: Capybara execute js to save value to browser's local storage

I am running tests using Rspec, Capybara, Cucumber, and Selenium webdriver. For my app, if a user is a first time visitor to the site, a pop-up appears after 10 seconds, asking the user to signup for a newsletter. Whether the user signs up or not, a…
Darkisa
  • 1,899
  • 3
  • 20
  • 40
2
votes
1 answer

Difference between "page.should_not have_content" and "page.should have_no_content"

Can anybody explain me the difference between "page.should_not have_content" and "page.should have_no_content" in capybara and which one is the better option to ensure page does not have a specific content?
A J
  • 1,439
  • 4
  • 25
  • 42
2
votes
1 answer

Is there any way to run a capybara server?

I am looking for a way to get my cucumber test with selenium and capybara to skip the startup of the server on each run of the test. Is there a way to let is startup in the background and stay running and attach to it on each test run?
Ben
  • 9,725
  • 6
  • 23
  • 28
2
votes
0 answers

How to print an exception under rspec execution log and rails console?

When Letter Opener email is triggered, it get printed into test.log. I need it to print it under console log. When Feature spec is running and if exception is occurred, it should get printed into server log on terminal. How to inspect the exception…
rhunal
  • 395
  • 2
  • 15
1 2 3
99
100