I haven't been able to nail down the exact issue but when using Chromedriver the login seems to get past itself, showing a logged in page, but not being logged in on the subsequent step. I have reproduced the error on a Drupal 9.5 install using this composer only including the necessary behat stuff.
I have solved this by adding a sleep(1); right before the submit click. This solves it in all of our tests so far:
Patch:
--- vendor/drupal/drupal-extension/src/Drupal/DrupalExtension/Manager/DrupalAuthenticationManager.php 2022-04-26 12:55:44
+++ vendor/drupal/drupal-extension/src/Drupal/DrupalExtension/Manager/DrupalAuthenticationManager.php 2024-08-26 12:05:37
@@ -68,7 +68,7 @@
if (empty($submit)) {
throw new \Exception(sprintf("No submit button at %s", $this->getSession()->getCurrentUrl()));
}
-
+ sleep(1);
// Log in.
$submit->click();
Feature: Check that content type basic page and the respective fields exist and are as expected.
Scenario: All basic page fields exist and are present.
Given I am logged in as a user with the 'administrator' role
When I am at "/admin/structure/types/manage/page/fields"
Then I should see "Body" in the "body" row
I haven't been able to nail down the exact issue but when using Chromedriver the login seems to get past itself, showing a logged in page, but not being logged in on the subsequent step. I have reproduced the error on a Drupal 9.5 install using this composer only including the necessary behat stuff.
I have solved this by adding a sleep(1); right before the submit click. This solves it in all of our tests so far: Patch:
Composer:
Test:
Behat.yml:
.lando: