You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CLAUDE.md
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,6 +23,9 @@ composer test # Run PHPUnit tests without coverage
23
23
- Coverage reports are generated in .logs/coverage directory
24
24
25
25
## Recent Improvements
26
+
- Added support for fullscreen screenshots with two algorithms:
27
+
- Stitch algorithm (default): Takes multiple screenshots while scrolling and stitches them together
28
+
- Resize algorithm: Temporarily resizes browser window to capture full page
26
29
- Updated autoloader from PSR-0 to PSR-4
27
30
- Made constants public as per PHP 8.2+ standards
28
31
- Improved error messages for file operations
@@ -34,7 +37,7 @@ composer test # Run PHPUnit tests without coverage
34
37
The Behat Screenshot extension provides functionality to capture screenshots during Behat test runs. Its main components are:
35
38
36
39
1.**BehatScreenshotExtension**: Handles configuration and service container integration
37
-
2.**ScreenshotContext**: Provides Behat steps and screenshot capabilities
40
+
2.**ScreenshotContext**: Provides Behat steps and screenshot capabilities, including fullscreen screenshot functionality with both stitch and resize algorithms
38
41
3.**Tokenizer**: Processes dynamic filename generation with tokens
|`dir`|`%paths.base%/screenshots`| Path to directory to save screenshots. Directory structure will be created if the directory does not exist. Override with `BEHAT_SCREENSHOT_DIR` env var. |
98
-
|`on_failed`|`true`| Capture screenshot on failed test. |
99
-
|`purge`|`false`| Remove all files from the screenshots directory on each test run. Useful during debugging of tests. |
100
-
|`info_types`|`url`, `feature`, `step`, `datetime`| Show additional information on screenshots. Comma-separated list of `url`, `feature`, `step`, `datetime`, or remove to disable. Ordered as listed. |
101
-
|`failed_prefix`|`failed_`| Prefix failed screenshots with `failed_` string. Useful to distinguish failed and intended screenshots. |
102
-
|`filename_pattern`|`{datetime:u}.{feature_file}.feature_{step_line}.{ext}`| File name pattern for successful assertions. |
103
-
|`filename_pattern_failed`|`{datetime:u}.{failed_prefix}{feature_file}.feature_{step_line}.{ext}`| File name pattern for failed assertions. |
| `dir` | `%paths.base%/screenshots` | Path to directory to save screenshots. Directory structure will be created if the directory does not exist. Override with `BEHAT_SCREENSHOT_DIR` env var. |
| `purge` | `false` | Remove all files from the screenshots directory on each test run. Useful during debugging of tests. |
145
+
| `always_fullscreen` | `false` | Always use fullscreen screenshot capture for all screenshot steps, including regular screenshot steps. When enabled, all `I save screenshot` steps will behave like `I save fullscreen screenshot`. |
146
+
| `fullscreen_algorithm` | `stitch` | Algorithm to use for fullscreen screenshots. Options: `stitch`(captures multiple screenshots while scrolling and stitches them together) or `resize` (temporarily resizes browser window to full page height). The stitch algorithm requires GD extension but produces higher quality results. |
147
+
| `info_types` | `url`, `feature`, `step`, `datetime` | Show additional information on screenshots. Comma-separated list of `url`, `feature`, `step`, `datetime`, or remove to disable. Ordered as listed. |
148
+
| `failed_prefix` | `failed_` | Prefix failed screenshots with `failed_` string. Useful to distinguish failed and intended screenshots. |
149
+
| `filename_pattern` | `{datetime:u}.{feature_file}.feature_{step_line}.{ext}` | File name pattern for successful assertions. |
150
+
| `filename_pattern_failed` | `{datetime:u}.{failed_prefix}{feature_file}.feature_{step_line}.{ext}` | File name pattern for failed assertions. |
104
151
105
152
### File name tokens
106
153
@@ -203,9 +250,7 @@ streamlined in the future).
203
250
```shell
204
251
# Start Chromium in container for Selenium-based tests.
205
252
docker run -d -p 4444:4444 -p 9222:9222 selenium/standalone-chromium
0 commit comments