Questions tagged [capybara]
Capybara is a web application testing framework for Rack applications, such as Rails, Sinatra and Merb.
5,818
questions
0
votes
0
answers
43
views
URI::InvalidURIError when performing Feature Tests in RSpec Capybara
I am currently developing feature tests for a Ruby on Rails website in Capybara and every time I attempt to run this test file, I am greeted with the same error.
I have listed the code below for the ...
0
votes
0
answers
14
views
Users get disconnected during test runs
I work on a Ruby on Rails app that has many test in its deployment process (~3000)
We use capybara and selenium for feature tests.
We recently migrated CI from Heroku CI to CircleCi.
We run 10 docker ...
1
vote
0
answers
20
views
Twilio with Capybara Getting "stack level too deep (SystemStackError)" error
I am getting stack level too deep (SystemStackError) error when trying to make Read: List messages matching filter criteria API call for Twilio in Selenium/Cucumber framework.
I have no issues making ...
0
votes
1
answer
10
views
How to test react-rails components in rspec feature tests using Cuprite & Webdrivers
I am updating an older app's Ruby and Rails versions and attempting to get all of the feature tests passing. Most of them were failing due to still relying on capybara-webit. I have replaced that with ...
1
vote
1
answer
22
views
Rspec Capybara Failure/Error: DatabaseCleaner.clean
I am using rails 6.1.4 (Ubuntu 20.04) and am running tests with rspec, factorybot, and capybara. I also got database_cleaner where I'm using :truncation to start each test block with a clean slate (...
0
votes
1
answer
28
views
Validating is there any different menu item with capybara
I will try to improve the question.
How to validate if a different item is included in the menu: GAR?
I used it below and it still didn't work
page.all('select#tbm2').map(&:value).should == %w(...
0
votes
0
answers
13
views
Check that only those menu items should be there with the Capybara
Friends, I have a menu named GAR with the items: GAR Rules, GAE Rules and Gar/Gae Processes log. How to validate if only these items should be there?. If a different item is entered, the test must ...
1
vote
1
answer
18
views
When clicking update button with Capybara gem, my instance is not being updated [Rails / Rspec/ Testing]
To make it short but clear, I'm working on a Rails app and I'm now testing my controllers.
I use FactoryBot to generate instances to work with, database cleaner (truncation) to clean up my database ...
0
votes
1
answer
18
views
How do capybara ancestor and sibling instance methods actually work?
Typically when I had to find siblings, I had to do this:
find('#child').find(:xpath, '..').find(#some-other-child-from-this-parent)
Does using sibling replace this entire line?
Does ancestor replace ...
1
vote
2
answers
62
views
Capybara::ElementNotFound: Unable to find checkbox that is not disabled
I've checked all the SO questions I can find related to this issue.
The rest of the form works and the test passes if I remove the validation that a PlanTemplate must have a Category.
I have created a ...
0
votes
1
answer
39
views
Iterating through div class in Capybara
I've got a page containing multiple elements of class div In Capybara, I want to be able to loop through and refer to the first text in the first row.
However, none of the code I've tried so far has ...
0
votes
1
answer
27
views
Finding and entering text in CapyBara
I'm currently trying to find this specific textbook and send keys to it. The problem that I'm having is I'm trying to use the find method. I tried a lot of variations on this textbox and was unable to ...
1
vote
1
answer
37
views
List only records populated with Capybara
Friends helped me with a solution that validates if there are [active/inactive] records in the list. When I list the records using pp capybara also returns blank lines. How do I disregard empty ...
1
vote
1
answer
23
views
Finding a weird symbol in Capybara
I'm currently trying to find a symbol on a page. I have the HTML tag and the find method that I'm using. However it's not able to find this symbol. I'm not sure what I'm doing wrong to do so.
<div ...
1
vote
2
answers
42
views
How to validate if the table is empty with capybara?
I have tried all these commands but none works. I even used some tips from StackOverflow but I wasn't happy yet..
I have tried all these commands but none works. I even used some tips from ...
1
vote
2
answers
36
views
Clicking on a editing button in capybara?
I'm trying to click on this specific edit button. I'm using find method in ruby to do so, the problem I'm running into is that It's not able to find the specific element.
<i ng-click="grid....
1
vote
1
answer
32
views
Capybara expect the page to have 2 different contents in the table column
I just need to validate two different items in one column. For example if the column of the table writes Yes and No and I want to confirm if these items that are in the column correspond to yes and no....
0
votes
1
answer
33
views
How to validate if a value doesn't exist in a table's row count using ruby capybara?
There is a column in my table that stores the active and inactive value in the STATUS column. I want to validate if when searching for the ACTIVE status if there are no INACTIVE records.
How do I scan ...
1
vote
1
answer
40
views
Finding a button in Capybara
I'm trying to find this specific button. I've tried using find button in capybara to do this but I'm unable to.
find(:button, 'Open Cow menu').click
HTML Tag
<button class="cd-icon-button cd-...
0
votes
2
answers
44
views
Capybara expect an input placeholder that's within a div to have some text
I have a snippet that looks like this and I'm trying to run a test that expects the placeholder.
<div class="article_creator_isni form-group">
<label class="control-label ...
1
vote
2
answers
60
views
How to find the exact element path without using xpath
I'm currently trying to locate this check box. I know I can use a xpath to locate it but I'm trying to see if there's a more efficient way of doing it. The problem I'm seeing is that there are ...
0
votes
0
answers
16
views
How to define within scope for (hidden) div with id-tag (capybara testing)?
Does somebody know how i use the visible option in a within to define a scope within a tagged div like <div id="contact-persons" class="row"> so that my testing scope for ...
1
vote
2
answers
36
views
Filling in text box with capybara
I have a text box that I'm trying to fill in with Capybara. I've tried to play around with it and try to figure something's out but my tests don't pass.
Here's
It's for this specific text box:
<...
0
votes
1
answer
24
views
Capybara integration view testing not reading the correct data -ruby on rails
https://github.com/adamteddychang/The-Budget/tree/view-testing
All the fields are filled out accordingly
User can be created successfully in the rails console with the same parameters
but unable to ...
1
vote
3
answers
57
views
Capybara checking HTML class and ID
I'm currently trying to find this element and have capybara validate that it's there. There's an element that shows up and I'm using page.should have_css to see if this element is there.
<i class=&...
0
votes
1
answer
56
views
testing flash[:notice] with capybara and activerecord NameError: undefined local variable or method `flash'
I am very new to building websites and am currently running into the following problem.
I am using ruby, rspec, sinatra, sinatra-flash, capybara and ActiveRecord to design a website.
I am not using ...
0
votes
1
answer
48
views
Rails capybara selenium element not not clickable because another element obscures it
I am a struggling to find the right syntax to select an option in a dropdown list using rails/capybara/selenium for testing purpose. Here are the inspect output of the HTML page
<select id=”...
0
votes
0
answers
25
views
How to find element, content, text from iframe with capybara rspec?
feature "Widget test", :integration, :slow do
background do
visit(widget)
end
# given(:subject) { page }
scenario "dsffsdf" do
sleep 2
find(:xpath, ...
0
votes
0
answers
25
views
Capybara downloads a file in a wrong directory locally
Capybara, RSpec download file in the root directory but not in the folder, that I indicated.
My code in rspec file:
expect(File.exist?( "#{DownloadHelpers::PATH}/filename.pdf" )).to be true
...
0
votes
1
answer
59
views
How to allow camera permission popup while testing with cucumber-capybara(selenium -chromeDriver)
I have link that will open a new page to do some task. I can only proceed further only after allowing camera permissions.
popup window
First a confirmation popup appears which ask for camera ...
0
votes
0
answers
60
views
Why is Capybara unable to find my element?
I'm making a fake twitter app for a project and I have this issue with Capybara not recognizing my :username element. Is there something that I'm missing in my code or perhaps a process that I haven't ...
0
votes
1
answer
37
views
Rails capybara Cliver::Dependency::NotFound in production
I'm attempting to run Capybara in production in a scheduled Sidekiq task in my Rails app. It works locally (as it was designed to), but when deployed I run into a Cliver::Dependency::NotFound error.
...
0
votes
1
answer
59
views
Selenium::WebDriver::Error::SessionNotCreatedError: from action in github (in vscod works good)
2022-03-08 11:21:22 WARN Selenium [DEPRECATION] [:driver_path] Selenium::WebDriver::Chrome#driver_path= is deprecated. Use Selenium::WebDriver::Chrome::Service#driver_path= instead.
An error occurred ...
0
votes
1
answer
23
views
How to use another step inside a main step in Ruby Cucumber?
I have the step_definition called "ForPreEdit.rb", whose tag is @preed when I want to run this separate step (which works perfectly).
I also have the step_definition called "LoginSolic....
0
votes
0
answers
20
views
Validate if all Grid records are active with capybara. Please?
I need to validate two situations:
The first one I want to validate if all returned records are active. When they are active the corresponding column is:
<th colspan="1" style="white-...
0
votes
0
answers
44
views
Rails system test w/ Capybara RackTest raises ActiveSupport::MessageVerifier::InvalidSignature
I have a typical Rails model form with a file attachment selector allowing multiple attachments. It works fine in development, but during a system test, raises an ActiveSupport::MessageVerifier::...
-1
votes
1
answer
106
views
Capybara: How to set cookie before navigation / loading page
How can I set a cookie before navigation with Capybara? The following code raises an exception:
page.driver.browser.manage.add_cookie(
name: "name",
value: "value",
path: &...
0
votes
1
answer
131
views
Error with headless chrome driver unable to click an anchor element
I'm trying to test my pagination feature with rspec, capybara, selenium, and chrome headless driver. I keep running into this error:
Failures:
1) Paginations user clicks on next button
Failure/...
0
votes
1
answer
42
views
Why my Stimulus change event doesn't trigger in Heroku CI
I have two datetime inputs that have a change event (through stimulus) that trigger a function when values change. If the dates (whatever times are) are the same in both fields, it removes d-none ...
0
votes
0
answers
170
views
Selenium::WebDriver::Error::UnknownError: unknown error: session deleted because of page crash on rails application tested on codeship
Using Codeship as an automatic test plateform I have this error that occur only on codeship automatic run, not on my local environment, nor if I run the same test on codeship via ssh debug console :
...
0
votes
0
answers
31
views
Capybara warning Unexpected confirm modal
It looks like Capybara is issuing a deprecation warning when I run my complete test suite. The warning is
Unexpected confirm modal - accepting.You should be using `accept_confirm` or `dismiss_confirm`
...
0
votes
1
answer
132
views
How to use factories to create test data to be tested with Rspec and Capybara
I'm trying to test my pagination feature with rspec/capybara. I created the articles using FactoryBot but encountered two issues. If I create the data:
in a before block, the data is saved to the ...
1
vote
0
answers
48
views
Rspec: Why does this example hang?
I had this issue for the last 4 years where my feature specs would hang indefinitely, apparently at random. No errors, no failures, nothing. The page goes unresponsive (I am using puma).
I spent such ...
0
votes
2
answers
52
views
Selenium : cannot upload file
I am testing a Rails 6 application with Rspec, Capybara and Selenium (grid, standalone-chrome) using a remote Chrome in a Docker container.
The driver configuration:
default_chrome_args = [ '--disable-...
0
votes
0
answers
22
views
Uninitialized constant error after moving page models
I am using Selenium, Capybara, and Rspec to write UI tests. Our project has lots of helpers and page models. I would like to sort out the helpers and page models that are only used in specific test ...
0
votes
2
answers
37
views
Delete records Oracle before tests from Ruby, capybara and Cucumber. Please
does anyone have an example of how to remove the records from the table before starting or after finishing the tests?
My tests are working perfectly fine and all that remains is to automatically ...
0
votes
1
answer
80
views
Capybara feature specs fails with Turbo Drive
I'm experimenting with introducing Turbo Drive on a couple of pages in my Rails 6.1 app.
Ḯ've got it as expected after moving some legacy JQuery plugin initialization from $(document).ready() calls ...
0
votes
1
answer
64
views
How to update my driver initialization to avoid deprecation warning?
The warning I'm receiving is: WARN Selenium [DEPRECATION] [:capabilities_hash] passing a Hash value to :capabilities is deprecated. Use Capabilities instance initialized with the Hash, or build values ...
0
votes
1
answer
28
views
Is it possible to test spam clicking submit button using Capybara in Rails?
I'm working on a large repo, and we have a bug that causes multiple accounts to be created when the form's submit button is spam clicked.
Is there any way to automate spam clicking using Capybara? I'...
3
votes
0
answers
566
views
Cannot use selenium_chrome_headless on docker container Apple M1 Chip
I am working on an Apple M1 Pro and running onto several issues with Docker and chromedriver.
So I want to run RSpec tests with selenium chrome headless on my Docker container. My Dockerfile is:
# ...