test: #3618332 Add functional testing coverage for Drupal Canvas page translations
Adds functional testing coverage for translating a Drupal Canvas page: the translation setup the Varbase Internationalization Base recipe puts in place, the translations overview of a Canvas page, and a translated page actually being served in its own language and direction.
Issue: #3618332
Scenarios added
tests/features/09-drupal-canvas/09-07-canvas-page-translations.feature (new, 3 scenarios):
- A Canvas page is set up to be translated, component copy included — the Canvas "Page" entity is translatable and so is the "Component input values" field, which is what lets a translator rewrite a Canvas page's copy and not only its title. Runs on any site, single language or not.
- The translations overview of a Canvas page lists the site languages and their status (
@wip @multilingual) — the Pages listing carries a Translate operation, and it opens an overview naming every language with the source title, the translated title and its status. - A translated Canvas page is served in its own language and direction (
@wip @multilingual) — an anonymous visitor getslang="en" dir="ltr"on the English path andlang="ar" dir="rtl"on the Arabic one, with both variants advertised throughhreflangalternates.
Supporting changes
tests/features/09-drupal-canvas/README.md— adds the09-07row and the09-06row, which was already missing before this change. Total 17 → 24 scenarios across 7 feature files, plus a note on how to run the gated scenarios..gitlab-ci.yml— one line: the09-drupal-canvas-cmatrix glob goes09-{03,04,05}-*→09-{03,04,05,07}-*. Without it the new feature file is never picked up by any CI bucket..cspell.json— addshreflangandالمزايا, the two words the new file introduces, so the gating Cspell job stays green.
Why two scenarios are gated @wip @multilingual
The CI test jobs run --tags "not @wip" against a freshly installed, single-language site. Those two scenarios need a second language and an already-translated Canvas page, and on a single-language site Drupal hides the Translate tab entirely (content translation access is gated on LanguageManager::isMultilingual()).
They are not unfinished work. They are proven against a multilingual fixture (English default + Arabic, with the "Features" Canvas page translated as "المزايا") and stay excluded only until a fresh install can add a language through the admin UI without a fatal error — the language module is installed without its language.entity.en / und / zxx config entities (Drupal core #3002532, Drupal CMS #3497957). They flip ungated once that is fixed.
Run them meanwhile with:
FEATURES="tests/features/09-drupal-canvas/09-07-*.feature" \
./node_modules/.bin/cucumber-js --config cucumber.js --tags "@multilingual"Testing
- CI lane,
--tags "not @wip": 5 scenarios / 65 steps passed on a 5-language site. - Gated lane,
--tags "@multilingual": 2 scenarios / 29 steps passed on a 2-language site. - Whole-suite dry run: 0 undefined, 0 ambiguous steps.
- Adversarial run: the Translation Management Tool scenario in the companion Varbase Project change correctly failed on a site where TMGMT was installed, so these assertions are not passing vacuously.
gitlab-ci-local on this exact tree, every job the pipeline can reproduce offline, all allow_failure: false and unmasked:
| Job | Result |
|---|---|
📦 Composer validate |
PASS |
📐 YAML lint |
PASS |
🔤 Cspell |
PASS |
🟨 ESLint |
PASS |
🧩 Cucumber dry-run |
PASS — 275 scenarios / 1869 steps, 0 undefined, 0 ambiguous |
The 📦 Install Varbase Starter site template, 🧩 (Drupal CMS) Install, 🧪 varbase-e2e matrix and 📊 Create reports jobs need the Composer-built site artifact, a MySQL service and a Playwright browser, so they do not run under gitlab-ci-local. They were run against a live site instead, with the numbers above. gitlab-ci-local --list confirms the matrix job now resolves as 09-drupal-canvas-c, tests/features/09-drupal-canvas/09-{03,04,05,07}-*.feature.
AI-Generated: Yes
Checkpoints:
- 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
- Developer Documentation
- User Guide Documentation
- Reviewed by human
- Code review by maintainers
- Full testing and approval
- Credit contributors
- Review with the product owner
- Release notes snippet
- Release