Skip to content

Commit 10366f7

Browse files
test: add Screenshot Updater CLI tool for updating widgets e2e screenshots
1 parent 6f8d550 commit 10366f7

File tree

5 files changed

+1421
-301
lines changed

5 files changed

+1421
-301
lines changed

automation/utils/README.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Screenshot Updater
2+
3+
CLI tool for updating Playwright screenshots for Mendix widgets using Docker and Mendix runtime.
4+
5+
## Quick Start
6+
7+
```bash
8+
# From project root (recommended)
9+
pnpm run update-screenshots update <widget-name>
10+
11+
# Or from automation/utils
12+
cd automation/utils && pnpm run update-screenshots update <widget-name>
13+
```
14+
15+
## Prerequisites
16+
17+
- Docker running
18+
- GitHub token (for Atlas updates): `export GITHUB_TOKEN=your_token`
19+
20+
## Commands
21+
22+
```bash
23+
# List available widgets
24+
pnpm run update-screenshots list
25+
26+
# Update screenshots
27+
pnpm run update-screenshots update calendar-web
28+
29+
# Use specific Mendix version
30+
pnpm run update-screenshots update calendar-web --mendix-version 10.24.0.73019
31+
32+
# Skip Atlas theme updates (faster)
33+
pnpm run update-screenshots update calendar-web --skip-atlas-themesource
34+
35+
# List available Mendix versions
36+
pnpm run update-screenshots versions
37+
```
38+
39+
## How It Works
40+
41+
1. Downloads test project from GitHub
42+
2. Builds widget and copies to test project
43+
3. Updates Atlas components (if not skipped)
44+
4. Creates Mendix deployment bundle
45+
5. Starts Mendix runtime in Docker
46+
6. Runs Playwright tests to update screenshots
47+
7. Cleans up containers and temp files
48+
49+
## Configuration
50+
51+
| Environment Variable | Description | Default |
52+
| -------------------- | ------------------------------------------- | -------------------------- |
53+
| `GITHUB_TOKEN` | GitHub access token | Required for Atlas updates |
54+
| `LOG_LEVEL` | Logging verbosity (`debug`, `info`, `warn`) | `info` |
55+
56+
## Troubleshooting
57+
58+
**Docker issues**: Ensure Docker is running (`docker info`)
59+
**Widget not found**: Check available widgets with `list` command
60+
**Build failures**: Enable debug logging (`LOG_LEVEL=debug`)
61+
**Detailed logs**: Check `screenshot-updater.log`

0 commit comments

Comments
 (0)