Authentication is hard: there are many edge cases, and most users (including yourself) usually only go the "happy path" once...

Note: This technique is confusing and slows down your test suite. Copy the attached code to features/support. This gets you...

stackoverflow.com

TL;DR: Variables not declared using var are stored outside the current scope, most likely in the global scope (which...

When a controller action redirects to an external URL (like http://somehost.com/some/path) you will find that this is hard...

opensoul.org

Great presentation about writing Javascript like you write everything else: Well-structured and tested. JavaScript is no longer a toy...

chartjs.org

Chart.js seems to be a good alternative to Google's Chart API and other commercial chart drawing libraries.

JavaScript has no built-in functions to compare two objects or arrays for equality of their contained values.

If you open a pop-up window [1] in your Selenium tests and you want to close it, you can...

makandra dev

JavaScripts and CSS should be minified for production use. In Rails 3.1+ the asset pipeline will take care of this...

If you need to capture signatures on an IPad or similar device, you can use Thomas J Bradley's excellent...

kushagragour.in

A tooltip library that does not use Javascript. Works in IE9+. This library (or the technique used by it) could...

Spreewald now comes with a step that tests if a form field is visible: Then the "Due date" field should...

developers.google.com

The attached article outlines considerations when choosing client-side vs. server-side implementations of the Google Geocoding APIs (geocoder, directions...

So you want to find out how many horizontal pixels you have available on a mobile device. This is super...

makandra dev
github.com

Tracekit is a JavaScript library that automatically normalizes and exposes stack traces for unhandled exceptions across the 5 major browsers...

The basic idea is pretty simple: an element's height is accessible via the offsetHeight property, its drawn height via...

stackoverflow.com

This works in all relevant browsers: document.activeElement You can use this in your Selenium steps, for example, to assert that...

Selenium cannot reliably control a browser when its window is not in focus, or when you accidentally interact with the...

Capybara gives you two different methods for executing Javascript: page.evaluate_script("$('input').focus()") page.execute_script("$('input').focus()")

coding.smashingmagazine.com

JavaScript engines such as Google’s V8 (Chrome, Node) are specifically designed for the fast execution of large JavaScript applications...

Generally, Selenium tests use the browser to interact with the page. If it's unavailable, a timeout error is...

If you're using the Capybara webdriver, steps sometimes fail because the browser hasn't finished loading the next page...

makandra dev
leemunroe.com

Shows how to implement an animated progress bar in pure CSS, without animated GIFs, Javascript or Flash.

makandra dev
bitbucket.org

Makes a robust determination of a user's timezone through Javascript.