@argos-ci/core 5.0.4 → 5.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.
package/dist/index.d.ts CHANGED
@@ -120,6 +120,11 @@ interface Config {
120
120
  * Whether the environment is a merge queue.
121
121
  */
122
122
  mergeQueue?: boolean;
123
+ /**
124
+ * Whether this build contains only a subset of screenshots.
125
+ * This is useful when a build is created from an incomplete test suite where some tests are skipped.
126
+ */
127
+ subset?: boolean;
123
128
  }
124
129
  declare function readConfig(options?: Partial<Config>): Promise<Config>;
125
130
  declare function getConfigFromOptions({ parallel, ...options }: Omit<Partial<Config>, "parallel"> & {
@@ -237,11 +242,17 @@ interface components {
237
242
  };
238
243
  /** @description Build metadata */
239
244
  BuildMetadata: {
245
+ /** @description Test suite report */
240
246
  testReport?: {
241
- /** @enum {string} */
247
+ /**
248
+ * @description Status of the test suite
249
+ * @enum {string}
250
+ */
242
251
  status: "passed" | "failed" | "timedout" | "interrupted";
243
252
  stats?: {
253
+ /** @description Date when the test suite started */
244
254
  startTime?: string;
255
+ /** @description Duration of the test suite in milliseconds */
245
256
  duration?: number;
246
257
  };
247
258
  };
@@ -253,6 +264,43 @@ interface components {
253
264
  number: number;
254
265
  /** @description The status of the build */
255
266
  status: ("accepted" | "rejected") | ("no-changes" | "changes-detected") | ("expired" | "pending" | "progress" | "error" | "aborted");
267
+ /** @description The conclusion of the build */
268
+ conclusion: ("no-changes" | "changes-detected") | null;
269
+ /** @description Stats of the diffs present in the build */
270
+ stats: {
271
+ /** @description Added snapshots */
272
+ added: number;
273
+ /** @description Removed snapshots */
274
+ removed: number;
275
+ /** @description Unchanged snapshots */
276
+ unchanged: number;
277
+ /** @description Changed snapshots */
278
+ changed: number;
279
+ /** @description Ignored snapshots */
280
+ ignored: number;
281
+ /** @description Failure screenshots */
282
+ failure: number;
283
+ /** @description Retry failure screenshots */
284
+ retryFailure: number;
285
+ /** @description Total number of snapshots */
286
+ total: number;
287
+ } | null;
288
+ metadata: {
289
+ /** @description Test suite report */
290
+ testReport?: {
291
+ /**
292
+ * @description Status of the test suite
293
+ * @enum {string}
294
+ */
295
+ status: "passed" | "failed" | "timedout" | "interrupted";
296
+ stats?: {
297
+ /** @description Date when the test suite started */
298
+ startTime?: string;
299
+ /** @description Duration of the test suite in milliseconds */
300
+ duration?: number;
301
+ };
302
+ };
303
+ } | null;
256
304
  /**
257
305
  * Format: uri
258
306
  * @description The URL of the build
@@ -279,12 +327,6 @@ interface components {
279
327
  message: string;
280
328
  }[];
281
329
  };
282
- /** @description Project */
283
- Project: {
284
- id: string;
285
- defaultBaseBranch: string;
286
- hasRemoteContentAccess: boolean;
287
- };
288
330
  /** @description Page information */
289
331
  PageInfo: {
290
332
  /** @description Total number of items */
@@ -294,6 +336,226 @@ interface components {
294
336
  /** @description Number of items per page */
295
337
  perPage: number;
296
338
  };
339
+ /** @description Snapshot diff */
340
+ SnapshotDiff: {
341
+ /** @description Unique identifier of the snapshot diff */
342
+ id: string;
343
+ /** @description Name of the snapshot diff */
344
+ name: string;
345
+ /**
346
+ * @description Status of the snapshot diff
347
+ * @enum {string}
348
+ */
349
+ status: "pending" | "removed" | "failure" | "added" | "changed" | "unchanged" | "retryFailure" | "ignored";
350
+ /** @description Similarity score between snapshots */
351
+ score: number | null;
352
+ /** @description Grouping key for the snapshot diff */
353
+ group: string | null;
354
+ /** @description Parent name of the snapshot (usually the story id) */
355
+ parentName: string | null;
356
+ /** @description URL of the diff image */
357
+ url: string | null;
358
+ base: {
359
+ /** @description Unique identifier of the snapshot */
360
+ id: string;
361
+ /** @description Name of the snapshot */
362
+ name: string;
363
+ metadata: {
364
+ /**
365
+ * @description Ignored. Can be set to get completions, validations and documentation in some editors.
366
+ * @example https://api.argos-ci.com/v2/screenshot-metadata.json
367
+ */
368
+ $schema?: string;
369
+ /** @description The URL of the page that was screenshotted */
370
+ url?: string | null;
371
+ /** @description An URL to an accessible preview of the screenshot */
372
+ previewUrl?: string | null;
373
+ viewport?: {
374
+ /** @description The width of the viewport */
375
+ width: number;
376
+ /** @description The height of the viewport */
377
+ height: number;
378
+ } | null;
379
+ /** @description The color scheme when the screenshot was taken */
380
+ colorScheme?: ("light" | "dark") | null;
381
+ /** @description The media type when the screenshot was taken */
382
+ mediaType?: ("screen" | "print") | null;
383
+ test?: ({
384
+ /** @description The unique identifier of the test */
385
+ id?: string | null;
386
+ /** @description The title of the test */
387
+ title: string;
388
+ /** @description The path of titles leading to the test */
389
+ titlePath: string[];
390
+ /** @description The number of retries for the test */
391
+ retries?: number | null;
392
+ /** @description The current retry count */
393
+ retry?: number | null;
394
+ /** @description The repeat count for the test */
395
+ repeat?: number | null;
396
+ /** @description The location of the test in the source code */
397
+ location?: {
398
+ /** @description The located file */
399
+ file: string;
400
+ /** @description The line number in the file */
401
+ line: number;
402
+ /** @description The column number in the file */
403
+ column: number;
404
+ };
405
+ /** @description Annotations associated to the test */
406
+ annotations?: {
407
+ /** @description The type of annotation */
408
+ type: string;
409
+ /** @description The description of the annotation */
410
+ description?: string;
411
+ /** @description The location of the annotation in the source code */
412
+ location?: {
413
+ /** @description The located file */
414
+ file: string;
415
+ /** @description The line number in the file */
416
+ line: number;
417
+ /** @description The column number in the file */
418
+ column: number;
419
+ };
420
+ }[];
421
+ } | null) | null;
422
+ browser?: {
423
+ /** @description The name of the browser */
424
+ name: string;
425
+ /** @description The version of the browser */
426
+ version: string;
427
+ } | null;
428
+ /** @description The automation library that generated the screenshot */
429
+ automationLibrary: {
430
+ /** @description The name of the automation library */
431
+ name: string;
432
+ /** @description The version of the automation library */
433
+ version: string;
434
+ };
435
+ /** @description The Argos SDK that generated the screenshot */
436
+ sdk: {
437
+ /** @description The name of the Argos SDK */
438
+ name: string;
439
+ /** @description The version of the Argos SDK */
440
+ version: string;
441
+ };
442
+ } | null;
443
+ /** @description Width of the screenshot in pixels */
444
+ width: number | null;
445
+ /** @description Height of the screenshot in pixels */
446
+ height: number | null;
447
+ /**
448
+ * Format: uri
449
+ * @description Public URL of the snapshot
450
+ */
451
+ url: string;
452
+ /** @description Content type of the snapshot file */
453
+ contentType: string;
454
+ } | null;
455
+ head: {
456
+ /** @description Unique identifier of the snapshot */
457
+ id: string;
458
+ /** @description Name of the snapshot */
459
+ name: string;
460
+ metadata: {
461
+ /**
462
+ * @description Ignored. Can be set to get completions, validations and documentation in some editors.
463
+ * @example https://api.argos-ci.com/v2/screenshot-metadata.json
464
+ */
465
+ $schema?: string;
466
+ /** @description The URL of the page that was screenshotted */
467
+ url?: string | null;
468
+ /** @description An URL to an accessible preview of the screenshot */
469
+ previewUrl?: string | null;
470
+ viewport?: {
471
+ /** @description The width of the viewport */
472
+ width: number;
473
+ /** @description The height of the viewport */
474
+ height: number;
475
+ } | null;
476
+ /** @description The color scheme when the screenshot was taken */
477
+ colorScheme?: ("light" | "dark") | null;
478
+ /** @description The media type when the screenshot was taken */
479
+ mediaType?: ("screen" | "print") | null;
480
+ test?: ({
481
+ /** @description The unique identifier of the test */
482
+ id?: string | null;
483
+ /** @description The title of the test */
484
+ title: string;
485
+ /** @description The path of titles leading to the test */
486
+ titlePath: string[];
487
+ /** @description The number of retries for the test */
488
+ retries?: number | null;
489
+ /** @description The current retry count */
490
+ retry?: number | null;
491
+ /** @description The repeat count for the test */
492
+ repeat?: number | null;
493
+ /** @description The location of the test in the source code */
494
+ location?: {
495
+ /** @description The located file */
496
+ file: string;
497
+ /** @description The line number in the file */
498
+ line: number;
499
+ /** @description The column number in the file */
500
+ column: number;
501
+ };
502
+ /** @description Annotations associated to the test */
503
+ annotations?: {
504
+ /** @description The type of annotation */
505
+ type: string;
506
+ /** @description The description of the annotation */
507
+ description?: string;
508
+ /** @description The location of the annotation in the source code */
509
+ location?: {
510
+ /** @description The located file */
511
+ file: string;
512
+ /** @description The line number in the file */
513
+ line: number;
514
+ /** @description The column number in the file */
515
+ column: number;
516
+ };
517
+ }[];
518
+ } | null) | null;
519
+ browser?: {
520
+ /** @description The name of the browser */
521
+ name: string;
522
+ /** @description The version of the browser */
523
+ version: string;
524
+ } | null;
525
+ /** @description The automation library that generated the screenshot */
526
+ automationLibrary: {
527
+ /** @description The name of the automation library */
528
+ name: string;
529
+ /** @description The version of the automation library */
530
+ version: string;
531
+ };
532
+ /** @description The Argos SDK that generated the screenshot */
533
+ sdk: {
534
+ /** @description The name of the Argos SDK */
535
+ name: string;
536
+ /** @description The version of the Argos SDK */
537
+ version: string;
538
+ };
539
+ } | null;
540
+ /** @description Width of the screenshot in pixels */
541
+ width: number | null;
542
+ /** @description Height of the screenshot in pixels */
543
+ height: number | null;
544
+ /**
545
+ * Format: uri
546
+ * @description Public URL of the snapshot
547
+ */
548
+ url: string;
549
+ /** @description Content type of the snapshot file */
550
+ contentType: string;
551
+ } | null;
552
+ };
553
+ /** @description Project */
554
+ Project: {
555
+ id: string;
556
+ defaultBaseBranch: string;
557
+ hasRemoteContentAccess: boolean;
558
+ };
297
559
  };
298
560
  responses: never;
299
561
  parameters: never;
@@ -401,6 +663,12 @@ interface UploadParameters {
401
663
  previewUrl?: {
402
664
  baseUrl: string;
403
665
  } | ((url: string) => string);
666
+ /**
667
+ * Whether this build contains only a subset of screenshots.
668
+ * This is useful when a build is created from an incomplete test suite where some tests are skipped.
669
+ * @default false
670
+ */
671
+ subset?: boolean;
404
672
  }
405
673
  interface Screenshot {
406
674
  hash: string;
package/dist/index.js CHANGED
@@ -931,6 +931,11 @@ var schema = {
931
931
  mergeQueue: {
932
932
  format: Boolean,
933
933
  default: false
934
+ },
935
+ subset: {
936
+ env: "ARGOS_SUBSET",
937
+ format: Boolean,
938
+ default: false
934
939
  }
935
940
  };
936
941
  function createConfig() {
@@ -973,6 +978,7 @@ async function readConfig(options = {}) {
973
978
  ciProvider: ciEnv?.key || null,
974
979
  previewBaseUrl: defaultConfig.previewBaseUrl || null,
975
980
  skipped: options.skipped ?? defaultConfig.skipped ?? false,
981
+ subset: options.subset ?? defaultConfig.subset ?? false,
976
982
  mergeQueue: ciEnv?.mergeQueue ?? false
977
983
  });
978
984
  if (!config.get("branch") || !config.get("commit")) {
@@ -1395,7 +1401,8 @@ async function upload(params) {
1395
1401
  ciProvider: config.ciProvider,
1396
1402
  runId: config.runId,
1397
1403
  runAttempt: config.runAttempt,
1398
- mergeQueue: config.mergeQueue
1404
+ mergeQueue: config.mergeQueue,
1405
+ subset: config.subset
1399
1406
  }
1400
1407
  });
1401
1408
  if (createBuildResponse.error) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@argos-ci/core",
3
3
  "description": "Node.js SDK for visual testing with Argos.",
4
- "version": "5.0.4",
4
+ "version": "5.1.0",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
7
7
  "exports": {
@@ -40,7 +40,7 @@
40
40
  "access": "public"
41
41
  },
42
42
  "dependencies": {
43
- "@argos-ci/api-client": "0.15.0",
43
+ "@argos-ci/api-client": "0.16.0",
44
44
  "@argos-ci/util": "3.2.0",
45
45
  "convict": "^6.2.4",
46
46
  "debug": "^4.4.3",
@@ -67,5 +67,5 @@
67
67
  "lint": "eslint .",
68
68
  "test": "vitest"
69
69
  },
70
- "gitHead": "6fdd2406c03f3eea78931dc5f221cb438440c620"
70
+ "gitHead": "6887164dc0ccd5b2a3dd1d7d9e778cdbbdd2d534"
71
71
  }