Problem/Motivation

Ace Editor has no automated functional (browser) test coverage, no end-user documentation and no self-contained CI pipeline.
Without acceptance tests, regressions in the three ways the module surfaces the Ace editor — the text editor on forms,
the Ace Format field formatter, and the Ace Filter for <ace> snippets — go unnoticed. While
building this coverage on Drupal 11, several functional and coding-standard defects were also found.

Defects found while writing the tests

  • Permission never registered — the file was named ace_editor.permission.yml (singular). Drupal
    only loads <module>.permissions.yml, so administer ace_editor was never registered.
  • Print margin never shown — js/editor.js, js/formatter.js and
    js/filter.js read a non-existent print_margin key, while the config/UI key is
    print_margins.
  • Filter / formatter behaviour collision — js/filter.js registered
    Drupal.behaviors.ace_formatter (the formatter's name), so on a page rendering both, one clobbered the other. The
    per-<ace>-tag attribute overrides were also computed but never applied.
  • Label typo — the "Enable Autocomplete (Ctrl+Space" checkbox label was missing its closing parenthesis.

Proposed resolution

Automated functional acceptance testing (webship-js)

  • Add a webship-js (Playwright + Cucumber-js) BDD suite under
    tests/features/drupal/** — 12 scenarios / 76 steps covering: the text editor attaching and syncing to the textarea,
    the print-margin regression, the editor settings form, the read-only field formatter, the <ace> filter, per-tag
    attribute overrides, and accessibility (axe).
  • Custom step definitions, named selectors, shared world parameters and a tests/fixtures/provision-fixtures.php
    that configures the editor/filter/formatter and demo content through Drush.

GitLab CI

  • .gitlab-ci.yml — the drupalci validation gates (composer-lint, cspell, eslint, phpcs, phpstan, phpunit) plus a
    webship-js-test job that installs a Drupal Standard site, downloads the Ace library, provisions fixtures and runs the
    suite.
  • .gitlab-ci-local.yml — a self-contained pipeline for href="https://github.com/firecow/gitlab-ci-local">gitlab-ci-local (cspell, eslint, MkDocs --strict, and a full
    webship-js-test that builds a fresh Drupal 11 site via a Composer path repository). All jobs validated green
    locally.

Documentation (MkDocs)

  • Add Material-for-MkDocs documentation under docs/ + mkdocs.yml: introduction, installation, using
    the editor/formatter/filter, configuration, themes & syntaxes, permissions, architecture and library detection, plus an
    FAQ.
  • Add a README.md to every module folder.

Bug & coding-standard fixes

  • Rename ace_editor.permission.yml → ace_editor.permissions.yml.
  • Honour print_margins in all three behaviours, still accepting the legacy print-margin inline
    attribute.
  • Register the filter as Drupal.behaviors.ace_filter and apply per-tag overrides without mutating shared
    defaults.
  • Fix the autocomplete label and resolve phpcs (Drupal/DrupalPractice) issues.

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

API changes

  • N/A

Data model changes

  • N/A

Release notes snippet

  • N/A

Issue fork ace_editor-3593925

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

rajab natshah created an issue. See original summary.

  • rajab natshah committed 5040ca3a on 2.0.x
    test: Add automated functional acceptance testing for Ace Editor with...
rajab natshah’s picture

Status: Active » 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

Assigned: rajab natshah » Unassigned

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.