Unable to use --repeat since Drupal 10.3

Created on 22 August 2024, 2 months ago

Problem/Motivation

Repeating tests fails with the following error:

Drupal\Tests\moduleName\ExistingSite\ExampleTest::testLlama
Behat\Mink\Exception\ElementNotFoundException: Element matching xpath "//form[@id='user-logout-confirm']" not found.

This seems to be due to changes in core around the user logout process. If the user is not logged in the logout confirm form is not shown. But the underlying issue is that we're not resetting the user session in tear down.

Steps to reproduce

phpunit tests/ExampleTest.php --repeat=2

Proposed resolution

Add $this->loggedInUser = false;, or alternatively $this->drupalResetSession(), to ::tearDownDrupal

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Needs review

Component

Code

Created by

πŸ‡¦πŸ‡ΊAustralia mstrelan

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024