---
url: 'https://dxpr.com/it/hc/documentation/learn-dxpr-builder/development/testing'
title: 'Test | DXPR'
author:
  name: Jurriaan
  url: 'https://dxpr.com/users/jurriaan'
date: '2026-10-24T03:04:27+00:00'
updated: '2026-10-24T09:09:48+00:00'
copyright: 'Copyright DXPR. All rights reserved.'
type: article
summary: |-
  DXPR Builder ha quattro tipi di controlli automatici: un test Puppeteer
  dell’editor, test Bash end-to-end per i comandi Drush, una suite Selenium
  di regressione visiva nel repository separato dxpr_maven e
  linter. Questa pagina elenca ciascuno, come eseguirlo in locale e come
  CI lo esegue.
tags:
  - 'Architectuur en API’s'
image: 'https://dxpr.com/themes/custom/dxpr_com/images/dxpr-share-card.jpg'
published: true
og:
  site_name: DXPR
  updated_time: '2026-10-24T09:09:48+0000'
  'image:alt': 'DXPR, powered by Drupal: AI-powered Drupal for marketers.'
schema:
  '@context': 'https://schema.org'
  '@graph':
    -
      mainEntity: {  }
    -
      '@type': TechArticle
      headline: Test
      description: |-
        DXPR Builder ha quattro tipi di controlli automatici: un test Puppeteer
        dell’editor, test Bash end-to-end per i comandi Drush, una suite Selenium
        di regressione visiva nel repository separato dxpr_maven e
        linter. Questa pagina elenca ciascuno, come eseguirlo in locale e come
        CI lo esegue.
      image:
        '@type': ImageObject
        url: 'https://dxpr.com/themes/custom/dxpr_com/images/dxpr-share-card.jpg'
        width: '1200'
        height: '630'
      datePublished: '2026-10-24T03:04:27+0000'
      dateModified: '2026-10-24T09:09:48+0000'
      author:
        '@type': Organization
        '@id': 'https://dxpr.com/#organization'
        name: DXPR
        url: 'https://dxpr.com/'
        logo:
          '@type': ImageObject
          url: 'https://dxpr.com/themes/custom/dxpr_com/dxpr-logo-dark.svg'
          width: '1348'
          height: '501'
      publisher:
        '@type': Organization
        '@id': 'https://dxpr.com/#organization'
        name: DXPR
        url: 'https://dxpr.com/'
        logo:
          '@type': ImageObject
          url: 'https://dxpr.com/themes/custom/dxpr_com/dxpr-logo-dark.svg'
          width: '1348'
          height: '501'
      mainEntityOfPage: 'https://dxpr.com/it/hc/documentation/learn-dxpr-builder/development/testing'
      articleSection: 'Architectuur en API’s'
    -
      '@type': WebPage
      '@id': 'https://dxpr.com/it/hc/documentation/learn-dxpr-builder/development/testing'
      description: |-
        DXPR Builder ha quattro tipi di controlli automatici: un test Puppeteer
        dell’editor, test Bash end-to-end per i comandi Drush, una suite Selenium
        di regressione visiva nel repository separato dxpr_maven e
        linter. Questa pagina elenca ciascuno, come eseguirlo in locale e come
        CI lo esegue.
      breadcrumb:
        '@type': BreadcrumbList
        itemListElement:
          -
            '@type': ListItem
            position: 1
            name: Home
            item: 'https://dxpr.com/it'
      publisher:
        '@type': Organization
        '@id': 'https://dxpr.com/#organization'
        name: DXPR
      inLanguage: it
---
[Help Center](/it/hc)/[Documentation](/it/hc/documentation) /[Learn DXPR Builder](/hc/documentation/learn-dxpr-builder) /[Extend](/hc/documentation/learn-dxpr-builder/extend) /[Architectuur en API’s](/hc/documentation/learn-dxpr-builder/extend/architecture) # Test.

 Learn DXPR BuilderExtendArchitectuur en API’s

   ## In this guide

 Related guides

