Rethinking Drupal Testing: Kernel HTTP Requests Reduce Need for Browser Tests
Drupal’s testing framework now allows Kernel tests to make HTTP requests, enabling developers to replace some Browser tests with faster alternatives. In a blog post, Joachim Noreiko argues that this shift can significantly reduce test execution time by avoiding full browser simulation where it is not required.
Browser tests validate rendered HTML and user interactions through an internal browser, making them slower and resource-intensive. Kernel tests operate closer to the application layer and, with HTTP request support, can now cover some of these scenarios with less overhead. This makes them suitable for cases where full browser behaviour is not essential.
The approach comes with limitations. Kernel tests do not support sessions, cannot submit forms, and require manual setup for schemas and configuration. Not all Browser tests can be replaced, particularly those involving user interaction. The post does not provide benchmarks or implementation examples, and remains a conceptual guide rather than a detailed migration reference.

