pw-core 1.3.0 → 1.3.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.
Files changed (61) hide show
  1. package/README.md +1 -0
  2. package/dist/cli.js +145 -421
  3. package/dist/codegen/action-formatter.d.ts +19 -0
  4. package/dist/codegen/action-formatter.js +160 -0
  5. package/dist/codegen/action-processor.d.ts +23 -0
  6. package/dist/codegen/action-processor.js +112 -0
  7. package/dist/codegen/floating-panel/client.d.ts +14 -1
  8. package/dist/codegen/floating-panel/client.js +20 -25
  9. package/dist/codegen/floating-panel/manager.js +16 -22
  10. package/dist/codegen/generator/action.validator.d.ts +2 -1
  11. package/dist/codegen/generator/action.validator.js +2 -1
  12. package/dist/codegen/generator/candidate-scorer.d.ts +7 -0
  13. package/dist/codegen/generator/candidate-scorer.js +206 -0
  14. package/dist/codegen/generator/dom-scanner.d.ts +39 -0
  15. package/dist/codegen/generator/dom-scanner.js +429 -0
  16. package/dist/codegen/generator/id-stability.d.ts +6 -0
  17. package/dist/codegen/generator/id-stability.js +38 -0
  18. package/dist/codegen/generator/index.d.ts +8 -10
  19. package/dist/codegen/generator/index.js +23 -678
  20. package/dist/codegen/generator/key-builder.d.ts +13 -0
  21. package/dist/codegen/generator/key-builder.js +32 -0
  22. package/dist/codegen/hover-tracker/client.d.ts +5 -0
  23. package/dist/codegen/hover-tracker/client.js +14 -15
  24. package/dist/codegen/hover-tracker/manager.js +2 -6
  25. package/dist/codegen/index.d.ts +9 -32
  26. package/dist/codegen/index.js +9 -1128
  27. package/dist/codegen/key-utils.d.ts +16 -0
  28. package/dist/codegen/key-utils.js +29 -1
  29. package/dist/codegen/project-finder.d.ts +29 -0
  30. package/dist/codegen/project-finder.js +283 -0
  31. package/dist/codegen/registry-matcher.d.ts +27 -0
  32. package/dist/codegen/registry-matcher.js +254 -0
  33. package/dist/codegen/registry-store.d.ts +52 -0
  34. package/dist/codegen/registry-store.js +652 -0
  35. package/dist/codegen/selector-parser.d.ts +16 -0
  36. package/dist/codegen/selector-parser.js +121 -0
  37. package/dist/codegen/types.d.ts +18 -1
  38. package/dist/codegen/uniqueness.d.ts +3 -0
  39. package/dist/codegen/uniqueness.js +15 -0
  40. package/dist/component/table.d.ts +2 -2
  41. package/dist/component/table.js +7 -6
  42. package/dist/index.d.ts +3 -0
  43. package/dist/index.js +19 -0
  44. package/dist/page/actions/locator-actions.d.ts +6 -10
  45. package/dist/page/actions/locator-actions.js +24 -23
  46. package/dist/page/assertions/verify-chain.d.ts +11 -13
  47. package/dist/page/assertions/verify-chain.js +26 -7
  48. package/dist/page/assertions/verify-helpers.d.ts +5 -15
  49. package/dist/page/config.d.ts +25 -25
  50. package/dist/page/locators/dynamic-locator-resolver.js +22 -9
  51. package/dist/page/locators/resolver.d.ts +17 -11
  52. package/dist/page/locators/resolver.js +84 -78
  53. package/dist/page/registry.d.ts +35 -35
  54. package/dist/page/registry.js +86 -82
  55. package/dist/page/typed-page.d.ts +1 -0
  56. package/dist/page/typed-page.js +22 -12
  57. package/dist/page/types/proxy-methods.d.ts +11 -19
  58. package/dist/page/types/validation.d.ts +1 -1
  59. package/dist/page/utils/formatter.d.ts +3 -3
  60. package/dist/page/utils/formatter.js +5 -2
  61. package/package.json +6 -3
@@ -0,0 +1,52 @@
1
+ export type DynamicRegistryEntry = {
2
+ testId?: string;
3
+ selector?: string;
4
+ [key: string]: string | string[] | undefined;
5
+ };
6
+ export type RegistryLocatorDictionary = Record<string, string | DynamicRegistryEntry>;
7
+ export interface RegistryPageConfig {
8
+ url?: string;
9
+ testId?: RegistryLocatorDictionary;
10
+ testIds?: RegistryLocatorDictionary;
11
+ selector?: RegistryLocatorDictionary;
12
+ selectors?: RegistryLocatorDictionary;
13
+ [key: string]: unknown;
14
+ }
15
+ export type RegistryRoot = Record<string, RegistryPageConfig>;
16
+ /**
17
+ * Finds the character bounds `(startIdx, endIdx)` of the argument inside `createPageRegistry(...)`.
18
+ * Robustly ignores parentheses inside strings, template literals, and comments.
19
+ */
20
+ export declare function findRegistryCallBounds(content: string): {
21
+ startIdx: number;
22
+ endIdx: number;
23
+ } | null;
24
+ /**
25
+ * Parses a `registry.ts` file by evaluating the object literal passed to `createPageRegistry`.
26
+ * Returns an empty object if the file does not exist yet.
27
+ */
28
+ export declare function parseRegistry(filePath: string): RegistryRoot;
29
+ /**
30
+ * Checks if a string value matches a dynamic registry entry pattern.
31
+ */
32
+ export declare function matchDynamicEntry(val: string, entry: DynamicRegistryEntry, isTestId: boolean): {
33
+ matches: boolean;
34
+ matchedValue?: string;
35
+ placeholderName?: string;
36
+ };
37
+ /**
38
+ * Finds the common prefix between hyphen/underscore delimited string values.
39
+ */
40
+ export declare function findCommonPrefix(values: string[]): string;
41
+ /**
42
+ * Collapses similar static entries into dynamic parameterized entries in a locator dictionary.
43
+ */
44
+ export declare function collapsePageDict(dict: RegistryLocatorDictionary, isTestId: boolean, keyReplacements: Record<string, string>): RegistryLocatorDictionary;
45
+ /**
46
+ * Serializes a JavaScript value into formatted TypeScript source text for registry files.
47
+ */
48
+ export declare function serializeRegistryObject(obj: unknown, indent?: number, isTestIdsOrSelectors?: boolean): string;
49
+ /**
50
+ * Updates or appends page object definitions inside a `registry.ts` file and updates any referencing test specs.
51
+ */
52
+ export declare function writeRegistry(filePath: string, registryObj: RegistryRoot, overrideMode?: boolean, usedPageKeys?: Set<string> | string[]): Record<string, string>;