@letsrunit/playwright 0.7.0 → 0.8.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
@@ -15,7 +15,7 @@ declare function setFieldValue(el: Locator, value: Value, options?: SetOptions):
15
15
  declare function formatHtml(page: string | Page): Promise<string>;
16
16
 
17
17
  /**
18
- * Locates an element using Playwright selectors, with fallbacks.
18
+ * Locates an element using Playwright selectors, with lazy fallbacks.
19
19
  */
20
20
  declare function fuzzyLocator(page: Page, selector: string): Promise<Locator>;
21
21
 
@@ -63,7 +63,11 @@ interface PageInfo {
63
63
  screenshot?: File;
64
64
  }
65
65
 
66
- declare function snapshot(page: Page): Promise<Snapshot>;
66
+ type SnapshotOptions = {
67
+ /** Strip utility-framework classes (Tailwind, Bootstrap, UnoCSS, Windi) from the captured HTML. */
68
+ dropUtilityClasses?: boolean;
69
+ };
70
+ declare function snapshot(page: Page, opts?: SnapshotOptions): Promise<Snapshot>;
67
71
 
68
72
  declare function screenshotElement(page: Page, selector: string, options?: LocatorScreenshotOptions): Promise<File>;
69
73
  declare function screenshot(page: Page, options?: PageScreenshotOptions): Promise<File>;
@@ -123,6 +127,9 @@ type ScrubHtmlOptions = {
123
127
  replaceBrInHeadings?: boolean;
124
128
  /** Limit lists to max items: -1 mean no limit. Default: -1 */
125
129
  limitLists?: number;
130
+ /** Strip utility-framework classes (Tailwind, Bootstrap, UnoCSS, Windi) from class
131
+ * attributes. Removes the attribute entirely when all classes are stripped. Default: false */
132
+ dropUtilityClasses?: boolean;
126
133
  };
127
134
  declare function scrubHtml(page: {
128
135
  html: string;
@@ -136,4 +143,12 @@ declare function realScrubHtml({ html, url }: {
136
143
  url: string;
137
144
  }, opts?: ScrubHtmlOptions): Promise<string>;
138
145
 
139
- export { type PageInfo, type ScrubHtmlOptions, type Snapshot, browse, createDateEngine, createFieldEngine, formatDate, formatDateForInput, formatHtml, fuzzyLocator, getMonthNames, realScrubHtml, screenshot, screenshotElement, scrollToCenter, scrubHtml, setFieldValue, snapshot, suppressInterferences, waitAfterInteraction, waitForAnimationsToFinish, waitForDomIdle, waitForIdle, waitForMeta, waitForUrlChange, waitUntilEnabled };
146
+ declare function unifiedHtmlDiff(old: {
147
+ html: string;
148
+ url: string;
149
+ } | Page, current: {
150
+ html: string;
151
+ url: string;
152
+ } | Page): Promise<string>;
153
+
154
+ export { type PageInfo, type ScrubHtmlOptions, type Snapshot, type SnapshotOptions, browse, createDateEngine, createFieldEngine, formatDate, formatDateForInput, formatHtml, fuzzyLocator, getMonthNames, realScrubHtml, screenshot, screenshotElement, scrollToCenter, scrubHtml, setFieldValue, snapshot, suppressInterferences, unifiedHtmlDiff, waitAfterInteraction, waitForAnimationsToFinish, waitForDomIdle, waitForIdle, waitForMeta, waitForUrlChange, waitUntilEnabled };