Note that if you plan to downgrade Firefox because your Selenium tests broke after a Firefox upgrade, there is a better way that doesn't involve downgrading. Mozilla has stated...
...the prepended module and we need to prepend the class to define class methods. Test class Test; include SuperClient; end Test.foo => 'New foo' Test.new.bar => 'New bar' Good practice
end Note that you need to tag the scenario with @allow-rescue to test that an error is shown like this @allow-rescue Scenario: Accessing the admin area requires...
Safari & Chrome Use $x() in your console: $x('//span') # selects all span elements Firefox There's an add-on.
...staging', 'production']. Remove better_errors from Gemfile if existing and bundle. With Raven.capture_message('Test from development') you can test your setting on console. Raising an exception will now report...
...Add continuous integration in Gitlab 4 0 - 5 Dev machines are not blocked on test runs; Code Reviews include test badge; Automatically merge a PR on green tests
...library has a better API Add capybara_lockstep 2 0 - 5 Reduce flaky integration tests
...to make it accessible from other machines in the local network, e.g. with a test iPad Improve geordi tests: If rake runs tests, skip other test runs (cucumber, rspec), as...
...rake usually runs all employed tests Rename geordi devserver to geordi server (the former is still supported) Improved command descriptions and README Fix geordi firefox --setup: Fail on missing version...
Use the following command to test if a server (in this example: makandra.com on port 443) uses Perfect Forward Secrecy (PFS): openssl s_client -connect makandra.com:443 -cipher ECDHE-RSA-RC4...
This describes how to migrate an existing cucumber test suite to Spreewald. Add the gem Include spreewald into your cucumber environment by putting require 'spreewald/web_steps' require 'spreewald/email_steps' # ... or just
...web_steps, shared_steps, table_steps, email_steps etc. Comment it out. Run your test suite. It will probably complain about missing steps, those that didn't make it into...
...a machine by sending an e-mail you can run the following: mail -s Test someone@example.com < /dev/null This will send an empty e-mail with "Test" as its subject to...
...someone@example.com. If you want it to contain a message body, call mail -s Test someone@example.com only; the mail application will then read your input from stdin. Finish your message by...
If you want to freeze a different version of a dependency for your tests, prefer putting it into the Gemfile in your gem project directory. In the example above...
...gemspec like this: spec.add_dependency 'activesupport' Then, in your Gemfile, add the dependency for tests: gem 'activesupport', '~> 2.3'
...have a program running in a hidden X screen (like with Xvfb for Selenium tests) you may want to look at that hidden screen occasionally. First, find out what X...
...site using the Page Object Model pattern, for use with Capybara in automated acceptance testing. The Page Object Model is a test automation pattern that aims to create an abstraction...
...of your site's user interface that can be used in tests. The most common way to do this is to model each page as a class, and to then...
...XrayWrapper [object HTMLInputElement]] (Selenium::WebDriver::Error::MoveTargetOutOfBoundsError) I had the Terminal window running the test on my secondary screen, whereas the Selenium-webdriven Firefox always started on my primary one...
...Now if I had focused the secondary screen when running the tests, Selenium could not start Firefox and switch to it (probably because the screens are split), generating the above...
I got this error when running Rails 2.3 tests for Rails LTS. More stacktrace: NoMethodError: undefined method `cache' for Gem:Module /vagrant/rails-2-3-lts-repository/railties/lib/rails_generator/lookup.rb:212:in `each' /vagrant/rails-2-3-lts-repository/railties/lib/rails_generator/lookup.rb:146:in `to_a...
...started your screen reader you can simply navigate to whatever application you want to test and the screen reader will start to do its thing. If your screen reader isn...
...the application. If that still does not work, then the application you want to test may not be supported. Since we are usually building websites though, that should not pose...
Cucumber will clean up files you've uploaded in your Cucumber features automatically with the attached code. Put the file...
...are probably using closures to hide local state, e.g. to have private methods. In tests you may find it necessary to inspect a variable that is hidden behind a closure...
...option is available, not that it is selected. There is a separate step to test that an option is selected. Capybara (0.4.1 or higher) Then /^"([^"]*)" should( not)? be an option...
...you don't need to check the input of hidden fields in an integration test. But e.g. waiting for a datepicker library to write the expected value to this field...
...before continuing the test, which prevents flaky tests, is a valid use case...
...rails generators) with rails g -h. generator model migration controller entry in routes.rb views tests scaffold ✔ ✔ ✔ ✔ ✔ ✔ resource ✔ ✔ ✔ ✔ ✔ model ✔ ✔ ✔ controller ✔ ✔ ✔ migration ✔ Also see this blog post...
...you use that "db count" and process the loaded elements. A common example is tests: Imagine a test that sets up a few records and finishes the test setup by...
...records have loaded (i.e. cached) their associations too early and now are missing elements. Tests relying on the setup will fail, because they will operate on the loaded records. You...
...as pending, include a failing spec body or RSpec 3 will consider the pending test as failing. The reasoning is: If the spec is flagged as pending but passes, it...
...or when you accidentally interact with the browser frame. This will result in flickering tests, which are "randomly" red and green. In fact, this behavior is not random at all...
...better understanding of Selenium focus issues, and what you can do to get your test suite stable again. Preventing accidental interaction with the Selenium window When Selenium windows steal your...