Skip to content
This repository was archived by the owner on Sep 30, 2026. It is now read-only.

Position axe-cuprite as Cuprite-only (#31) - #34

Merged
AbuMareBear merged 3 commits into
mainfrom
docs/cuprite-only-positioning
Jun 16, 2026
Merged

AbuMareBear merged 3 commits into
mainfrom
docs/cuprite-only-positioning

Conversation

@AbuMareBear

Copy link
Copy Markdown
Contributor

Closes #31.

Problem

The README, gemspec description, and AGENTS.md advertised that axe-cuprite works on "any real-browser Capybara driver," with driver-agnosticism framed as a bonus. That bonus is neither tested nor fully supported — the non-Ferrum fallback in Injector#evaluate_axe has zero coverage (every spec runs under Cuprite, where ferrum_page is always truthy), and timeout_error? only recognizes Ferrum timeout classes. Advertising support we don't test invites bug reports we can't reproduce.

Changes

Reposition as Cuprite-only (docs):

  • README.md — "Why this gem exists" now states Cuprite is the only supported and tested driver, while keeping the honest engineering note that axe is driven through Capybara's driver-neutral JS API (which is why it works where the official gem doesn't). The Timeout caveat now labels the non-Ferrum evaluate_async_script fallback as best-effort/untested.
  • axe-cuprite.gemspec — description drops the "any other real-browser driver" claim.
  • AGENTS.md — replaces "staying driver-agnostic is a bonus" with the Cuprite-only positioning (CLAUDE.md symlinks to it).

Keep the fallback, just stop advertising it: the best-effort non-Ferrum path in Injector#evaluate_axe is unchanged, and the Cuprite-only timeout_error? classification is left as-is (acceptable per the issue once the broad-driver claim is dropped).

New spec (the issue's optional follow-up): added a #evaluate_axe non-Ferrum fallback group to spec/injector_spec.rb. Instead of stubbing the subject, it gives page.driver an object with no #browser, so the real ferrum_page returns nil and forces the fallback. It asserts the fallback (a) calls evaluate_async_script with RUN_JS/context/options, and (b) runs under the explicit timeout (17s), not Capybara.default_max_wait_time (2s), restoring the wait time afterward — so the best-effort path can't silently break.

Verification

  • bundle exec rspec — 66 examples, 0 failures
  • bundle exec rubocop spec/injector_spec.rb — clean

Drop the "works with any real-browser Capybara driver" claim from the
README, gemspec description, and AGENTS.md. Cuprite is the only supported
and tested driver; the driver-neutral JS API is now framed as the
implementation detail that makes the gem work on Cuprite and avoid
Selenium internals, not a promise of broad driver support. The
best-effort non-Ferrum fallback in Injector#evaluate_axe is kept but
documented as unsupported/untested.

Add a unit test pinning that fallback: with no Ferrum page, evaluate_axe
routes through evaluate_async_script under the explicit timeout rather
than Capybara.default_max_wait_time, so the path can't silently break.
@AbuMareBear
AbuMareBear merged commit 68d4039 into main Jun 16, 2026
6 checks passed
@AbuMareBear
AbuMareBear deleted the docs/cuprite-only-positioning branch June 16, 2026 17:56
@AbuMareBear AbuMareBear mentioned this pull request Jun 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Drop the "works with any real-browser Capybara driver" claim; position axe-cuprite as Cuprite-only

1 participant