...t tried it. Please update this card if you find out. What I did test successfully was the workaround below. Workaround In Rails 4 you can wrap the output of...
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...
.replace(/^/, '#') Ruby My use case was comparing colors in an integration test, so I used JS to get the pseudo element's style via Selenium, and then processed it...
...Unpoly you may also use up.util.parseUrl(), which implements the technique in this card with tests and all caveats fixed. Related topic: JavaScript: Working with Query Parameters Javascript: Read params from...
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...
...jQueryUI's Sortable plugin (either directly or via Angular's ui.sortable), you might struggle testing your nice drag&drop GUI since Selenium webdriver does not support native dragging events.
...jQueryUI uses jquery.simulate for their testing, so why shouldn't you? There is even an extension to it that makes testing drag & drop quite easy. Here is what you need...
...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...
VCR.use_cassette(' ', match_requests_on: %i[method oauth_uri]) do # Your test here
...If you have more than one recording device, find the correct one. Make a test call to a colleague that can tell you if it's too loud or too...
...display the video. When you deliver your youtube video via https://youtu.be/jyElDp98HdI your test which checks that the embeded video is rendered in the view will fail because your...
...test server doesn't use https Solution Let your links look like //youtu.be/jyElDp98HdI and you will be fine, server side and test side...
...This broke during deployment while Capistrano tries to run bundle --deployment --quiet --without development test. On our development machines bundle install run successfully. Fix this by making sure both sides...
...positioning, width/heigth, or similar. Every browser has its own caveats and you can not test them all. Generally speaking: Use the html tag to define your page's default background...
...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...
...committed fix that is not yet in the stable repository. You can enable the testing sources (natty-proposed) and update your packages to get the fix. You will also receive...
...lots of other code in testing, so hold on to something. This can be avoided by restricting it to the compiz package (I did not test this). Warning: Your system...
class Note does 'strip_carriage_returns', :prose, :code end Here is the test that goes with it: describe Note do describe 'before_validation' do it_should_run_callbacks...
yarn add rails-erb-loader Add this to your config/webpacker/environment.js: environment.loaders.prepend('erb', { test: /\.erb$/, enforce: 'pre', use: [{ loader: 'rails-erb-loader', }] }) Start using erb. For example, in a...
...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 could open a new tab via window.open when using execute_script in Selenium tests. It no longer works in Chrome (will show a "popup blocked" notification). This is because...
So I checked the /var/lib/dpkg/info/varnish.postrm for exit 78 and found the following: [...] if test -e /var/lib/varnish; then rm -r /var/lib/varnish > /dev/null 2>&1 || exit 78 fi [...] This directory couldn...
If you open a pop-up window [1] in your Selenium tests and you want to close it, you can do this: # Find our target window handle = page.driver.find_window("My...
...is not used before removing it. If you remove the --dry-run flag, all tests will actually run and you can skip adding the require_relative line. It will take...
...above commands does, see explainshell. Note that we use geordi cucumber to run our tests. If you don't, xargs cucumber or similar might work for you. Part of Geordi...
...If you want to open XLSX spreadsheets (for example to confirm your output in tests), you can use roo. To easily dump Rails records to XLSX, there is also axlsx...
Note that if you plan to freeze your Firefox versions because your Selenium tests break whenever Firefox updates, there is a better way that lets you keep an up-to...