Chromedriver: Disabling the w3c option might break your integration tests with Chrome 91
Chrome 91 can break Selenium integration tests when w3c is disabled, changing input values to nil and causing unexpected assertion failures.
Firefox ESR Release Calendar
Firefox ESR keeps a fixed browser version for a year with security backports only, while overlapping releases give enterprises three months to test and migrate.
Check if two arrays contain the same elements in Ruby, RSpec or Test::Unit
Array equality without regard to order is awkward in Ruby tests; RSpec and Test::Unit provide matchers for matching elements, and plain Ruby needs custom comparison logic.
Preparing your test database: mind the differences
Test database setup can drift from development when schema dumps omit SQL-specific details; choose the right Rake task to keep structure, charset, and collation aligned.
Debugging flickering VCR tests
VCR tests can flicker when recorded requests change because of randomness, timestamps, or generated sequences, making cassette mismatches hard to diagnose.
RSpec: Messages in Specific Order
ordered in RSpec verifies that mocked messages arrive in a specific sequence, helping catch incorrect call order in tests.
Run a single test in Test::Unit
Run one Test::Unit file, method, or name-matching subset directly from the command line when a full test suite is unnecessary.
How to provoke Selenium focus issues in parallel test processes
Parallel Selenium scenarios can steal browser focus and make integration tests flicker. A dedicated focus loop helps reproduce and fix timing-sensitive failures.
How to set the user agent in tests
Customizing the User-Agent header in tests makes browser- and crawler-specific behavior reproducible across Rack::Test, Selenium, and request specs.
How to install a frozen version of Firefox for your Selenium tests
Firefox updates can break Selenium and Cucumber tests; a separate unchanging browser copy avoids auto-updates, profile clashes, and window reuse.
JavaScript: How to query the state of a Promise
Native promises do not expose their current state, which makes state checks in unit tests awkward; a promiseState helper can distinguish pending, fulfilled, and rejected promises.
Switch to a recently opened tab with Cucumber
I switch to the new browser tab lets Selenium-enabled tests handle links that open a new tab or window, such as link_to(..., :target => '_blank').
How to disable cookies in cucumber tests
Capybara has no built-in switch for disabling cookies in browser tests; a small Rack middleware can strip request cookies so scenarios can verify sign-in failures without them.
Rails: Concurrent requests in development and tests
Puma concurrency in Rails depends on workers and threads; self-calls during a request can deadlock in development or tests unless multiple workers are enabled.
Mysql::Error: SAVEPOINT active_record_1 does not exist: ROLLBACK TO SAVEPOINT active_record_1 (ActiveRecord::StatementInvalid)
Parallel test runs can trigger missing-savepoint rollback errors when processes share a database or transactional test settings conflict.
Rails 2's CookieStore produces invalid cookie data, causing tests to break
Recent Rails 2 CookieStore versions can emit malformed Set-Cookie headers with blank lines, breaking Cucumber integration tests when cookies are written more than once.
How to: Run geordi in a single proccess with parallel test setup
Parallel test runs in Geordi can break terminal I/O during debugging; forcing one process or using vanilla cucumber avoids breakpoint issues.
RSpec: You can super into parent "let" definitions
let can call super() in nested RSpec contexts to reuse parent test data and override one field, but heavy use can make specs harder to read.
Protip: Clone large projects multiple times
Long test suites block new work on large projects; cloning the repository into a separate directory lets tests run in parallel while development continues.
How to test Autoprefixer and CSSnext in PostCSS
PostCSS plugin output can be verified by compiling assets and checking Autoprefixer and CSS feature transforms from postcss-preset-env.
Mocks and stubs in Test::Unit when you are used to RSpec
Test::Unit lacks built-in mocks and stubs; Mocha adds them and maps common RSpec double, stub, and expectation patterns to mock, stubs, and expects.
ActionMailer: How to send a test mail directly from the console
Rails console debugging for mail delivery failures, with ActionMailer settings inspection and a direct test message to verify SMTP and spam score.
RSpec & Devise: How to sign in users in request specs
Devise controller helpers do not work in request specs; Warden test helpers provide sign_in and sign_out for authenticating users in integration-style tests.
How to test bundled applications using Aruba and Cucumber
Bundler environment variables can shadow a Rails test app when integration-testing CLI tools with Aruba and Cucumber. Clearing the Bundler env and disabling Spring keeps commands isolated.