@healflow/playwright 0.1.1 → 0.1.3

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.
Files changed (165) hide show
  1. package/README.md +38 -21
  2. package/dist/index.d.ts +2 -22
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +4 -691
  5. package/dist/index.js.map +1 -1
  6. package/dist/plugin/classification.d.ts +6 -0
  7. package/dist/plugin/classification.d.ts.map +1 -0
  8. package/dist/plugin/classification.js +343 -0
  9. package/dist/plugin/classification.js.map +1 -0
  10. package/dist/plugin/constants.d.ts +5 -0
  11. package/dist/plugin/constants.d.ts.map +1 -0
  12. package/dist/plugin/constants.js +55 -0
  13. package/dist/plugin/constants.js.map +1 -0
  14. package/dist/plugin/heal-emit.d.ts +5 -0
  15. package/dist/plugin/heal-emit.d.ts.map +1 -0
  16. package/dist/plugin/heal-emit.js +69 -0
  17. package/dist/plugin/heal-emit.js.map +1 -0
  18. package/dist/plugin/index.d.ts +5 -0
  19. package/dist/plugin/index.d.ts.map +1 -0
  20. package/dist/plugin/index.js +11 -0
  21. package/dist/plugin/index.js.map +1 -0
  22. package/dist/plugin/locator-wrap.d.ts +4 -0
  23. package/dist/plugin/locator-wrap.d.ts.map +1 -0
  24. package/dist/plugin/locator-wrap.js +68 -0
  25. package/dist/plugin/locator-wrap.js.map +1 -0
  26. package/dist/plugin/options.d.ts +3 -0
  27. package/dist/plugin/options.d.ts.map +1 -0
  28. package/dist/plugin/options.js +25 -0
  29. package/dist/plugin/options.js.map +1 -0
  30. package/dist/plugin/page-wrap.d.ts +9 -0
  31. package/dist/plugin/page-wrap.d.ts.map +1 -0
  32. package/dist/plugin/page-wrap.js +99 -0
  33. package/dist/plugin/page-wrap.js.map +1 -0
  34. package/dist/plugin/types.d.ts +19 -0
  35. package/dist/plugin/types.d.ts.map +1 -0
  36. package/dist/plugin/types.js +3 -0
  37. package/dist/plugin/types.js.map +1 -0
  38. package/dist/report-html/build.d.ts +7 -0
  39. package/dist/report-html/build.d.ts.map +1 -0
  40. package/dist/report-html/build.js +138 -0
  41. package/dist/report-html/build.js.map +1 -0
  42. package/dist/report-html/format.d.ts +6 -0
  43. package/dist/report-html/format.d.ts.map +1 -0
  44. package/dist/report-html/format.js +37 -0
  45. package/dist/report-html/format.js.map +1 -0
  46. package/dist/report-html/icons.d.ts +4 -0
  47. package/dist/report-html/icons.d.ts.map +1 -0
  48. package/dist/report-html/icons.js +7 -0
  49. package/dist/report-html/icons.js.map +1 -0
  50. package/dist/report-html/index.d.ts +3 -0
  51. package/dist/report-html/index.d.ts.map +1 -0
  52. package/dist/report-html/index.js +6 -0
  53. package/dist/report-html/index.js.map +1 -0
  54. package/dist/report-html/render.d.ts +6 -0
  55. package/dist/report-html/render.d.ts.map +1 -0
  56. package/dist/report-html/render.js +139 -0
  57. package/dist/report-html/render.js.map +1 -0
  58. package/dist/report-html/script.d.ts +2 -0
  59. package/dist/report-html/script.d.ts.map +1 -0
  60. package/dist/report-html/script.js +75 -0
  61. package/dist/report-html/script.js.map +1 -0
  62. package/dist/report-html/status.d.ts +2 -0
  63. package/dist/report-html/status.d.ts.map +1 -0
  64. package/dist/report-html/status.js +13 -0
  65. package/dist/report-html/status.js.map +1 -0
  66. package/dist/report-html/styles.d.ts +2 -0
  67. package/dist/report-html/styles.d.ts.map +1 -0
  68. package/dist/report-html/styles.js +441 -0
  69. package/dist/report-html/styles.js.map +1 -0
  70. package/dist/report-html/tree.d.ts +8 -0
  71. package/dist/report-html/tree.d.ts.map +1 -0
  72. package/dist/report-html/tree.js +57 -0
  73. package/dist/report-html/tree.js.map +1 -0
  74. package/dist/report-html/types.d.ts +19 -0
  75. package/dist/report-html/types.d.ts.map +1 -0
  76. package/dist/report-html/types.js +3 -0
  77. package/dist/report-html/types.js.map +1 -0
  78. package/dist/report-html.d.ts +2 -6
  79. package/dist/report-html.d.ts.map +1 -1
  80. package/dist/report-html.js +3 -859
  81. package/dist/report-html.js.map +1 -1
  82. package/dist/runtime-ladder.d.ts +17 -0
  83. package/dist/runtime-ladder.d.ts.map +1 -0
  84. package/dist/runtime-ladder.js +61 -0
  85. package/dist/runtime-ladder.js.map +1 -0
  86. package/dist/runtime-techniques/heal-helpers.d.ts +10 -0
  87. package/dist/runtime-techniques/heal-helpers.d.ts.map +1 -0
  88. package/dist/runtime-techniques/heal-helpers.js +304 -0
  89. package/dist/runtime-techniques/heal-helpers.js.map +1 -0
  90. package/dist/runtime-techniques/index.d.ts +11 -0
  91. package/dist/runtime-techniques/index.d.ts.map +1 -0
  92. package/dist/runtime-techniques/index.js +34 -0
  93. package/dist/runtime-techniques/index.js.map +1 -0
  94. package/dist/runtime-techniques/registry.d.ts +5 -0
  95. package/dist/runtime-techniques/registry.d.ts.map +1 -0
  96. package/dist/runtime-techniques/registry.js +29 -0
  97. package/dist/runtime-techniques/registry.js.map +1 -0
  98. package/dist/runtime-techniques/shared/constants.d.ts +4 -0
  99. package/dist/runtime-techniques/shared/constants.d.ts.map +1 -0
  100. package/dist/runtime-techniques/shared/constants.js +7 -0
  101. package/dist/runtime-techniques/shared/constants.js.map +1 -0
  102. package/dist/runtime-techniques/shared/error-utils.d.ts +9 -0
  103. package/dist/runtime-techniques/shared/error-utils.d.ts.map +1 -0
  104. package/dist/runtime-techniques/shared/error-utils.js +27 -0
  105. package/dist/runtime-techniques/shared/error-utils.js.map +1 -0
  106. package/dist/runtime-techniques/shared/heal-alternate.d.ts +6 -0
  107. package/dist/runtime-techniques/shared/heal-alternate.d.ts.map +1 -0
  108. package/dist/runtime-techniques/shared/heal-alternate.js +130 -0
  109. package/dist/runtime-techniques/shared/heal-alternate.js.map +1 -0
  110. package/dist/runtime-techniques/shared/heal-candidates.d.ts +11 -0
  111. package/dist/runtime-techniques/shared/heal-candidates.d.ts.map +1 -0
  112. package/dist/runtime-techniques/shared/heal-candidates.js +127 -0
  113. package/dist/runtime-techniques/shared/heal-candidates.js.map +1 -0
  114. package/dist/runtime-techniques/shared/heal-history.d.ts +10 -0
  115. package/dist/runtime-techniques/shared/heal-history.d.ts.map +1 -0
  116. package/dist/runtime-techniques/shared/heal-history.js +42 -0
  117. package/dist/runtime-techniques/shared/heal-history.js.map +1 -0
  118. package/dist/runtime-techniques/shared/locator-actions.d.ts +6 -0
  119. package/dist/runtime-techniques/shared/locator-actions.d.ts.map +1 -0
  120. package/dist/runtime-techniques/shared/locator-actions.js +66 -0
  121. package/dist/runtime-techniques/shared/locator-actions.js.map +1 -0
  122. package/dist/runtime-techniques/shared/page-waits.d.ts +6 -0
  123. package/dist/runtime-techniques/shared/page-waits.d.ts.map +1 -0
  124. package/dist/runtime-techniques/shared/page-waits.js +57 -0
  125. package/dist/runtime-techniques/shared/page-waits.js.map +1 -0
  126. package/dist/runtime-techniques/shared.d.ts +8 -0
  127. package/dist/runtime-techniques/shared.d.ts.map +1 -0
  128. package/dist/runtime-techniques/shared.js +24 -0
  129. package/dist/runtime-techniques/shared.js.map +1 -0
  130. package/dist/runtime-techniques/t0-retry.d.ts +4 -0
  131. package/dist/runtime-techniques/t0-retry.d.ts.map +1 -0
  132. package/dist/runtime-techniques/t0-retry.js +334 -0
  133. package/dist/runtime-techniques/t0-retry.js.map +1 -0
  134. package/dist/runtime-techniques/t1-scope.d.ts +4 -0
  135. package/dist/runtime-techniques/t1-scope.d.ts.map +1 -0
  136. package/dist/runtime-techniques/t1-scope.js +70 -0
  137. package/dist/runtime-techniques/t1-scope.js.map +1 -0
  138. package/dist/runtime-techniques/t2-normalize.d.ts +3 -0
  139. package/dist/runtime-techniques/t2-normalize.d.ts.map +1 -0
  140. package/dist/runtime-techniques/t2-normalize.js +12 -0
  141. package/dist/runtime-techniques/t2-normalize.js.map +1 -0
  142. package/dist/runtime-techniques/t3-fingerprint.d.ts +4 -0
  143. package/dist/runtime-techniques/t3-fingerprint.d.ts.map +1 -0
  144. package/dist/runtime-techniques/t3-fingerprint.js +13 -0
  145. package/dist/runtime-techniques/t3-fingerprint.js.map +1 -0
  146. package/dist/runtime-techniques/t4-trace.d.ts +4 -0
  147. package/dist/runtime-techniques/t4-trace.d.ts.map +1 -0
  148. package/dist/runtime-techniques/t4-trace.js +125 -0
  149. package/dist/runtime-techniques/t4-trace.js.map +1 -0
  150. package/dist/runtime-techniques/t5-history.d.ts +3 -0
  151. package/dist/runtime-techniques/t5-history.d.ts.map +1 -0
  152. package/dist/runtime-techniques/t5-history.js +50 -0
  153. package/dist/runtime-techniques/t5-history.js.map +1 -0
  154. package/dist/runtime-techniques/types.d.ts +36 -0
  155. package/dist/runtime-techniques/types.d.ts.map +1 -0
  156. package/dist/runtime-techniques/types.js +3 -0
  157. package/dist/runtime-techniques/types.js.map +1 -0
  158. package/dist/runtime-techniques.d.ts +2 -0
  159. package/dist/runtime-techniques.d.ts.map +1 -0
  160. package/dist/runtime-techniques.js +18 -0
  161. package/dist/runtime-techniques.js.map +1 -0
  162. package/dist/terminal.d.ts.map +1 -1
  163. package/dist/terminal.js +52 -3
  164. package/dist/terminal.js.map +1 -1
  165. package/package.json +3 -3
