@dargmuesli/nuxt-vio-testing 13.1.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 (83) hide show
  1. package/e2e/specs/pages/root/error-404.spec.ts +63 -0
  2. package/e2e/specs/pages/root/error-404.spec.ts-snapshots/visual-regression-consistent-appearance-system-chromium-linux.png +0 -0
  3. package/e2e/specs/pages/root/error-404.spec.ts-snapshots/visual-regression-consistent-appearance-system-firefox-linux.png +0 -0
  4. package/e2e/specs/pages/root/error-404.spec.ts-snapshots/visual-regression-consistent-appearance-system-webkit-linux.png +0 -0
  5. package/e2e/specs/pages/root/index.spec.ts +114 -0
  6. package/e2e/specs/pages/root/index.spec.ts-snapshots/schema-org-graph-dev-chromium-linux.json +30 -0
  7. package/e2e/specs/pages/root/index.spec.ts-snapshots/schema-org-graph-dev-firefox-linux.json +30 -0
  8. package/e2e/specs/pages/root/index.spec.ts-snapshots/schema-org-graph-dev-webkit-linux.json +30 -0
  9. package/e2e/specs/pages/root/index.spec.ts-snapshots/schema-org-graph-node-chromium-linux.json +1 -0
  10. package/e2e/specs/pages/root/index.spec.ts-snapshots/schema-org-graph-node-firefox-linux.json +1 -0
  11. package/e2e/specs/pages/root/index.spec.ts-snapshots/schema-org-graph-node-webkit-linux.json +1 -0
  12. package/e2e/specs/pages/root/index.spec.ts-snapshots/schema-org-graph-static-chromium-linux.json +1 -0
  13. package/e2e/specs/pages/root/index.spec.ts-snapshots/schema-org-graph-static-firefox-linux.json +1 -0
  14. package/e2e/specs/pages/root/index.spec.ts-snapshots/schema-org-graph-static-webkit-linux.json +1 -0
  15. package/e2e/specs/pages/root/index.spec.ts-snapshots/visual-regression-consistent-appearance-dark-chromium-linux.png +0 -0
  16. package/e2e/specs/pages/root/index.spec.ts-snapshots/visual-regression-consistent-appearance-dark-firefox-linux.png +0 -0
  17. package/e2e/specs/pages/root/index.spec.ts-snapshots/visual-regression-consistent-appearance-dark-webkit-linux.png +0 -0
  18. package/e2e/specs/pages/root/index.spec.ts-snapshots/visual-regression-consistent-appearance-light-chromium-linux.png +0 -0
  19. package/e2e/specs/pages/root/index.spec.ts-snapshots/visual-regression-consistent-appearance-light-firefox-linux.png +0 -0
  20. package/e2e/specs/pages/root/index.spec.ts-snapshots/visual-regression-consistent-appearance-light-webkit-linux.png +0 -0
  21. package/e2e/specs/pages/root/index.spec.ts-snapshots/visual-regression-consistent-appearance-system-chromium-linux.png +0 -0
  22. package/e2e/specs/pages/root/index.spec.ts-snapshots/visual-regression-consistent-appearance-system-firefox-linux.png +0 -0
  23. package/e2e/specs/pages/root/index.spec.ts-snapshots/visual-regression-consistent-appearance-system-webkit-linux.png +0 -0
  24. package/e2e/specs/pages/root/index.spec.ts-snapshots/visual-regression-consistent-appearance-with-cookie-banner-chromium-linux.png +0 -0
  25. package/e2e/specs/pages/root/index.spec.ts-snapshots/visual-regression-consistent-appearance-with-cookie-banner-firefox-linux.png +0 -0
  26. package/e2e/specs/pages/root/index.spec.ts-snapshots/visual-regression-consistent-appearance-with-cookie-banner-webkit-linux.png +0 -0
  27. package/e2e/specs/pages/root/index.spec.ts-snapshots/visual-regression-generates-the-open-graph-image-1-chromium-linux.png +0 -0
  28. package/e2e/specs/pages/root/index.spec.ts-snapshots/visual-regression-generates-the-open-graph-image-1-firefox-linux.png +0 -0
  29. package/e2e/specs/pages/root/index.spec.ts-snapshots/visual-regression-generates-the-open-graph-image-1-webkit-linux.png +0 -0
  30. package/e2e/specs/pages/root/index.spec.ts-snapshots/visual-regression-generates-the-open-graph-image-2-chromium-linux.png +0 -0
  31. package/e2e/specs/pages/root/index.spec.ts-snapshots/visual-regression-generates-the-open-graph-image-2-firefox-linux.png +0 -0
  32. package/e2e/specs/pages/root/index.spec.ts-snapshots/visual-regression-generates-the-open-graph-image-2-webkit-linux.png +0 -0
  33. package/e2e/specs/pages/root/legal-notice.spec.ts +50 -0
  34. package/e2e/specs/pages/root/legal-notice.spec.ts-snapshots/schema-org-graph-dev-chromium-linux.json +31 -0
  35. package/e2e/specs/pages/root/legal-notice.spec.ts-snapshots/schema-org-graph-dev-firefox-linux.json +31 -0
  36. package/e2e/specs/pages/root/legal-notice.spec.ts-snapshots/schema-org-graph-dev-webkit-linux.json +31 -0
  37. package/e2e/specs/pages/root/legal-notice.spec.ts-snapshots/schema-org-graph-node-chromium-linux.json +1 -0
  38. package/e2e/specs/pages/root/legal-notice.spec.ts-snapshots/schema-org-graph-node-firefox-linux.json +1 -0
  39. package/e2e/specs/pages/root/legal-notice.spec.ts-snapshots/schema-org-graph-node-webkit-linux.json +1 -0
  40. package/e2e/specs/pages/root/legal-notice.spec.ts-snapshots/schema-org-graph-static-chromium-linux.json +1 -0
  41. package/e2e/specs/pages/root/legal-notice.spec.ts-snapshots/schema-org-graph-static-firefox-linux.json +1 -0
  42. package/e2e/specs/pages/root/legal-notice.spec.ts-snapshots/schema-org-graph-static-webkit-linux.json +1 -0
  43. package/e2e/specs/pages/root/legal-notice.spec.ts-snapshots/visual-regression-consistent-appearance-1-chromium-linux.png +0 -0
  44. package/e2e/specs/pages/root/legal-notice.spec.ts-snapshots/visual-regression-consistent-appearance-1-firefox-linux.png +0 -0
  45. package/e2e/specs/pages/root/legal-notice.spec.ts-snapshots/visual-regression-consistent-appearance-1-webkit-linux.png +0 -0
  46. package/e2e/specs/pages/root/legal-notice.spec.ts-snapshots/visual-regression-generates-the-open-graph-image-1-chromium-linux.png +0 -0
  47. package/e2e/specs/pages/root/legal-notice.spec.ts-snapshots/visual-regression-generates-the-open-graph-image-1-firefox-linux.png +0 -0
  48. package/e2e/specs/pages/root/legal-notice.spec.ts-snapshots/visual-regression-generates-the-open-graph-image-1-webkit-linux.png +0 -0
  49. package/e2e/specs/pages/root/legal-notice.spec.ts-snapshots/visual-regression-generates-the-open-graph-image-2-chromium-linux.png +0 -0
  50. package/e2e/specs/pages/root/legal-notice.spec.ts-snapshots/visual-regression-generates-the-open-graph-image-2-firefox-linux.png +0 -0
  51. package/e2e/specs/pages/root/legal-notice.spec.ts-snapshots/visual-regression-generates-the-open-graph-image-2-webkit-linux.png +0 -0
  52. package/e2e/specs/pages/root/privacy-policy.spec.ts +40 -0
  53. package/e2e/specs/pages/root/privacy-policy.spec.ts-snapshots/visual-regression-consistent-appearance-1-chromium-linux.png +0 -0
  54. package/e2e/specs/pages/root/privacy-policy.spec.ts-snapshots/visual-regression-consistent-appearance-1-firefox-linux.png +0 -0
  55. package/e2e/specs/pages/root/privacy-policy.spec.ts-snapshots/visual-regression-consistent-appearance-1-webkit-linux.png +0 -0
  56. package/e2e/specs/pages/root/privacy-policy.spec.ts-snapshots/visual-regression-generates-the-open-graph-image-1-chromium-linux.png +0 -0
  57. package/e2e/specs/pages/root/privacy-policy.spec.ts-snapshots/visual-regression-generates-the-open-graph-image-1-firefox-linux.png +0 -0
  58. package/e2e/specs/pages/root/privacy-policy.spec.ts-snapshots/visual-regression-generates-the-open-graph-image-1-webkit-linux.png +0 -0
  59. package/e2e/specs/pages/root/privacy-policy.spec.ts-snapshots/visual-regression-generates-the-open-graph-image-2-chromium-linux.png +0 -0
  60. package/e2e/specs/pages/root/privacy-policy.spec.ts-snapshots/visual-regression-generates-the-open-graph-image-2-firefox-linux.png +0 -0
  61. package/e2e/specs/pages/root/privacy-policy.spec.ts-snapshots/visual-regression-generates-the-open-graph-image-2-webkit-linux.png +0 -0
  62. package/e2e/specs/server/headers.spec.ts +53 -0
  63. package/e2e/specs/server/headers.spec.ts-snapshots/csp-production-chromium-linux.txt +1 -0
  64. package/e2e/specs/server/headers.spec.ts-snapshots/csp-production-firefox-linux.txt +1 -0
  65. package/e2e/specs/server/headers.spec.ts-snapshots/csp-production-webkit-linux.txt +1 -0
  66. package/e2e/specs/server/robots.spec.ts +29 -0
  67. package/e2e/specs/server/robots.spec.ts-snapshots/robots-txt-content-development-chromium-linux.txt +4 -0
  68. package/e2e/specs/server/robots.spec.ts-snapshots/robots-txt-content-development-firefox-linux.txt +4 -0
  69. package/e2e/specs/server/robots.spec.ts-snapshots/robots-txt-content-development-webkit-linux.txt +4 -0
  70. package/e2e/specs/server/robots.spec.ts-snapshots/robots-txt-content-production-chromium-linux.txt +4 -0
  71. package/e2e/specs/server/robots.spec.ts-snapshots/robots-txt-content-production-firefox-linux.txt +4 -0
  72. package/e2e/specs/server/robots.spec.ts-snapshots/robots-txt-content-production-webkit-linux.txt +4 -0
  73. package/e2e/specs/server/sitemap.spec.ts +42 -0
  74. package/e2e/specs/server/sitemap.spec.ts-snapshots/sitemap-content-de-chromium-linux.txt +21 -0
  75. package/e2e/specs/server/sitemap.spec.ts-snapshots/sitemap-content-de-firefox-linux.txt +21 -0
  76. package/e2e/specs/server/sitemap.spec.ts-snapshots/sitemap-content-de-webkit-linux.txt +21 -0
  77. package/e2e/specs/server/sitemap.spec.ts-snapshots/sitemap-content-en-chromium-linux.txt +21 -0
  78. package/e2e/specs/server/sitemap.spec.ts-snapshots/sitemap-content-en-firefox-linux.txt +21 -0
  79. package/e2e/specs/server/sitemap.spec.ts-snapshots/sitemap-content-en-webkit-linux.txt +21 -0
  80. package/e2e/utils/constants.ts +37 -0
  81. package/e2e/utils/tests.ts +574 -0
  82. package/package.json +58 -0
  83. package/playwright.config.ts +100 -0
