A TYPO3 v13 extension for automated visual regression testing. Compare two website bases (A and B) and identify pages with frontend differences.
- Scheduler-based: Run visual comparisons as TYPO3 Scheduler tasks
- Issues-only reporting: Shows ONLY pages with detected frontend differences
- No Node.js/Chromium required: Uses
wkhtmltoimagefor HTML→PNG rendering - Pure PHP image comparison: Uses PHP Imagick or GD for computing differences
- Organized storage: Results stored under
var/visual-diff/job-*
- TYPO3 v13.0 or later
- PHP 8.1 or later
wkhtmltoimagebinary installed on the system- PHP Imagick extension (recommended) or GD extension
apt-get install wkhtmltopdfyum install wkhtmltopdfbrew install wkhtmltopdf- Install via Composer:
composer require devsk/visualdiff- Activate the extension in the TYPO3 Extension Manager or via CLI:
./vendor/bin/typo3 extension:activate devsk_visualdiff- Go to System → Scheduler in the TYPO3 Backend
- Click "Create new task"
- Select "Visual Diff Comparison" from the Class dropdown
- Configure the task:
- Base URL A (Reference): URL of the reference site (e.g.,
https://production.example.com) - Base URL B (Comparison): URL of the comparison site (e.g.,
https://staging.example.com) - Page URLs: Comma-separated list of page paths to compare (e.g.,
/page1, /page2, /about-us) - Difference Threshold (%): Minimum difference percentage to report (default: 1.0)
- Base URL A (Reference): URL of the reference site (e.g.,
- Set the execution schedule (e.g., daily at 2 AM)
- Save the task
Base URL A: https://production.example.com
Base URL B: https://staging.example.com
Page URLs: /, /products, /about, /contact
Threshold: 1.0
Once configured, the Scheduler task will run automatically according to its schedule. You can also run it manually from the Scheduler module.
The extension stores results in var/visual-diff/job-YYYYMMDDHHMMSS-HASH/:
var/visual-diff/
└── job-20240101120000-abc12345/
├── job.json # Job metadata and results
├── images/
│ ├── A/ # Screenshots from Base A
│ │ ├── index.png
│ │ ├── products.png
│ │ └── about.png
│ └── B/ # Screenshots from Base B
│ ├── index.png
│ ├── products.png
│ └── about.png
└── diffs/ # Visual diff images
├── index.png
├── products.png
└── about.png
{
"jobId": "job-20240101120000-abc12345",
"baseUrlA": "https://production.example.com",
"baseUrlB": "https://staging.example.com",
"urls": ["/", "/products", "/about"],
"threshold": 1.0,
"status": "completed",
"createdAt": "2024-01-01 12:00:00",
"completedAt": "2024-01-01 12:05:00",
"results": [
{
"url": "/products",
"urlA": "https://production.example.com/products",
"urlB": "https://staging.example.com/products",
"hasDifference": true,
"differencePercentage": 5.2,
"imagePathA": "var/visual-diff/job-.../images/A/products.png",
"imagePathB": "var/visual-diff/job-.../images/B/products.png",
"diffImagePath": "var/visual-diff/job-.../diffs/products.png",
"error": null
}
]
}-
Scheduler Task (
VisualDiffTask)- Configurable task for running comparisons
- Validates configuration and executes jobs
-
Visual Diff Service (
VisualDiffService)- Core service orchestrating the comparison workflow
- Creates jobs, executes comparisons, manages results
-
Image Renderer (
ImageRenderer)- Renders web pages to PNG images using
wkhtmltoimage - Configurable rendering options
- Renders web pages to PNG images using
-
Image Comparator (
ImageComparator)- Compares images using Imagick (preferred) or GD
- Generates visual diff images with highlighted differences
- Calculates difference percentage
-
Storage Utility (
StorageUtility)- Manages file storage under
var/visual-diff/ - Handles job persistence and retrieval
- Manages file storage under
-
Job Model (
Job)- Domain model for comparison jobs
- Tracks status, configuration, and results
- Only compares publicly accessible pages
- Does not interact with JavaScript-heavy dynamic content (2-second JS delay is used)
- Image comparison is pixel-based (layout shifts are detected as differences)
- Requires
wkhtmltoimageto be installed on the system
Error: wkhtmltoimage binary not found
Solution: Install wkhtmltoimage package: apt-get install wkhtmltopdf
Error: Failed to compare images
Solution: Ensure PHP Imagick or GD extension is installed and enabled
Error: Failed to create directory
Solution: Ensure web server has write permissions to var/ directory
GPL-2.0-or-later
DevSK