...same regardless of the driver Capybara is using (drivers are e.g. the headless Rack::Test or Selenium). It is a stupid idea to call #node on such a Capybara node...
...used by the driver, e.g. instances Nokogiri::XML::Element if you are using Rack::Test, or of Selenium::WebDriver::Element if you are using Selenium. Because the API of these...
Apache HTTP server benchmarking tool (ab) is a nice tool to test performance on sites delivered by HTTP. If the site you're about to test is placed behind a...
...login, follow these steps to successfully use ab on it. Open the site to test in the browser of your choice. Do not login yet. Use developer tools to show...
...need a special version of chrome because it has some features you need for testing, like in this card. You do not need to use that Version apart from tests...
end Capybara::Selenium::Driver.new(app, :browser => :chrome) end You can use this for tests with a special chrome versions as well, you can have several - see this card
In order to chain greps on log files that are opened via tail -f test.log you have to use the --line-buffered command line option for grep. Imagine you have...
...the following content in your log file. # content for log/test.log test foo bar test foo bar baz bla Now if you would like to grep for lines that contain foo...
The pages […] allow you to see different types of mixed content and test how they behave in your browser. The "Secure" pages are referencing assets with HTTPS, the "Non-Secure...
...same behavior with both Secure pages and the Secure HTTP page for a given test; the behavior will change on the Non-Secure HTTPS page. Also see Testing HTTPS with...
In Ruby, you can only write environment variables that subprocesses will see. For tests with a Rails application (i.e., that call rails or rake or other binstubbed commands), this...
...method may help you: # Use this method to wrap any system calls to the test application def prepare_environment(&block) Bundler.with_clean_env do # Spring leads to all kinds of...
When testing code that uses pushState / replaceState, your browser will appear to navigate away from http://localhost:3000/specs (or wherever you run your Jasmine tests). This is inconvenient, since reloading...
...the document will no longer re-run the test suite. To remedy this, copy the attached file to a place like spec/javascripts/helpers and #= require it from your tests. It will...
...consolidated commit. Having as little commits as possible to restore later is key. Run tests and fix them, if necessary. Maybe tests were added that expect the removed functionality as...
...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
...linking from HTTPS to HTTPS. Fixes Tunnel links through a non-HTTPS page (but test the effect because HTTP referers survive a 301 redirect) There's a new tag you...
...no user at the end of a web browser, e.g. on the console, during tests or during batch processes. You will often want to access Power.current from another model, to...
called as part of processing a browser request, e.g. on the console, during tests and during batch processes. In such cases your model should simply skip authorization and assume...
...both Gemfile as well as Gemfile.lock to the repository. Use bundle to execute your tests using the current bundled environment. Make sure you didn't break anything: bundle exec spec...
Update your scripts Most of us have some alias scripts to run all tests (e.g. ~/bin/tests). Update those scripts so they use bundle exec like this: #!/bin/sh
...as an npm package. // vendor/asset-libs/bought-font/package.json { "name": "bought-font", "version": "1.0.0", "description": "", "main": "index.scss", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "author": "Salesman of trust", "license": "LICENSE", "private": true...
...official" rails2 branch [2] which contains commits that were added after 0.8.6 was released. Tests are fully passing on our fork for Ruby 1.8.7, REE, and Ruby 1.9.3.
...of Module.const_defined? was missing. [2] Changes for replica sets were reverted (since their tests were not passing) and some tests were fixed...
...Find descendant(s) by CSS selector .find(selector) one: .querySelector(selector), many: .querySelectorAll(selector) Test an element (returns boolean) .is(selector) .matches(selector) Test for class presence (boolean) .hasClass(class...
...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...
...their default distribution from Ubuntu 14.04 (trusty) to 16.04 (precise). This might break your test setup for new builds. You can solve this issue by freezing your test distribution in...
...builds might have started failing on the usual psql -c 'create database active_type_test;' -U postgres with an error psql: could not connect to server: No such file or...
...will encounter validation errors being added twice occasionally. This happened to me when during tests: a spec was referring to Foo, which was not yet loaded, because it was in...
...ran its manual validation method twice. Consider the fun you'll have when running tests in parallel...
...to organize features in subdirectories, you won't have any problems when running the whole test-suite. Cucumber will automatically load and run features in subdirectories, too. However, running features...
...working on the project don't have to provide the option for every cucumber test run execution...
After installing Bundler 1.1 you will get the following warning when running tests: WARNING: Cucumber-rails required outside of env.rb. The rest of loading is being defered until env.rb is...
To avoid this warning, move 'gem cucumber-rails' under only group :test in your Gemfile The warning is misleading because it has nothing to do with moving cucumber-rails...
Travis CI is a free continuous integration testing service. However, it is really fragile and will break more than it will work. If you choose to use it anyway, learn...
...add before_script: rvm rubygems latest-1.8 --force to .travis.yml. However, if you run tests for multiple Ruby versions, you need to add before_script: travis:prepare to .travis.yml. In...
...already have a database.yml which defines the database for the cucumber environment instead of test. (Spreewald database.sample.yml has changed) Fix Change cucumber to test in your databse.yml test: # <--- adapter: mysql2...
...database: spreewald_test encoding: utf8 host: localhost username: root password: password
.../home/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/capistrano-3.14.1/lib/capistrano/tasks/deploy.rake:90:in `block (5 levels) in <top (required)>' 11: from /home/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/sshkit-1.9.0/lib/sshkit/backends/abstract.rb:50:in `test' 10: from /home/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/sshkit-1.9.0/lib/sshkit/backends/abstract.rb:137:in `create_command_and_execute' 9: from /home/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/sshkit-1.9.0/lib/sshkit/backends/abstract.rb:137:in `tap...
If your application does something specific on certain hostnames and you want to test this in a feature, you need to tell Capybara to assume a different host.
...scenario (i.e. you do not need an After step to clean up). Notes: Selenium tests will actually visit the app_host, so you can't really use it for those...