@testomatio/reporter 2.6.0 → 2.6.1

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.
@@ -102,11 +102,16 @@ export function formatError(error, message) {
102
102
  * @returns {boolean}
103
103
  */
104
104
  function isNotInternalFrame(frame) {
105
+ const fileName = frame.getFileName();
106
+ if (!fileName) return false;
107
+
108
+ const isFileUrl = fileName.startsWith('file://');
109
+ const hasPathSeparator = fileName.includes(sep) || fileName.includes('/') || isFileUrl;
110
+
105
111
  return (
106
- frame.getFileName() &&
107
- frame.getFileName().includes(sep) &&
108
- !frame.getFileName().includes('node_modules') &&
109
- !frame.getFileName().includes('internal')
112
+ hasPathSeparator &&
113
+ !fileName.includes('node_modules') &&
114
+ !fileName.includes('internal')
110
115
  );
111
116
  }
112
117
 
package/types/types.d.ts CHANGED
@@ -28,22 +28,22 @@ declare module '@testomatio/reporter' {
28
28
 
29
29
  /**
30
30
  * Add a single label to the test report
31
- * @param key - label key (e.g. 'severity', 'feature', or just 'smoke' for labels without values)
32
- * @param value - optional label value (e.g. 'high', 'login')
31
+ * @param {string | {[key: string]: string}} key - label key (e.g. 'severity', 'feature', or just 'smoke' for labels without values)
32
+ * @param {string | null} [value=null] - optional label value (of custom field value) (used when key is a string)
33
33
  */
34
- export function label(key: string, value?: string | null): void;
34
+ export function label(key: string | { [key: string]: string }, value?: string | null): void;
35
35
 
36
36
  /**
37
37
  * Add link(s) to the test report
38
38
  * @param testIds - test IDs to link
39
39
  */
40
- export function linkTest(...testIds: string[]): void;
40
+ export function linkTest(...testIds: (string | string[])[]): void;
41
41
 
42
42
  /**
43
43
  * Add JIRA issue link(s) to the test report
44
44
  * @param jiraIds - JIRA issue IDs to link
45
45
  */
46
- export function linkJira(...jiraIds: string[]): void;
46
+ export function linkJira(...jiraIds: (string | string[])[]): void;
47
47
 
48
48
  /**
49
49
  * Logger service for intercepting and managing logs
@@ -159,6 +159,12 @@ export interface TestData {
159
159
  /** The unique identifier from Testomat.io of the test case. If provided, updates the existing test case with the given ID. */
160
160
  test_id?: string;
161
161
 
162
+ /** The status of the test (passed, failed, skipped, etc.) */
163
+ status?: 'passed' | 'failed' | 'skipped';
164
+
165
+ /** An array of artifacts associated with the test case (screenshots, videos, traces, etc.) */
166
+ artifacts?: ArtifactData[];
167
+
162
168
  /** An object representing an error that occurred during the execution of the test case. */
163
169
  error?: Error;
164
170
 
@@ -207,6 +213,24 @@ export interface TestData {
207
213
  overwrite?: boolean;
208
214
  }
209
215
 
216
+ /**
217
+ * Extended test data for HTML reporter.
218
+ */
219
+ export interface HtmlTestData extends TestData {
220
+ meta?: { [key: string]: any } & {
221
+ attachments?: any[];
222
+ traces?: any;
223
+ console?: any;
224
+ stdout?: any;
225
+ stderr?: any;
226
+ logs?: any;
227
+ retryCount?: number;
228
+ isFlaky?: boolean;
229
+ attempts?: any[];
230
+ retries?: any[];
231
+ };
232
+ }
233
+
210
234
  /**
211
235
  * Object representing a result of a Run.
212
236
  */
File without changes
File without changes
@@ -1 +0,0 @@
1
-