- [Come contribuire](/it/hc/documentation/learn-dxpr-builder/development/contributing)
- [Comandi Drush](/it/hc/documentation/learn-dxpr-builder/development/drush-commands)

DXPR Builder ha quattro tipi di controlli automatici: un test Puppeteer dell’editor, test Bash end-to-end per i comandi Drush, una suite Selenium di regressione visiva nel repository separato `dxpr_maven` e linter. Questa pagina elenca ciascuno, come eseguirlo in locale e come CI lo esegue.

## Cosa esiste

| Controllo | Dove sta | Gira su |
|---|---|---|
| Test console e layout dell’editor | `test/test-editor.js` | Pull request che toccano JavaScript, HTML o `test/` (`.github/workflows/fe-test.yaml`) |
| Test Drush end-to-end | `scripts/drush-e2e/` | Pull request che toccano PHP, YAML o Markdown (`.github/workflows/review.yaml`) |
| Suite Selenium di regressione visiva | `dxpr_maven` come repository | Comandi da commento PR (`.github/workflows/e2e-command.yaml`, `e2e-bs3-command.yml`, `e2eV2-command.yaml`) |
| Standard di programmazione PHP (phpcs) | `scripts/linters/run-drupal-lint.sh`, `phpcs.xml.dist` | Pull request che toccano PHP, YAML o Markdown; ogni push a `3.x` |
| PHPStan | `scripts/linters/run-drupal-check.sh` | Pull request che toccano PHP, YAML o Markdown; ogni push a `3.x` |
| ESLint, Stylelint, Rust Clippy | `scripts/linters/` | Pull request, filtrate per percorsi modificati |
| Rilevatori di deprecazioni | `.github/workflows/deprecations.yml` | Pull request che toccano `js/` o `dxpr_builder/build/` |
| Controlli docs (markdownlint, `check_docs.py`, Vale) | `.markdownlint-cli2.yaml`, `docs/lint/`, `.vale.ini` | Pull request che toccano `docs/` (`review.yaml`) |

L’unico test PHPUnit nel repository è `modules/dxpr_builder_media/tests/src/FunctionalJavascript/MediaEntityBrowserTest.php`per il sottomodulo media legacy. Nessun workflow GitHub lo esegue; la pipeline GitLab di drupal.org (`.gitlab-ci.yml`) usa i template DrupalCI standard, il cui job PHPUnit non è disattivato lì.

## Test console dell’editor

`test/test-editor.js` avvia un server statico sulla porta 3000 (`test/start-standalone-server.js`) e apre quattro pagine standalone da `test/standalone-editor/` in Chrome headless: `test-bs5-anon.html`, `test-bs5-cms-block.html`, `test-bs5-editor.html` e `test-bs5-clean-html.html`. Fallisce quando:

- una pagina lancia un errore JavaScript;
- l’editor completo non è pronto entro 2000 ms, o non restano controlli fuori schermo differiti dopo il caricamento (il gate di performance);
- i controlli degli elementi si sovrappongono in modalità Power user (la baseline è zero coppie sovrapposte);
- l’HTML salvato della pagina dell’editor completo è più grande del riferimento di 32.094 caratteri;
- un controllo specifico di pagina fallisce, ad esempio il parsing di HTML Bootstrap pulito, il breadcrumb, i tipi Panel, l’impostazione **Muted** del video locale o l’anteprima del blocco CMS.

Le pagine caricano i file compilati da `dxpr_builder/`, quindi compila prima.

1. Installa le dipendenze:

    ```bash
    npm install

    ```
2. Compila il bundle dell’editor. Lo script CI esegue questi task in quest’ordine (`test/scripts/run-fe-tests.sh`):

    ```bash
    npx grunt concat
    npx grunt exec:gen
    npx grunt babel
    npx grunt terser
    npx grunt sass
    npx grunt postcss

    ```
3. Esegui il test:

    ```bash
    npm run fe-test

    ```

    Usa `npm run fe-test:headed` per guardare il browser, e `npm run fe-test:dev` per servire le pagine standalone senza eseguire asserzioni.