package/README.md CHANGED
@@ -60,12 +60,12 @@ export const test = base.extend(healflowFixture());
60
60
 
61
61
  After each run, `.healflow/` contains:
62
62
 
63
- | File | Purpose |
64
- | ---- | ------- |
65
- | `report.html` | Human-readable heal summary |
66
- | `heals.json` | Runtime heals applied during the run |
67
- | `fixes.json` | AST fix proposals (dry-run) |
68
- | `run.json` | Full run metadata |
63
+ | File | Purpose |
64
+ | ------------- | ------------------------------------ |
65
+ | `report.html` | Human-readable heal summary |
66
+ | `heals.json` | Runtime heals applied during the run |
67
+ | `fixes.json` | AST fix proposals (dry-run) |
68
+ | `run.json` | Full run metadata |
69
69
 
70
70
  ## Configuration
71
71
 
@@ -80,6 +80,14 @@ healing:
80
80
  timing: true
81
81
  overlay: true
82
82
  iframe: true
83
+ shadowDom: true
84
+ auth: true
85
+ network: true
86
+ navigation: true
87
+ mobile: true
88
+ i18n: true
89
+ upload: true
90
+ multiTab: true
83
91
 
84
92
  # Optional cloud sync
85
93
  backend:
@@ -93,26 +101,35 @@ Environment variables: `HEALFLOW_API_URL`, `HEALFLOW_ORG_ID`, `HEALFLOW_REPO_ID`
93
101
 
