Allow capybara to click on labels instead of inputs for checkboxes
Custom-styled checkboxes with hidden inputs can’t be toggled by Capybara’s check and uncheck; allow_label_click: true lets tests click the label instead.
How to employ and run your tests with parallel_tests to speed up test execution
Parallel test execution can cut long Cucumber, RSpec, or Test::Unit runs by splitting work across CPU cores with parallel_tests and separate test databases.
How to: Specify size of Selenium browser window
Set a consistent browser viewport for Selenium tests to avoid layout-dependent failures and mobile-versus-desktop behavior differences.
Geordi 10.0.0 released
Geordi 10.0.0 adds console and test-runner fixes, IRB configuration, and safer PostgreSQL dump restoration, with breaking changes to database drop handling.
Creating a sample video with ffmpeg
Create tiny test videos with ffmpeg by lowering resolution, framerate, and bitrate to keep files small while preserving duration.
Capybara: Preventing headless Chrome from freezing your test suite
Headless Chrome can freeze end-to-end test runs and leave Capybara waiting through long timeouts; restarting sessions regularly and failing fast on lost browser communication reduces hangs.
Your Rails sandbox console
rails console --sandbox lets you test database changes in a console session and automatically rolls them back on exit, while file and email actions remain permanent.
Webmock normalizes arrays in urls
Different HTTP clients encode array query parameters differently, and WebMock normalizes them during matching, which can hide real-world crashes in tests.
Jasmine: Spy on value properties
Jasmine spyOnProperty() fails on plain value fields; a helper can convert them into accessors so they can be stubbed or asserted in tests.
Jest: How to clear the cache
Stale Jest cache can make tests reference refactored code that no longer exists; clearing it with npx jest --clearCache resolves the mismatch.
Migrate gem tests from Travis CI to Github Actions with gemika
Moving gem test suites from Travis CI to GitHub Actions reduces maintenance and aligns CI with current Ruby support. gemika generates the workflow for gems already using it.
Rails: How to check if a certain validation failed
Find out whether a Rails validation failed by checking ActiveModel::Errors types instead of messages, which is useful in tests and for validations with extra options.
How to bind an event listener only once with Unpoly
Unpoly event listeners can be limited to a single execution with { once: true } or up.off, useful for tests and callbacks that must not repeat.
Headless Chrome: Changing the Accept-Language header is not possible
Headless Chrome on Ubuntu cannot reliably change Accept-Language through Selenium options; test code can override the header in Rails instead.
Run Selenium tests in Chrome instead of Firefox
Switching Selenium from Firefox to Chrome requires a matching chromedriver and Capybara driver configuration. Older Capybara versions need a manual Selenium WebDriver setup.
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.
Test redirects to an external URL with Cucumber/Capybara
External redirects are awkward to test with Cucumber and Capybara: Rack::Test ignores the host, while Selenium follows it. Controller specs or an observable redirect make the target URL verifiable.
RSpec: Messages in Specific Order
ordered in RSpec verifies that mocked messages arrive in a specific sequence, helping catch incorrect call order in tests.
Test concurrent Ruby code
Concurrent Ruby code with blocking system calls can fail under Thread-based tests; using forked processes, pipes, and separate ActiveRecord connections keeps synchronization tests reliable.
Always store your Paperclip attachments in a separate folder per environment
Paperclip attachments can collide across development, test, and parallel test processes when they share one storage tree. Separate environment-specific paths prevent overwritten files and missing test data.
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.
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.
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.