Skip to content

Add a headless browser to the default template #4

Description

@defkode

Problem

The default template is a Rails sandbox, but there's no browser in it. That
means an agent working in the sandbox cannot run system tests and cannot
verify that a page renders
— it can only reason about the code it just wrote.
For a Rails template this is the single largest capability gap: the agent's
feedback loop stops at the model and controller layer.

Proposal

npx playwright install --with-deps chromium

This gets two things at once: a Capybara-drivable Chrome for system tests, and
a scriptable browser the agent can drive directly to check a rendered page.

Do not use apt install chromium on Ubuntu — it's a snap transitional
package and is painful in a container.

Considerations

  • --with-deps pulls a meaningful number of shared libraries; this is the
    heaviest single addition proposed for the template. If image size matters,
    this may deserve its own template (rails-e2e?) rather than living in
    default.
  • Install at provision time or lazily on first use? Provisioning happens once
    per sandbox, so doing it upfront keeps the first test run fast — at the cost
    of a slower orbx up.
  • Chromium only, or also Firefox/WebKit? Chromium alone covers the common
    Capybara setup.
  • Worth checking whether selenium-webdriver / cuprite is what the target
    Rails version's generated application_system_test_case.rb actually expects,
    and matching that.

Acceptance

A generated Rails app's default system test passes inside a fresh sandbox with
no additional setup.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions