@silasfmartins/testhub 1.0.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.
Files changed (296) hide show
  1. package/.github/copilot-instructions.md +520 -0
  2. package/biome.json +37 -0
  3. package/dist/index.d.ts +45 -0
  4. package/dist/index.js +169 -0
  5. package/dist/scripts/consumer-postinstall.d.ts +15 -0
  6. package/dist/scripts/consumer-postinstall.js +785 -0
  7. package/dist/scripts/generate-docs.d.ts +16 -0
  8. package/dist/scripts/generate-docs.js +1363 -0
  9. package/dist/scripts/generate-index.d.ts +2 -0
  10. package/dist/scripts/generate-index.js +314 -0
  11. package/dist/scripts/init-api.d.ts +2 -0
  12. package/dist/scripts/init-api.js +525 -0
  13. package/dist/scripts/init-banco.d.ts +2 -0
  14. package/dist/scripts/init-banco.js +347 -0
  15. package/dist/scripts/init-frontend.d.ts +2 -0
  16. package/dist/scripts/init-frontend.js +627 -0
  17. package/dist/scripts/init-mobile.d.ts +2 -0
  18. package/dist/scripts/init-mobile.js +481 -0
  19. package/dist/scripts/init-scenarios.d.ts +2 -0
  20. package/dist/scripts/init-scenarios.js +846 -0
  21. package/dist/scripts/init-ssh.d.ts +2 -0
  22. package/dist/scripts/init-ssh.js +639 -0
  23. package/dist/scripts/package-versions.d.ts +57 -0
  24. package/dist/scripts/package-versions.js +768 -0
  25. package/dist/scripts/postinstall.d.ts +1 -0
  26. package/dist/scripts/postinstall.js +527 -0
  27. package/dist/scripts/robust-build.d.ts +7 -0
  28. package/dist/scripts/robust-build.js +88 -0
  29. package/dist/scripts/setup-local-packages.d.ts +31 -0
  30. package/dist/scripts/setup-local-packages.js +237 -0
  31. package/dist/scripts/smart-override.d.ts +2 -0
  32. package/dist/scripts/smart-override.js +1360 -0
  33. package/dist/scripts/sync-configs.d.ts +27 -0
  34. package/dist/scripts/sync-configs.js +248 -0
  35. package/dist/scripts/test-biome-parse.d.ts +5 -0
  36. package/dist/scripts/test-biome-parse.js +84 -0
  37. package/dist/scripts/ultracite-setup.d.ts +4 -0
  38. package/dist/scripts/ultracite-setup.js +310 -0
  39. package/dist/scripts/update-all-init-scripts.d.ts +2 -0
  40. package/dist/scripts/update-all-init-scripts.js +52 -0
  41. package/dist/scripts/update-biome-schema.d.ts +15 -0
  42. package/dist/scripts/update-biome-schema.js +124 -0
  43. package/dist/src/AutoCoreFacade.d.ts +145 -0
  44. package/dist/src/AutoCoreFacade.js +217 -0
  45. package/dist/src/api/ApiActions.d.ts +297 -0
  46. package/dist/src/api/ApiActions.js +1905 -0
  47. package/dist/src/api/Certificate.d.ts +60 -0
  48. package/dist/src/api/Certificate.js +79 -0
  49. package/dist/src/api/JsonResponse.d.ts +116 -0
  50. package/dist/src/api/JsonResponse.js +206 -0
  51. package/dist/src/appium/DeviceFarmViewer.d.ts +79 -0
  52. package/dist/src/appium/DeviceFarmViewer.js +1083 -0
  53. package/dist/src/appium/MobileActions.d.ts +347 -0
  54. package/dist/src/appium/MobileActions.js +1632 -0
  55. package/dist/src/appium/MobileConnection.d.ts +160 -0
  56. package/dist/src/appium/MobileConnection.js +772 -0
  57. package/dist/src/config/envLoader.d.ts +123 -0
  58. package/dist/src/config/envLoader.js +361 -0
  59. package/dist/src/config/jest-safe-setup.d.ts +19 -0
  60. package/dist/src/config/jest-safe-setup.js +369 -0
  61. package/dist/src/config/timeouts.d.ts +32 -0
  62. package/dist/src/config/timeouts.js +38 -0
  63. package/dist/src/desktop/DesktopActions.d.ts +46 -0
  64. package/dist/src/desktop/DesktopActions.js +398 -0
  65. package/dist/src/desktop/DesktopConnection.d.ts +32 -0
  66. package/dist/src/desktop/DesktopConnection.js +84 -0
  67. package/dist/src/domain/entities/TestExecution.d.ts +117 -0
  68. package/dist/src/domain/entities/TestExecution.js +150 -0
  69. package/dist/src/domain/entities/TestReport.d.ts +114 -0
  70. package/dist/src/domain/entities/TestReport.js +179 -0
  71. package/dist/src/domain/repositories/ITestRepository.d.ts +196 -0
  72. package/dist/src/domain/repositories/ITestRepository.js +14 -0
  73. package/dist/src/domain/schemas/ValidationSchemas.d.ts +159 -0
  74. package/dist/src/domain/schemas/ValidationSchemas.js +181 -0
  75. package/dist/src/functions/errors/BaseError.d.ts +78 -0
  76. package/dist/src/functions/errors/BaseError.js +245 -0
  77. package/dist/src/functions/errors/ConfigurationError.d.ts +16 -0
  78. package/dist/src/functions/errors/ConfigurationError.js +48 -0
  79. package/dist/src/functions/errors/ErrorCatalog.d.ts +148 -0
  80. package/dist/src/functions/errors/ErrorCatalog.js +157 -0
  81. package/dist/src/functions/errors/GlobalErrorHandler.d.ts +101 -0
  82. package/dist/src/functions/errors/GlobalErrorHandler.js +281 -0
  83. package/dist/src/functions/errors/IntegrationError.d.ts +17 -0
  84. package/dist/src/functions/errors/IntegrationError.js +51 -0
  85. package/dist/src/functions/errors/SecurityError.d.ts +14 -0
  86. package/dist/src/functions/errors/SecurityError.js +42 -0
  87. package/dist/src/functions/errors/SystemError.d.ts +12 -0
  88. package/dist/src/functions/errors/SystemError.js +36 -0
  89. package/dist/src/functions/errors/ValidationError.d.ts +14 -0
  90. package/dist/src/functions/errors/ValidationError.js +61 -0
  91. package/dist/src/functions/errors/index.d.ts +12 -0
  92. package/dist/src/functions/errors/index.js +13 -0
  93. package/dist/src/global-setup.d.ts +1 -0
  94. package/dist/src/global-setup.js +1037 -0
  95. package/dist/src/helpers/BancoActions.d.ts +188 -0
  96. package/dist/src/helpers/BancoActions.js +581 -0
  97. package/dist/src/helpers/EnviromentHelper.d.ts +17 -0
  98. package/dist/src/helpers/EnviromentHelper.js +66 -0
  99. package/dist/src/helpers/ParallelExecutionHelper.d.ts +183 -0
  100. package/dist/src/helpers/ParallelExecutionHelper.js +375 -0
  101. package/dist/src/helpers/SyncSignal.d.ts +15 -0
  102. package/dist/src/helpers/SyncSignal.js +44 -0
  103. package/dist/src/hubdocs/CategoryDetector.d.ts +83 -0
  104. package/dist/src/hubdocs/CategoryDetector.js +401 -0
  105. package/dist/src/hubdocs/DirectStatementInterceptor.d.ts +54 -0
  106. package/dist/src/hubdocs/DirectStatementInterceptor.js +243 -0
  107. package/dist/src/hubdocs/ExecutionTracker.d.ts +107 -0
  108. package/dist/src/hubdocs/ExecutionTracker.js +702 -0
  109. package/dist/src/hubdocs/HubDocs.d.ts +395 -0
  110. package/dist/src/hubdocs/HubDocs.js +3586 -0
  111. package/dist/src/hubdocs/StatementMethodFilter.d.ts +71 -0
  112. package/dist/src/hubdocs/StatementMethodFilter.js +618 -0
  113. package/dist/src/hubdocs/StatementTracker.d.ts +417 -0
  114. package/dist/src/hubdocs/StatementTracker.js +2419 -0
  115. package/dist/src/hubdocs/SwaggerGenerator.d.ts +59 -0
  116. package/dist/src/hubdocs/SwaggerGenerator.js +405 -0
  117. package/dist/src/hubdocs/index.d.ts +9 -0
  118. package/dist/src/hubdocs/index.js +9 -0
  119. package/dist/src/hubdocs/types.d.ts +114 -0
  120. package/dist/src/hubdocs/types.js +5 -0
  121. package/dist/src/infrastructure/DependencyContainer.d.ts +142 -0
  122. package/dist/src/infrastructure/DependencyContainer.js +250 -0
  123. package/dist/src/infrastructure/adapters/AppiumAdapter.d.ts +168 -0
  124. package/dist/src/infrastructure/adapters/AppiumAdapter.js +468 -0
  125. package/dist/src/infrastructure/adapters/OracleAdapter.d.ts +150 -0
  126. package/dist/src/infrastructure/adapters/OracleAdapter.js +388 -0
  127. package/dist/src/infrastructure/adapters/PlaywrightAdapter.d.ts +192 -0
  128. package/dist/src/infrastructure/adapters/PlaywrightAdapter.js +382 -0
  129. package/dist/src/infrastructure/adapters/SSHAdapter.d.ts +141 -0
  130. package/dist/src/infrastructure/adapters/SSHAdapter.js +428 -0
  131. package/dist/src/interfaces.d.ts +501 -0
  132. package/dist/src/interfaces.js +25 -0
  133. package/dist/src/internal/fakes/__fake-actions__.d.ts +17 -0
  134. package/dist/src/internal/fakes/__fake-actions__.js +21 -0
  135. package/dist/src/internal/fakes/__forbidden__.d.ts +10 -0
  136. package/dist/src/internal/fakes/__forbidden__.js +18 -0
  137. package/dist/src/internal/fakes/__honeypot__.d.ts +15 -0
  138. package/dist/src/internal/fakes/__honeypot__.js +24 -0
  139. package/dist/src/octane/OctaneReporter.d.ts +13 -0
  140. package/dist/src/octane/OctaneReporter.js +61 -0
  141. package/dist/src/playwright/CryptoActions.d.ts +20 -0
  142. package/dist/src/playwright/CryptoActions.js +75 -0
  143. package/dist/src/playwright/EnhancedWebActions.d.ts +7 -0
  144. package/dist/src/playwright/EnhancedWebActions.js +65 -0
  145. package/dist/src/playwright/WebActions.d.ts +1599 -0
  146. package/dist/src/playwright/WebActions.js +11788 -0
  147. package/dist/src/playwright/actions/ActionTimeline.d.ts +36 -0
  148. package/dist/src/playwright/actions/ActionTimeline.js +101 -0
  149. package/dist/src/playwright/actions/RecoveryQueue.d.ts +82 -0
  150. package/dist/src/playwright/actions/RecoveryQueue.js +130 -0
  151. package/dist/src/playwright/actions/SelectorCache.d.ts +53 -0
  152. package/dist/src/playwright/actions/SelectorCache.js +96 -0
  153. package/dist/src/playwright/actions/index.d.ts +13 -0
  154. package/dist/src/playwright/actions/index.js +14 -0
  155. package/dist/src/playwright/actions/types.d.ts +147 -0
  156. package/dist/src/playwright/actions/types.js +5 -0
  157. package/dist/src/playwright/fixtures.d.ts +112 -0
  158. package/dist/src/playwright/fixtures.js +718 -0
  159. package/dist/src/playwright/network-logs-reporter.d.ts +7 -0
  160. package/dist/src/playwright/network-logs-reporter.js +66 -0
  161. package/dist/src/playwright/registerRecoveryWrappers.d.ts +1 -0
  162. package/dist/src/playwright/registerRecoveryWrappers.js +54 -0
  163. package/dist/src/security/BuildSecurity.d.ts +12 -0
  164. package/dist/src/security/BuildSecurity.js +138 -0
  165. package/dist/src/security/EulaProtection.d.ts +70 -0
  166. package/dist/src/security/EulaProtection.js +155 -0
  167. package/dist/src/security/HoneypotManager.d.ts +46 -0
  168. package/dist/src/security/HoneypotManager.js +234 -0
  169. package/dist/src/security/KeysManager.d.ts +36 -0
  170. package/dist/src/security/KeysManager.js +158 -0
  171. package/dist/src/security/ProofOfWorkIntegration.d.ts +64 -0
  172. package/dist/src/security/ProofOfWorkIntegration.js +206 -0
  173. package/dist/src/security/SecurityValidation.d.ts +21 -0
  174. package/dist/src/security/SecurityValidation.js +163 -0
  175. package/dist/src/security/SourceMapProtection.d.ts +55 -0
  176. package/dist/src/security/SourceMapProtection.js +220 -0
  177. package/dist/src/security/protector.d.ts +1 -0
  178. package/dist/src/security/protector.js +97 -0
  179. package/dist/src/ssh/SSHActions.d.ts +262 -0
  180. package/dist/src/ssh/SSHActions.js +790 -0
  181. package/dist/src/ssh/SSHClient.d.ts +99 -0
  182. package/dist/src/ssh/SSHClient.js +409 -0
  183. package/dist/src/statements/BaseStatement.d.ts +38 -0
  184. package/dist/src/statements/BaseStatement.js +78 -0
  185. package/dist/src/testContext/AuthStateManager.d.ts +93 -0
  186. package/dist/src/testContext/AuthStateManager.js +256 -0
  187. package/dist/src/testContext/CoverageManager.d.ts +198 -0
  188. package/dist/src/testContext/CoverageManager.js +917 -0
  189. package/dist/src/testContext/TestAnnotations.d.ts +476 -0
  190. package/dist/src/testContext/TestAnnotations.js +2647 -0
  191. package/dist/src/testContext/TestContext.d.ts +138 -0
  192. package/dist/src/testContext/TestContext.js +369 -0
  193. package/dist/src/testContext/UnifiedHtmlGenerator.d.ts +7 -0
  194. package/dist/src/testContext/UnifiedHtmlGenerator.js +264 -0
  195. package/dist/src/testContext/UnifiedReportManager.d.ts +211 -0
  196. package/dist/src/testContext/UnifiedReportManager.js +1206 -0
  197. package/dist/src/testhub/DynamicConfigManager.d.ts +121 -0
  198. package/dist/src/testhub/DynamicConfigManager.js +320 -0
  199. package/dist/src/testhub/SystemsManager.d.ts +119 -0
  200. package/dist/src/testhub/SystemsManager.js +365 -0
  201. package/dist/src/testhub/TestHubClient.d.ts +335 -0
  202. package/dist/src/testhub/TestHubClient.js +1215 -0
  203. package/dist/src/testhub/TestHubReporter.d.ts +62 -0
  204. package/dist/src/testhub/TestHubReporter.js +576 -0
  205. package/dist/src/testhub/TestHubVars.d.ts +116 -0
  206. package/dist/src/testhub/TestHubVars.js +273 -0
  207. package/dist/src/utils/ActionInterceptor.d.ts +59 -0
  208. package/dist/src/utils/ActionInterceptor.js +741 -0
  209. package/dist/src/utils/ArtifactsCompressor.d.ts +43 -0
  210. package/dist/src/utils/ArtifactsCompressor.js +181 -0
  211. package/dist/src/utils/AutoLogsFinal.d.ts +47 -0
  212. package/dist/src/utils/AutoLogsFinal.js +148 -0
  213. package/dist/src/utils/CodeGenSession.d.ts +114 -0
  214. package/dist/src/utils/CodeGenSession.js +264 -0
  215. package/dist/src/utils/ConfigLogger.d.ts +133 -0
  216. package/dist/src/utils/ConfigLogger.js +611 -0
  217. package/dist/src/utils/CustomReporter.d.ts +22 -0
  218. package/dist/src/utils/CustomReporter.js +352 -0
  219. package/dist/src/utils/DataStore.d.ts +171 -0
  220. package/dist/src/utils/DataStore.js +484 -0
  221. package/dist/src/utils/DatabaseInterceptor.d.ts +19 -0
  222. package/dist/src/utils/DatabaseInterceptor.js +295 -0
  223. package/dist/src/utils/DateHelper.d.ts +16 -0
  224. package/dist/src/utils/DateHelper.js +120 -0
  225. package/dist/src/utils/DateValidator.d.ts +4 -0
  226. package/dist/src/utils/DateValidator.js +51 -0
  227. package/dist/src/utils/DocumentGenerator.d.ts +35 -0
  228. package/dist/src/utils/DocumentGenerator.js +129 -0
  229. package/dist/src/utils/EvidenceCapture.d.ts +90 -0
  230. package/dist/src/utils/EvidenceCapture.js +600 -0
  231. package/dist/src/utils/EvidenceReportGenerator.d.ts +70 -0
  232. package/dist/src/utils/EvidenceReportGenerator.js +799 -0
  233. package/dist/src/utils/FrameManagementUtil.d.ts +42 -0
  234. package/dist/src/utils/FrameManagementUtil.js +75 -0
  235. package/dist/src/utils/GlobalStatementsInterceptor.d.ts +1 -0
  236. package/dist/src/utils/GlobalStatementsInterceptor.js +1 -0
  237. package/dist/src/utils/HTMLTemplate.d.ts +1 -0
  238. package/dist/src/utils/HTMLTemplate.js +1034 -0
  239. package/dist/src/utils/InterceptacaoMagica.d.ts +23 -0
  240. package/dist/src/utils/InterceptacaoMagica.js +365 -0
  241. package/dist/src/utils/LogSanitizer.d.ts +35 -0
  242. package/dist/src/utils/LogSanitizer.js +110 -0
  243. package/dist/src/utils/Logger.d.ts +65 -0
  244. package/dist/src/utils/Logger.js +284 -0
  245. package/dist/src/utils/McpLocalClient.d.ts +141 -0
  246. package/dist/src/utils/McpLocalClient.js +871 -0
  247. package/dist/src/utils/PDFEvidenceGenerator.d.ts +20 -0
  248. package/dist/src/utils/PDFEvidenceGenerator.js +156 -0
  249. package/dist/src/utils/SpecFileAnalyzer.d.ts +35 -0
  250. package/dist/src/utils/SpecFileAnalyzer.js +209 -0
  251. package/dist/src/utils/StatementInterceptor.d.ts +18 -0
  252. package/dist/src/utils/StatementInterceptor.js +87 -0
  253. package/dist/src/utils/StatementLogger.d.ts +33 -0
  254. package/dist/src/utils/StatementLogger.js +113 -0
  255. package/dist/src/utils/StatementsInterceptor.d.ts +1 -0
  256. package/dist/src/utils/StatementsInterceptor.js +1 -0
  257. package/dist/src/utils/TeamsFlushHook.d.ts +17 -0
  258. package/dist/src/utils/TeamsFlushHook.js +168 -0
  259. package/dist/src/utils/TerminalLogCapture.d.ts +158 -0
  260. package/dist/src/utils/TerminalLogCapture.js +531 -0
  261. package/dist/src/utils/TestMethodLogger.d.ts +70 -0
  262. package/dist/src/utils/TestMethodLogger.js +95 -0
  263. package/dist/src/utils/UnifiedTeardown.d.ts +4 -0
  264. package/dist/src/utils/UnifiedTeardown.js +400 -0
  265. package/dist/src/utils/XPathCatalog.d.ts +152 -0
  266. package/dist/src/utils/XPathCatalog.js +350 -0
  267. package/dist/src/utils/generators.d.ts +90 -0
  268. package/dist/src/utils/generators.js +167 -0
  269. package/dist/src/utils/testRecovery/ResilientPlaywright.d.ts +152 -0
  270. package/dist/src/utils/testRecovery/ResilientPlaywright.js +715 -0
  271. package/dist/src/utils/testRecovery/TestRecoveryClient.d.ts +801 -0
  272. package/dist/src/utils/testRecovery/TestRecoveryClient.js +1415 -0
  273. package/dist/src/utils/testRecovery/autoFixCode.d.ts +65 -0
  274. package/dist/src/utils/testRecovery/autoFixCode.js +32 -0
  275. package/dist/vitest.config.d.ts +2 -0
  276. package/dist/vitest.config.js +59 -0
  277. package/dist/wdio.conf.d.ts +1 -0
  278. package/dist/wdio.conf.js +420 -0
  279. package/package.json +137 -0
  280. package/protect-loader.mjs +643 -0
  281. package/scripts/consumer-postinstall.ts +975 -0
  282. package/scripts/generate-index.ts +343 -0
  283. package/scripts/init-api.ts +613 -0
  284. package/scripts/init-banco.ts +437 -0
  285. package/scripts/init-frontend.ts +727 -0
  286. package/scripts/init-mobile.ts +558 -0
  287. package/scripts/init-scenarios.ts +925 -0
  288. package/scripts/init-ssh.ts +734 -0
  289. package/scripts/package-versions.ts +978 -0
  290. package/scripts/postinstall.ts +605 -0
  291. package/scripts/smart-override.ts +1675 -0
  292. package/scripts/sync-configs.ts +302 -0
  293. package/scripts/ultracite-setup.ts +370 -0
  294. package/src/types/globals.d.ts +48 -0
  295. package/tsconfig.json +29 -0
  296. package/types/autocore-sync-signal.d.ts +10 -0
