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.
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.
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).DOMElement wrappers and XPath/CSS selectors consistently across WebDriver and PhpBrowser tests.grabPageSource() or seeInSource()—these rely on internal utilities from lib-web.WebModule (though rarely exposed directly—study WebDriver source for reference).PhpBrowser) and browser-native engines (via Selenium) may cause selector mismatches—always test selectors in the actual browser console.amOnPage() might behave differently under WebDriver vs PhpBrowser—configure actor config for PhpBrowser with url: http://localhost and verify in acceptance suites.debug mode in Codeception (--debug flag) to see underlying HTTP requests/responses, which often reveal issues resolved by lib-web internals.composer show codeception/lib-web.How can I help you explore Laravel packages today?