2.5.0
What's new since 2.4.2
Breaking changes
-
Boolean options in
behat.ymlare now validated as booleans. @AlexSkrypnyk (#258)on_failed,purge,always_fullscreenandon_every_stepno longer accept quoted values or integers:'true','false',0and1are rejected with a configuration error, so replace them with unquotedtrueorfalse. Check foron_failed: 'false'in particular - it used to be read as a non-empty string, which is truthy, so it silently turned failure screenshots on rather than off. See #259. -
Animated GIF frames are written at the size they were captured, not padded to the tallest frame. @AlexSkrypnyk (#242)
One full-page capture used to pad every other frame up to its height before encoding, so on a real suite (#241) a scenario finished its last step and then sat for 178s building a 64MB GIF. Frames are now encoded at their own size, cutting a 100-step scenario containing one 19090px page from 67.6s to 3.58s and leaving nothing blocking at scenario end. The animation looks the same, but the protectednormaliseFrames(),pad()and$animationFramesmembers were removed - if you subclassAnimatedGiforScreenshotContextand use them, switch to the newaddFrame()andrender()methods. -
Tokens inside a step name are now resolved in screenshot filenames. @AlexSkrypnyk (#258)
A step whose name contains a token -Visit {url} page, say - used to produce a filename with the literal text{url}in it, because the tokenizer never rescanned its own replacements. Those tokens now resolve, so filenames change for any step name containing braces; all other filenames are unchanged. See #260.
Highlights
-
The browser window is now restored when a fullscreen capture fails. @AlexSkrypnyk (#258)
Taking a fullscreen screenshot enlarges the browser window to the full page height and shrinks it back afterwards, but a driver error during the capture skipped the restore entirely. The window then stayed at full page height for the rest of the scenario, so every later screenshot came out at the wrong size, with nothing in the log explaining why. See #261. -
[#243] Added PHP 8.5 to the test matrix. @AlexSkrypnyk (#246)
PHP 8.5 now runs as a first-class, must-pass CI leg alongside 8.2, 8.3 and 8.4, covering both the PHPUnit and Behat suites. The calls 8.5 newly deprecates -imagedestroy()andReflection*::setAccessible(), no-ops since PHP 8.0 and 8.1 respectively - were removed, so the suite runs with no deprecation notices. The>=8.2floor is unchanged, so the supported range widens rather than shifts. -
[#241] Added a profiler that measures animated GIF assembly cost and memory. @AlexSkrypnyk (#244)
composer profilereplays a scenario of configurable length through the real Behat hooks with the browser replaced by prepared images, timing the steps separately from the scenario-end GIF assembly and reporting peak memory alongside pixels captured versus pixels encoded. It is excluded from the default suite, socomposer testis unaffected. This is what turned the report in #241 into numbers, and what the fix above was measured against. -
New public constants on
ScreenshotContext. @AlexSkrypnyk (#258)
The default window size, thescreenshotsandscreenshots:animatedtag names, and the animation frame delay are now public constants instead of repeated literals, so subclasses and tests can reference them. The frame delay is the one with a functional consequence: its default was previously written out in two places free to drift apart, and is now defined once and read from both. See #262.
Other changes
-
Converged naming, structure, API shape and comments across the codebase. @AlexSkrypnyk (#247)
An internal pass unifying how the same idea is spelled in different parts of the codebase, and tidying source comments onto one technical register. No public API changed and no behaviour changed, so upgrading needs no action - it is listed only because it touches most files in the repository. -
Update browser-actions/setup-chrome digest to 48ad923 @renovate[bot] (#245)
-
Update toshimaru/auto-author-assign action to v3.1.0 @renovate[bot] (#240)
-
Update selenium/standalone-chromium Docker tag to v151 @renovate[bot] (#239)
-
Update release-drafter/release-drafter digest to 34d8067 @renovate[bot] (#238)
-
Update actions/checkout digest to 3d3c42e @renovate[bot] (#237)
-
Update release-drafter/release-drafter digest to eada3c9 @renovate[bot] (#236)
-
Update selenium/standalone-chromium Docker tag to v150 @renovate[bot] (#235)
Full Changelog: 2.4.2...2.5.0