Skip to content

Commit c45f73c

Browse files
committed
Updated default fullscreen algorithm to use resize.
1 parent ba617d7 commit c45f73c

6 files changed

Lines changed: 17 additions & 17 deletions

File tree

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ default:
6868
on_failed: true
6969
purge: false
7070
always_fullscreen: false
71-
fullscreen_algorithm: stitch # Options: 'stitch' or 'resize'
71+
fullscreen_algorithm: resize # Options: 'stitch' or 'resize'
7272
failed_prefix: 'failed_'
7373
filename_pattern: '{datetime:u}.{feature_file}.feature_{step_line}.{ext}'
7474
filename_pattern_failed: '{datetime:u}.{failed_prefix}{feature_file}.feature_{step_line}.{ext}'
@@ -90,14 +90,14 @@ Then I save fullscreen screenshot
9090

9191
There are two algorithms available for capturing fullscreen screenshots:
9292

93-
1. **Stitch** (default): Takes multiple screenshots while scrolling the page and
94-
stitches them together. This produces high-quality results with proper
95-
content rendering but requires the GD extension.
96-
97-
2. **Resize**: Temporarily resizes the browser window to the full height of the
93+
1. **Resize** (default): Temporarily resizes the browser window to the full height of the
9894
page to capture everything in one screenshot. This is faster, but may cause
9995
layout issues on some pages.
10096

97+
2. **Stitch**: Takes multiple screenshots while scrolling the page and
98+
stitches them together. This produces high-quality results with proper
99+
content rendering but requires the GD extension.
100+
101101
You can configure which algorithm to use via the `fullscreen_algorithm` option:
102102

103103
```yaml
@@ -143,7 +143,7 @@ default:
143143
| `on_failed` | `true` | Capture screenshot on failed test. |
144144
| `purge` | `false` | Remove all files from the screenshots directory on each test run. Useful during debugging of tests. |
145145
| `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. |
146+
| `fullscreen_algorithm` | `resize` | Algorithm to use for fullscreen screenshots. Options: `resize` (temporarily resizes browser window to full page height) or `stitch` (captures multiple screenshots while scrolling and stitches them together). The stitch algorithm requires GD extension but produces higher quality results. |
147147
| `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. |
148148
| `failed_prefix` | `failed_` | Prefix failed screenshots with `failed_` string. Useful to distinguish failed and intended screenshots. |
149149
| `filename_pattern` | `{datetime:u}.{feature_file}.feature_{step_line}.{ext}` | File name pattern for successful assertions. |

behat.yml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ default:
1010
on_failed: true
1111
purge: false
1212
always_fullscreen: false
13-
fullscreen_algorithm: stitch # 'stitch' (only if GD ext available) or 'resize'
13+
fullscreen_algorithm: resize # 'stitch' (only if GD ext available) or 'resize'
1414
info_types:
1515
- url
1616
- feature

src/DrevOps/BehatScreenshotExtension/Context/ScreenshotContext.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class ScreenshotContext extends RawMinkContext implements ScreenshotAwareContext
3636
/**
3737
* Algorithm to use for fullscreen screenshots ('stitch' or 'resize').
3838
*/
39-
protected string $fullscreenAlgorithm = 'stitch';
39+
protected string $fullscreenAlgorithm = 'resize';
4040

4141
/**
4242
* Prefix for failed screenshot files.

src/DrevOps/BehatScreenshotExtension/ServiceContainer/BehatScreenshotExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function configure(ArrayNodeDefinition $builder): void {
7575
->end()
7676
->enumNode('fullscreen_algorithm')
7777
->values(['stitch', 'resize'])
78-
->defaultValue('stitch')
78+
->defaultValue('resize')
7979
->end()
8080
->scalarNode('filename_pattern')
8181
->cannotBeEmpty()

tests/phpunit/Unit/BehatScreenshotExtensionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function testLoad(): void {
3030
'failed_prefix' => 'failed_',
3131
'purge' => FALSE,
3232
'always_fullscreen' => FALSE,
33-
'fullscreen_algorithm' => 'stitch',
33+
'fullscreen_algorithm' => 'resize',
3434
'filename_pattern' => '{datetime:U}.{feature_file}.feature_{step_line}.{ext}',
3535
'filename_pattern_failed' => '{datetime:U}.{failed_prefix}{feature_file}.feature_{step_line}.{ext}',
3636
'info_types' => FALSE,

tests/phpunit/Unit/Context/Initializer/ScreenshotContextInitializerTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function testInitializeContextNonScreenshotAware(): void {
3030
'failed_',
3131
TRUE,
3232
TRUE,
33-
'stitch',
33+
'resize',
3434
'{datetime:U}.{ext}',
3535
'{datetime:U}.{failed_prefix}{ext}',
3636
[]
@@ -55,7 +55,7 @@ public function testInitializeContext(): void {
5555
TRUE,
5656
'failed_',
5757
TRUE,
58-
'stitch',
58+
'resize',
5959
'{datetime:U}.{ext}',
6060
'{datetime:U}.{failed_prefix}{ext}',
6161
[]
@@ -68,7 +68,7 @@ public function testInitializeContext(): void {
6868
// don't purge.
6969
FALSE,
7070
TRUE,
71-
'stitch',
71+
'resize',
7272
'{datetime:U}.{ext}',
7373
'{datetime:U}.{failed_prefix}{ext}',
7474
[]
@@ -97,7 +97,7 @@ public function testInitializeContextWithEnv(): void {
9797
TRUE,
9898
'failed_',
9999
TRUE,
100-
'stitch',
100+
'resize',
101101
'{datetime:U}.{ext}',
102102
'{datetime:U}.{failed_prefix}{ext}',
103103
[]
@@ -133,7 +133,7 @@ public function testInitializeContextWithEnv(): void {
133133
// Not used due to ENV override.
134134
FALSE,
135135
TRUE,
136-
'stitch',
136+
'resize',
137137
'{datetime:U}.{ext}',
138138
'{datetime:U}.{failed_prefix}{ext}',
139139
[],
@@ -155,7 +155,7 @@ public function testInitializeContextWithEnv(): void {
155155
TRUE,
156156
'failed_',
157157
TRUE,
158-
'stitch',
158+
'resize',
159159
'{datetime:U}.{ext}',
160160
'{datetime:U}.{failed_prefix}{ext}',
161161
[]

0 commit comments

Comments
 (0)