A Capybara matcher using two sequential `has_css?` calls causes each call to wait the full timeout before trying the next selector. Since `has_css?` is a waiting method, a 30-second CI timeout per failing selector adds up fast. The fix is combining both CSS selectors with a comma into a single query, so Capybara checks both in one pass. Even better, Capybara's built-in `:label` selector already handles both label-for and label-wrapping-input cases natively, eliminating the need for custom CSS entirely.
Sort: