@qualflare/playwright 0.2.0 → 0.4.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.
@@ -104,6 +104,10 @@ interface Attachment {
104
104
  * Relative to the report file's own directory. Never sent to `/collect`
105
105
  * directly; mutually exclusive with `content`/`storageKey`. */
106
106
  localVideoPath?: string;
107
+ /** Filename of a Playwright trace zip copied into `outputDir`, relative to
108
+ * it. Read by `@qualflare/cli` v0.1.20+, which uploads it only when
109
+ * `--upload-artifacts=trace` asks; an older CLI ignores the field. */
110
+ localTracePath?: string;
107
111
  /** Byte size of the object at `storageKey`. Ignored when `storageKey` is
108
112
  * unset. */
109
113
  fileSize?: number;
@@ -111,6 +115,52 @@ interface Attachment {
111
115
  * Omit for a case-level (not step-level) attachment. */
112
116
  stepIndex?: number;
113
117
  }
118
+ /**
119
+ * One execution of a test, when the framework retried it.
120
+ *
121
+ * Sent as `Case.attempts`, persisted per-attempt server-side (see
122
+ * `case_run_attempts`). This is what lets a report answer "what failed on the
123
+ * first try?" rather than only "it was retried twice" — `retryCount`/`isFlaky`
124
+ * are aggregates and cannot.
125
+ *
126
+ * Three rules the server relies on:
127
+ *
128
+ * 1. **Send every attempt, including the final one**, numbered 1..N. The
129
+ * server treats the highest-numbered attempt as the final execution and
130
+ * overwrites its `status`/`duration` from the Case itself, so the two can
131
+ * never disagree — but it keeps this attempt's own `message`/`trace`, which
132
+ * is precisely why the final attempt must be sent rather than inferred.
133
+ * 2. **Fewer than two attempts persists nothing.** A test that ran once has no
134
+ * history worth storing, so omit `attempts` entirely rather than sending a
135
+ * single-element array; it is bytes against the 10MB body limit for a row
136
+ * the server will discard.
137
+ * 3. **`attempt` must be >= 1.** Zero-based numbering is silently dropped.
138
+ */
139
+ interface Attempt {
140
+ /** 1-based. Must be >= 1; the server drops anything lower. */
141
+ attempt: number;
142
+ status: CaseStatus;
143
+ /** NANOSECONDS — see `NanosecondDuration`. */
144
+ duration?: NanosecondDuration;
145
+ /** ISO-8601. When this attempt started. */
146
+ startedAt?: string;
147
+ /** The framework's own id for this attempt, passed through untouched.
148
+ * Max 255 chars server-side. */
149
+ attemptId?: string;
150
+ /** Truncated server-side at 8192 runes, never validation-rejected. */
151
+ message?: string;
152
+ /** Stack trace. Truncated server-side at 32768 runes. */
153
+ trace?: string;
154
+ /** Source snippet. Truncated server-side at 4096 runes. */
155
+ snippet?: string;
156
+ /** 1-based source line the failure points at. */
157
+ line?: number;
158
+ /** Captured stdout, one entry per line. Server keeps the first 200 lines,
159
+ * then truncates to 16384 runes. */
160
+ stdout?: string[];
161
+ /** Captured stderr, same bounds as `stdout`. */
162
+ stderr?: string[];
163
+ }
114
164
  interface Case {
115
165
  /** Required. A stable per-test identifier used for flaky-history matching
116
166
  * across separate runs — must stay the same for what a human would call
@@ -126,6 +176,10 @@ interface Case {
126
176
  /** NANOSECONDS — see `NanosecondDuration`. */
127
177
  duration: NanosecondDuration;
128
178
  retryCount?: number;
179
+ /** Per-attempt execution history, present only when the framework retried
180
+ * this test (>= 2 entries). Omitted otherwise — a single attempt persists
181
+ * nothing server-side. See `Attempt`. */
182
+ attempts?: Attempt[];
129
183
  isFlaky?: boolean;
130
184
  /** Truncated server-side at 65536 runes, never validation-rejected — send
131
185
  * the full error/stack text, don't pre-truncate. */
@@ -252,6 +306,10 @@ interface QualflarePlaywrightOptions {
252
306
  /** Per-video byte cap, checked before the file is written. Default 50MB,
253
307
  * matching the server's own hard cap. */
254
308
  maxVideoBytes?: number;
309
+ /** Cap on a single Playwright trace zip copied into `outputDir`. Traces are
310
+ * larger than videos in some suites, but the server rejects anything past its
311
+ * own 50MB cap, so the default matches it. */
312
+ maxTraceBytes?: number;
255
313
  debug?: boolean;
256
314
  /** `false` fully disables accumulation/upload (a complete no-op) but the
257
315
  * reporter still no-ops cleanly rather than throwing. */
@@ -300,6 +358,7 @@ interface ResolvedReporterConfig {
300
358
  maxAttachmentBytes: number;
301
359
  maxTotalAttachmentBytes: number;
302
360
  maxVideoBytes: number;
361
+ maxTraceBytes: number;
303
362
  debug: boolean;
304
363
  enabled: boolean;
305
364
  outputDir: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qualflare/playwright",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "description": "Native Playwright reporter for the Qualflare test-management platform.",
5
5
  "keywords": [
6
6
  "qualflare",