Skip to content

Commit

Permalink
Logout after each Behat scenario
Browse files Browse the repository at this point in the history
In newly written tests we were already doin this manually in each
scenario. Between scenario's the user manager in the DrupalExtension was
not correctly keeping track of the logged in user status which could
prevent a new scenario from logging a user in.

With the removal of clean-up in scenario's we now need that logout step
literally everywhere, so it's easier to add it as an `@afterScenario`
and run it every time than to require developers to decide about 100s of
places whether it's needed.

See jhedstrom/drupalextension#641
  • Loading branch information
Kingdutch authored and Robert Ragas committed Jul 22, 2023
1 parent 8cbf0c6 commit 0082d46
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/behat/features/bootstrap/FeatureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,9 @@ public function openFileAndExpectAccess($fid, $expected_access) {
/**
* Log out.
*
* Until https://github.com/jhedstrom/drupalextension/issues/641
* @afterScenario
*
* @Given /^(?:|I )logout$/
*/
public function iLogOut()
Expand Down

0 comments on commit 0082d46

Please sign in to comment.