Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Lib Innerbrowser Laravel Package

codeception/lib-innerbrowser

InnerBrowser module for Codeception that simulates browser requests without a real browser. Useful for functional testing PHP web apps by sending GET/POST requests, managing cookies and sessions, following redirects, and asserting responses quickly in-memory.

View on GitHub
Deep Wiki
Context7

Getting Started

InnerBrowser is a lightweight browser simulation engine used primarily within Codeception’s testing framework. To get started:

  • Install via Composer: composer require --dev codeception/lib-innerbrowser
  • Use it automatically via Codeception’s PhpBrowser or Framework modules (it powers their DOM-based HTML parsing and request simulation).
  • First use case: Write unit/integration tests that require DOM inspection or HTTP request simulation without launching a real browser (e.g., assert HTML content, submit forms, follow redirects).
    Start by checking tests/acceptance.suite.yml or tests/unit.suite.yml if using Codeception — InnerBrowser is typically enabled as a dependency of PhpBrowser or Symfony module.

Implementation Patterns

  • Form submission simulation: Use WebDriver or PhpBrowser to submit forms, then assert DOM elements via InnerBrowser’s Dom crawler-based methods (e.g., $I->seeElement('#submit-btn')).
  • Header/response assertion: Access raw HTTP response headers and body via $I->grabHttpHeader() or $I->grabPageSource(), leveraging InnerBrowser’s internal parsing.
  • Debugging during test development: Temporarily enable $I->debugSection('response', $I->grabPageSource()); — InnerBrowser parses the HTML into a traversable DOM for efficient element selection.
  • Integration with Laravel/ Symfony: Works behind the scenes when using Laravel or Symfony modules — no direct instantiation required.

Gotchas and Tips

  • InnerBrowser itself is not meant for standalone use — it’s a dependency of other modules. Direct usage is rare and usually only in custom module development.
  • It does not handle JavaScript — redirects or DOM changes via JS won’t reflect; for that, use WebDriver or Playwright.
  • Caching: InnerBrowser caches parsed DOM per request. If you modify HTML mid-test (e.g., via $I->amOnPage()), DOM state updates automatically — no manual refresh needed.
  • Debugging tip: Set debug: true in your suite config to see real-time DOM snapshots. Use dom_dump() in custom helpers if extending functionality.
  • Extension point: Override the InnerBrowser class via module configuration to inject custom DOM manipulation or logging hooks.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport