Problem/Motivation

Admin Audit Trail logs CUD events for many entity types through a base module and fifteen handler submodules (node, user, user
roles, taxonomy, menu, block content, comment, file, media, workflows, authentication, redirect, entity queue, group, paragraphs),
and surfaces them in a Views-based report at /admin/reports/audit-trail. None of this is covered by automated
browser tests, so regressions in event logging, the report, the exposed filters, the settings form or access control can only be
caught by hand.

Separately, admin_audit_trail_safe_truncate() truncates reference values by bytes
(strlen()/substr()), which can corrupt multibyte UTF-8 (e.g. Arabic titles or usernames) by splitting a character mid-sequence.

Proposed resolution

Add a full functional acceptance test suite using webship-js (Playwright + Cucumber-js BDD) that drives a real
site through the browser, performs create/update/delete actions on each audited entity type, and asserts the matching row appears
in the report.

  • webship-js project at the module root (cucumber.js, cucumber.shared.js,
    playwright.config.ts, package.json scripts) with a pinned, reproducible Cucumber/Playwright
    toolchain.
  • Features under tests/features/drupal/, custom steps in
    tests/step-definitions/admin_audit_trail.steps.js, named selectors in tests/selectors/, and a Drush
    fixtures script tests/fixtures/provision-fixtures.php (image media type, Editorial workflow on Article, a group type,
    a paragraph type + field).
  • Coverage: smoke, report structure, exposed filters, settings form, the legacy report, access control, accessibility
    (axe-core), and one functional feature per handler submodule (node insert/update/delete; user; user roles; taxonomy vocabulary +
    term; menu + menu link; block content; comment; file; media; workflows; auth logout/fail/password request; redirect; entity queue;
    group; paragraphs).
  • webship-js-test job added to .gitlab-ci.yml (Drupal Standard profile, all submodules enabled,
    fixtures provisioned, HTML/PDF/JUnit + screenshots/videos artifacts), plus a self-contained .gitlab-ci-local.yml for
    running the whole pipeline locally with gitlab-ci-local.
  • Fix admin_audit_trail_safe_truncate() to truncate by characters using mb_strlen() and
    \Drupal\Component\Utility\Unicode::truncate().

Result: 39 scenarios / 174 steps passing on a clean Drupal 11 install and under
gitlab-ci-local, with all jobs set to allow_failure: false.

Remaining tasks

  • ✅ File an issue
  • ✅ Addition/Change/Update/Fix
  • ✅ Testing to ensure no regression
  • ✅ Automated unit testing coverage
  • ✅ Automated functional testing coverage
  • ➖ UX/UI designer responsibilities
  • ➖ Readability
  • ➖ Accessibility
  • ➖ Performance
  • ➖ Security
  • ➖ Documentation
  • ✅ Code review by maintainers
  • ✅ Full testing and approval
  • ✅ Credit contributors
  • ✅ Review with the product owner
  • ✅ Release notes snippet
  • ✅ Release admin_audit_trail-1.0.10

API changes

  • N/A

Data model changes

  • N/A

Release notes snippet

  • ci: #3593632 Add automated functional acceptance testing for Admin Audit Trail with webship-js (Playwright + Cucumber-js) covering the base module and every handler submodule

Comments

rajab natshah created an issue. See original summary.

  • rajab natshah committed b6299f93 on 1.0.x
    ci: #3593632 Add automated functional acceptance testing for Admin Audit...

  • rajab natshah committed 1dd3209c on 1.0.x
    ci: #3593632 Add automated functional acceptance testing for Admin Audit...
rajab natshah’s picture

Assigned: rajab natshah » josebc
Issue summary: View changes
Issue tags: +admin_audit_trail-1.0.10
rajab natshah’s picture

Status: Active » Needs review
rajab natshah’s picture

Assigned: josebc » Unassigned
Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

rajab natshah’s picture

Issue summary: View changes