@cronn/element-snapshot 0.13.0 → 0.14.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.
- package/README.md +16 -0
- package/dist/browser-lib.iife.js +31 -17
- package/dist/index.d.mts +75 -16
- package/dist/index.mjs +134 -37
- package/package.json +12 -9
package/README.md
CHANGED
|
@@ -25,6 +25,12 @@ pnpm add -D @cronn/element-snapshot
|
|
|
25
25
|
|
|
26
26
|
## Writing Tests
|
|
27
27
|
|
|
28
|
+
This package provides multiple snapshot formats for different use cases:
|
|
29
|
+
|
|
30
|
+
- **General-Purpose Snapshots**: Human-readable JSON format for all element types
|
|
31
|
+
- **Markdown Table Snapshots**: Specialized format for tables and grids ([documentation](docs/markdown-table-snapshot.md))
|
|
32
|
+
- **Custom Snapshots**: Build your own snapshot formats using raw element data and utility functions
|
|
33
|
+
|
|
28
34
|
### General-Purpose Snapshots
|
|
29
35
|
|
|
30
36
|
The function `snapshotElement` provides a general-purpose snapshot including all supported roles and attributes. It can be used to achieve a high test coverage, but can become hard to read for complex HTML structures.
|
|
@@ -113,3 +119,13 @@ function transformToMarkdownTable(snapshot: Array<NodeSnapshot>): string {
|
|
|
113
119
|
// transform table snapshot to markdown table
|
|
114
120
|
}
|
|
115
121
|
```
|
|
122
|
+
|
|
123
|
+
#### Utility Functions for Custom Snapshots
|
|
124
|
+
|
|
125
|
+
| Function | Description |
|
|
126
|
+
| ---------------- | --------------------------------------------------------------------- |
|
|
127
|
+
| `filter` | Filters node snapshots based on the provided predicate function. |
|
|
128
|
+
| `filterByRole` | Filters node snapshots by the specified role. |
|
|
129
|
+
| `includeRole` | Includes only elements with the specified role. |
|
|
130
|
+
| `excludeRole` | Excludes elements with the specified role. |
|
|
131
|
+
| `getTextContent` | Aggregates and normalizes the text content of all provided snapshots. |
|
package/dist/browser-lib.iife.js
CHANGED
|
@@ -32,23 +32,28 @@
|
|
|
32
32
|
//#endregion
|
|
33
33
|
//#region src/utils/guards.ts
|
|
34
34
|
function isTextSnapshot(snapshot) {
|
|
35
|
-
return
|
|
35
|
+
return hasRole("text", snapshot);
|
|
36
|
+
}
|
|
37
|
+
function hasRole(role, snapshot) {
|
|
38
|
+
if (typeof role === "string") return role === snapshot.role;
|
|
39
|
+
return role.includes(snapshot.role);
|
|
36
40
|
}
|
|
37
41
|
|
|
38
42
|
//#endregion
|
|
39
|
-
//#region src/utils/
|
|
40
|
-
function
|
|
41
|
-
const {
|
|
43
|
+
//#region src/utils/filter.ts
|
|
44
|
+
function filter(options) {
|
|
45
|
+
const { predicate, snapshots, recurse = false } = options;
|
|
42
46
|
return snapshots.flatMap((snapshot) => {
|
|
43
|
-
const isFilteredIn =
|
|
47
|
+
const isFilteredIn = predicate(snapshot);
|
|
44
48
|
if (isFilteredIn && !recurse) return snapshot;
|
|
45
49
|
if (!isFilteredIn && recurse) return [];
|
|
46
|
-
const filteredChildren = hasChildren(snapshot) ?
|
|
47
|
-
|
|
50
|
+
const filteredChildren = hasChildren(snapshot) ? filter({
|
|
51
|
+
predicate,
|
|
48
52
|
snapshots: snapshot.children ?? [],
|
|
49
53
|
recurse
|
|
50
54
|
}) : [];
|
|
51
55
|
if (!isFilteredIn) return filteredChildren;
|
|
56
|
+
if (isTextSnapshot(snapshot)) return snapshot;
|
|
52
57
|
return {
|
|
53
58
|
...snapshot,
|
|
54
59
|
children: filteredChildren
|
|
@@ -59,6 +64,21 @@
|
|
|
59
64
|
return "children" in snapshot && snapshot.children.length > 0;
|
|
60
65
|
}
|
|
61
66
|
|
|
67
|
+
//#endregion
|
|
68
|
+
//#region src/utils/text.ts
|
|
69
|
+
/**
|
|
70
|
+
* Aggregates and normalizes the text content of all provided snapshots
|
|
71
|
+
*/
|
|
72
|
+
function getTextContent(snapshots) {
|
|
73
|
+
return normalizeText(filter({
|
|
74
|
+
snapshots,
|
|
75
|
+
predicate: isTextSnapshot
|
|
76
|
+
}).map((textNode) => textNode.name).join(" "));
|
|
77
|
+
}
|
|
78
|
+
function normalizeText(text) {
|
|
79
|
+
return text.replaceAll(/\s+/g, " ").trim();
|
|
80
|
+
}
|
|
81
|
+
|
|
62
82
|
//#endregion
|
|
63
83
|
//#region src/browser/text.ts
|
|
64
84
|
function snapshotTextNode(textNode) {
|
|
@@ -81,14 +101,8 @@
|
|
|
81
101
|
function resolveAccessibleTextContent(node, excludedNodes = []) {
|
|
82
102
|
const children = snapshotChildren(node, excludedNodes);
|
|
83
103
|
if (children === void 0) return;
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
filter: isTextSnapshot
|
|
87
|
-
}).map((textNode) => textNode.name).join(" "));
|
|
88
|
-
return normalizedText.length > 0 ? normalizedText : void 0;
|
|
89
|
-
}
|
|
90
|
-
function normalizeText(text) {
|
|
91
|
-
return text.replaceAll(/\s+/g, " ").trim();
|
|
104
|
+
const textContent = getTextContent(children);
|
|
105
|
+
return textContent.length > 0 ? textContent : void 0;
|
|
92
106
|
}
|
|
93
107
|
|
|
94
108
|
//#endregion
|
|
@@ -641,7 +655,7 @@
|
|
|
641
655
|
|
|
642
656
|
//#endregion
|
|
643
657
|
//#region src/browser/table.ts
|
|
644
|
-
const
|
|
658
|
+
const SORT_TYPES = new Set([
|
|
645
659
|
"ascending",
|
|
646
660
|
"descending",
|
|
647
661
|
"other"
|
|
@@ -650,7 +664,7 @@
|
|
|
650
664
|
return {
|
|
651
665
|
role: "columnheader",
|
|
652
666
|
name: resolveAccessibleName(element),
|
|
653
|
-
attributes: { sort: enumAttribute(element.ariaSort,
|
|
667
|
+
attributes: { sort: enumAttribute(element.ariaSort, SORT_TYPES) },
|
|
654
668
|
children: snapshotChildren(element)
|
|
655
669
|
};
|
|
656
670
|
}
|
package/dist/index.d.mts
CHANGED
|
@@ -102,10 +102,10 @@ interface TabAttributes extends DisableableAttributes, SelectableAttributes {}
|
|
|
102
102
|
//#region src/browser/table.d.ts
|
|
103
103
|
interface ColumnheaderSnapshot extends GenericElementSnapshot<"columnheader", ColumnheaderAttributes> {}
|
|
104
104
|
interface ColumnheaderAttributes {
|
|
105
|
-
sort?:
|
|
105
|
+
sort?: SortType;
|
|
106
106
|
}
|
|
107
|
-
declare const
|
|
108
|
-
type
|
|
107
|
+
declare const SORT_TYPES: Set<"ascending" | "descending" | "other">;
|
|
108
|
+
type SortType = SetValues<typeof SORT_TYPES>;
|
|
109
109
|
//#endregion
|
|
110
110
|
//#region src/browser/text.d.ts
|
|
111
111
|
interface TextSnapshot {
|
|
@@ -126,21 +126,64 @@ interface GenericElementSnapshot<TRole extends NodeRole = NodeRole, TAttributes
|
|
|
126
126
|
}
|
|
127
127
|
type SetValues<TSet> = TSet extends Set<infer TValue> ? TValue : never;
|
|
128
128
|
//#endregion
|
|
129
|
-
//#region src/
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
129
|
+
//#region src/playwright/markdown-table.d.ts
|
|
130
|
+
interface TableSnapshotOptions {
|
|
131
|
+
/**
|
|
132
|
+
* Show sort indicator for column headers
|
|
133
|
+
*
|
|
134
|
+
* @default true
|
|
135
|
+
*/
|
|
136
|
+
showSortIndicator?: boolean;
|
|
136
137
|
}
|
|
137
|
-
|
|
138
|
-
|
|
138
|
+
/**
|
|
139
|
+
* Creates a Markdown table snapshot from a table or grid element
|
|
140
|
+
*/
|
|
141
|
+
declare function markdownTableSnapshot(locator: Locator, options?: TableSnapshotOptions): Promise<string>;
|
|
142
|
+
//#endregion
|
|
143
|
+
//#region src/types/snapshot.d.ts
|
|
144
|
+
type SnapshotByRole<TRole extends NodeRole> = NodeSnapshot & {
|
|
145
|
+
role: TRole;
|
|
146
|
+
};
|
|
147
|
+
//#endregion
|
|
148
|
+
//#region src/utils/filter.d.ts
|
|
149
|
+
type FilterPredicate = (snapshot: NodeSnapshot) => boolean;
|
|
150
|
+
type GuardedFilterPredicate<TSnapshot extends NodeSnapshot> = (snapshot: NodeSnapshot) => snapshot is TSnapshot;
|
|
151
|
+
interface FilterOptions extends FilterBaseOptions {
|
|
152
|
+
/**
|
|
153
|
+
* Include only elements in the snapshot for which the specified predicate returns `true`
|
|
154
|
+
*/
|
|
155
|
+
predicate: FilterPredicate;
|
|
156
|
+
}
|
|
157
|
+
interface GuardedFilterOptions<TSnapshot extends NodeSnapshot> extends FilterBaseOptions {
|
|
158
|
+
/**
|
|
159
|
+
* Include only elements in the snapshot for which the specified predicate returns `true`
|
|
160
|
+
*/
|
|
161
|
+
predicate: GuardedFilterPredicate<TSnapshot>;
|
|
162
|
+
}
|
|
163
|
+
interface FilterBaseOptions {
|
|
164
|
+
/**
|
|
165
|
+
* Array of snapshots to filter.
|
|
166
|
+
*/
|
|
139
167
|
snapshots: Array<NodeSnapshot>;
|
|
168
|
+
/**
|
|
169
|
+
* Recursively apply specified filter to children of filtered elements
|
|
170
|
+
*
|
|
171
|
+
* By default, recursion ends when the filter returns `true` for an element.
|
|
172
|
+
* Should be `true` for filters intended to remove specific elements recursively.
|
|
173
|
+
*
|
|
174
|
+
* @default false
|
|
175
|
+
*/
|
|
140
176
|
recurse?: boolean;
|
|
141
177
|
}
|
|
142
|
-
|
|
143
|
-
|
|
178
|
+
/**
|
|
179
|
+
* Filters node snapshots based on the provided predicate function
|
|
180
|
+
*/
|
|
181
|
+
declare function filter<TSnapshot extends NodeSnapshot = NodeSnapshot>(options: GuardedFilterOptions<TSnapshot>): Array<TSnapshot>;
|
|
182
|
+
declare function filter(options: FilterOptions): Array<NodeSnapshot>;
|
|
183
|
+
/**
|
|
184
|
+
* Filters node snapshots by a specific role
|
|
185
|
+
*/
|
|
186
|
+
declare function filterByRole<TRole extends NodeRole>(role: TRole, snapshots: Array<NodeSnapshot>): Array<SnapshotByRole<TRole>>;
|
|
144
187
|
//#endregion
|
|
145
188
|
//#region src/playwright/snapshot.d.ts
|
|
146
189
|
interface ElementSnapshotOptions {
|
|
@@ -149,7 +192,7 @@ interface ElementSnapshotOptions {
|
|
|
149
192
|
*
|
|
150
193
|
* @default () => true
|
|
151
194
|
*/
|
|
152
|
-
filter?:
|
|
195
|
+
filter?: FilterPredicate;
|
|
153
196
|
/**
|
|
154
197
|
* Recursively apply specified filter to children of filtered elements
|
|
155
198
|
*
|
|
@@ -185,4 +228,20 @@ declare function snapshotElement(locator: Locator, options?: ElementSnapshotOpti
|
|
|
185
228
|
*/
|
|
186
229
|
declare function snapshotElementRaw(locator: Locator): Promise<Array<NodeSnapshot>>;
|
|
187
230
|
//#endregion
|
|
188
|
-
|
|
231
|
+
//#region src/utils/predicates.d.ts
|
|
232
|
+
/**
|
|
233
|
+
* Include only elements with the specified role
|
|
234
|
+
*/
|
|
235
|
+
declare function includeRole<TRole extends NodeRole>(role: TRole | Array<TRole>): GuardedFilterPredicate<SnapshotByRole<TRole>>;
|
|
236
|
+
/**
|
|
237
|
+
* Exclude elements with the specified role
|
|
238
|
+
*/
|
|
239
|
+
declare function excludeRole<TRole extends NodeRole>(role: TRole | Array<TRole>): GuardedFilterPredicate<SnapshotByRole<TRole>>;
|
|
240
|
+
//#endregion
|
|
241
|
+
//#region src/utils/text.d.ts
|
|
242
|
+
/**
|
|
243
|
+
* Aggregates and normalizes the text content of all provided snapshots
|
|
244
|
+
*/
|
|
245
|
+
declare function getTextContent(snapshots: Array<NodeSnapshot>): string;
|
|
246
|
+
//#endregion
|
|
247
|
+
export { type ButtonSnapshot, type ColumnheaderSnapshot, type ComboboxSnapshot, type ContainerSnapshot, type DialogSnapshot, type ElementRole, type ElementSnapshot, type GroupSnapshot, type HeadingSnapshot, type ImageSnapshot, type InputSnapshot, type LinkSnapshot, type MenuitemSnapshot, type NodeRole, type NodeSnapshot, type OptionSnapshot, type ProgressbarSnapshot, type RadiogroupSnapshot, type SeparatorSnapshot, type TabSnapshot, type TextSnapshot, excludeRole, filter, filterByRole, getTextContent, includeRole, markdownTableSnapshot, snapshotElement, snapshotElementRaw };
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,86 @@
|
|
|
1
|
+
import { markdownTable } from "markdown-table";
|
|
1
2
|
import path from "node:path";
|
|
2
3
|
import { packageDirectory } from "package-directory";
|
|
3
4
|
|
|
5
|
+
//#region src/utils/guards.ts
|
|
6
|
+
function isTextSnapshot(snapshot) {
|
|
7
|
+
return hasRole("text", snapshot);
|
|
8
|
+
}
|
|
9
|
+
function hasRole(role, snapshot) {
|
|
10
|
+
if (typeof role === "string") return role === snapshot.role;
|
|
11
|
+
return role.includes(snapshot.role);
|
|
12
|
+
}
|
|
13
|
+
function isEmpty(value) {
|
|
14
|
+
if (typeof value === "string" || Array.isArray(value)) return value.length === 0;
|
|
15
|
+
return Object.keys(value).length === 0;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region src/utils/predicates.ts
|
|
20
|
+
/**
|
|
21
|
+
* Include only elements with the specified role
|
|
22
|
+
*/
|
|
23
|
+
function includeRole(role) {
|
|
24
|
+
return (snapshot) => hasRole(role, snapshot);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Exclude elements with the specified role
|
|
28
|
+
*/
|
|
29
|
+
function excludeRole(role) {
|
|
30
|
+
return (snapshot) => !hasRole(role, snapshot);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
//#endregion
|
|
34
|
+
//#region src/utils/filter.ts
|
|
35
|
+
function filter(options) {
|
|
36
|
+
const { predicate, snapshots, recurse = false } = options;
|
|
37
|
+
return snapshots.flatMap((snapshot) => {
|
|
38
|
+
const isFilteredIn = predicate(snapshot);
|
|
39
|
+
if (isFilteredIn && !recurse) return snapshot;
|
|
40
|
+
if (!isFilteredIn && recurse) return [];
|
|
41
|
+
const filteredChildren = hasChildren(snapshot) ? filter({
|
|
42
|
+
predicate,
|
|
43
|
+
snapshots: snapshot.children ?? [],
|
|
44
|
+
recurse
|
|
45
|
+
}) : [];
|
|
46
|
+
if (!isFilteredIn) return filteredChildren;
|
|
47
|
+
if (isTextSnapshot(snapshot)) return snapshot;
|
|
48
|
+
return {
|
|
49
|
+
...snapshot,
|
|
50
|
+
children: filteredChildren
|
|
51
|
+
};
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Filters node snapshots by a specific role
|
|
56
|
+
*/
|
|
57
|
+
function filterByRole(role, snapshots) {
|
|
58
|
+
return filter({
|
|
59
|
+
predicate: includeRole(role),
|
|
60
|
+
recurse: false,
|
|
61
|
+
snapshots
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
function hasChildren(snapshot) {
|
|
65
|
+
return "children" in snapshot && snapshot.children.length > 0;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region src/utils/text.ts
|
|
70
|
+
/**
|
|
71
|
+
* Aggregates and normalizes the text content of all provided snapshots
|
|
72
|
+
*/
|
|
73
|
+
function getTextContent(snapshots) {
|
|
74
|
+
return normalizeText(filter({
|
|
75
|
+
snapshots,
|
|
76
|
+
predicate: isTextSnapshot
|
|
77
|
+
}).map((textNode) => textNode.name).join(" "));
|
|
78
|
+
}
|
|
79
|
+
function normalizeText(text) {
|
|
80
|
+
return text.replaceAll(/\s+/g, " ").trim();
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
//#endregion
|
|
4
84
|
//#region src/playwright/proxy.ts
|
|
5
85
|
var ElementSnapshotProxy = class {
|
|
6
86
|
page;
|
|
@@ -28,40 +108,6 @@ var ElementSnapshotProxy = class {
|
|
|
28
108
|
}
|
|
29
109
|
};
|
|
30
110
|
|
|
31
|
-
//#endregion
|
|
32
|
-
//#region src/utils/guards.ts
|
|
33
|
-
function isTextSnapshot(snapshot) {
|
|
34
|
-
return snapshot.role === "text";
|
|
35
|
-
}
|
|
36
|
-
function isEmpty(value) {
|
|
37
|
-
if (typeof value === "string" || Array.isArray(value)) return value.length === 0;
|
|
38
|
-
return Object.keys(value).length === 0;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
//#endregion
|
|
42
|
-
//#region src/utils/snapshot.ts
|
|
43
|
-
function filterSnapshots(options) {
|
|
44
|
-
const { filter, snapshots, recurse = false } = options;
|
|
45
|
-
return snapshots.flatMap((snapshot) => {
|
|
46
|
-
const isFilteredIn = filter(snapshot);
|
|
47
|
-
if (isFilteredIn && !recurse) return snapshot;
|
|
48
|
-
if (!isFilteredIn && recurse) return [];
|
|
49
|
-
const filteredChildren = hasChildren(snapshot) ? filterSnapshots({
|
|
50
|
-
filter,
|
|
51
|
-
snapshots: snapshot.children ?? [],
|
|
52
|
-
recurse
|
|
53
|
-
}) : [];
|
|
54
|
-
if (!isFilteredIn) return filteredChildren;
|
|
55
|
-
return {
|
|
56
|
-
...snapshot,
|
|
57
|
-
children: filteredChildren
|
|
58
|
-
};
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
function hasChildren(snapshot) {
|
|
62
|
-
return "children" in snapshot && snapshot.children.length > 0;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
111
|
//#endregion
|
|
66
112
|
//#region src/playwright/transformer.ts
|
|
67
113
|
var ElementSnapshotTransformer = class {
|
|
@@ -81,8 +127,8 @@ var ElementSnapshotTransformer = class {
|
|
|
81
127
|
}
|
|
82
128
|
filterSnapshots(snapshots) {
|
|
83
129
|
if (this.filter === void 0) return snapshots;
|
|
84
|
-
return
|
|
85
|
-
|
|
130
|
+
return filter({
|
|
131
|
+
predicate: this.filter,
|
|
86
132
|
snapshots,
|
|
87
133
|
recurse: this.recurseFilter
|
|
88
134
|
});
|
|
@@ -188,4 +234,55 @@ async function snapshotElementRaw(locator) {
|
|
|
188
234
|
}
|
|
189
235
|
|
|
190
236
|
//#endregion
|
|
191
|
-
|
|
237
|
+
//#region src/playwright/markdown-table.ts
|
|
238
|
+
const tableRoles = ["table", "grid"];
|
|
239
|
+
const cellRoles = [
|
|
240
|
+
"rowheader",
|
|
241
|
+
"cell",
|
|
242
|
+
"gridcell"
|
|
243
|
+
];
|
|
244
|
+
const sortIndicators = {
|
|
245
|
+
ascending: "⯅",
|
|
246
|
+
descending: "⯆",
|
|
247
|
+
other: "⯁"
|
|
248
|
+
};
|
|
249
|
+
/**
|
|
250
|
+
* Creates a Markdown table snapshot from a table or grid element
|
|
251
|
+
*/
|
|
252
|
+
async function markdownTableSnapshot(locator, options = {}) {
|
|
253
|
+
const { columnHeaders, rows } = parseTable(await snapshotElementRaw(locator), options);
|
|
254
|
+
return markdownTable([columnHeaders, ...rows]);
|
|
255
|
+
}
|
|
256
|
+
function parseTable(snapshot, options) {
|
|
257
|
+
const { showSortIndicator = true } = options;
|
|
258
|
+
const tableOrGridResult = filter({
|
|
259
|
+
predicate: includeRole(tableRoles),
|
|
260
|
+
snapshots: snapshot
|
|
261
|
+
});
|
|
262
|
+
if (tableOrGridResult.length > 1) throw new Error("Multiple tables or grids found");
|
|
263
|
+
const [tableOrGrid] = tableOrGridResult;
|
|
264
|
+
if (tableOrGrid === void 0) throw new Error("No table or grid found");
|
|
265
|
+
const [headerRow, ...bodyRows] = filterByRole("row", tableOrGrid.children);
|
|
266
|
+
if (headerRow === void 0) throw new Error("No header row found");
|
|
267
|
+
const columnHeaders = filterByRole("columnheader", headerRow.children);
|
|
268
|
+
if (columnHeaders.length === 0) throw new Error("No column headers found");
|
|
269
|
+
return {
|
|
270
|
+
columnHeaders: columnHeaders.map((columnHeader) => getColumnHeaderText(columnHeader, showSortIndicator)),
|
|
271
|
+
rows: bodyRows.map(getCellTexts)
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
function getColumnHeaderText(columnHeader, showSortIndicator) {
|
|
275
|
+
const headerText = getTextContent([columnHeader]);
|
|
276
|
+
const sortType = columnHeader.attributes.sort;
|
|
277
|
+
if (!showSortIndicator || sortType === void 0) return headerText;
|
|
278
|
+
return `${headerText} ${sortIndicators[sortType]}`;
|
|
279
|
+
}
|
|
280
|
+
function getCellTexts(row) {
|
|
281
|
+
return filter({
|
|
282
|
+
predicate: includeRole(cellRoles),
|
|
283
|
+
snapshots: row.children
|
|
284
|
+
}).map((cell) => getTextContent(cell.children));
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
//#endregion
|
|
288
|
+
export { excludeRole, filter, filterByRole, getTextContent, includeRole, markdownTableSnapshot, snapshotElement, snapshotElementRaw };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cronn/element-snapshot",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.1",
|
|
4
4
|
"description": "Element snapshots for Playwright",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/cronn/file-snapshots/issues"
|
|
@@ -40,26 +40,29 @@
|
|
|
40
40
|
"dist"
|
|
41
41
|
],
|
|
42
42
|
"dependencies": {
|
|
43
|
+
"markdown-table": "3.0.4",
|
|
43
44
|
"package-directory": "8.2.0"
|
|
44
45
|
},
|
|
45
46
|
"devDependencies": {
|
|
46
47
|
"@arethetypeswrong/core": "0.18.2",
|
|
47
48
|
"@playwright/test": "1.58.2",
|
|
48
49
|
"@trivago/prettier-plugin-sort-imports": "6.0.2",
|
|
49
|
-
"@
|
|
50
|
-
"@
|
|
50
|
+
"@types/node": "24.11.0",
|
|
51
|
+
"@typescript/native-preview": "7.0.0-dev.20260302.1",
|
|
51
52
|
"@vitest/coverage-v8": "4.0.18",
|
|
52
|
-
"eslint": "10.0.
|
|
53
|
+
"eslint": "10.0.2",
|
|
53
54
|
"eslint-config-prettier": "10.1.8",
|
|
55
|
+
"eslint-plugin-check-file": "3.3.1",
|
|
54
56
|
"eslint-plugin-unused-imports": "4.4.1",
|
|
55
57
|
"prettier": "3.8.1",
|
|
56
|
-
"publint": "0.3.
|
|
58
|
+
"publint": "0.3.18",
|
|
57
59
|
"tsdown": "0.20.3",
|
|
58
|
-
"typescript-eslint": "8.56.
|
|
60
|
+
"typescript-eslint": "8.56.1",
|
|
59
61
|
"vitest": "4.0.18",
|
|
60
|
-
"@cronn/playwright-file-snapshots": "1.0.
|
|
61
|
-
"@cronn/
|
|
62
|
-
"@cronn/
|
|
62
|
+
"@cronn/playwright-file-snapshots": "1.0.1",
|
|
63
|
+
"@cronn/test-utils": "0.0.0",
|
|
64
|
+
"@cronn/vitest-file-snapshots": "1.0.1",
|
|
65
|
+
"@cronn/shared-configs": "0.0.0"
|
|
63
66
|
},
|
|
64
67
|
"peerDependencies": {
|
|
65
68
|
"@playwright/test": "^1.55"
|