...inserted data in a migration or when you had to kill -9 a frozen test process. Old Capybara versions already have the Database Cleaner gem as dependency. Otherwise add database...
...Rake task by copying the attachment into lib/tasks/clean_database.rake. Now you can e.g. clean the test database by saying on the shell: rake db:clean RAILS_ENV=test
...If you haven't installed Firefox 24 yet, the next time you run tests with Geordi, it will tell you how to install it. On a Rails 2 project:
-> Remove cucumber_spinner from Gemfile. We're not using it in parallel_tests anyway...
...expect(timerCallback).not.toHaveBeenCalled(); jasmine.clock().tick(101); expect(timerCallback).toHaveBeenCalled(); }); If you actually want the test to wait out the timer, your example function needs to accept a done argument, which...
...you then call when the test is expected to finish: it("causes a timeout to be called", function(done) { setTimeout(function() { timerCallback(); }, 100); setTimeout(function() { expect(timerCallback).toHaveBeenCalled();
...fix" this in multiple ways: Update your drivers on your machine with RAILS_ENV=test rake webdrivers:chromedriver:update Ignore the driver update-URL in your VCR configuration
...does not support Ruby 1.8.x anymore removes confusion with Rails' built in integration tests (you put capybara rspec integration tests into the spec/feature/... folder) and the :type metadata has...
...first detected element found by the identifier) has a new syntax for writing integration tests with capybara in rspec (describe => feature, it => scenario) Excerpt of some other major changes
The easiest way to freeze or travel through time in a Jasmine spec is to use the built-in jasmine.clock...
There is a kind of features in web applications that hinder automated integration tests. Examples include cookie consent banners or form captchas. Clearly, these should be disabled so you do...
...not have to explicitly deal with them in each and every test (like, every test starting with accepting the cookies notice). On the other hand, they must be tested as...
Consider this class: class Foo private def test puts "Hello" end end While you can say create a block to call that method (using ampersand and colon) on Ruby...
...Foo.new.tap(&:test) Hello => # ... you cannot do that on Ruby 1.9 or 2.0: 1.9.3 > Foo.new.tap(&:test) NoMethodError: private method `test' called for # ^ 2.0.0 > Foo.new.tap(&:test) NoMethodError: private method `test' called for...
...Specs with --backtrace option Run Cucumber features (with Geordi's --debug option) When all tests are green, look through your Gemfile and remove as many version constraints as possible.
Update rspec to '< 2' Lock haml to '= 3.1.7' Unlock andand Unlock rake Lock test-unit to '= 1.2.3' Lock database_cleaner to '< 1.3' Lock cucumber to '< 2'
...and qualified:fields') This trait used to be a huge blob of code without tests and documentation, so I made a gem out of it. Check out https://github.com/makandra/dusen...
...for code, tests, and a huge README. You should use the Dusen gem and delete SearchableTrait in all future projects. Note that the syntax to define query processors has changed...
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...