@@ -0,0 +1,574 @@
1
+ import { expect, type Page } from '@playwright/test'
2
+ import { joinURL, withoutTrailingSlash } from 'ufo'
3
+
4
+ import { SITE_URL } from '#src/utils/constants'
5
+
6
+ export const testMetadata = async ({
7
+ page,
8
+ path,
9
+ title,
10
+ }: {
11
+ page: Page
12
+ path: string
13
+ title: string
14
+ }) => {
15
+ await page.goto(path)
16
+
17
+ expect(await page.title()).toStrictEqual(title)
18
+
19
+ const meta = [
20
+ {
21
+ tag: 'html',
22
+ attributes: [
23
+ { key: 'dir', value: 'ltr' },
24
+ { key: 'lang', value: 'en' },
25
+ ],
26
+ },
27
+ // {
28
+ // tag: 'link',
29
+ // attributes: [
30
+ // {
31
+ // key: 'data-testid',
32
+ // value: 'polyfill-preload',
33
+ // },
34
+ // { key: 'rel', value: 'preload' },
35
+ // {
36
+ // key: 'href',
37
+ // value:
38
+ // 'https://polyfill.io/v3/polyfill.min.js?features=Promise&flags=gated',
39
+ // },
40
+ // {
41
+ // key: 'crossorigin',
42
+ // value: 'anonymous',
43
+ // },
44
+ // {
45
+ // key: 'as',
46
+ // value: 'script',
47
+ // },
48
+ // ],
49
+ // },
50
+ {
51
+ tag: 'meta',
52
+ attributes: [
53
+ {
54
+ key: 'charset',
55
+ value: 'utf-8',
56
+ },
57
+ ],
58
+ },
59
+ {
60
+ tag: 'meta',
61
+ attributes: [
62
+ {
63
+ key: 'name',
64
+ value: 'viewport',
65
+ },
66
+ { key: 'content', value: 'width=device-width, initial-scale=1' },
67
+ ],
68
+ },
69
+ {
70
+ tag: 'meta',
71
+ attributes: [
72
+ {
73
+ key: 'property',
74
+ value: 'og:image',
75
+ },
76
+ {
77
+ key: 'content',
78
+ value: joinURL(SITE_URL, '/__og-image__/image', path, '/og.png'),
79
+ },
80
+ ],
81
+ },
82
+ {
83
+ tag: 'meta',
84
+ attributes: [
85
+ {
86
+ key: 'property',
87
+ value: 'og:image:type',
88
+ },
89
+ {
90
+ key: 'content',
91
+ value: 'image/png',
92
+ },
93
+ ],
94
+ },
95
+ {
96
+ tag: 'meta',
97
+ attributes: [
98
+ {
99
+ key: 'name',
100
+ value: 'twitter:card',
101
+ },
102
+ { key: 'content', value: 'summary_large_image' },
103
+ ],
104
+ },
105
+ {
106
+ tag: 'meta',
107
+ attributes: [
108
+ {
109
+ key: 'name',
110
+ value: 'twitter:image',
111
+ },
112
+ {
113
+ key: 'content',
114
+ value: joinURL(SITE_URL, '/__og-image__/image', path, '/og.png'),
115
+ },
116
+ ],
117
+ },
118
+ {
119
+ tag: 'meta',
120
+ attributes: [
121
+ {
122
+ key: 'name',
123
+ value: 'twitter:image:src',
124
+ },
125
+ {
126
+ key: 'content',
127
+ value: joinURL(SITE_URL, '/__og-image__/image', path, '/og.png'),
128
+ },
129
+ ],
130
+ },
131
+ {
132
+ tag: 'meta',
133
+ attributes: [
134
+ {
135
+ key: 'property',
136
+ value: 'og:image:width',
137
+ },
138
+ { key: 'content', value: '1200' },
139
+ ],
140
+ },
141
+ {
142
+ tag: 'meta',
143
+ attributes: [
144
+ {
145
+ key: 'name',
146
+ value: 'twitter:image:width',
147
+ },
148
+ { key: 'content', value: '1200' },
149
+ ],
150
+ },
151
+ {
152
+ tag: 'meta',
153
+ attributes: [
154
+ {
155
+ key: 'property',
156
+ value: 'og:image:height',
157
+ },
158
+ { key: 'content', value: '600' },
159
+ ],
160
+ },
161
+ {
162
+ tag: 'meta',
163
+ attributes: [
164
+ {
165
+ key: 'name',
166
+ value: 'twitter:image:height',
167
+ },
168
+ { key: 'content', value: '600' },
169
+ ],
170
+ },
171
+ {
172
+ tag: 'meta',
173
+ attributes: [
174
+ {
175
+ key: 'property',
176
+ value: 'og:image:alt',
177
+ },
178
+ { key: 'content', value: 'Social Preview Image for a Vio webpage.' },
179
+ ],
180
+ },
181
+ {
182
+ tag: 'meta',
183
+ attributes: [
184
+ {
185
+ key: 'name',
186
+ value: 'twitter:image:alt',
187
+ },
188
+ { key: 'content', value: 'Social Preview Image for a Vio webpage.' },
189
+ ],
190
+ },
191
+ {
192
+ tag: 'link',
193
+ attributes: [
194
+ {
195
+ key: 'rel',
196
+ value: 'icon',
197
+ },
198
+ {
199
+ key: 'href',
200
+ value: '/favicon.ico',
201
+ },
202
+ {
203
+ key: 'sizes',
204
+ value: 'any',
205
+ },
206
+ ],
207
+ },
208
+ {
209
+ tag: 'link',
210
+ attributes: [
211
+ {
212
+ key: 'rel',
213
+ value: 'icon',
214
+ },
215
+ {
216
+ key: 'href',
217
+ value: '/favicon-16x16.png',
218
+ },
219
+ {
220
+ key: 'type',
221
+ value: 'image/png',
222
+ },
223
+ {
224
+ key: 'sizes',
225
+ value: '16x16',
226
+ },
227
+ ],
228
+ },
229
+ {
230
+ tag: 'link',
231
+ attributes: [
232
+ {
233
+ key: 'rel',
234
+ value: 'icon',
235
+ },
236
+ {
237
+ key: 'href',
238
+ value: '/favicon-32x32.png',
239
+ },
240
+ {
241
+ key: 'type',
242
+ value: 'image/png',
243
+ },
244
+ {
245
+ key: 'sizes',
246
+ value: '32x32',
247
+ },
248
+ ],
249
+ },
250
+ {
251
+ tag: 'link',
252
+ attributes: [
253
+ {
254
+ key: 'rel',
255
+ value: 'apple-touch-icon',
256
+ },
257
+ {
258
+ key: 'href',
259
+ value: '/apple-touch-icon.png',
260
+ },
261
+ {
262
+ key: 'type',
263
+ value: 'image/png',
264
+ },
265
+ {
266
+ key: 'sizes',
267
+ value: '180x180',
268
+ },
269
+ ],
270
+ },
271
+ {
272
+ tag: 'meta',
273
+ attributes: [
274
+ {
275
+ key: 'property',
276
+ value: 'og:type',
277
+ },
278
+ { key: 'content', value: 'website' },
279
+ ],
280
+ },
281
+ {
282
+ tag: 'link',
283
+ attributes: [
284
+ {
285
+ key: 'rel',
286
+ value: 'canonical',
287
+ },
288
+ {
289
+ key: 'href',
290
+ value: `${SITE_URL}${path}`,
291
+ },
292
+ ],
293
+ },
294
+ {
295
+ tag: 'meta',
296
+ attributes: [
297
+ {
298
+ key: 'name',
299
+ value: 'robots',
300
+ },
301
+ {
302
+ key: 'content',
303
+ value:
304
+ process.env.NODE_ENV === 'production'
305
+ ? 'index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1'
306
+ : 'noindex, nofollow',
307
+ },
308
+ ],
309
+ },
310
+ {
311
+ tag: 'link',
312
+ attributes: [
313
+ {
314
+ key: 'href',
315
+ value: `${SITE_URL}${path}`,
316
+ },
317
+ {
318
+ key: 'hreflang',
319
+ value: 'en',
320
+ },
321
+ {
322
+ key: 'rel',
323
+ value: 'alternate',
324
+ },
325
+ ],
326
+ },
327
+ {
328
+ tag: 'link',
329
+ attributes: [
330
+ {
331
+ key: 'href',
332
+ value: withoutTrailingSlash(`${SITE_URL}/de${path}`),
333
+ },
334
+ {
335
+ key: 'hreflang',
336
+ value: 'de',
337
+ },
338
+ {
339
+ key: 'rel',
340
+ value: 'alternate',
341
+ },
342
+ ],
343
+ },
344
+ {
345
+ tag: 'link',
346
+ attributes: [
347
+ {
348
+ key: 'href',
349
+ value: `${SITE_URL}${path}`,
350
+ },
351
+ {
352
+ key: 'hreflang',
353
+ value: 'x-default',
354
+ },
355
+ {
356
+ key: 'rel',
357
+ value: 'alternate',
358
+ },
359
+ ],
360
+ },
361
+ {
362
+ tag: 'meta',
363
+ attributes: [
364
+ {
365
+ key: 'property',
366
+ value: 'og:url',
367
+ },
368
+ {
369
+ key: 'content',
370
+ value: `${SITE_URL}${path}`,
371
+ },
372
+ ],
373
+ },
374
+ {
375
+ tag: 'meta',
376
+ attributes: [
377
+ {
378
+ key: 'property',
379
+ value: 'og:locale',
380
+ },
381
+ { key: 'content', value: 'en' },
382
+ ],
383
+ },
384
+ {
385
+ tag: 'meta',
386
+ attributes: [
387
+ {
388
+ key: 'property',
389
+ value: 'og:locale:alternate',
390
+ },
391
+ { key: 'content', value: 'de' },
392
+ ],
393
+ },
394
+ {
395
+ tag: 'meta',
396
+ attributes: [
397
+ {
398
+ key: 'name',
399
+ value: 'msapplication-TileColor',
400
+ },
401
+ { key: 'content', value: '#202020' },
402
+ ],
403
+ },
404
+ {
405
+ tag: 'meta',
406
+ attributes: [
407
+ {
408
+ key: 'name',
409
+ value: 'theme-color',
410
+ },
411
+ { key: 'content', value: '#202020' },
412
+ ],
413
+ },
414
+ {
415
+ tag: 'link',
416
+ attributes: [
417
+ {
418
+ key: 'href',
419
+ value: '/site.webmanifest?v=bOXMwoKlJr',
420
+ },
421
+ {
422
+ key: 'rel',
423
+ value: 'manifest',
424
+ },
425
+ ],
426
+ },
427
+ {
428
+ tag: 'link',
429
+ attributes: [
430
+ {
431
+ key: 'color',
432
+ value: '#202020',
433
+ },
434
+ {
435
+ key: 'href',
436
+ value: '/assets/static/favicon/safari-pinned-tab.svg?v=bOXMwoKlJr',
437
+ },
438
+ {
439
+ key: 'rel',
440
+ value: 'mask-icon',
441
+ },
442
+ ],
443
+ },
444
+ {
445
+ tag: 'link',
446
+ attributes: [
447
+ {
448
+ key: 'href',
449
+ value: '/favicon.ico?v=bOXMwoKlJr',
450
+ },
451
+ {
452
+ key: 'rel',
453
+ value: 'shortcut icon',
454
+ },
455
+ ],
456
+ },
457
+ {
458
+ tag: 'meta',
459
+ attributes: [
460
+ {
461
+ key: 'name',
462
+ value: 'description',
463
+ },
464
+ { key: 'content', value: "Vio is @dargmuesli's Nuxt layer." },
465
+ ],
466
+ },
467
+ {
468
+ tag: 'meta',
469
+ attributes: [
470
+ {
471
+ key: 'property',
472
+ value: 'og:description',
473
+ },
474
+ { key: 'content', value: "Vio is @dargmuesli's Nuxt layer." },
475
+ ],
476
+ },
477
+ {
478
+ tag: 'meta',
479
+ attributes: [
480
+ {
481
+ key: 'name',
482
+ value: 'twitter:description',
483
+ },
484
+ { key: 'content', value: "Vio is @dargmuesli's Nuxt layer." },
485
+ ],
486
+ },
487
+ {
488
+ tag: 'meta',
489
+ attributes: [
490
+ {
491
+ key: 'name',
492
+ value: 'msapplication-Config',
493
+ },
494
+ {
495
+ key: 'content',
496
+ value: '/assets/static/favicon/browserconfig.xml?v=bOXMwoKlJr',
497
+ },
498
+ ],
499
+ },
500
+ {
501
+ tag: 'meta',
502
+ attributes: [
503
+ {
504
+ key: 'property',
505
+ value: 'og:title',
506
+ },
507
+ { key: 'content', value: title },
508
+ ],
509
+ },
510
+ {
511
+ tag: 'meta',
512
+ attributes: [
513
+ {
514
+ key: 'name',
515
+ value: 'twitter:title',
516
+ },
517
+ { key: 'content', value: title },
518
+ ],
519
+ },
520
+ {
521
+ tag: 'meta',
522
+ attributes: [
523
+ {
524
+ key: 'property',
525
+ value: 'og:site_name',
526
+ },
527
+ { key: 'content', value: 'Vio Playground' },
528
+ ],
529
+ },
530
+ {
531
+ tag: 'meta',
532
+ attributes: [
533
+ {
534
+ key: 'name',
535
+ value: 'twitter:site',
536
+ },
537
+ { key: 'content', value: '@dargmuesli' },
538
+ ],
539
+ },
540
+ {
541
+ tag: 'script',
542
+ attributes: [
543
+ {
544
+ key: 'id',
545
+ value: 'schema-org-graph',
546
+ },
547
+ { key: 'type', value: 'application/ld+json' },
548
+ ],
549
+ },
550
+ ]
551
+
552
+ for (const object of meta) {
553
+ await expect(
554
+ page.locator(
555
+ object.tag +
556
+ object.attributes
557
+ ?.map((attribute) => `[${attribute.key}="${attribute.value}"]`)
558
+ .join(''),
559
+ ),
560
+ ).toBeAttached()
561
+ }
562
+
563
+ expect(await page.locator('#schema-org-graph').innerText()).toMatchSnapshot(
564
+ `schema-org-graph-${process.env.VIO_SERVER || 'dev'}.json`,
565
+ )
566
+
567
+ // if (process.env.VIO_SERVER === 'static') {
568
+ // expect(
569
+ // await page
570
+ // .locator('meta[http-equiv="Content-Security-Policy"]')
571
+ // .innerText(),
572
+ // ).toMatchSnapshot(`content-security-policy.txt`)
573
+ // }
574
+ }
package/package.json ADDED
@@ -0,0 +1,58 @@
1
+ {
2
+ "devDependencies": {
3
+ "@axe-core/playwright": "4.9.1",
4
+ "@eslint/js": "9.5.0",
5
+ "@playwright/test": "1.44.1",
6
+ "@types/node": "20.14.2",
7
+ "cross-env": "7.0.3",
8
+ "eslint": "9.5.0",
9
+ "eslint-config-prettier": "9.1.0",
10
+ "eslint-plugin-prettier": "5.1.3",
11
+ "lodash-es": "4.17.21",
12
+ "typescript": "5.4.5",
13
+ "typescript-eslint": "7.13.0",
14
+ "ufo": "1.5.3"
15
+ },
16
+ "engines": {
17
+ "node": "20"
18
+ },
19
+ "files": [
20
+ "e2e/fixtures",
21
+ "e2e/specs",
22
+ "e2e/utils",
23
+ "package.json",
24
+ "playwright.config.ts"
25
+ ],
26
+ "name": "@dargmuesli/nuxt-vio-testing",
27
+ "peerDependencies": {
28
+ "playwright-core": "1.44.1"
29
+ },
30
+ "publishConfig": {
31
+ "access": "public"
32
+ },
33
+ "repository": {
34
+ "type": "git",
35
+ "url": "git+https://github.com/dargmuesli/vio.git"
36
+ },
37
+ "scripts": {
38
+ "lint": "pnpm run lint:js && pnpm run lint:ts",
39
+ "lint:fix": "pnpm run lint:js --fix",
40
+ "lint:js": "eslint --cache",
41
+ "lint:ts": "tsc --noEmit",
42
+ "test:e2e": "playwright test",
43
+ "test:e2e:docker:br": "pnpm run test:e2e:docker:build && pnpm run test:e2e:docker:run",
44
+ "test:e2e:docker:build": "docker build -t test-e2e_development --build-arg UID=$(id -u) --build-arg GID=$(id -g) --target test-e2e_development ..",
45
+ "test:e2e:docker:run": "docker run --rm -v \"$PWD/..:/srv/app\" -v \"$(pnpm store path):/srv/.pnpm-store\" test-e2e_development",
46
+ "test:e2e:docker:server:dev": "pnpm run test:e2e:docker:br pnpm --dir tests run test:e2e:server:dev",
47
+ "test:e2e:docker:server:dev:update": "pnpm run test:e2e:docker:server:dev --update-snapshots",
48
+ "test:e2e:docker:server:node": "pnpm run test:e2e:docker:br pnpm --dir tests run test:e2e:server:node",
49
+ "test:e2e:docker:server:node:update": "pnpm run test:e2e:docker:server:node --update-snapshots",
50
+ "test:e2e:docker:server:static": "pnpm run test:e2e:docker:br pnpm --dir tests run test:e2e:server:static",
51
+ "test:e2e:docker:server:static:update": "pnpm run test:e2e:docker:server:static --update-snapshots",
52
+ "test:e2e:server:dev": "cross-env PORT=3000 SITE_URL=http://localhost:3000 VIO_SERVER=dev pnpm run test:e2e",
53
+ "test:e2e:server:node": "cross-env NODE_ENV=production NUXT_PUBLIC_I18N_BASE_URL=http://localhost:3001 NUXT_PUBLIC_SITE_URL=http://localhost:3001 PORT=3001 VIO_SERVER=node pnpm run test:e2e",
54
+ "test:e2e:server:static": "cross-env NODE_ENV=production PORT=\"${PORT:-3002}\" SITE_URL=\"${SITE_URL:-https://localhost:3002}\" VIO_SERVER=static pnpm run test:e2e"
55
+ },
56
+ "type": "module",
57
+ "version": "13.1.0"
58
+ }