Summary
Track entities created during a scenario and delete them at teardown, with an opt-out tag.
Details
Add an opt-in mechanism that tracks every entity created during a scenario and deletes them (in reverse order) at scenario end, with a tag to bypass cleanup for specific types. This keeps a test database clean across long suites and prevents cross-scenario contamination from leftover content, users, or files.
Proposed behaviour
- Record entities created through the library's creation steps during a scenario.
- Delete tracked entities in reverse creation order in an
@AfterScenario hook.
- Provide a tag to bypass cleanup for named entity types.
Acceptance criteria
Summary
Track entities created during a scenario and delete them at teardown, with an opt-out tag.
Details
Add an opt-in mechanism that tracks every entity created during a scenario and deletes them (in reverse order) at scenario end, with a tag to bypass cleanup for specific types. This keeps a test database clean across long suites and prevents cross-scenario contamination from leftover content, users, or files.
Proposed behaviour
@AfterScenariohook.Acceptance criteria
src/Drupal/.STEPS.mdregenerated viaahoy update-docsif steps are added.