Sometimes modern Javascript projects get out of hand. A major culprit in this can be the messy handling of asynchronous...
You should prefer native promises to jQuery's Deferreds. Native promises are much faster than their jQuery equivalent. Native promises...
Native promises have no methods to inspect their state. You can use the promiseState function below to check whether a...
I often see the use of || to set a default value for a variable that might be nil, null or...
Capybara clears cookies before each scenario, but not other client-side data stores. If your app is using localStorage or...
select2 is a great jQuery library to make (large) fields more usable. For Bootstrap 3 there is select2-bootstrap-theme...
Webpack is the future. We're using it in our latest Rails applications. For tests, we want to compile assets...
I needed to make sure that an element is visible and not overshadowed by an element that has a higher...
ChromeDriver clicking works by simulating a mouse click in the middle of the element's first client rect (or bounding...
Middleman is a static page generator that brings many of the goodies that Rails developers are used to.
Sass lets you easily specify multiple selectors at once like this: .some-block &.has-hover, &:hover outline: 1px solid red...
To move elements around we should be familiar with coordinates. Most JavaScript methods deal with one of two coordinate systems...
As web developers, we know how easy it is to end up with web page bloat. But loading a webpage...
window.getSelection().toString(); Browser support: IE9+, Android 4.3+, Safari 5+
You can easily have a JavaScript hash/object that returns a default value for unset keys/properties – as long as you need...
There seems to be a nasty bug in Chrome 56 when testing with Selenium and Capybara: Slashes are not written...
Web technology is a broad field and you cannot be an expert in all aspects. However, it is useful to...
Just like we use gems on the server, we use third party JavaScript libraries in the browser. These typically provide...
Collection of useful tools in the Chrome JavaScript console. Make the whole page editable This is not special to Chrome...
TLDR: A function is hard to use when it sometimes returns a promise and sometimes throws an exception. When writing...
Chrome gives you the currently selected element in the inspector with $0. If you select a button in the DOM...
Plot graphs in Ruby WebGraphviz renders in your browser via JavaScript (to store the rendered graph, extract the SVG using...
TL;DR Debugging problems with javascript errors in cucumber tests is sometimes easier in the browser. Run the test, stop...
There is no CSS selector for matching elements that contains a given string ¹. Luckily, Capybara offers the :text option to...