How to handle when an HTML <video> element cannot autoplay

Posted 3 days ago by Arne Hartherz.

...HTML elements can automatically start playing when the autoplay attribute is set on them. Except for when they can not...

Using rack-mini-profiler (with Unpoly)

Posted 3 days ago by Niklas Hä..

Debugging performance issues in your Rails app can be a tough challenge. To get more detailed insights consider using the...

Caution: rem in @media queries ignore your font-size

Posted 5 days ago by Dominik Schöler.
drafts.csswg.org

Relative length units in media queries are based on the initial value, which means that units are never based on...

Problems with git submodules in Gitlab CI

Posted 9 days ago by Tobias Kraze.

If you are using git submodules in Gitlab CI, you might run into a "The project you were looking for...

Rails: Testing file downloads with request specs

Posted About 1 month ago by Julian.

tl;dr Prefer request specs over end-to-end tests (Capybara) to joyfully test file downloads! Why? Testing file downloads

Accessibility: Making non-standard elements interactive

Posted About 2 months ago by Michael Leimstädtner.
developer.mozilla.org

A common cause of non-accessible web pages are elements that were made interactive via JavaScript but cannot be focused...

Heads up: You should always use "current_window.resize_to" to resize the browser window in tests

Posted 2 months ago by Michael Leimstädtner.

I recently noticed a new kind of flaky tests on the slow free tier GitHub Action runners: Integration tests were...

Use <input type="number"> for numeric form fields

Posted 2 months ago by Arne Hartherz.

Any form fields where users enter numbers should be an . Numeric inputs have several benefits over : On mobile or tablet...

Best practices: Writing a Rails script (and how to test it)

Posted 3 months ago by Dominik Schöler.

A Rails script lives in lib/scripts and is run with bin/rails runner lib/scripts/.... They are a simple tool to perform...

Element.animate() to animate single elements with given keyframes

Posted 3 months ago by Nico Winkler.
developer.mozilla.org

Today I learned that you can animate HTML elements using the Web Animation API's method .animate(keyframes, options) (which...

Unpoly 3.7.1, 3.7.2 and 3.7.3 released

Posted 3 months ago by Henning Koch.
unpoly.com

Version 3.7.0 broke some things in complex forms. Sorry for that. Concurrent user input is hard. 3.7.1 This change fixes...

RailsStateMachine 2.2.0 released

Posted 4 months ago by Max E..

Added: State machine can now use the :prefix-option to avoid name collision if you define multiple state machines on...

Javascript: Avoid using innerHTML for unsafe arguments

Posted 5 months ago by Emanuel.

Make sure that you use the correct property when editing an HTML attribute. Using innerHTML with unsafe arguments makes your...

A reasonable default CSP for Rails projects

Posted 5 months ago by Tobias Kraze.

Every modern Rails app should have a Content Security Policy enabled. Very compatible default The following "default" is a minimal...

How to: Upgrade CarrierWave to 3.x

Posted 5 months ago by Dominic Beger.

While upgrading CarrierWave from version 0.11.x to 3.x, we encountered some very nasty fails. Below are the basic...

Zeitwerk: How to collapse folders in Rails

Posted 5 months ago by Niklas Hä..

All direct child directories of app are automatically added to the eager- and autoload paths. They do NOT create a...

RSpec: Leverage the power of Capybara Finders and Matchers for view specs

Posted 6 months ago by Felix Eschey.
thegnar.com

View specs are a powerful tool to test several rendering paths by their cases instead of using a more costing...

Spreewald, Cucumber: Selector for the nth element

Posted 6 months ago by Felix Eschey.

The recommended additional setup of the spreewald gem, a useful set of cucumber steps, includes adding a file for defining...

How to work around selenium chrome missing clicks to elements which are just barely visible

Posted 7 months ago by Arne Hartherz.

Chromedriver (or selenium-webdriver?) will not reliably scroll elements into view before clicking them, and actually not click the element...

HTML: Auto fill-in OTP received in text message (SMS)

Posted 7 months ago by Dominik Schöler.

Browsers can auto fill-in one time codes if advised. Use it like this: Demo: https://twitter.com/sulco/status/1320700982943223808 Browser support...

Lightning Talk: Coverage based Test Case Prioritization in Ruby on Rails

Posted 7 months ago by Felix Eschey.
github.com

For my computer science bachelor's thesis I programmed and evaluated a CLI Test Case Prioritization (TCP) tool for makandra...

Do not pass params directly into url_for or URL helpers

Posted 7 months ago by Arne Hartherz.

Rails' url_for is useful for generating routes from a Hash, but can lead to an open redirect vulnerability.

RSpec: How to write isolated specs with cookies

Posted 8 months ago by Felix Eschey.

Rails offers several methods to manage three types of different cookies along with a session storage for cookies. These...

How to transition the height of elements with unknown/auto height

Posted 8 months ago by Arne Hartherz.

If you want to collapse/expand elements with dynamic content (and thus unknown height), you can not transition between height: 0...