Questions tagged [capybara]

Capybara serves as a powerful web application testing tool specifically designed for Rack applications like Rails, Sinatra, and Merb.

Evaluating React components in Rails using capybara and spinach

Currently, I am in the process of developing a Rails application that utilizes React components for its layouts. Below is an example: .pure-g.homepage = react_component("SectionA", {foo: @bar}, class: "pure-u-1") = react_component("SectionB", {foo: @b ...

Testing your login functionality with RSpec, Capybara, and Selenium

I'm currently working on passing the login test using rspec integration testing. Although I have set up rspec and confirmed that it's functioning properly, the test is not successfully passing. Below is the code snippet: require 'spec_helper' describe "Us ...

How can I automate testing with Cucumber using Rails and Capybara to manage an AngularJS dialog box?

Currently, I am developing an application that utilizes AngularJS. There is a flow in the application where clicking a button triggers a dialog box to appear with various fields. I am facing an issue when trying to input values into the fields within the ...

Creating a Dockerfile for a Ruby Capybara scraper: Step-by-step guide

I'm in the process of creating a Dockerfile to run a Ruby Capybara scraper within a docker container. The code I've tested works fine on my host OS, but it's throwing an error when executed within the docker container. Dockerfile FROM ruby:2.6.6 RUN apt- ...

Cannot see the created item in Rails application when using RSpec, Capybara, Selenium, and JavaScript

Currently, I am in the process of developing a web store. The key functionality is already implemented where all products are displayed on one screen along with the list of ordered items. Whenever a product is selected for ordering, it should instantly app ...

Capybara with Angular Material Select

Is it possible to use select in RoR RSpec + Capybara? I typically use: select 'something', from: 'select_name' However, this method does not work for Angular's md-select. Capybara displays the following error message: Capybara::ElementNotFound: Unable t ...

Difficulty in finding element in iframe using ember and Selenium

This is my first time working on automation using cucumber. The UI is in an iFrame and built with ember by another team, so any changes to the UI are not feasible. I am attempting to locate a text field and populate it (the final step). However, I continu ...

Using a combination of Cucumber, Capybara, and Selenium to interact with and select

I am currently modifying a text editor and I have the task of selecting text for manipulation using JavaScript. Can you provide guidance on how to select text using Cucumber, Capybara, and Selenium? ...

Dealing with changing elements using cucumber and capybara

(Click for image) I've been working on a project where I need to create a scenario to test the login feature. However, I've encountered an issue with Capybara not being able to access dynamic elements. To Reproduce the Issue: 1) Go to Redfin.co ...

Prevent access to hosts using Capybara with selenium

Can domains be blocked with the selenium web driver? I have heard about using the page.driver.browser.url_blacklist feature for the webkit driver. ...

What could be causing the slow start to my feature tests using Rails, Selenium, and Spring?

My Rails 5.0.5 application has feature tests that utilize Capybara and Selenium with chromedriver. Despite using spring, the first request to my app during the feature tests takes around 45 seconds before subsequent requests return to normal response times ...

Verify the presence of a particular attribute in an HTML tag using Capybara and polling techniques

In my HTML code, the attributes of buttons (such as "AAAAA") will change based on external events. This real-time update is achieved through AJAX pooling. <div class="parent"> <div class="group"><button title="AAAAA"/></div> <di ...

Today, I am experimenting with HTML5 File Upload using Capybara and Selenium Webdriver in Ruby

I have encountered a problem with a simple modal that allows users to upload a file using a browse button. Due to some unknown issue, possibly related to the fact that it is an HTML5 file input and the browser adds its own functions to it, testing this has ...

What is the functioning mechanism behind capybara ancestor and sibling methods?

Usually, when I needed to locate siblings, I used the following code: find('#child').find(:xpath, '..').find(#some-other-child-from-this-parent) Does using sibling replace this entire line? Will ancestor suffice for moving upwards in the xpath selector? ...

Selenium successfully tests Foundation modals, however, it encounters issues when trying to do so

While experimenting with :webkit, I encountered an issue where testing for the existence of my Foundation modal was not possible. However, everything seemed to be working correctly when using :selenium. What could be causing this discrepancy? it "should o ...

The UnknownError in Selenium WebDriver has been triggered due to an unexpected issue where the function attribute_value.lastIndexOf is not recognized

My cucumber test using selenium-webdriver is encountering an issue. Upon running my feature, the test fails with Selenium::WebDriver::Error::UnknownError: unknown error: attribute_value.lastIndexOf is not a function [5] pry(#<Object>)> fill_in ' ...

Encountering an ArgumentError while executing Capybara tests in Ruby version 3.0

I've hit a roadblock while upgrading my Rails app to Ruby 3 from version 2.7. Every time I run tests and try to visit a path, I encounter the following issue: state = "new" visit status_path(state: “state") When running rspec, I get the e ...

Is there a way to locate the Capybara::Node::Element that matches the Selenium::WebDriver::Element?

While trying to locate a node by coordinates and perform a relative xpath query on it, I need to obtain a Capybara object (Capybara::Node::Element) in order to use .find(:xpath). However, the object returned from evaluate_script("document.elementFromPoin ...

Capybara is throwing a NoMethodError - looks like something is

I need help with adding a tag to a tag field. To populate the tag field, I must either add ',' or press enter with a tag name such as "Ezgi,". Below are the steps I have outlined for this task. When(/^I enter "([^"]*)" on Label field$/) do |arg1 ...

Ruby: accessing the identifier of a constant instead of its assigned value

As I begin automating tests using Ruby with Selenium, I am facing a challenge in using the name of a constant instead of its value in my test script. The relevant files being used are as follows: LoginPage.rb: class LoginPage < Base FIELDS = { ...

What is the best way to download multiple files using Capybara and Selenium in Chrome?

Currently using Capybara in conjunction with Chrome and Selenium. When attempting to click on a link that results in an automatic download, the file is downloaded successfully for the first time. However, subsequent attempts trigger a prompt from Chrome st ...

The Capybara click functionality does not function properly when used with the Selenium webdriver

After switching from the poltergeist driver to selenium, I encountered an issue while running my test case. The browser (Mozilla firefox 50.0.02) opens successfully but gets stuck at the first click event and fails to proceed to the next page. Test case ...

Running several Angular requests simultaneously can trigger failures in test cases

I am facing an issue with my Angular 1.5 application and Rails 4.0 backend. During testing, when a Staff member logs in, three queries are simultaneously sent to the backend causing errors. Strangely, this issue does not occur in the development environmen ...

Capybara - Navigating a page by clicking on a link related to another value

I'm currently facing a challenge in locating and selecting a particular link on a web page. All links within an HTML table contain the term 'Edit' (it's a link for editing configuration settings). However, the exact link changes depending on the environme ...

Why do Capybara/Rspec tests refuse to play nice together, yet excel when running solo?

Recently, I encountered an interesting issue with my rspec tests. When running them individually using Selenium as the driver, everything worked fine without any errors. However, when attempting to run multiple tests at once or putting them in the same fi ...

Is it possible to conduct Rails Rspec and Capybara testing on a staging server?

Currently, I am conducting testing with rspec and capybara on my localhost. However, I am now interested in testing on a staging server running Linux. Is it feasible to use capybara for this purpose? I have a feeling that testing with selenium may not be ...

Accessing the downloaded file from the browser footer using Capybara and Selenium

Can you advise me on how to open a downloaded file from the footer bar? I am working on creating tests for downloading a PDF in Chrome. I would like to be able to open the file and verify its contents as well. Thank you! ...

Unable to close Chrome driver following completion of capybara test

Currently, I am utilizing capybara 2.1.0 along with the default selenium webdriver, minitest, and test::unit. For certain tests that require the use of the .hover method, I switch to the Chrome webdriver. However, after running these tests using Chrome, I ...

Tests pass successfully on local environment, but encounter failures on Circle CI

I've encountered an issue with my ActiveAdmin view while running feature specs on CircleCi. It works perfectly fine on my local machine, but fails with the error message: undefined method `text' for nil:NilClass spec it 'utilizes the updated_at date ...

Waiting for Capybara to wait for the AJAX to finish loading

Hello, I am experiencing an issue with my capybara testing environment. Error: jQuery is not defined (Session info: chrome=43.0.2357.125) I suspect that this problem may be related to the ajax wait function. def wait_for_ajax Timeout.timeou ...

Utilizing the .uniq method on capybara xpath selectors to efficiently navigate past Capybara::ElementNotFound exceptions

Currently, I'm developing a JavaScript-enabled screen-scraper using capybara/dsl, selenium webdriver, and the spreadsheet gem. Although I am very close to achieving the desired output, there are two significant issues that have emerged: Firstly, I have ...

Guide on verifying confirmation popup using cucumber in Ruby on Rails

Currently, I am attempting to test a feature within my Ruby on Rails app using Cucumber and Capybara. The objective is to verify that when the "delete" button is clicked, a confirmation prompt appears saying "Are you sure?" followed by clicking "OK". Init ...

Can one retrieve the CSS/XPath from a Capybara Element?

Is it possible to extract CSS/XPath from a Capybara Element? I have attempted to use #path but it doesn't appear to be effective. Here is the link I tried: The test is being executed on Selenium Webdriver. ...

Using Capybara for testing integration with asynchronous JavaScript

I am currently facing an issue with a failing Rails integration test that has me stumped. The test utilizes Capybara with Selenium as the driver. The specific problem lies in verifying that certain page content is removed after an AJAX call is made. Essen ...

Retrieve the ReadTimeout while using Selenium webdrivers on Heroku platform

Encountering an error while using selenium webdrivers on Heroku. (rspec->capybara->selenium) Net::ReadTimeout: Net::ReadTimeout with #<TCPSocket:(closed)> Utilizing the heroku-buildpack-google-chrome buildpack, alongside webdrivers-gem. Here is th ...

Executing identical Cucumber Features on multiple machines simultaneously with parallel_tests gem

Running identical Cucumber Features simultaneously on various machines using the parallel_tests gem I am currently exploring how to utilize the parallel_tests gem in order to execute the EXACT SAME Cucumber Features concurrently on different machines. At ...

Guide for clicking on a dynamic button with multiple words using cucumber and capybara

Struggling to write a test that involves clicking on a button with two separate words, as indicated in the code snippet below. The command Click_on("More Filters") is not effective because the button actually changes to "less Filters" when clicked due to ...

Experimenting with Capybara to upload files - circumventing a conventional form by using a button and a specialized JavaScript

I've been struggling to figure out how to make that test function properly. I've tried multiple approaches but nothing has worked so far. I have a button <div > <a href class="btn btn-default btn-block btn-lg btn-shadowed ut-upload- ...

The issue of custom CSS and JS not loading during Capybara and Selenium tests

I am currently testing some code that depends on custom JavaScript. While everything works as expected in the development environment, my test fails because no custom CSS and JS are included: https://i.stack.imgur.com/n1fq5.png What steps can I take to t ...

Capybara, Selenium, and the Redactor Rich Text Editor trio

Encountered an intriguing issue with Capybara and Selenium. Some Capybara request specs demand javascript to be enabled while interacting with a form. Particularly, one of the forms contains a textarea that utilizes the Redactor Rich Text Editor. <div ...

Rails capybara found multiple ambiguous matches, resulting in 50 elements matching the CSS

I encountered the following error: There seems to be a conflict, as 50 elements were found with matching css "input[value=\"delete\"]" This error occured when executing the following code snippet: find('input[value="delete"]').first. ...

Is it possible to utilize rspec for conducting feature testing on an integrated rails-angular application?

My Rails-Angular application is very basic and integrated. It simply renders a link, fetching data from a GET request to Rails: 'use strict'; angular.module('angularRspec.controllers') .controller('FightersController', function($scope, $http){ ...

Utilizing Ruby interpolation to dynamically select elements in Capybara's CSS selectors

Having trouble with invalid selector errors when attempting to locate an element using capybara This method is successful: page.find("#widget_amount_Standard") But I encounter issues when trying any of the following: credit_type = "Standard" page.find( ...