Skip to main content

Questions tagged [rspec]

RSpec is a behavior-driven development (BDD) framework for the Ruby programming language, inspired by JBehave. It contains its own mocking framework that is fully integrated into the framework based upon JMock. The framework can be considered a domain-specific language (DSL) and resembles a natural language specification.

Filter by
Sorted by
Tagged with
2 votes
2 answers
1k views

Check that an element does not exist *after* a button is clicked

With ruby, I'm doing some cucumber tests with capybara to test a Shiny application (shiny is a R package to do web applications). But I'm a newbie with ruby and cucumber (and this is my first post ...
Stéphane Laurent's user avatar
1 vote
2 answers
4k views

Stop page load, or visit page without waiting for full page load -Capybara

Background: A web page takes about 2+ minutes to load. Problem: I am currently automating acceptance test using Capybara, Rspec, Selenium. Visit(URL) -- waits for all the way until the page is ...
Estefania's user avatar
1 vote
1 answer
93 views

What is the name for the 'describe it' format in testing?

This is with ruby-rspec but I have seen it for other languages too. BDD is one term but maybe that is to too general as it covers Cucumber which doesn't use this format. Example: describe "Stuff" do ...
Michael Durrant's user avatar
0 votes
1 answer
307 views

How can I test if a page object yml file has orphaned keys using rspec?

I like using page objects through a yaml file with name:locator pairs One problem I run into is that over time as the locators file grows, test cases are changed or removed and we end up with ...
Michael Durrant's user avatar
0 votes
1 answer
382 views

How can I test if a page object yml file has duplicate keys using rspec?

Given a yml file with thing1: 'thing1' thing2: 'thing2' thing3: 'first' thing3: 'second' thing4: 'thing4' thing5: 'thing5' thing5: 'thing5' thing6: 'thing6' How can I write an rspec test that fails ...
Michael Durrant's user avatar
1 vote
1 answer
30 views

How to provide non-technical users with better rspec output

When writing UI automation specs RSpec has a great option --format=documentation You can combine this with --dry-run and get instant tests as documentation... The only problem is that it has all ...
Michael Durrant's user avatar
2 votes
1 answer
274 views

What would switching from ruby rspec to minitest involve?

I see that minitest is now included in Ruby, just require the file. Replaces unittest. I'm still using rspec everywhere 'cos I came from Ruby on Rails. minitest looks just like rspec witht the ...
Michael Durrant's user avatar
2 votes
1 answer
1k views

Why do rspec-capybara chrome tests run headless fail on my mac and how to diagnose/fix it?

My colleague with a windows machine doesn't have this issue with the same code. All my tests that pass normally when run in chrome - fail when run headless at the point where the user presses save ...
Michael Durrant's user avatar
2 votes
1 answer
214 views

Why are intermittent browser automation failures hard to fix and how to overcome that?

They seem to pop up almost randomly and with varying amounts of frequency. How to avoid them and fix the ones we have?
Michael Durrant's user avatar
1 vote
1 answer
809 views

How to use xvfb to run my automated rspec-capybara chromedriver tests?

I read through this and I don't quite get it. If I currently run my rspec capybara tests using chromedriver, how will I change that to xvfb ? I see the examples like Xvfb :1 -screen 0 1600x1200x32 ...
Michael Durrant's user avatar
2 votes
1 answer
126 views

What's the 'workflow' for writing tests for existing code with zero tests?

When I search for info on testing, all I seem to find is TDD/BDD workflow: Write a test for a basic functionality Run and watch if fail Implement Run tests again Fix code if needed Rinse/repeat ...
Tuma's user avatar
  • 123
1 vote
1 answer
578 views

How do I stop my rspec capybara tests failing intermittently

The intermittent failures are hard to pin down and they can be in many different tests. Often you can see the element you are targeting in the browser but the program just doesn't seem to be in sync ...
Michael Durrant's user avatar
0 votes
1 answer
32 views

Running tests in chrome but just getting data;. in every browser window

My test suite (ruby, rspec, capybara) was able to run browser based feature tests before but they somehow are broken now, and none pass. This only happens on my Ubuntu machine. On other machines ...
Michael Durrant's user avatar
1 vote
1 answer
548 views

Are there advantages to using Capybara with RSpec + Selenium?

I want to create some front-end automation for our web application. My plan is to use RSpec as the framework and Selenium to drive the browser. I see a lot of information (blog posts) around using ...
Chris Kenst's user avatar
  • 3,741
7 votes
2 answers
6k views

How can I run one spec 100 times using the command line?

We're getting intermittent failures. Hope can I run one test 100 times to see how 'stable' it is?
Michael Durrant's user avatar