In CI, `.github/workflows/fe-test.yaml` esegue lo stesso test tramite Docker:

```bash
docker compose --profile fe-test run --rm fe-test

```

## Test Drush end-to-end

`scripts/drush-e2e/run-e2e-tests.sh` installa un sito Drupal 11 nuovo con SQLite dentro un container Composer, vi collega il modulo con symlink, lo attiva, crea un tipo di contenuto Basic page con il formatter `dxpr_builder_text`, un modello di pagina e un modello utente, poi esegue ogni file `scripts/drush-e2e/test-*.sh`:

| File | Comandi testati |
|---|---|
| `test-cleartext-key-update.sh` | L’update 9026 azzera una chiave prodotto in chiaro rimasta nello storage del modulo Key, e la mantiene quando la Key scelta non c’è più (`cleartext-key-update.php`) |
| `test-cms-cache-tags.sh` | Invalidazione cache degli elenchi di blocchi e viste (`cms-cache-tags.php`) |
| `test-elements.sh` | `drush dxb:element:list` |
| `test-migration-summary.sh` | Formulazione singolare e plurale del riepilogo della colonna di migrazione (`migration-summary.php`) |
| `test-migrations.sh` | `drush dxb:migrate` e regressioni di migrazione contenuti (`migration-regressions.php`) |
| `test-page-controller.sh` | Le build del controller di pagina per le sue route (`page-controller.php`) |
| `test-page-create.sh` | `drush dxb:page:create` |
| `test-page-get-update.sh` | `drush dxb:page:get`, `drush dxb:page:update` |
| `test-page-module.sh` | Il modulo Drag and Drop Page fornisce ogni configurazione elencata (`page-module.php`) |
| `test-profile-buttons.sh` | Pulsanti dell’editor di testo dei profili builder (`profile-buttons.php`) |
| `test-profile-order.sh` | Quale profilo si applica per peso, e l’ordine dell’elenco profili (`profile-order.php`) |
| `test-settings-form.sh` | Salvataggio e validazione della chiave prodotto in **General Settings**, e la sincronizzazione licenze attivata (`settings-form.php`) |
| `test-setup-ai.sh` | `drush dxb:setup-ai` |
| `test-templates.sh` | `drush dxb:template:list` |
| `test-user-licenses-page.sh` | La card delle licenze compare una volta in **User Licenses** e compare ancora in **People** (`user-licenses-page.php`) |
| `test-user-settings.sh` | Le impostazioni editor proprie di ogni editor (`user-settings.php`) |
| `test-user-templates.sh` | `drush dxb:user-template:list`, `drush dxb:user-template:create` |

Eseguili tutti:

```bash
docker compose --profile drush-e2e run --rm e2e-test

```

Esegui un file passando parte del suo nome; lo script confronta `scripts/drush-e2e/test-*<filter>*.sh`:

```bash
docker compose --profile drush-e2e run --rm e2e-test page-create

```

Per aggiungere un test, crea `scripts/drush-e2e/test-<name>.sh`, chiama `section "<Title>"`, e usa gli helper da `scripts/drush-e2e/_helpers.sh`: `assert_success`, `assert_fail`, `assert_eq`, `assert_has`, `assert_not_empty`, `assert_runs` e `assert_dry_run`. Ogni helper prende una descrizione e una stringa di comando.

In CI questa suite è il job "Run Drush E2E tests" in `.github/workflows/review.yaml`. Gira quando una pull request modifica file `.php`, `.module`, `.inc`, `.install`, `.yml`, `.md`, `composer.json` o `composer.lock`.

## Suite Selenium di regressione visiva

I test browser sono suite Java TestNG nel repository `dxpr_maven`. Girano contro uno stack Docker definito in `docker-compose.test.yml`(hub Selenium, nodi Chrome e container Maven) su un sito installato da questo repository. Non li esegui da un checkout locale; li avvii da un commento di pull request. `.github/workflows/command-dispatcher.yml`trasforma il commento in un’esecuzione di workflow.

