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> — 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>&lt;meta&gt;</code> and<br>
<code>&lt;link rel&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> — 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> — 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>&lt;head&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>✅ File an issue</li>
<li>✅ Addition/Change/Update/Fix</li>
<li>✅ Merge request, Patch, or Commit</li>
<li>✅ Testing to ensure no regression</li>
<li>✅ Automated unit testing coverage</li>
<li>✅ Automated functional testing coverage</li>
<li>➖ UX/UI designer responsibilities</li>
<li>➖ Readability</li>
<li>➖ Accessibility</li>
<li>➖ Performance</li>
<li>➖ Security</li>
<li>➖ Documentation</li>
<li>✅ Code review by maintainers</li>
<li>✅ Full testing and approval</li>
<li>✅ Credit contributors</li>
<li>✅ Review with the product owner</li>
<li>✅ Release notes snippet</li>
<li>✅ 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