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 Web Laravel Package

codeception/lib-web

Codeception module for web testing helpers and HTTP/HTML interaction utilities used across Codeception suites. Provides common web-related abstractions and support code to build functional and acceptance tests that simulate user behavior and verify responses.

View on GitHub
Deep Wiki
Context7

Getting Started

codeception/lib-web is a low-level utility package containing shared abstractions and helpers for Codeception’s browser testing modules (like WebDriver, PhpBrowser, InnerBrowser). You typically don’t install it directly—it’s a dependency pulled in by those modules. Start by ensuring you have codeception/codeception and a browser module (e.g., codeception/module-webdriver) installed. Your first real use case is writing functional/acceptance tests that interact with a browser:

codecept generate:cept acceptance UserLogin

Then use generated tests to click links, fill forms, and assert DOM content—lib-web handles underlying URL resolution, HTTP header handling, and DOM parsing behind the scenes.

Implementation Patterns

  • Abstraction over browsers: Use Helper classes that extend Codeception\Module and leverage methods like $this->amOnPage(), $this->click(), etc., knowing lib-web standardizes cross-module behaviors (e.g., handling redirects, cookies, session storage).
  • DOM manipulation & assertion: Leverage DOMElement wrappers and XPath/CSS selectors consistently across WebDriver and PhpBrowser tests.
  • Shared response utilities: When debugging, use methods like grabPageSource() or seeInSource()—these rely on internal utilities from lib-web.
  • Custom module development: If building a custom browser-based module, extend existing patterns using traits like WebModule (though rarely exposed directly—study WebDriver source for reference).

Gotchas and Tips

  • Silent dependency: Since it’s an internal dependency, avoid direct reliance on its classes unless absolutely necessary (no public API guarantees).
  • DOMParser inconsistencies: Differences in DOM parsing between Symfony DomCrawler (used by PhpBrowser) and browser-native engines (via Selenium) may cause selector mismatches—always test selectors in the actual browser console.
  • Request header handling: Cookies or headers set via amOnPage() might behave differently under WebDriver vs PhpBrowser—configure actor config for PhpBrowser with url: http://localhost and verify in acceptance suites.
  • Debugging tip: Enable debug mode in Codeception (--debug flag) to see underlying HTTP requests/responses, which often reveal issues resolved by lib-web internals.
  • Last release date quirk: The future release date (2026-02-06) likely indicates a misconfigured release tag—verify the actual package version via composer show codeception/lib-web.
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