Skip to main content
shrutid56001193
User Group Leader
User Group Leader
Nov 6, 2026 1:15 PM UTC

AI-Assisted Authoring Tests for AEM Dialogs

[OVERVIEW] Most AEM testing starts after the content exists. Very little of it covers what an author actually does: insert a component, fill in a dialog, save. This framework uses Claude Code and Playwright to cover that gap in the Touch UI editor. It has three Claude Code commands.

  1. The first reads your AEM project and proposes where tests should create pages and insert components.
  2. The second compares what a dialog promises with what the Sling Model and HTL enforce.
  3. The third turns a chosen case into a Playwright test that drives the real editor, then runs it and fixes selectors from the trace. When a failure looks like intended behaviour or a product bug, the agent stops and asks instead of working around it.

It works on any AEM project that uses the Touch UI page editor. The repo ships with WKND as a working example.

[TRYABLE]

  • Clone the repo, then run npm install and npx playwright install chromium
  • Try it on WKND first: install WKND on a disposable local AEM SDK author and run npm test.
  • For your own project, open the repo in Claude Code and run /setup-project <path to your AEM project>. Check the values it proposes.
  • Run /audit-dialog <path to your AEM project> <component name> and treat each mismatch as a candidate until a test proves it.
  • Run /add-authoring-test <resource type> <dialog path> for the cases that matter.
  • Review the failures. Fix selectors in one file, and report anything that looks like a real bug.

[SETUP]

  • Any AEM project that uses the Touch UI page editor, running on a local AEM SDK author on localhost:4502.
  • Node 22 or later
  • Claude Code, or another coding agent if you adapt the commands
  • Tested on AEM SDK 2026.10 with Core Components 2.33.0, and on 2026.3 with 2.30.4
  • Local SDK only: the login step doesn’t handle IMS sign-in on AEMaaCS

[IMPACT]

Goal: catch authoring bugs that render-level tests can’t see, without a dedicated QA person.

A run on WKND: latest SDK (2026.10, Core Components 2.33.0).

What it found on WKND:

  • A Byline dialog that saves content the model won’t render
  • A Teaser default (“Inherit featured image from page”) that blocks text-only saves on pages with no featured image
  • A Teaser Description that is read-only by default, so typed text is dropped without an error

[LESSONS]

  • Split decisions between agent and human. The agent fixed selectors and timing by itself. Whether a behaviour is intended went to a human, and it stopped instead of guessing.
  • Prefer the picker to drag and drop. It’s just as real an authoring path, and the overlays don’t shift under it.
  • Containers need their own route to the dialog, because child overlays sit on top of them.
  • Use keyboard.insertText() for rich text. keyboard.type() silently dropped characters.
  • Keep to one request context. Playwright’s standalone request fixture can drift from the browser’s cookies, and the resulting 403 looks like flakiness.
  • Pin a known bug as a test that fails once it’s fixed, with a control test beside it.

[SAMPLE_OUTPUT]

https://github.com/shrutidamle-aem/aem-touchui-playwright