regressify 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/.browserslistrc +7 -0
  2. package/.editorconfig +14 -0
  3. package/.engine_scripts/auto-scroll.js +63 -0
  4. package/.engine_scripts/imageStub.jpg +0 -0
  5. package/.engine_scripts/package.json +11 -0
  6. package/.engine_scripts/playwright/actions.js +174 -0
  7. package/.engine_scripts/playwright/clickAndHoverHelper.js +43 -0
  8. package/.engine_scripts/playwright/embedFiles.js +28 -0
  9. package/.engine_scripts/playwright/interceptImages.js +31 -0
  10. package/.engine_scripts/playwright/loadCookies.js +26 -0
  11. package/.engine_scripts/playwright/login-user.js +143 -0
  12. package/.engine_scripts/playwright/onBefore.js +4 -0
  13. package/.engine_scripts/playwright/onReady.js +38 -0
  14. package/.engine_scripts/playwright/overrideCSS.js +39 -0
  15. package/.engine_scripts/puppet/clickAndHoverHelper.js +39 -0
  16. package/.engine_scripts/puppet/ignoreCSP.js +65 -0
  17. package/.engine_scripts/puppet/interceptImages.js +37 -0
  18. package/.engine_scripts/puppet/loadCookies.js +41 -0
  19. package/.engine_scripts/puppet/login-user.js +142 -0
  20. package/.engine_scripts/puppet/onBefore.js +4 -0
  21. package/.engine_scripts/puppet/onReady.js +32 -0
  22. package/.engine_scripts/puppet/overrideCSS.js +28 -0
  23. package/.engine_scripts/replacement-profiles-schema.json +32 -0
  24. package/.engine_scripts/scroll-top.js +27 -0
  25. package/.engine_scripts/test-schema.json +629 -0
  26. package/.eslintrc.cjs +23 -0
  27. package/.github/workflows/deploy.yml +37 -0
  28. package/.nvmrc +1 -0
  29. package/.prettierignore +2 -0
  30. package/.prettierrc +7 -0
  31. package/.prettierrc.js +8 -0
  32. package/.vscode/settings.json +57 -0
  33. package/LICENSE +21 -0
  34. package/README.md +32 -0
  35. package/alias.ps1 +44 -0
  36. package/bun.lockb +0 -0
  37. package/cli.js +76 -0
  38. package/generate_tests.js +39 -0
  39. package/package.json +44 -0
  40. package/src/config.ts +172 -0
  41. package/src/helpers.ts +40 -0
  42. package/src/index.ts +55 -0
  43. package/src/replacements.ts +34 -0
  44. package/src/scenarios.ts +21 -0
  45. package/src/types.ts +44 -0
  46. package/tsconfig.json +26 -0
  47. package/visual_tests/_cookies.yaml +21 -0
  48. package/visual_tests/_on-ready.js +3 -0
  49. package/visual_tests/_override.css +1 -0
  50. package/visual_tests/_replacement-profiles.yaml +6 -0
  51. package/visual_tests/_signing-in.yaml +7 -0
  52. package/visual_tests/_viewports.yaml +11 -0
  53. package/visual_tests/alloy.tests.yaml +6 -0
  54. package/visual_tests/color-blender.tests.yaml +62 -0
  55. package/visual_tests/form-reuse-scenarios.tests.yaml +38 -0
  56. package/visual_tests/form-submission.tests.yaml +59 -0
  57. package/visual_tests/frequently-changed-data.tests.yaml +22 -0
  58. package/visual_tests/sign-in.tests.yaml +6 -0
