Selenium: How to close another tab (popup)
Closing a Selenium pop-up requires switching to its window handle and then pointing the driver back to another tab to avoid broken subsequent steps.
Take care of existing users when upgrading Clearance
Upgrading Clearance can break existing logins when password hashes change from SHA1 to BCrypt, causing BCrypt::Errors::InvalidHash for legacy users.
randym/axlsx · GitHub
Create XLSX spreadsheets in Ruby with charts, images, styling, auto column sizing, and schema validation; handles large files and eases migration from spreadsheet.
Request a non-HTML format in controller specs
Controller specs can exercise non-HTML responses such as PDF, Excel, XML or JSON by setting :format or the HTTP_ACCEPT header. The format value must be a String, not a Symbol.
Puppet: Could not evaluate: Field 'device' is required
Puppet mount failures can stem from a malformed /etc/fstab; rewriting the file can resolve missing device field errors during catalog runs.
How to pair a Bose Quiet Comfort 35 with your Ubuntu computer
Bluetooth on Ubuntu can pair with Bose QC35 but still lack audio output; disabling low-energy mode and enabling the PulseAudio Bluetooth module restores sound.
Linux: How to add a task bar to VNC displays
VNC sessions often lack window switching and a visible task list, making Selenium debugging awkward. A lightweight panel such as lxpanel restores task switching on the remote desktop.
Colcade is a lightweight Masonry alternative
Lightweight grid layouting for mixed-size items with smaller footprint and no dependencies; performance is better than Masonry, but column spanning and built-in transitions are missing.
A solid and unobtrusive plugin for form field placeholders
jQuery plugin for placeholder text in browsers without native HTML5 support, including IE6. Skips elements that already support the placeholder attribute.
Testing state_machine callbacks without touching the database
Testing state transition callbacks without database writes requires isolating callback methods from the event itself. spec_candy offers helpers to exercise them directly.
Match strings in a given order with Cucumber and Capybara
Verify that page text appears in a specific sequence while ignoring HTML markup, using a Cucumber step for plain-text order checks.
Parametrized shared example groups in RSpec
Parameterized shared examples make reusable RSpec behavior checks accept arguments and blocks, avoiding duplicated expectations across similar specs.
Rails: Disable options of a select field
Rails select helpers can disable specific options by value, preventing choice of unavailable entries in forms.
Cucumber: Wait for any requests to finish before moving on to the next scenario
Selenium/Cucumber scenarios can finish before browser requests and redirects are done, leaving the session busy and breaking later steps and hooks.
ActiveRecord meets database views with scenic
Use SQL views in a Rails app without switching the schema format to SQL; Scenic adds versioned, reversible migrations and keeps view definitions in SQL files.
Beware: Nested Spreewald patiently blocks are not patient
Nested patiently blocks in Spreewald can disable retries by setting inner wait times to zero, causing flaky Cucumber/Selenium steps.
Force SSH client to use password authentication instead of public key
Password authentication can be tested by forcing SSH to skip public key login and prefer passwords. The same options also work with scp for file copies.
VNC browser disappears while typing
Typing d in a Geordi VNC browser can switch to a grey screen; pressing d again brings the browser back.
How to silence UTF-8 warnings on Rails 2.3 with Ruby 1.9
Ruby 1.9 triggers UTF-8 regexp warnings in Rails 2.3.16+ from ActiveSupport; a monkey patch in config/initializers suppresses them.
How to set the default monospace font on Xfce (Xubuntu)
Applications that use the generic Monospace family ignore terminal font settings. A fontconfig override in ~/.fonts.conf can map it to a preferred font.
Change how Capybara sees or ignores hidden elements
Capybara’s default hidden-element handling affects DOM queries globally, while :visible scopes visibility checks to one lookup. Driver-specific visibility rules differ between RackTest and Selenium.
Use byebug on Ruby 2+
debugger is unreliable on Ruby 2; byebug provides a fast, reliable debugger for Ruby 2.0.0+ using TracePoint and Debug Inspector.
Using FactoryBot in Development
Dummy development data is faster to create by reusing FactoryBot factories than by using the UI or Rails console records. Defaults, associations, traits, and attribute overrides come along automatically.
How to find out which type of Spec you are
Runtime checks can identify the current RSpec spec type, letting shared setup run only for controller, helper, or request/response-aware examples.