Needs review
Project:
Drupal core
Version:
main
Component:
phpunit
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
8 May 2026 at 21:44 UTC
Updated:
8 May 2026 at 23:02 UTC
Jump to comment: Most recent
BrowserTestBase::initFrontPage() exists to work around a limitation in WebDriver where cookies cannot be set unless the domain in question has already been visited.
However, not all functional tests likely need to load the homepage, so maybe we can improve performance a tiny bit by loading an image instead of the homepage - this should set the domain without having to execute any PHP.
Change this line in ::initFrontPage():
$session->visit($this->baseUrl);
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
longwaveCurious as to whether this makes any difference, I suspect there's not much in it. But perhaps we could remove
initFrontPage()altogether (including all subclass overrides) if we can assume the image is enough?Comment #4
longwaveNot even sure this is needed at all. The comment says
but even if I comment the
visit()out entirely then I can still place breakpoints inside Drupal and they are hit during a test. Perhaps the webdriver implementation no longer has this issue?Comment #5
mstrelan commentedAre you using xdebug.start_with_request = trigger? Because ddev uses on by default which I don't think requires the cookie. I'd like to not break the trigger mode as we use that a lot outside of ddev.
Comment #6
catchWe could at least only do the request when xdebug is enabled if it's only really for that?