Skip to content

Commit bde4851

Browse files
feat: don't store actual images on success (#1081)
* feat: don't store actual images on success * feat: implement the code changes * chore: fix tests * test: fix ts errors UT's * test: update snapshots * test: fix more UTs * test: add missing tests * chore: add changeset * chore: reverted e2e test changes * Update .changeset/kind-forks-move.md Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>
1 parent ecbdf3f commit bde4851

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+435
-22
lines changed

.changeset/kind-forks-move.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
"@wdio/image-comparison-core": minor
3+
"@wdio/visual-service": minor
4+
---
5+
6+
This PR will implement FR #1077 which is asking not to create the actual image on success. This should create a better performance because no files are writing to the system and should make sure that there's not a lot of noise in the actual folder.
7+
8+
# Committers: 1
9+
10+
- Wim Selles ([@wswebcreation](https://github.com/wswebcreation))

packages/image-comparison-core/src/__snapshots__/base.test.ts.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ exports[`BaseClass > initializes default options correctly 1`] = `
44
{
55
"addIOSBezelCorners": false,
66
"addressBarShadowPadding": 6,
7+
"alwaysSaveActualImage": true,
78
"autoElementScroll": true,
89
"autoSaveBaseline": true,
910
"clearFolder": false,

packages/image-comparison-core/src/commands/__snapshots__/checkAppElement.test.ts.snap

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
exports[`checkAppElement > should always disable block out options for element screenshots 1`] = `
44
[
55
{
6+
"actualBase64Image": undefined,
67
"isNativeContext": true,
78
"isViewPortScreenshot": false,
89
"options": {
@@ -220,6 +221,7 @@ exports[`checkAppElement > should execute checkAppElement with basic options 2`]
220221
"wic": {
221222
"addIOSBezelCorners": false,
222223
"addressBarShadowPadding": 6,
224+
"alwaysSaveActualImage": true,
223225
"autoElementScroll": true,
224226
"autoSaveBaseline": false,
225227
"clearFolder": false,
@@ -276,6 +278,7 @@ exports[`checkAppElement > should execute checkAppElement with basic options 2`]
276278
exports[`checkAppElement > should handle Android device correctly 1`] = `
277279
[
278280
{
281+
"actualBase64Image": undefined,
279282
"isNativeContext": true,
280283
"isViewPortScreenshot": false,
281284
"options": {

packages/image-comparison-core/src/commands/__snapshots__/checkAppScreen.test.ts.snap

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ exports[`checkAppScreen > should execute checkAppScreen with basic options 2`] =
230230
"wic": {
231231
"addIOSBezelCorners": false,
232232
"addressBarShadowPadding": 6,
233+
"alwaysSaveActualImage": true,
233234
"autoElementScroll": true,
234235
"autoSaveBaseline": false,
235236
"clearFolder": false,
@@ -378,6 +379,7 @@ exports[`checkAppScreen > should handle Android device correctly 1`] = `
378379
exports[`checkAppScreen > should handle Android device correctly 2`] = `
379380
[
380381
{
382+
"actualBase64Image": undefined,
381383
"isNativeContext": true,
382384
"isViewPortScreenshot": true,
383385
"options": {
@@ -653,6 +655,7 @@ exports[`checkAppScreen > should handle ignore regions and device blockouts 2`]
653655
exports[`checkAppScreen > should handle ignore regions and device blockouts 3`] = `
654656
[
655657
{
658+
"actualBase64Image": undefined,
656659
"isNativeContext": true,
657660
"isViewPortScreenshot": true,
658661
"options": {
@@ -791,6 +794,7 @@ exports[`checkAppScreen > should handle ignore regions and device blockouts 3`]
791794
exports[`checkAppScreen > should merge compare options correctly 1`] = `
792795
[
793796
{
797+
"actualBase64Image": undefined,
794798
"isNativeContext": true,
795799
"isViewPortScreenshot": true,
796800
"options": {
@@ -951,6 +955,7 @@ exports[`checkAppScreen > should spread hideElements and removeElements into ign
951955
exports[`checkAppScreen > should spread hideElements and removeElements into ignore array 2`] = `
952956
[
953957
{
958+
"actualBase64Image": undefined,
954959
"isNativeContext": true,
955960
"isViewPortScreenshot": true,
956961
"options": {

packages/image-comparison-core/src/commands/__snapshots__/checkElement.test.ts.snap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ exports[`checkElement > should call checkAppElement when isNativeContext is true
2121
"wic": {
2222
"addIOSBezelCorners": false,
2323
"addressBarShadowPadding": 6,
24+
"alwaysSaveActualImage": true,
2425
"autoElementScroll": true,
2526
"autoSaveBaseline": false,
2627
"clearFolder": false,
@@ -190,6 +191,7 @@ exports[`checkElement > should call checkWebElement 2`] = `
190191
"wic": {
191192
"addIOSBezelCorners": false,
192193
"addressBarShadowPadding": 6,
194+
"alwaysSaveActualImage": true,
193195
"autoElementScroll": true,
194196
"autoSaveBaseline": false,
195197
"clearFolder": false,

packages/image-comparison-core/src/commands/__snapshots__/checkFullPageScreen.test.ts.snap

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ exports[`checkFullPageScreen > should execute checkFullPageScreen with basic opt
102102
"wic": {
103103
"addIOSBezelCorners": false,
104104
"addressBarShadowPadding": 6,
105+
"alwaysSaveActualImage": true,
105106
"autoElementScroll": true,
106107
"autoSaveBaseline": false,
107108
"clearFolder": false,
@@ -158,6 +159,7 @@ exports[`checkFullPageScreen > should execute checkFullPageScreen with basic opt
158159
exports[`checkFullPageScreen > should handle Android device correctly 1`] = `
159160
[
160161
{
162+
"actualBase64Image": undefined,
161163
"isNativeContext": false,
162164
"isViewPortScreenshot": false,
163165
"options": {
@@ -332,6 +334,7 @@ exports[`checkFullPageScreen > should handle all full page specific options 1`]
332334
"wic": {
333335
"addIOSBezelCorners": false,
334336
"addressBarShadowPadding": 6,
337+
"alwaysSaveActualImage": true,
335338
"autoElementScroll": true,
336339
"autoSaveBaseline": false,
337340
"clearFolder": false,
@@ -482,6 +485,7 @@ exports[`checkFullPageScreen > should handle hideAfterFirstScroll correctly 1`]
482485
"wic": {
483486
"addIOSBezelCorners": false,
484487
"addressBarShadowPadding": 6,
488+
"alwaysSaveActualImage": true,
485489
"autoElementScroll": true,
486490
"autoSaveBaseline": false,
487491
"clearFolder": false,
@@ -637,6 +641,7 @@ exports[`checkFullPageScreen > should handle hideElements and removeElements cor
637641
"wic": {
638642
"addIOSBezelCorners": false,
639643
"addressBarShadowPadding": 6,
644+
"alwaysSaveActualImage": true,
640645
"autoElementScroll": true,
641646
"autoSaveBaseline": false,
642647
"clearFolder": false,
@@ -693,6 +698,7 @@ exports[`checkFullPageScreen > should handle hideElements and removeElements cor
693698
exports[`checkFullPageScreen > should handle hybrid app options correctly 1`] = `
694699
[
695700
{
701+
"actualBase64Image": undefined,
696702
"isNativeContext": false,
697703
"isViewPortScreenshot": false,
698704
"options": {
@@ -867,6 +873,7 @@ exports[`checkFullPageScreen > should handle undefined method options with fallb
867873
"wic": {
868874
"addIOSBezelCorners": false,
869875
"addressBarShadowPadding": 6,
876+
"alwaysSaveActualImage": true,
870877
"autoElementScroll": true,
871878
"autoSaveBaseline": false,
872879
"clearFolder": false,
@@ -923,6 +930,7 @@ exports[`checkFullPageScreen > should handle undefined method options with fallb
923930
exports[`checkFullPageScreen > should merge compare options correctly 1`] = `
924931
[
925932
{
933+
"actualBase64Image": undefined,
926934
"isNativeContext": false,
927935
"isViewPortScreenshot": false,
928936
"options": {

packages/image-comparison-core/src/commands/__snapshots__/checkScreen.test.ts.snap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ exports[`checkScreen > should call checkAppScreen when isNativeContext is true 2
2121
"wic": {
2222
"addIOSBezelCorners": false,
2323
"addressBarShadowPadding": 6,
24+
"alwaysSaveActualImage": true,
2425
"autoElementScroll": true,
2526
"autoSaveBaseline": false,
2627
"clearFolder": false,
@@ -187,6 +188,7 @@ exports[`checkScreen > should call checkWebScreen when isNativeContext is false
187188
"wic": {
188189
"addIOSBezelCorners": false,
189190
"addressBarShadowPadding": 6,
191+
"alwaysSaveActualImage": true,
190192
"autoElementScroll": true,
191193
"autoSaveBaseline": false,
192194
"clearFolder": false,

packages/image-comparison-core/src/commands/__snapshots__/checkTabbablePage.test.ts.snap

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ exports[`checkTabbablePage > should execute checkTabbablePage with basic options
109109
"wic": {
110110
"addIOSBezelCorners": false,
111111
"addressBarShadowPadding": 6,
112+
"alwaysSaveActualImage": true,
112113
"autoElementScroll": true,
113114
"autoSaveBaseline": false,
114115
"clearFolder": false,
@@ -314,6 +315,7 @@ exports[`checkTabbablePage > should handle Android device correctly 1`] = `
314315
"wic": {
315316
"addIOSBezelCorners": false,
316317
"addressBarShadowPadding": 6,
318+
"alwaysSaveActualImage": true,
317319
"autoElementScroll": true,
318320
"autoSaveBaseline": false,
319321
"clearFolder": false,
@@ -599,6 +601,7 @@ exports[`checkTabbablePage > should handle hybrid app options correctly 1`] = `
599601
"wic": {
600602
"addIOSBezelCorners": false,
601603
"addressBarShadowPadding": 6,
604+
"alwaysSaveActualImage": true,
602605
"autoElementScroll": true,
603606
"autoSaveBaseline": false,
604607
"clearFolder": false,

packages/image-comparison-core/src/commands/__snapshots__/checkWebElement.test.ts.snap

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ exports[`checkWebElement > should execute checkWebElement with basic options 2`]
104104
"wic": {
105105
"addIOSBezelCorners": false,
106106
"addressBarShadowPadding": 6,
107+
"alwaysSaveActualImage": true,
107108
"autoElementScroll": true,
108109
"autoSaveBaseline": false,
109110
"clearFolder": false,
@@ -160,6 +161,7 @@ exports[`checkWebElement > should execute checkWebElement with basic options 2`]
160161
exports[`checkWebElement > should execute checkWebElement with basic options 3`] = `
161162
[
162163
{
164+
"actualBase64Image": undefined,
163165
"isNativeContext": false,
164166
"isViewPortScreenshot": true,
165167
"options": {
@@ -243,6 +245,7 @@ exports[`checkWebElement > should execute checkWebElement with basic options 3`]
243245
exports[`checkWebElement > should handle Android device correctly 1`] = `
244246
[
245247
{
248+
"actualBase64Image": undefined,
246249
"isNativeContext": false,
247250
"isViewPortScreenshot": true,
248251
"options": {
@@ -326,6 +329,7 @@ exports[`checkWebElement > should handle Android device correctly 1`] = `
326329
exports[`checkWebElement > should handle compare options correctly 1`] = `
327330
[
328331
{
332+
"actualBase64Image": undefined,
329333
"isNativeContext": false,
330334
"isViewPortScreenshot": true,
331335
"options": {
@@ -523,6 +527,7 @@ exports[`checkWebElement > should handle custom element options 1`] = `
523527
"wic": {
524528
"addIOSBezelCorners": false,
525529
"addressBarShadowPadding": 6,
530+
"alwaysSaveActualImage": true,
526531
"autoElementScroll": true,
527532
"autoSaveBaseline": false,
528533
"clearFolder": false,
@@ -579,6 +584,7 @@ exports[`checkWebElement > should handle custom element options 1`] = `
579584
exports[`checkWebElement > should handle device rectangles correctly 1`] = `
580585
[
581586
{
587+
"actualBase64Image": undefined,
582588
"isNativeContext": false,
583589
"isViewPortScreenshot": true,
584590
"options": {
@@ -662,6 +668,7 @@ exports[`checkWebElement > should handle device rectangles correctly 1`] = `
662668
exports[`checkWebElement > should handle hybrid app options correctly 1`] = `
663669
[
664670
{
671+
"actualBase64Image": undefined,
665672
"isNativeContext": false,
666673
"isViewPortScreenshot": true,
667674
"options": {
@@ -836,6 +843,7 @@ exports[`checkWebElement > should handle undefined method options with fallbacks
836843
"wic": {
837844
"addIOSBezelCorners": false,
838845
"addressBarShadowPadding": 6,
846+
"alwaysSaveActualImage": true,
839847
"autoElementScroll": true,
840848
"autoSaveBaseline": false,
841849
"clearFolder": false,

packages/image-comparison-core/src/commands/__snapshots__/checkWebScreen.test.ts.snap

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ exports[`checkWebScreen > should execute checkWebScreen with basic options 2`] =
101101
"wic": {
102102
"addIOSBezelCorners": false,
103103
"addressBarShadowPadding": 6,
104+
"alwaysSaveActualImage": true,
104105
"autoElementScroll": true,
105106
"autoSaveBaseline": false,
106107
"clearFolder": false,
@@ -157,6 +158,7 @@ exports[`checkWebScreen > should execute checkWebScreen with basic options 2`] =
157158
exports[`checkWebScreen > should execute checkWebScreen with basic options 3`] = `
158159
[
159160
{
161+
"actualBase64Image": undefined,
160162
"isNativeContext": false,
161163
"isViewPortScreenshot": true,
162164
"options": {
@@ -239,6 +241,7 @@ exports[`checkWebScreen > should execute checkWebScreen with basic options 3`] =
239241
exports[`checkWebScreen > should handle Android device correctly 1`] = `
240242
[
241243
{
244+
"actualBase64Image": undefined,
242245
"isNativeContext": false,
243246
"isViewPortScreenshot": true,
244247
"options": {
@@ -425,6 +428,7 @@ exports[`checkWebScreen > should handle all method options correctly 1`] = `
425428
"wic": {
426429
"addIOSBezelCorners": false,
427430
"addressBarShadowPadding": 6,
431+
"alwaysSaveActualImage": true,
428432
"autoElementScroll": true,
429433
"autoSaveBaseline": false,
430434
"clearFolder": false,
@@ -481,6 +485,7 @@ exports[`checkWebScreen > should handle all method options correctly 1`] = `
481485
exports[`checkWebScreen > should handle all method options correctly 2`] = `
482486
[
483487
{
488+
"actualBase64Image": undefined,
484489
"isNativeContext": false,
485490
"isViewPortScreenshot": true,
486491
"options": {
@@ -667,6 +672,7 @@ exports[`checkWebScreen > should handle hideElements and removeElements correctl
667672
"wic": {
668673
"addIOSBezelCorners": false,
669674
"addressBarShadowPadding": 6,
675+
"alwaysSaveActualImage": true,
670676
"autoElementScroll": true,
671677
"autoSaveBaseline": false,
672678
"clearFolder": false,
@@ -723,6 +729,7 @@ exports[`checkWebScreen > should handle hideElements and removeElements correctl
723729
exports[`checkWebScreen > should handle hideElements and removeElements correctly 2`] = `
724730
[
725731
{
732+
"actualBase64Image": undefined,
726733
"isNativeContext": false,
727734
"isViewPortScreenshot": true,
728735
"options": {
@@ -893,6 +900,7 @@ exports[`checkWebScreen > should handle native context correctly 1`] = `
893900
"wic": {
894901
"addIOSBezelCorners": false,
895902
"addressBarShadowPadding": 6,
903+
"alwaysSaveActualImage": true,
896904
"autoElementScroll": true,
897905
"autoSaveBaseline": false,
898906
"clearFolder": false,
@@ -949,6 +957,7 @@ exports[`checkWebScreen > should handle native context correctly 1`] = `
949957
exports[`checkWebScreen > should handle native context correctly 2`] = `
950958
[
951959
{
960+
"actualBase64Image": undefined,
952961
"isNativeContext": true,
953962
"isViewPortScreenshot": true,
954963
"options": {
@@ -1119,6 +1128,7 @@ exports[`checkWebScreen > should merge compare options correctly 1`] = `
11191128
"wic": {
11201129
"addIOSBezelCorners": false,
11211130
"addressBarShadowPadding": 6,
1131+
"alwaysSaveActualImage": true,
11221132
"autoElementScroll": true,
11231133
"autoSaveBaseline": false,
11241134
"clearFolder": false,
@@ -1175,6 +1185,7 @@ exports[`checkWebScreen > should merge compare options correctly 1`] = `
11751185
exports[`checkWebScreen > should merge compare options correctly 2`] = `
11761186
[
11771187
{
1188+
"actualBase64Image": undefined,
11781189
"isNativeContext": false,
11791190
"isViewPortScreenshot": true,
11801191
"options": {

0 commit comments

Comments
 (0)