@@ -0,0 +1,801 @@
1
+ export type ErrorType = "not_found" | "multiple_elements" | "timeout" | "wrong_navigation" | "stale_element";
2
+ export type ActionType = "click" | "fill" | "select" | "hover" | "check" | "uncheck" | "press" | "wait" | "navigate" | "doubleClick";
3
+ /** Origem da execução (v2.6.9) */
4
+ export type ExecutionSource = "LOCAL" | "AZURE";
5
+ /** Origem da correção (v2.6.9) */
6
+ export type RecoverySource = "framework" | "manual" | "auto_code";
7
+ /** Lista de actionTypes válidos para validação */
8
+ export declare const VALID_ACTION_TYPES: ActionType[];
9
+ /**
10
+ * Mapeamento de nomes de métodos WebActions para actionTypes do Test Recovery
11
+ * Usado para normalizar o actionType quando vem do wrapper automático
12
+ */
13
+ export declare const METHOD_TO_ACTION_TYPE: Record<string, ActionType>;
14
+ /**
15
+ * Converte nome de método WebActions para actionType do Test Recovery
16
+ * @param methodName Nome do método (ex: 'setText', 'click', 'waitForVisible')
17
+ * @returns ActionType normalizado
18
+ */
19
+ export declare function methodToActionType(methodName: string): ActionType;
20
+ /** Lista de errorTypes válidos para validação */
21
+ export declare const VALID_ERROR_TYPES: ErrorType[];
22
+ /**
23
+ * Valida se um actionType é válido
24
+ */
25
+ export declare function isValidActionType(action: string | undefined | null): action is ActionType;
26
+ /**
27
+ * Valida se um errorType é válido
28
+ */
29
+ export declare function isValidErrorType(error: string | undefined | null): error is ErrorType;
30
+ /**
31
+ * Infere o actionType baseado no contexto do XPath ou elemento
32
+ * Útil quando o actionType não é fornecido explicitamente
33
+ */
34
+ export declare function inferActionType(xpath: string, context?: Record<string, unknown>): ActionType;
35
+ /** Elemento de página capturado */
36
+ export interface PageElement {
37
+ tag?: string;
38
+ text?: string;
39
+ id?: string;
40
+ className?: string;
41
+ name?: string;
42
+ type?: string;
43
+ href?: string;
44
+ placeholder?: string;
45
+ ariaLabel?: string;
46
+ dataTestId?: string;
47
+ role?: string;
48
+ xpath?: string;
49
+ title?: string;
50
+ }
51
+ /**
52
+ * Contexto adicional para análise de falha (v2.6.0+)
53
+ * Usado para melhorar a sugestão de XPath em formulários sequenciais
54
+ */
55
+ export interface RecoveryContext {
56
+ /** Valor que estava tentando preencher (para fill) */
57
+ value?: string;
58
+ /** Método original que foi chamado (ex: fill, click) */
59
+ originalMethod?: string;
60
+ /** Lista de XPaths de inputs que JÁ FORAM PREENCHIDOS COM SUCESSO */
61
+ filledInputs?: string[];
62
+ /** Lista de IDs/names de campos que JÁ FORAM PREENCHIDOS COM SUCESSO */
63
+ filledFields?: string[];
64
+ /** Texto visível do elemento */
65
+ text?: string;
66
+ /** Papel ARIA do elemento */
67
+ role?: string;
68
+ /** Label ARIA */
69
+ ariaLabel?: string;
70
+ /** Tipo do elemento (text, password, etc) */
71
+ type?: string;
72
+ /** Elementos próximos (para contexto) */
73
+ nearbyElements?: string[];
74
+ /**
75
+ * Aliases do seletor original (v2.7.44 - item 14)
76
+ * Permite preservar o XPath original para fill de username/login.
77
+ * Backend usa para heurística de alias (ex: user -> username).
78
+ */
79
+ selectorAliases?: {
80
+ selector?: string;
81
+ ref?: string;
82
+ xpath?: string;
83
+ };
84
+ /** Nome do arquivo Page Object do chamador (item 20 v2.7.44) */
85
+ pageFileName?: string;
86
+ /** Nome legível da página (item 20 v2.7.44) */
87
+ pageName?: string;
88
+ /** Nome da classe Page Object (item 20 v2.7.44) */
89
+ pageObjectName?: string;
90
+ }
91
+ export interface RecoveryRequest {
92
+ url: string;
93
+ failedXPath: string;
94
+ errorType: ErrorType;
95
+ actionType: ActionType;
96
+ sessionId?: string;
97
+ systemName?: string;
98
+ environment?: string;
99
+ expectedUrl?: string;
100
+ actualUrl?: string;
101
+ /** Origem da execução (v2.6.9) - LOCAL ou AZURE */
102
+ executionSource?: ExecutionSource;
103
+ /** Origem da correção (v2.6.9) - framework, manual ou auto_code */
104
+ recoverySource?: RecoverySource;
105
+ /** Nome do teste/cenário - CN (v2.6.9) */
106
+ testCaseName?: string;
107
+ /** ID do caso de teste - CT (v2.6.9) */
108
+ testCaseId?: string;
109
+ /** Nome do método que falhou (v2.6.9) */
110
+ testMethodName?: string;
111
+ /** Contexto adicional para análise (v2.6.0+) */
112
+ context?: RecoveryContext;
113
+ /** Estrutura capturada localmente via MCP (extract_page_structure/playwright_execute) */
114
+ pageStructure?: {
115
+ title?: string;
116
+ url?: string;
117
+ buttons?: PageElement[];
118
+ inputs?: PageElement[];
119
+ links?: PageElement[];
120
+ elements?: PageElement[];
121
+ headings?: PageElement[];
122
+ };
123
+ /** HTML capturado localmente se preferir enviar HTML bruto */
124
+ pageHtml?: string;
125
+ screenshot?: string;
126
+ /**
127
+ * Objeto estruturado do ator/executor real (item 23 v2.7.44).
128
+ * Permite dashboard exibir nome real (não PlaywrightFrame).
129
+ * Valores vêm de UserHeaders ou de env vars.
130
+ */
131
+ actor?: {
132
+ id?: string;
133
+ name?: string;
134
+ email?: string;
135
+ matricula?: string;
136
+ };
137
+ }
138
+ export interface RecoveryResponse {
139
+ success: boolean;
140
+ /** ID do log de recovery (v2.7.43) - priorizar no report-result */
141
+ logId?: string;
142
+ analysis: {
143
+ suggestedXPath: string;
144
+ confidence: number;
145
+ reason?: string;
146
+ alternatives?: string[];
147
+ pageChanged?: boolean;
148
+ elementCount?: number;
149
+ /** Indica se auto-fix local está disponível (v2.7.1) - true quando confidence >= 0.7 E executionSource=LOCAL */
150
+ autoFixAvailable?: boolean;
151
+ };
152
+ actions?: Array<{
153
+ type: "wait" | "click_other" | "navigate" | "refresh" | "switch_frame";
154
+ selector?: string;
155
+ url?: string;
156
+ waitMs?: number;
157
+ reason?: string;
158
+ }>;
159
+ /** Indica resposta enfileirada (202) - v2.7.43 */
160
+ queued?: boolean;
161
+ requestId?: string;
162
+ position?: number;
163
+ metadata?: {
164
+ pageTitle?: string;
165
+ pageStructureHash?: string;
166
+ timestamp?: string;
167
+ systemId?: string;
168
+ environmentId?: string;
169
+ };
170
+ }
171
+ export interface FixInCodeRequest {
172
+ url?: string;
173
+ failedXPath: string;
174
+ newXPath: string;
175
+ errorType?: ErrorType;
176
+ actionType?: ActionType;
177
+ projectRoot: string;
178
+ attributesFile?: string;
179
+ locatorProperty?: string;
180
+ systemName?: string;
181
+ autoConfirm?: boolean;
182
+ }
183
+ export interface FixInCodeResponse {
184
+ success: boolean;
185
+ fileUpdated: boolean;
186
+ filePath?: string;
187
+ changes?: {
188
+ oldXPath: string;
189
+ newXPath: string;
190
+ property?: string;
191
+ lineNumber?: number;
192
+ };
193
+ }
194
+ /**
195
+ * Request para Auto-Fix Local (v2.7.1)
196
+ * Permite aplicar correção de XPath diretamente nos arquivos do projeto
197
+ */
198
+ export interface AutoFixLocalRequest {
199
+ /** Raiz do projeto (caminho absoluto) */
200
+ projectRoot: string;
201
+ /** XPath antigo que falhou */
202
+ oldXPath: string;
203
+ /** Novo XPath sugerido pelo Test Recovery */
204
+ newXPath: string;
205
+ /** Confiança do novo XPath (0-1) */
206
+ confidence: number;
207
+ /** Arquivo de teste (ex: LoginTest.spec.ts) - usado para inferir Attributes automaticamente */
208
+ testFilePath?: string;
209
+ /** Arquivo de Attributes específico (opcional) */
210
+ attributesFile?: string;
211
+ /** Nome da classe/Page onde o XPath está (opcional) */
212
+ className?: string;
213
+ /** Nome da propriedade/getter do locator (opcional) */
214
+ locatorProperty?: string;
215
+ /** Nome do método que falhou (para audit) */
216
+ methodName?: string;
217
+ /** Número da linha onde ocorreu a falha (para audit) */
218
+ lineNumber?: number;
219
+ /** Session ID do recovery (para correlacionar com logs) */
220
+ recoverySessionId?: string;
221
+ /** Nome do sistema (opcional, para contexto) */
222
+ systemName?: string;
223
+ /** Ambiente onde ocorreu a falha (opcional) */
224
+ environmentType?: string;
225
+ /** Se true, aplica a correção sem confirmação */
226
+ autoConfirm?: boolean;
227
+ /** Origem da execução - sempre 'Local' para auto-fix */
228
+ executionSource?: "Local";
229
+ }
230
+ /**
231
+ * Response do Auto-Fix Local (v2.7.1)
232
+ */
233
+ export interface AutoFixLocalResponse {
234
+ success: boolean;
235
+ message: string;
236
+ fix?: {
237
+ /** Arquivo que foi modificado */
238
+ filePath: string;
239
+ /** XPath antigo substituído */
240
+ oldXPath: string;
241
+ /** Novo XPath aplicado */
242
+ newXPath: string;
243
+ /** Número da linha onde a alteração foi feita */
244
+ lineNumber?: number;
245
+ /** Nome da propriedade/getter modificado */
246
+ property?: string;
247
+ /** Backup do arquivo original criado? */
248
+ backupCreated?: boolean;
249
+ };
250
+ /** Motivo da falha (quando success=false) */
251
+ error?: string;
252
+ }
253
+ /**
254
+ * Metadados de recovery obtidos do ambiente/contexto (v2.7.43)
255
+ * Usado para enriquecer payloads de analyzeFailure, reportResult e autoFixLocal
256
+ */
257
+ export interface RecoveryMetadata {
258
+ executionSource: ExecutionSource;
259
+ testCaseName?: string;
260
+ testCaseId?: string;
261
+ testMethodName?: string;
262
+ }
263
+ /**
264
+ * Obtém metadados de recovery a partir de variáveis de ambiente e TestContext (v2.7.43)
265
+ * - executionSource: detecta automaticamente LOCAL vs AZURE
266
+ * - testCaseName/testCaseId/testMethodName: obtém do TestContext.testInfo quando disponível
267
+ */
268
+ export declare function getRecoveryMetadata(): RecoveryMetadata;
269
+ /** Problema detectado em um XPath */
270
+ export interface XPathProblem {
271
+ type: "dynamic_id" | "deep_xpath" | "index_based" | "shallow_attributes" | "literal_text" | "dynamic_classes";
272
+ weight: number;
273
+ description: string;
274
+ }
275
+ /** Falha recorrente detectada pelo Auto-Healing */
276
+ export interface RecurringFailure {
277
+ xpath: string;
278
+ occurrences: number;
279
+ failureRate: number;
280
+ riskScore: number;
281
+ problems: XPathProblem[];
282
+ lastFailure?: string;
283
+ firstFailure?: string;
284
+ affectedTests: number;
285
+ }
286
+ /** Resposta de falhas recorrentes */
287
+ export interface RecurringFailuresResponse {
288
+ failures: RecurringFailure[];
289
+ total: number;
290
+ }
291
+ /** Sugestão de refatoração */
292
+ export interface RefactorSuggestion {
293
+ newXPath: string;
294
+ confidence: number;
295
+ effort: "low" | "medium" | "high";
296
+ justification: string;
297
+ affectedElements: number;
298
+ }
299
+ /** Resposta de sugestão de refatoração */
300
+ export interface SuggestRefactorResponse {
301
+ xpath: string;
302
+ suggestions: RefactorSuggestion[];
303
+ }
304
+ /** Análise de impacto */
305
+ export interface ImpactAnalysisResponse {
306
+ xpath: string;
307
+ impactAnalysis: {
308
+ affectedTests: number;
309
+ successRateHistorical: number;
310
+ lastSuccessAt?: string;
311
+ lastFailureAt?: string;
312
+ recommendation: "refactor_now" | "monitor" | "ignore";
313
+ confidence: number;
314
+ estimatedRecoveryTime?: number;
315
+ };
316
+ }
317
+ export declare function getRecurringFailures(params?: {
318
+ days?: number;
319
+ minOccurrences?: number;
320
+ limit?: number;
321
+ }): Promise<RecurringFailuresResponse | null>;
322
+ export declare function suggestRefactor(xpath: string): Promise<SuggestRefactorResponse | null>;
323
+ export declare function impactAnalysis(xpath: string): Promise<ImpactAnalysisResponse | null>;
324
+ export declare function analyzeFailure(body: RecoveryRequest): Promise<RecoveryResponse | null>;
325
+ export declare function fixInCode(payload: FixInCodeRequest): Promise<FixInCodeResponse | null>;
326
+ export declare function markSuccess(sessionId: string, attemptNumber: number): Promise<boolean>;
327
+ /**
328
+ * Requisição para reportar resultado de tentativa de recovery
329
+ * OBRIGATÓRIO chamar após testar XPath sugerido (v2.6.9)
330
+ */
331
+ export interface ReportResultRequest {
332
+ /** ID do log (preferencial quando disponível) */
333
+ logId?: string;
334
+ /** ID da sessão (alternativa ao logId) */
335
+ sessionId?: string;
336
+ /** Número da tentativa (alternativa ao logId) */
337
+ attemptNumber?: number;
338
+ /** XPath testado (alternativa ao logId) */
339
+ xpath?: string;
340
+ /** Resultado da tentativa */
341
+ success: boolean;
342
+ /** Se foi corrigido automaticamente no código */
343
+ autoFixed?: boolean;
344
+ /** Origem da execução - LOCAL ou AZURE */
345
+ executionSource?: ExecutionSource;
346
+ /** Origem da correção - framework, manual ou auto_code */
347
+ recoverySource?: RecoverySource;
348
+ /** Nome do teste/cenário - CN */
349
+ testCaseName?: string;
350
+ /** ID do caso de teste - CT */
351
+ testCaseId?: string;
352
+ /** Nome do método que falhou */
353
+ testMethodName?: string;
354
+ /**
355
+ * Ator/executor real (item 23 v2.7.44).
356
+ * Enviado no body para rastreio no dashboard.
357
+ */
358
+ actor?: {
359
+ id?: string;
360
+ name?: string;
361
+ email?: string;
362
+ matricula?: string;
363
+ };
364
+ }
365
+ /**
366
+ * Resposta do report-result
367
+ */
368
+ export interface ReportResultResponse {
369
+ success: boolean;
370
+ updated: boolean;
371
+ logId?: string;
372
+ }
373
+ /**
374
+ * Headers opcionais de identificação do usuário (v2.7.44)
375
+ * Suporta múltiplos aliases aceitos pelo backend
376
+ */
377
+ export interface UserHeaders {
378
+ userEmail?: string;
379
+ userMatricula?: string;
380
+ userId?: string;
381
+ userName?: string;
382
+ }
383
+ /**
384
+ * Reporta resultado de tentativa de recovery
385
+ *
386
+ * ⚠️ OBRIGATÓRIO chamar após testar XPath sugerido (v2.6.9)
387
+ * Sem report-result, a tentativa fica como "pendente" no dashboard
388
+ *
389
+ * @param params Parâmetros do resultado
390
+ * @param user Headers opcionais de identificação do usuário
391
+ * @returns Resposta do servidor
392
+ *
393
+ * @example
394
+ * ```typescript
395
+ * // Após testar XPath sugerido
396
+ * await reportResult({
397
+ * logId: result.logId,
398
+ * success: true,
399
+ * autoFixed: true,
400
+ * executionSource: 'AZURE',
401
+ * recoverySource: 'framework',
402
+ * testCaseName: 'Login Test',
403
+ * testCaseId: 'CT-001',
404
+ * testMethodName: 'testLogin'
405
+ * });
406
+ * ```
407
+ */
408
+ export declare function reportResult(params: ReportResultRequest, user?: UserHeaders): Promise<ReportResultResponse | null>;
409
+ /**
410
+ * Obtém estatísticas de recuperação (Dashboard)
411
+ * GET /api/test-recovery/stats
412
+ */
413
+ export interface RecoveryStats {
414
+ totalAttempts: number;
415
+ successfulRecoveries: number;
416
+ failedRecoveries: number;
417
+ successRate: number;
418
+ avgConfidence: number;
419
+ errorTypeDistribution: Record<ErrorType | string, number>;
420
+ actionTypeDistribution: Record<ActionType | string, number>;
421
+ }
422
+ export declare function getRecoveryStats(params?: {
423
+ userId?: string;
424
+ startDate?: string;
425
+ endDate?: string;
426
+ }): Promise<RecoveryStats | null>;
427
+ /**
428
+ * Verifica status da fila de processamento
429
+ * GET /api/test-recovery/queue/status/{requestId}
430
+ */
431
+ export interface QueueStatus {
432
+ requestId: string;
433
+ status: "pending" | "processing" | "completed" | "failed" | "timeout";
434
+ position?: number;
435
+ result?: RecoveryResponse;
436
+ error?: string;
437
+ }
438
+ export declare function getQueueStatus(requestId: string): Promise<QueueStatus | null>;
439
+ /**
440
+ * Log de recuperação
441
+ */
442
+ export interface RecoveryLog {
443
+ id: string;
444
+ sessionId: string;
445
+ xpath: string;
446
+ suggestedXPath?: string;
447
+ confidence?: number;
448
+ success: boolean;
449
+ timestamp: string;
450
+ errorType?: ErrorType;
451
+ actionType?: ActionType;
452
+ }
453
+ /** CT individual no batch */
454
+ export interface BatchCT {
455
+ name: string;
456
+ systemName?: string;
457
+ systemId?: string;
458
+ status: "passed" | "failed" | "skipped";
459
+ startTime: number;
460
+ startTimeFormatted?: string;
461
+ endTime: number;
462
+ endTimeFormatted?: string;
463
+ duration: number;
464
+ durationFormatted?: string;
465
+ error?: string;
466
+ }
467
+ /** Teste (CN) no batch */
468
+ export interface BatchTest {
469
+ testName: string;
470
+ startTime: number;
471
+ startTimeFormatted?: string;
472
+ endTime: number;
473
+ endTimeFormatted?: string;
474
+ totalCTs: number;
475
+ passedCTs: number;
476
+ failedCTs: number;
477
+ duration: number;
478
+ durationFormatted?: string;
479
+ cts: BatchCT[];
480
+ }
481
+ /** Payload completo do batch de execuções */
482
+ export interface BatchExecutionPayload {
483
+ systemName: string;
484
+ systemId?: string;
485
+ timestamp: string;
486
+ totalCTs: number;
487
+ passedCTs: number;
488
+ failedCTs: number;
489
+ totalDuration: number;
490
+ totalDurationFormatted?: string;
491
+ ambiente: "LOCAL" | "AZURE";
492
+ tests: BatchTest[];
493
+ }
494
+ /** Artifacts para upload */
495
+ export interface ArtifactsPayload {
496
+ timestamp: string;
497
+ execucaoCenarioId?: string;
498
+ systemName?: string;
499
+ systemId?: string;
500
+ artifacts: {
501
+ htmlReport?: string;
502
+ testResults?: string;
503
+ traces?: string[];
504
+ screenshots?: string[];
505
+ size?: {
506
+ htmlReportBytes?: number;
507
+ testResultsBytes?: number;
508
+ totalBytes?: number;
509
+ };
510
+ };
511
+ }
512
+ /**
513
+ * Obtém logs de recuperação (histórico)
514
+ * GET /api/test-recovery/recovery-logs
515
+ */
516
+ export declare function getRecoveryLogs(params?: {
517
+ sessionId?: string;
518
+ limit?: number;
519
+ }): Promise<RecoveryLog[] | null>;
520
+ /**
521
+ * Classe helper para integração com Test Recovery
522
+ * Gerencia o estado de campos preenchidos e facilita a análise de falhas
523
+ *
524
+ * @example
525
+ * ```typescript
526
+ * const recovery = new TestRecoveryHelper();
527
+ *
528
+ * try {
529
+ * await page.locator(xpath).fill(value);
530
+ * recovery.markFieldFilled(xpath, 'fieldId');
531
+ * } catch (error) {
532
+ * const pageStructure = await recovery.extractPageStructure(page);
533
+ * const result = await recovery.analyzeFailure({
534
+ * url: page.url(),
535
+ * failedXPath: xpath,
536
+ * errorType: 'timeout',
537
+ * actionType: 'fill',
538
+ * pageStructure,
539
+ * value,
540
+ * });
541
+ *
542
+ * if (result?.analysis.confidence >= 0.5) {
543
+ * await page.locator(result.analysis.suggestedXPath).fill(value);
544
+ * recovery.markFieldFilled(result.analysis.suggestedXPath);
545
+ * }
546
+ * }
547
+ * ```
548
+ */
549
+ export declare class TestRecoveryHelper {
550
+ private filledFields;
551
+ private filledInputs;
552
+ private sessionId;
553
+ private userHeaders;
554
+ private projectRoot;
555
+ /**
556
+ * Cria uma instância do TestRecoveryHelper
557
+ *
558
+ * @param sessionId ID da sessão para correlacionar requisições
559
+ * @param user Headers de identificação do usuário
560
+ * @param projectRoot Caminho absoluto do projeto (para auto-fix local)
561
+ */
562
+ constructor(sessionId?: string, user?: UserHeaders, projectRoot?: string);
563
+ /**
564
+ * Define o projectRoot para auto-fix local (v2.7.1)
565
+ */
566
+ setProjectRoot(projectRoot: string): void;
567
+ /**
568
+ * Obtém o projectRoot atual
569
+ */
570
+ getProjectRoot(): string | undefined;
571
+ /**
572
+ * Define o sessionId para manter contexto entre requisições
573
+ */
574
+ setSessionId(sessionId: string): void;
575
+ /**
576
+ * Obtém o sessionId atual
577
+ */
578
+ getSessionId(): string | undefined;
579
+ /**
580
+ * Define headers de identificação do usuário (v2.6.9)
581
+ * Também atualiza headers globais para chamadas do framework
582
+ */
583
+ setUserHeaders(user: UserHeaders): void;
584
+ /**
585
+ * Analisa falha e retorna XPath corrigido
586
+ * Envia automaticamente o contexto de campos já preenchidos
587
+ *
588
+ * @param params Parâmetros da análise (v2.6.9: inclui executionSource, recoverySource, testCase*)
589
+ */
590
+ analyzeFailure(params: {
591
+ url: string;
592
+ failedXPath: string;
593
+ errorType: ErrorType;
594
+ actionType: ActionType;
595
+ pageStructure?: RecoveryRequest["pageStructure"];
596
+ pageHtml?: string;
597
+ value?: string;
598
+ systemName?: string;
599
+ environment?: string;
600
+ /** Origem da execução (v2.6.9) - LOCAL ou AZURE */
601
+ executionSource?: ExecutionSource;
602
+ /** Origem da correção (v2.6.9) - framework, manual ou auto_code */
603
+ recoverySource?: RecoverySource;
604
+ /** Nome do teste/cenário - CN (v2.6.9) */
605
+ testCaseName?: string;
606
+ /** ID do caso de teste - CT (v2.6.9) */
607
+ testCaseId?: string;
608
+ /** Nome do método que falhou (v2.6.9) */
609
+ testMethodName?: string;
610
+ }): Promise<RecoveryResponse | null>;
611
+ /**
612
+ * Reporta resultado de tentativa de recovery
613
+ *
614
+ * ⚠️ OBRIGATÓRIO chamar após testar XPath sugerido (v2.6.9)
615
+ * Sem report-result, a tentativa fica como "pendente" no dashboard
616
+ *
617
+ * @param params Parâmetros do resultado
618
+ * @returns Resposta do servidor
619
+ */
620
+ reportResult(params: {
621
+ /** ID do log (preferencial) */
622
+ logId?: string;
623
+ /** Número da tentativa (alternativa ao logId) */
624
+ attemptNumber?: number;
625
+ /** XPath testado (alternativa ao logId) */
626
+ xpath?: string;
627
+ /** Resultado da tentativa */
628
+ success: boolean;
629
+ /** Se foi corrigido automaticamente no código */
630
+ autoFixed?: boolean;
631
+ /** Origem da execução - LOCAL ou AZURE */
632
+ executionSource?: ExecutionSource;
633
+ /** Origem da correção - framework, manual ou auto_code */
634
+ recoverySource?: RecoverySource;
635
+ /** Nome do teste/cenário - CN */
636
+ testCaseName?: string;
637
+ /** ID do caso de teste - CT */
638
+ testCaseId?: string;
639
+ /** Nome do método que falhou */
640
+ testMethodName?: string;
641
+ }): Promise<ReportResultResponse | null>;
642
+ /**
643
+ * Marca campo como preenchido com sucesso
644
+ * Deve ser chamado após cada preenchimento bem-sucedido
645
+ *
646
+ * @param xpath XPath do elemento preenchido
647
+ * @param fieldId ID ou name do campo (opcional, melhora a análise)
648
+ */
649
+ markFieldFilled(xpath: string, fieldId?: string): void;
650
+ /**
651
+ * Remove um campo da lista de preenchidos
652
+ * Útil quando um campo é limpo ou precisa ser repreenchido
653
+ */
654
+ unmarkFieldFilled(xpath: string, fieldId?: string): void;
655
+ /**
656
+ * Limpa histórico de campos preenchidos
657
+ * Deve ser chamado no início de cada novo teste ou ao mudar de página
658
+ */
659
+ clearFilledFields(): void;
660
+ /**
661
+ * Obtém lista de XPaths preenchidos
662
+ */
663
+ getFilledInputs(): string[];
664
+ /**
665
+ * Obtém lista de IDs/names preenchidos
666
+ */
667
+ getFilledFields(): string[];
668
+ /**
669
+ * Extrai estrutura da página usando Playwright Page
670
+ * Retorna objeto pronto para enviar ao Test Recovery
671
+ *
672
+ * @param page Instância de Page do Playwright
673
+ * @returns Estrutura da página com inputs, buttons, links e headings
674
+ */
675
+ extractPageStructure(page: {
676
+ evaluate: <T>(fn: () => T) => Promise<T>;
677
+ url: () => string;
678
+ title: () => Promise<string>;
679
+ }): Promise<RecoveryRequest["pageStructure"]>;
680
+ /**
681
+ * Extrai ID ou name de um XPath sugerido
682
+ * Útil para marcar campo como preenchido após recovery
683
+ *
684
+ * @param xpath XPath para extrair o identificador
685
+ * @returns ID ou name encontrado, ou undefined
686
+ */
687
+ extractFieldIdFromXPath(xpath: string): string | undefined;
688
+ /**
689
+ * Helper para executar ação com recovery automático
690
+ * Se a ação falhar, tenta recuperar usando Test Recovery
691
+ *
692
+ * @param params Parâmetros da ação (v2.6.9: inclui executionSource, testCase*)
693
+ * @returns Resultado da ação com informações de recovery
694
+ */
695
+ executeWithRecovery(params: {
696
+ page: {
697
+ locator: (selector: string) => {
698
+ fill: (value: string, options?: {
699
+ timeout?: number;
700
+ }) => Promise<void>;
701
+ click: (options?: {
702
+ timeout?: number;
703
+ }) => Promise<void>;
704
+ };
705
+ url: () => string;
706
+ evaluate: <T>(fn: () => T) => Promise<T>;
707
+ title: () => Promise<string>;
708
+ };
709
+ xpath: string;
710
+ actionType: "fill" | "click";
711
+ value?: string;
712
+ timeout?: number;
713
+ minConfidence?: number;
714
+ systemName?: string;
715
+ environment?: string;
716
+ /** Origem da execução (v2.6.9) - LOCAL ou AZURE */
717
+ executionSource?: ExecutionSource;
718
+ /** Nome do teste/cenário - CN (v2.6.9) */
719
+ testCaseName?: string;
720
+ /** ID do caso de teste - CT (v2.6.9) */
721
+ testCaseId?: string;
722
+ /** Nome do método que falhou (v2.6.9) */
723
+ testMethodName?: string;
724
+ }): Promise<{
725
+ success: boolean;
726
+ usedXPath: string;
727
+ wasRecovered: boolean;
728
+ }>;
729
+ /**
730
+ * Aplica correção de XPath automaticamente nos arquivos do projeto (v2.7.1)
731
+ *
732
+ * ⚠️ Requisitos:
733
+ * - executionSource deve ser 'LOCAL' (não funciona em Azure/CI)
734
+ * - confidence deve ser >= 0.7 (segurança)
735
+ * - projectRoot deve ser válido e acessível
736
+ *
737
+ * @param params Parâmetros para auto-fix local
738
+ * @returns Resultado da operação com detalhes da correção
739
+ *
740
+ * @example
741
+ * ```typescript
742
+ * const recovery = new TestRecoveryHelper();
743
+ *
744
+ * // Após analyzeFailure retornar autoFixAvailable=true
745
+ * const result = await recovery.autoFixLocal({
746
+ * projectRoot: '/home/user/projeto',
747
+ * oldXPath: '//input[@id="email"]',
748
+ * newXPath: '//input[@data-testid="email-input"]',
749
+ * confidence: 0.85,
750
+ * attributesFile: 'AttributesLogin.ts'
751
+ * });
752
+ *
753
+ * if (result.success) {
754
+ * console.log(`Arquivo corrigido: ${result.fix?.filePath}`);
755
+ * }
756
+ * ```
757
+ */
758
+ autoFixLocal(params: {
759
+ /** Raiz do projeto (caminho absoluto) - usa this.projectRoot se não informado */
760
+ projectRoot?: string;
761
+ /** XPath antigo que falhou */
762
+ oldXPath: string;
763
+ /** Novo XPath sugerido pelo Test Recovery */
764
+ newXPath: string;
765
+ /** Confiança do novo XPath (0-1) - mínimo 0.7 */
766
+ confidence: number;
767
+ /** Arquivo de teste (ex: LoginTest.spec.ts) - usado para inferir Attributes */
768
+ testFilePath?: string;
769
+ /** Arquivo de Attributes específico (opcional) */
770
+ attributesFile?: string;
771
+ /** Nome da classe onde o XPath está (opcional) */
772
+ className?: string;
773
+ /** Nome da propriedade/getter do locator (opcional) */
774
+ locatorProperty?: string;
775
+ /** Nome do método que falhou (para audit) */
776
+ methodName?: string;
777
+ /** Número da linha onde ocorreu a falha (para audit) */
778
+ lineNumber?: number;
779
+ /** Nome do sistema (opcional) */
780
+ systemName?: string;
781
+ /** Ambiente (opcional) */
782
+ environmentType?: string;
783
+ /** Se true, aplica sem confirmação (default: true em framework) */
784
+ autoConfirm?: boolean;
785
+ /** Origem da execução - 'Local' para auto-fix (v2.7.44) */
786
+ executionSource?: "Local";
787
+ }): Promise<AutoFixLocalResponse>;
788
+ }
789
+ /**
790
+ * Instância singleton do TestRecoveryHelper
791
+ * Use para casos simples sem necessidade de múltiplas instâncias
792
+ *
793
+ * @example
794
+ * ```typescript
795
+ * import { testRecoveryHelper } from '@silasfmartins/testhub';
796
+ *
797
+ * testRecoveryHelper.markFieldFilled(xpath, 'username');
798
+ * const result = await testRecoveryHelper.analyzeFailure({ ... });
799
+ * ```
800
+ */
801
+ export declare const testRecoveryHelper: TestRecoveryHelper;