Add automated functional acceptance testing for Web SEO with webship-js (Playwright + Cucumber-js)
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3591679. --> Reported by: [rajab natshah](https://www.drupal.org/user/1414312) >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>This change introduces a complete functional acceptance test suite for Web SEO based on <a href="https://www.npmjs.com/package/webship-js">webship-js</a> (Playwright + Cucumber-js BDD), together with the GitLab CI pipeline that executes it against a freshly built Drupal site on every pipeline run.</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <ul> <li><strong>BDD test suite</strong> under <code>tests/features/</code> &mdash; 12 feature files, 27 scenarios, 112 steps.</li> <li><strong>Webseo-specific step definitions</strong> under <code>tests/step-definitions/webseo.steps.js</code>: user login<br> fixtures, test-user provisioning, form-field-by-label assertions, button-by-text assertions, <code>&amp;lt;meta&amp;gt;</code> and<br> <code>&amp;lt;link rel&amp;gt;</code> assertions, HTTP status / response-body assertions, and JSON-LD <code>@type</code> graph<br> assertions.</li> <li><strong>Drupal core / CMS selectors</strong> under <code>tests/selectors/</code> (Claro + Gin) so the same scenarios run on<br> either admin theme.</li> <li><strong>Runtime configuration</strong>: <code>cucumber.js</code> (worldParameters, multi-user fixtures, screenshot / video /<br> JS-error policy), <code>playwright.config.ts</code> (Chromium, headed and headless modes), <code>package.json</code> pinning<br> <code>webship-js ~2.0</code> on Node 20.</li> <li><strong>GitLab CI integration</strong>: <ul> <li><code>.gitlab-ci.yml</code> &mdash; extends drupalci with a <code>.drupal-node-base</code> stage that performs<br> <code>site:install standard</code>, <code>drush en webseo</code>, then installs Node 20 + yarn deps + Playwright Chromium, and a<br> <code>webship-js-test</code> job that publishes JUnit + HTML reports, screenshots, and failure videos as artifacts.</li> <li><code>.gitlab-ci-local.yml</code> &mdash; slim Node-18 / Node-20 matrix for reproducing the engines.node bump locally with<br> <code>gitlab-ci-local</code>.</li> </ul> </li> </ul> <h4>Coverage</h4> <table> <thead> <tr> <th>Area</th> <th>Feature file</th> </tr> </thead> <tbody> <tr> <td>Multi-role login + user provisioning</td> <td><code>01-01-01-users-login.feature</code></td> </tr> <tr> <td>All bundled SEO modules are enabled</td> <td><code>02-01-01-webseo-modules-enabled.feature</code></td> </tr> <tr> <td>Metatag admin (list + global defaults)</td> <td><code>02-02-01-metatag-admin.feature</code></td> </tr> <tr> <td>Pathauto admin (patterns + settings)</td> <td><code>02-03-01-pathauto-admin.feature</code></td> </tr> <tr> <td>Redirect admin (list, settings, 404 log, add)</td> <td><code>02-04-01-redirect-admin.feature</code></td> </tr> <tr> <td>XML Sitemap admin and <code>/sitemap.xml</code><br> endpoint</td> <td><code>02-05-01-xmlsitemap-admin.feature</code></td> </tr> <tr> <td>Real-time SEO (Yoast) admin</td> <td><code>02-06-01-yoast-seo-admin.feature</code></td> </tr> <tr> <td>Google Analytics admin</td> <td><code>02-07-01-google-analytics-admin.feature</code></td> </tr> <tr> <td>Google Tag admin</td> <td><code>02-08-01-google-tag-admin.feature</code></td> </tr> <tr> <td>Schema.org Metatag submodules available</td> <td><code>03-01-01-schema-metatag-modules.feature</code></td> </tr> <tr> <td>Front-end <code>&amp;lt;head&amp;gt;</code> meta tags (canonical, shortlink,<br> Generator)</td> <td><code>04-01-01-frontend-meta-tags.feature</code></td> </tr> <tr> <td>Access-control matrix for anonymous + authenticated</td> <td><code>05-01-01-access-control.feature</code></td> </tr> </tbody> </table> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <ul> <li>&#9989; File an issue</li> <li>&#9989; Addition/Change/Update/Fix</li> <li>&#9989; Merge request, Patch, or Commit</li> <li>&#9989; Testing to ensure no regression</li> <li>&#9989; Automated unit testing coverage</li> <li>&#9989; Automated functional testing coverage</li> <li>&#10134; UX/UI designer responsibilities</li> <li>&#10134; Readability</li> <li>&#10134; Accessibility</li> <li>&#10134; Performance</li> <li>&#10134; Security</li> <li>&#10134; Documentation</li> <li>&#9989; Code review by maintainers</li> <li>&#9989; Full testing and approval</li> <li>&#9989; Credit contributors</li> <li>&#9989; Review with the product owner</li> <li>&#9989; Release notes snippet</li> <li>&#9989; Release <a href="https://www.drupal.org/project/webseo/releases/11.0.1">webseo-11.0.1</a></li> </ul> <h3 id="summary-ui-changes">User interface changes</h3> <ul> <li>N/A</li> </ul> <h3 id="summary-api-changes">API changes</h3> <ul> <li>N/A</li> </ul> <h3 id="summary-data-model-changes">Data model changes</h3> <ul> <li>N/A</li> </ul> <h3 id="summary-release-notes">Release notes snippet</h3> <ul> <li>ci: <a href="https://www.drupal.org/i/3591679">#3591679</a> Add automated functional acceptance testing for Web SEO with webship-js (Playwright + Cucumber-js)</li> </ul>
issue