makandra dev
whattrainisitnow.com

...subsequent ESR releases overlap for three months. This way enterprises have a quarter to test the new version and migrate their clients...

...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...

github.com

You know that Devise offers RSpec test helpers for controller specs. However, in request specs, they will not work. Here is a solution for request specs, adapted from the Devise...

...wiki. We will simply use Warden's test helpers -- you probably already load them for your Cucumber tests. First, we define sign_in and sign_out methods. These will behave...

makandra dev
github.com

...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...

...not to include 3 Applications Tip This can be used to test for exclusion of multiple values all at once...

...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

...Selenium note, I found yet another solution for the problem to hide your selenium tests away. This has the advantages ^ not to require a gem (so you do not force...

...at the running webdriver if necessary Simply make a script that runs your cucumber tests and runs this before: vncserver :6 -localhost -nolisten tcp -SecurityTypes None &>/dev/null DISPLAY=":6"

When you want to test how an web-application reacts in a specific resolution, you can set up a specific Selenium driver for some tests: Before('@chrome320x480') do Capybara.current_driver...

...your path. You can also set a special binary you only use for theese tests. You set up the driver in a file like this # features/support/chrome.rb Capybara.register_driver :chrome320x480 do...

jasmine.github.io

...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();

...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...

...and check if your application responds and everything looks okay. Run your application's tests...

...that running the Ruby garbage collector only every X seconds can speed up your tests. I found that deferring garbage collection would speed up my RSpec examples by about...

...but it probably depends on the nature of your tests. I also tried applying it to Cucumber features, but found no performance improvements. Since Joe is using Test::Unit in...

...files from the dist folder, which is most often <ES6 javascript. 9. Achieve green tests. 10. Check if postcss, uglifier, babel and other compilers work for production. This can be...

...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

...user hovers over the button, or when the article is scrolled into view). 6. Test it! There is so much that can go wrong with the buttons or how the...

...share dialog popups interact with your layout. Always test with each social network. Consider using a fake profile for this so you don't annoy your real life friends...

...on a Rails project a bundle install will get you back the gems. Run tests Now run your test suite to see if the migration was successful. Troubleshooting: Use an...

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...

makandra dev

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...

makandra dev
github.com

...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

...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...