@@ -0,0 +1,629 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-06/schema#",
3
+ "$ref": "#/definitions/TestSuite",
4
+ "definitions": {
5
+ "TestSuite": {
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "properties": {
9
+ "useCssOverride": {
10
+ "type": "boolean"
11
+ },
12
+ "urlReplacements": {
13
+ "type": "array",
14
+ "items": {
15
+ "$ref": "#/definitions/UrlReplacements"
16
+ }
17
+ },
18
+ "cssOverridePath": {
19
+ "type": "string"
20
+ },
21
+ "hideSelectors": {
22
+ "type": "array",
23
+ "items": {
24
+ "type": "string"
25
+ }
26
+ },
27
+ "removeSelectors": {
28
+ "type": "array",
29
+ "items": {
30
+ "type": "string"
31
+ }
32
+ },
33
+ "viewportNames": {
34
+ "oneOf": [
35
+ {
36
+ "type": "string"
37
+ },
38
+ {
39
+ "type": "array",
40
+ "items": {
41
+ "type": "string"
42
+ }
43
+ }
44
+ ]
45
+ },
46
+ "scenarios": {
47
+ "type": "array",
48
+ "items": {
49
+ "$ref": "#/definitions/TesScenario"
50
+ }
51
+ },
52
+ "debug": {
53
+ "type": "boolean"
54
+ },
55
+ "asyncCaptureLimit": {
56
+ "type": "number"
57
+ },
58
+ "asyncCompareLimit": {
59
+ "type": "number"
60
+ },
61
+ "browser": {
62
+ "type": "string",
63
+ "oneOf": [
64
+ {
65
+ "enum": [
66
+ "chromium",
67
+ "firefox",
68
+ "webkit"
69
+ ]
70
+ }
71
+ ]
72
+ },
73
+ "misMatchThreshold": {
74
+ "type": "number"
75
+ },
76
+ "postInteractionWait": {
77
+ "type": "number"
78
+ }
79
+ },
80
+ "required": [
81
+ "scenarios"
82
+ ],
83
+ "title": "TestSuite"
84
+ },
85
+ "TesScenario": {
86
+ "type": "object",
87
+ "additionalProperties": false,
88
+ "properties": {
89
+ "url": {
90
+ "type": "string"
91
+ },
92
+ "label": {
93
+ "type": "string"
94
+ },
95
+ "description": {
96
+ "type": "string"
97
+ },
98
+ "delay": {
99
+ "type": "number"
100
+ },
101
+ "useCssOverride": {
102
+ "type": "boolean"
103
+ },
104
+ "cssOverridePath": {
105
+ "type": "string"
106
+ },
107
+ "cookiePath": {
108
+ "type": "string"
109
+ },
110
+ "jsOnReadyPath": {
111
+ "type": "string"
112
+ },
113
+ "hideSelectors": {
114
+ "type": "array",
115
+ "items": {
116
+ "type": "string"
117
+ }
118
+ },
119
+ "removeSelectors": {
120
+ "type": "array",
121
+ "items": {
122
+ "type": "string"
123
+ }
124
+ },
125
+ "clickSelector": {
126
+ "type": "string"
127
+ },
128
+ "viewportNames": {
129
+ "oneOf": [
130
+ {
131
+ "type": "string"
132
+ },
133
+ {
134
+ "type": "array",
135
+ "items": {
136
+ "type": "string"
137
+ }
138
+ }
139
+ ]
140
+ },
141
+ "id": {
142
+ "type": "string"
143
+ },
144
+ "needs": {
145
+ "oneOf": [
146
+ {
147
+ "type": "string"
148
+ },
149
+ {
150
+ "type": "array",
151
+ "items": {
152
+ "type": "string"
153
+ }
154
+ }
155
+ ]
156
+ },
157
+ "noScrollTop": {
158
+ "type": "boolean"
159
+ },
160
+ "actions": {
161
+ "type": "array",
162
+ "items": {
163
+ "oneOf": [
164
+ {
165
+ "$ref": "#/definitions/CheckAction"
166
+ },
167
+ {
168
+ "$ref": "#/definitions/ClickAction"
169
+ },
170
+ {
171
+ "$ref": "#/definitions/HideAction"
172
+ },
173
+ {
174
+ "$ref": "#/definitions/HoverAction"
175
+ },
176
+ {
177
+ "$ref": "#/definitions/InputAction"
178
+ },
179
+ {
180
+ "$ref": "#/definitions/InputFileAction"
181
+ },
182
+ {
183
+ "$ref": "#/definitions/PressAction"
184
+ },
185
+ {
186
+ "$ref": "#/definitions/RemoveAction"
187
+ },
188
+ {
189
+ "$ref": "#/definitions/ScrollAction"
190
+ },
191
+ {
192
+ "$ref": "#/definitions/SelectByLabelAction"
193
+ },
194
+ {
195
+ "$ref": "#/definitions/SelectByValueAction"
196
+ },
197
+ {
198
+ "$ref": "#/definitions/UncheckAction"
199
+ },
200
+ {
201
+ "$ref": "#/definitions/WaitAction"
202
+ }
203
+ ]
204
+ },
205
+ "title": "Actions",
206
+ "description": "Documentation: https://tuyen.blog/optimizely-cms/testing/create-action/"
207
+ },
208
+ "misMatchThreshold": {
209
+ "type": "number"
210
+ },
211
+ "postInteractionWait": {
212
+ "type": "number"
213
+ }
214
+ },
215
+ "required": [
216
+ "url"
217
+ ],
218
+ "title": "URL"
219
+ },
220
+ "UrlReplacements": {
221
+ "type": "object",
222
+ "additionalProperties": false,
223
+ "properties": {
224
+ "ref": {
225
+ "type": "string",
226
+ "format": "uri",
227
+ "qt-uri-protocols": [
228
+ "https"
229
+ ]
230
+ },
231
+ "test": {
232
+ "type": "string",
233
+ "format": "uri",
234
+ "qt-uri-protocols": [
235
+ "https"
236
+ ]
237
+ }
238
+ },
239
+ "required": [
240
+ "ref",
241
+ "test"
242
+ ],
243
+ "title": "URL Replacements"
244
+ },
245
+ "CheckAction": {
246
+ "type": "object",
247
+ "description": "Documentation: https://tuyen.blog/optimizely-cms/testing/create-action/#spoiler--check",
248
+ "additionalProperties": false,
249
+ "properties": {
250
+ "check": {
251
+ "type": "string"
252
+ },
253
+ "frame": {
254
+ "oneOf": [
255
+ {
256
+ "type": "string"
257
+ },
258
+ {
259
+ "type": "array",
260
+ "items": {
261
+ "type": "string"
262
+ }
263
+ }
264
+ ]
265
+ }
266
+ }
267
+ },
268
+ "ClickAction": {
269
+ "type": "object",
270
+ "additionalProperties": false,
271
+ "properties": {
272
+ "click": {
273
+ "type": "string"
274
+ },
275
+ "frame": {
276
+ "oneOf": [
277
+ {
278
+ "type": "string"
279
+ },
280
+ {
281
+ "type": "array",
282
+ "items": {
283
+ "type": "string"
284
+ }
285
+ }
286
+ ]
287
+ }
288
+ }
289
+ },
290
+ "HideAction": {
291
+ "type": "object",
292
+ "additionalProperties": false,
293
+ "properties": {
294
+ "hide": {
295
+ "type": "string"
296
+ },
297
+ "frame": {
298
+ "oneOf": [
299
+ {
300
+ "type": "string"
301
+ },
302
+ {
303
+ "type": "array",
304
+ "items": {
305
+ "type": "string"
306
+ }
307
+ }
308
+ ]
309
+ }
310
+ },
311
+ "required": [
312
+ "hide"
313
+ ]
314
+ },
315
+ "HoverAction": {
316
+ "type": "object",
317
+ "additionalProperties": false,
318
+ "properties": {
319
+ "hover": {
320
+ "type": "string"
321
+ },
322
+ "frame": {
323
+ "oneOf": [
324
+ {
325
+ "type": "string"
326
+ },
327
+ {
328
+ "type": "array",
329
+ "items": {
330
+ "type": "string"
331
+ }
332
+ }
333
+ ]
334
+ }
335
+ },
336
+ "required": [
337
+ "hover"
338
+ ]
339
+ },
340
+ "InputAction": {
341
+ "type": "object",
342
+ "additionalProperties": false,
343
+ "properties": {
344
+ "input": {
345
+ "type": "string"
346
+ },
347
+ "value": {
348
+ "type": "string"
349
+ },
350
+ "append": {
351
+ "type": "boolean"
352
+ },
353
+ "frame": {
354
+ "oneOf": [
355
+ {
356
+ "type": "string"
357
+ },
358
+ {
359
+ "type": "array",
360
+ "items": {
361
+ "type": "string"
362
+ }
363
+ }
364
+ ]
365
+ }
366
+ },
367
+ "required": [
368
+ "input",
369
+ "value"
370
+ ]
371
+ },
372
+ "InputFileAction": {
373
+ "type": "object",
374
+ "additionalProperties": false,
375
+ "properties": {
376
+ "input": {
377
+ "type": "string"
378
+ },
379
+ "file": {
380
+ "oneOf": [
381
+ {
382
+ "type": "string"
383
+ },
384
+ {
385
+ "type": "array",
386
+ "items": {
387
+ "type": "string"
388
+ }
389
+ }
390
+ ]
391
+ },
392
+ "useFileChooser": {
393
+ "type": "boolean"
394
+ },
395
+ "frame": {
396
+ "oneOf": [
397
+ {
398
+ "type": "string"
399
+ },
400
+ {
401
+ "type": "array",
402
+ "items": {
403
+ "type": "string"
404
+ }
405
+ }
406
+ ]
407
+ }
408
+ },
409
+ "required": [
410
+ "input",
411
+ "file"
412
+ ]
413
+ },
414
+ "PressAction": {
415
+ "type": "object",
416
+ "additionalProperties": false,
417
+ "properties": {
418
+ "press": {
419
+ "type": "string"
420
+ },
421
+ "key": {
422
+ "type": "string"
423
+ },
424
+ "frame": {
425
+ "oneOf": [
426
+ {
427
+ "type": "string"
428
+ },
429
+ {
430
+ "type": "array",
431
+ "items": {
432
+ "type": "string"
433
+ }
434
+ }
435
+ ]
436
+ }
437
+ },
438
+ "required": [
439
+ "press",
440
+ "key"
441
+ ]
442
+ },
443
+ "RemoveAction": {
444
+ "type": "object",
445
+ "additionalProperties": false,
446
+ "properties": {
447
+ "remove": {
448
+ "type": "string"
449
+ },
450
+ "frame": {
451
+ "oneOf": [
452
+ {
453
+ "type": "string"
454
+ },
455
+ {
456
+ "type": "array",
457
+ "items": {
458
+ "type": "string"
459
+ }
460
+ }
461
+ ]
462
+ }
463
+ },
464
+ "required": [
465
+ "remove"
466
+ ]
467
+ },
468
+ "ScrollAction": {
469
+ "type": "object",
470
+ "additionalProperties": false,
471
+ "properties": {
472
+ "scroll": {
473
+ "type": "string"
474
+ },
475
+ "frame": {
476
+ "oneOf": [
477
+ {
478
+ "type": "string"
479
+ },
480
+ {
481
+ "type": "array",
482
+ "items": {
483
+ "type": "string"
484
+ }
485
+ }
486
+ ]
487
+ }
488
+ },
489
+ "required": [
490
+ "scroll"
491
+ ]
492
+ },
493
+ "SelectByValueAction": {
494
+ "type": "object",
495
+ "additionalProperties": false,
496
+ "properties": {
497
+ "select": {
498
+ "type": "string"
499
+ },
500
+ "value": {
501
+ "oneOf": [
502
+ {
503
+ "type": "string"
504
+ },
505
+ {
506
+ "type": "array",
507
+ "items": {
508
+ "type": "string"
509
+ }
510
+ }
511
+ ]
512
+ },
513
+ "frame": {
514
+ "oneOf": [
515
+ {
516
+ "type": "string"
517
+ },
518
+ {
519
+ "type": "array",
520
+ "items": {
521
+ "type": "string"
522
+ }
523
+ }
524
+ ]
525
+ }
526
+ },
527
+ "required": [
528
+ "select",
529
+ "value"
530
+ ]
531
+ },
532
+ "SelectByLabelAction": {
533
+ "type": "object",
534
+ "additionalProperties": false,
535
+ "properties": {
536
+ "select": {
537
+ "type": "string"
538
+ },
539
+ "label": {
540
+ "oneOf": [
541
+ {
542
+ "type": "string"
543
+ },
544
+ {
545
+ "type": "array",
546
+ "items": {
547
+ "type": "string"
548
+ }
549
+ }
550
+ ]
551
+ },
552
+ "frame": {
553
+ "oneOf": [
554
+ {
555
+ "type": "string"
556
+ },
557
+ {
558
+ "type": "array",
559
+ "items": {
560
+ "type": "string"
561
+ }
562
+ }
563
+ ]
564
+ }
565
+ },
566
+ "required": [
567
+ "select",
568
+ "label"
569
+ ]
570
+ },
571
+ "UncheckAction": {
572
+ "type": "object",
573
+ "additionalProperties": false,
574
+ "properties": {
575
+ "uncheck": {
576
+ "type": "string"
577
+ },
578
+ "frame": {
579
+ "oneOf": [
580
+ {
581
+ "type": "string"
582
+ },
583
+ {
584
+ "type": "array",
585
+ "items": {
586
+ "type": "string"
587
+ }
588
+ }
589
+ ]
590
+ }
591
+ }
592
+ },
593
+ "WaitAction": {
594
+ "type": "object",
595
+ "additionalProperties": false,
596
+ "properties": {
597
+ "wait": {
598
+ "oneOf": [
599
+ {
600
+ "type": "string"
601
+ },
602
+ {
603
+ "type": "number"
604
+ }
605
+ ]
606
+ },
607
+ "url": {
608
+ "type": "string"
609
+ },
610
+ "frame": {
611
+ "oneOf": [
612
+ {
613
+ "type": "string"
614
+ },
615
+ {
616
+ "type": "array",
617
+ "items": {
618
+ "type": "string"
619
+ }
620
+ }
621
+ ]
622
+ }
623
+ },
624
+ "required": [
625
+ "wait"
626
+ ]
627
+ }
628
+ }
629
+ }
package/.eslintrc.cjs ADDED
@@ -0,0 +1,23 @@
1
+ module.exports = {
2
+ env: { browser: true, es2020: true },
3
+ extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'plugin:react-hooks/recommended'],
4
+ parser: '@typescript-eslint/parser',
5
+ parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
6
+ plugins: ['react-refresh'],
7
+ rules: {
8
+ 'react-refresh/only-export-components': 'warn',
9
+ '@typescript-eslint/member-delimiter-style': [
10
+ 'error',
11
+ {
12
+ multiline: {
13
+ delimiter: 'semi',
14
+ requireLast: true,
15
+ },
16
+ singleline: {
17
+ delimiter: 'semi',
18
+ requireLast: false,
19
+ },
20
+ },
21
+ ],
22
+ },
23
+ };
@@ -0,0 +1,37 @@
1
+ name: Regression test Deploy
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - release
7
+ paths:
8
+ - src/**
9
+ - .engine_scripts/**
10
+
11
+ workflow_dispatch:
12
+
13
+ concurrency:
14
+ group: ${{ github.workflow }}-${{ github.ref }}
15
+ cancel-in-progress: true
16
+
17
+ jobs:
18
+ build:
19
+ timeout-minutes: 5
20
+ runs-on: ubuntu-latest
21
+ steps:
22
+ - name: Checkout code
23
+ uses: actions/checkout@v4
24
+
25
+ - name: Set up Node.js
26
+ uses: actions/setup-node@v4
27
+ with:
28
+ node-version: '20.x'
29
+ registry-url: 'https://registry.npmjs.org'
30
+
31
+ - name: Install dependencies
32
+ run: npm ci
33
+
34
+ - name: Publish to NPM
35
+ run: npm publish --access public
36
+ env:
37
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
package/.nvmrc ADDED
@@ -0,0 +1 @@
1
+ v18
@@ -0,0 +1,2 @@
1
+ /public
2
+ /.backstop
package/.prettierrc ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "trailingComma": "es5",
3
+ "tabWidth": 2,
4
+ "proseWrap": "never",
5
+ "printWidth": 150,
6
+ "singleQuote": true
7
+ }
package/.prettierrc.js ADDED
@@ -0,0 +1,8 @@
1
+ module.exports = {
2
+ trailingComma: 'es5',
3
+ tabWidth: 2,
4
+ proseWrap: 'never',
5
+ printWidth: 150,
6
+ singleQuote: true,
7
+ semi: true
8
+ }