| Comando | Suite | Workflow |
|---|---|---|
| `/e2e` | `chrome.editor.bs5.parallel.xml` più la suite BS5 anonima | `e2e-command.yaml` |
| `/e2e-bs3` | `chrome.editor.bs3.parallel.xml` | `e2e-bs3-command.yml` |
| `/e2eV2` | Suite editor e anonime BS5 sullo stack DXPR CMS | `e2eV2-command.yaml` |
| `/qa-demo-2x-dxpr_theme6x-tests` | Demo QA con DXPR Theme 6.x | `qa-demo-2x-dxpr_theme6x-tests-command.yaml` |

Opzioni, come documentato in `CONTRIBUTING.md`:

- `groups=row-element-test,icon-element-test` esegue i gruppi `<test name="...">`indicati dall’XML della suite.
- `tests=RowColumnLayoutVisualTest` esegue le classi di test indicate.
- `maven_ref=branch-name` usa un branch `dxpr_maven`, ed è così che una modifica del builder e il suo aggiornamento dei test sono revisionati insieme.

Il workflow carica `target/reports/**` e gli screenshot come artefatto di build e pubblica il risultato come commento sulla pull request, elencando fallimenti o test riusciti solo al retry. Ogni job di suite ha un timeout di 90 minuti.

## Linter e analisi statica

Ogni linter è un servizio Docker Compose, quindi non serve toolchain locale oltre Docker.

| Servizio | Comando | Cosa controlla |
|---|---|---|
| `drupal-lint` | `docker compose run --rm drupal-lint` | phpcs con PHPCompatibility (PHP 8.3 e su) e standard `Drupal` e `DrupalPractice`. |
| `drupal-check-D11` | `docker compose run --rm drupal-check-D11` | PHPStan livello 5 con `mglaman/phpstan-drupal` dentro un nuovo `drupal/recommended-project` |
| `eslint` | `docker compose run --rm eslint` | ESLint su `js/` e `dxpr_builder/build/`, più uno spellcheck di `dxpr_builder/extracted_t_functions.js` |
| `stylelint` | `docker compose run --rm stylelint` | Stylelint su `dxpr_builder/sass/` e `sass/` |
| `rust-lint` | `docker compose run --rm rust-lint` | Clippy sui sorgenti Rust in `rust/` |
| `no-jquery`, `no-underscore`, `html-in-js` | `docker compose run --rm <service>` | Rilevatori di deprecazioni da `.github/workflows/deprecations.yml` |

Esistono varianti auto-fix per phpcs, ESLint e Stylelint (`drupal-lint-auto-fix`, `eslint-auto-fix`, `stylelint-auto-fix`). Gli stessi controlli sono disponibili senza Docker tramite `npm run lint:scss`, `npm run lint:no-jquery`, `npm run lint:no-underscore`e `npm run lint:html-in-js`.

`npm install` installa anche un hook pre-commit Husky (`.husky/pre-commit`). Esegue i servizi auto-fix e lint corrispondenti sui file JavaScript, PHP e SCSS nello stage e sui sorgenti Rust, e `docs/video-tools/bin/lint-videos.mjs` quando sono in stage file sotto `docs/`.

`.github/workflows/review.yaml` esegue i linter corrispondenti ai percorsi modificati su ogni pull request. `.github/workflows/main.yaml`esegue `drupal-lint`, `eslint`, `drupal-check-D11` e `rust-lint` su ogni push a `3.x`. Entrambi falliscono la build quando un controllo fallisce e scrivono un riepilogo con i file colpevoli.

## Prossimi passi

- [Come contribuire](/it/hc/documentation/learn-dxpr-builder/development/contributing) per il processo di pull request e il flusso `maven_ref` per gli aggiornamenti dei test.
- [Comandi Drush](/it/hc/documentation/learn-dxpr-builder/development/drush-commands) per i comandi esercitati dalla suite Bash.