94
102
  ## Exports
95
103
 
96
- | Subpath | Purpose |
97
- | ------- | ------- |
98
- | `@healflow/playwright` | `healflowFixture`, `wrapPage`, plugin options |
99
- | `@healflow/playwright/auto` | `withHealFlow()` config wrapper |
100
- | `@healflow/playwright/reporter` | Custom Playwright reporter |
101
- | `@healflow/playwright/setup-global` | Global setup hook |
104
+ | Subpath | Purpose |
105
+ | ----------------------------------- | --------------------------------------------- |
106
+ | `@healflow/playwright` | `healflowFixture`, `wrapPage`, plugin options |
107
+ | `@healflow/playwright/auto` | `withHealFlow()` config wrapper |
108
+ | `@healflow/playwright/reporter` | Custom Playwright reporter |
109
+ | `@healflow/playwright/setup-global` | Global setup hook |
102
110
 
103
111
  ## Runtime healing categories
104
112
 
105
- - **Selector** stale locators, `getByTestId` fallbacks
106
- - **Timing** — wait for element stability before retry
107
- - **Overlay** — dismiss cookie banners and modals
108
- - **Iframe / Shadow DOM** — context switching
109
- - **Auth / Session** — storage-state refresh (when configured)
113
+ HealFlow walks the **T0→T5 runtime ladder** on every healable locator/page action:
110
114
 
