@regressionbot/sdk 2.6.0 → 2.7.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/README.md CHANGED
@@ -38,6 +38,20 @@ npm install @regressionbot/sdk
38
38
 
39
39
  ## Migration from 1.x
40
40
 
41
+ ### 2.7.0
42
+
43
+ Needs API 2.10.0 or later for `fidelity`/`scopeNote` to be populated. On an older API these
44
+ fields are simply absent.
45
+
46
+ - **`fidelity`**, on a project (`ProjectConfig`, `ProjectConfigUpdate`), a run's options
47
+ (`runProject()`, `JobBuilder.fidelity()`) and a result (`PageResult`, `JobStatus`,
48
+ `JobSummary`). `'low'` is a fast content-only check against another live site — no
49
+ screenshot, no stored baseline — [about 3-7s a page instead of up to 50s](https://regressionbot.com/docs/workflows/quick-check).
50
+ `'high'` (the default) is today's full capture. Omitted on a run, the project's own
51
+ fidelity is used.
52
+ - **`scopeNote`**, on `JobStatus` and `JobSummary`: on a low-fidelity run, what it compared
53
+ and what it did not look at. Quote it with a quiet result.
54
+
41
55
  ### 2.6.0
42
56
 
43
57
  - **`ProjectConfig.startFailureAlertedAt`** — when the owners were last told a scheduled run
package/dist/index.d.ts CHANGED
@@ -50,6 +50,12 @@ export declare class RegressionBot {
50
50
  autoApprove?: boolean;
51
51
  /** What this run is testing, used to judge whether changes were intended. */
52
52
  runContext?: RunContext;
53
+ /**
54
+ * `high` (default): today's capture, with screenshots. `low`: a fast content
55
+ * check — no screenshot, only content changes count, needs `baseOrigin`, and
56
+ * stores no baseline. Omitted, the project's fidelity is used.
57
+ */
58
+ fidelity?: 'low' | 'high';
53
59
  }): Promise<JobHandle>;
54
60
  /**
55
61
  * Update the configuration settings for a named project.
@@ -101,6 +107,12 @@ export declare class JobBuilder {
101
107
  * Merges with anything set by an earlier call.
102
108
  */
103
109
  withContext(context: RunContext): this;
110
+ /**
111
+ * `high` (default): today's capture, with screenshots. `low`: a fast content check —
112
+ * no screenshot, only content changes count, needs `.against()`, and stores no
113
+ * baseline. Left unset, the project's fidelity is used.
114
+ */
115
+ fidelity(value: 'low' | 'high'): this;
104
116
  /**
105
117
  * Compiles the manifest and triggers the API.
106
118
  */
package/dist/index.js CHANGED
@@ -170,6 +170,15 @@ class JobBuilder {
170
170
  this.manifest.runContext = { ...this.manifest.runContext, ...context };
171
171
  return this;
172
172
  }
173
+ /**
174
+ * `high` (default): today's capture, with screenshots. `low`: a fast content check —
175
+ * no screenshot, only content changes count, needs `.against()`, and stores no
176
+ * baseline. Left unset, the project's fidelity is used.
177
+ */
178
+ fidelity(value) {
179
+ this.manifest.fidelity = value;
180
+ return this;
181
+ }
173
182
  /**
174
183
  * Compiles the manifest and triggers the API.
175
184
  */
@@ -193,7 +202,8 @@ class JobBuilder {
193
202
  autoApprove: this.manifest.autoApprove,
194
203
  masks: this.manifest.masks,
195
204
  customCss: this.manifest.customCss,
196
- runContext: this.manifest.runContext
205
+ runContext: this.manifest.runContext,
206
+ fidelity: this.manifest.fidelity
197
207
  };
198
208
  const res = await this.sdk._request('/crawl', 'POST', payload);
199
209
  return new JobHandle(this.sdk, res.jobId);
package/dist/types.d.ts CHANGED
@@ -47,6 +47,8 @@ export interface ProjectConfig {
47
47
  masks?: string[];
48
48
  /** CSS injected before screenshotting, to hide dynamic widgets. Max 4096 characters. */
49
49
  customCss?: string;
50
+ /** `low` when the project captures in low fidelity by default. Absent means high. */
51
+ fidelity?: 'low';
50
52
  /** Presence flag only — the stored credential is never returned. */
51
53
  testAuth?: {
52
54
  configured: true;
@@ -130,6 +132,12 @@ export interface ProjectConfigUpdate {
130
132
  masks?: string[];
131
133
  /** Max 4096 characters. */
132
134
  customCss?: string;
135
+ /**
136
+ * The fidelity this project's runs capture at unless a run says otherwise. `high`
137
+ * (default) clears it. `low` needs the project's `baseOrigin`. Low fidelity stores no
138
+ * baseline, so changing it invalidates nothing.
139
+ */
140
+ fidelity?: 'low' | 'high';
133
141
  /** Credentials for the test origin's environment gate. Pass null to clear. */
134
142
  testAuth?: EnvGate | null;
135
143
  /** Credentials for the base origin's environment gate. Pass null to clear. */
@@ -382,6 +390,12 @@ export interface PageResult {
382
390
  url: string;
383
391
  /** Whether the capture and comparison succeeded. */
384
392
  status: 'SUCCESS' | 'ERROR';
393
+ /**
394
+ * `low` on a low-fidelity result: no screenshot was taken, and only content changes
395
+ * count. `currentUrl` and `baselineUrl` are pictures drawn from the page copies on a
396
+ * changed page, and null otherwise. Absent means high.
397
+ */
398
+ fidelity?: 'low';
385
399
  /** Device variant tested (e.g. "Desktop Chrome", "iPhone 12"). */
386
400
  variantName: string;
387
401
  /**
@@ -517,6 +531,10 @@ export interface JobStatus {
517
531
  intentProvided: boolean;
518
532
  /** Whether this run compared two live origins or one origin against a stored baseline. */
519
533
  comparisonMode?: 'live-vs-live' | 'managed';
534
+ /** `low` on a low-fidelity run. Absent means high. */
535
+ fidelity?: 'low';
536
+ /** On a low-fidelity run: what it compared and what it did not look at. Quote it with a quiet result. */
537
+ scopeNote?: string;
520
538
  /** Page-checks the run made, and how many finished. Mirrors `progress`. */
521
539
  totalUrls?: number;
522
540
  completedCount?: number;
@@ -529,6 +547,10 @@ export interface JobSummary {
529
547
  environment?: string;
530
548
  /** Live-vs-live runs only: the environment of the base origin. Absent otherwise. */
531
549
  baseEnvironment?: string;
550
+ /** `low` on a low-fidelity run. Absent means high. */
551
+ fidelity?: 'low';
552
+ /** On a low-fidelity run: what it compared and what it did not look at. Quote it with a quiet result. */
553
+ scopeNote?: string;
532
554
  /** getSummary() throws until the job reaches one of these. */
533
555
  status: 'COMPLETED' | 'APPROVED' | 'RESOLVED' | 'FAILED';
534
556
  summaryStatus: SummaryStatus;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@regressionbot/sdk",
3
- "version": "2.6.0",
3
+ "version": "2.7.0",
4
4
  "description": "The official SDK for regressionbot.com - the simplest way to automate visual regression testing.",
5
5
  "homepage": "https://regressionbot.com",
6
6
  "repository": {