111
- Product bugs and assertion failures are never auto-fixed.
115
+ | Technique | Purpose |
116
+ | -------------- | ---------------------------------------------------------------- |
117
+ | T0 Retry | Condition-based waits (visibility, network idle, spinner hidden) |
118
+ | T1 Scope | Parent-chain scoping |
119
+ | T2 Normalize | Role / label / text strategy migration |
120
+ | T3 Fingerprint | DOM attribute & aria similarity |
121
+ | T4 Trace | Frame/shadow/navigation hints from Playwright error context |
122
+ | T5 History | Reuse prior heals from `.healflow/heals.json` |
123
+
124
+ **Categories enabled by default:** selector, timing, overlay, iframe, shadow DOM, auth/session, network, navigation, mobile, i18n, upload, multi-tab.
125
+
126
+ Each runtime heal records `matrixEntryId`, `succeededTechnique`, and `healMode` in `.healflow/heals.json`.
127
+
128
+ Product bugs and assertion **values** are never auto-fixed.
112
129
 
113
130
  ## Cloud sync (optional)
114
131
 
115
- When `backend` is configured, the reporter syncs heals to the HealFlow API after each run. See [`@healflow/cli`](../cli) for `healflow ingest`.
132
+ When `backend` is configured, the reporter syncs heals to the HealFlow API after each run. See [@healflow/cli](https://www.npmjs.com/package/@healflow/cli) for `healflow ingest`.
116
133
 
117
134
  ## Development
118
135
 
@@ -123,8 +140,8 @@ pnpm --filter @healflow/playwright typecheck
123
140
 
124
141
  ## Related packages
125
142
 
126
- - [`@healflow/cli`](../cli) — `healflow init`, `doctor`, `report`
127
- - [`@healflow/classification`](../classification) — runtime error classification
143
+ - [@healflow/cli](https://www.npmjs.com/package/@healflow/cli) — `healflow init`, `doctor`, `report`
144
+ - [@healflow/classification](https://www.npmjs.com/package/@healflow/classification) — runtime error classification
128
145
 
129
146
  ## License
130
147
 
package/dist/index.d.ts CHANGED
@@ -1,25 +1,5 @@
1
- import type { Page, TestInfo } from '@playwright/test';
2
- import { type HealFlowConfig } from '@healflow/shared';
3
- export interface HealFlowPluginOptions {
4
- autoHeal?: boolean;
5
- maxAttempts?: number;
6
- apiUrl?: string;
7
- organizationId?: string;
8
- repositoryId?: string;
9
- config?: HealFlowConfig;
10
- }
11
- export interface HealContext {
12
- attempts: number;
13
- healedActions: string[];
14
- testFile?: string;
15
- testTitle?: string;
16
- }
17
- export declare function wrapPage(page: Page, options?: HealFlowPluginOptions, healContext?: HealContext): Page;
18
- export declare function healflowFixture(options?: HealFlowPluginOptions): {
19
- page: ({ page }: {
20
- page: Page;
21
- }, use: (p: Page) => Promise<void>, testInfo: TestInfo) => Promise<void>;
22
- };
1
+ export type { HealFlowPluginOptions, HealContext } from './plugin/index.js';
2
+ export { wrapPage, healflowFixture } from './plugin/index.js';
23
3
  export { registerHealFlow } from './register.js';
24
4
  export { withHealFlow, configToPluginOptions } from './auto.js';
25
5
  export { healflowReporter } from './reporter.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"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