@wdio/appium-service 9.23.3 → 9.25.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 (75) hide show
  1. package/README.md +639 -0
  2. package/build/index.d.ts +2 -1
  3. package/build/index.d.ts.map +1 -1
  4. package/build/index.js +2507 -52
  5. package/build/launcher.d.ts +1 -1
  6. package/build/launcher.d.ts.map +1 -1
  7. package/build/mobileSelectorPerformanceOptimizer/aggregator.d.ts +16 -0
  8. package/build/mobileSelectorPerformanceOptimizer/aggregator.d.ts.map +1 -0
  9. package/build/mobileSelectorPerformanceOptimizer/markdown-formatter.d.ts +11 -0
  10. package/build/mobileSelectorPerformanceOptimizer/markdown-formatter.d.ts.map +1 -0
  11. package/build/mobileSelectorPerformanceOptimizer/mspo-reporter.d.ts +45 -0
  12. package/build/mobileSelectorPerformanceOptimizer/mspo-reporter.d.ts.map +1 -0
  13. package/build/mobileSelectorPerformanceOptimizer/mspo-service.d.ts +27 -0
  14. package/build/mobileSelectorPerformanceOptimizer/mspo-service.d.ts.map +1 -0
  15. package/build/mobileSelectorPerformanceOptimizer/mspo-store.d.ts +50 -0
  16. package/build/mobileSelectorPerformanceOptimizer/mspo-store.d.ts.map +1 -0
  17. package/build/mobileSelectorPerformanceOptimizer/optimizer.d.ts +10 -0
  18. package/build/mobileSelectorPerformanceOptimizer/optimizer.d.ts.map +1 -0
  19. package/build/mobileSelectorPerformanceOptimizer/overwrite.d.ts +6 -0
  20. package/build/mobileSelectorPerformanceOptimizer/overwrite.d.ts.map +1 -0
  21. package/build/mobileSelectorPerformanceOptimizer/reporting-types.d.ts +48 -0
  22. package/build/mobileSelectorPerformanceOptimizer/reporting-types.d.ts.map +1 -0
  23. package/build/mobileSelectorPerformanceOptimizer/types.d.ts +53 -0
  24. package/build/mobileSelectorPerformanceOptimizer/types.d.ts.map +1 -0
  25. package/build/mobileSelectorPerformanceOptimizer/utils/browser-utils.d.ts +6 -0
  26. package/build/mobileSelectorPerformanceOptimizer/utils/browser-utils.d.ts.map +1 -0
  27. package/build/mobileSelectorPerformanceOptimizer/utils/command-timing.d.ts +10 -0
  28. package/build/mobileSelectorPerformanceOptimizer/utils/command-timing.d.ts.map +1 -0
  29. package/build/mobileSelectorPerformanceOptimizer/utils/constants.d.ts +14 -0
  30. package/build/mobileSelectorPerformanceOptimizer/utils/constants.d.ts.map +1 -0
  31. package/build/mobileSelectorPerformanceOptimizer/utils/formatting.d.ts +15 -0
  32. package/build/mobileSelectorPerformanceOptimizer/utils/formatting.d.ts.map +1 -0
  33. package/build/mobileSelectorPerformanceOptimizer/utils/index.d.ts +22 -0
  34. package/build/mobileSelectorPerformanceOptimizer/utils/index.d.ts.map +1 -0
  35. package/build/mobileSelectorPerformanceOptimizer/utils/optimization.d.ts +8 -0
  36. package/build/mobileSelectorPerformanceOptimizer/utils/optimization.d.ts.map +1 -0
  37. package/build/mobileSelectorPerformanceOptimizer/utils/performance-data.d.ts +10 -0
  38. package/build/mobileSelectorPerformanceOptimizer/utils/performance-data.d.ts.map +1 -0
  39. package/build/mobileSelectorPerformanceOptimizer/utils/reporter.d.ts +16 -0
  40. package/build/mobileSelectorPerformanceOptimizer/utils/reporter.d.ts.map +1 -0
  41. package/build/mobileSelectorPerformanceOptimizer/utils/selector-location.d.ts +20 -0
  42. package/build/mobileSelectorPerformanceOptimizer/utils/selector-location.d.ts.map +1 -0
  43. package/build/mobileSelectorPerformanceOptimizer/utils/selector-testing.d.ts +10 -0
  44. package/build/mobileSelectorPerformanceOptimizer/utils/selector-testing.d.ts.map +1 -0
  45. package/build/mobileSelectorPerformanceOptimizer/utils/selector-utils.d.ts +37 -0
  46. package/build/mobileSelectorPerformanceOptimizer/utils/selector-utils.d.ts.map +1 -0
  47. package/build/mobileSelectorPerformanceOptimizer/utils/test-context.d.ts +24 -0
  48. package/build/mobileSelectorPerformanceOptimizer/utils/test-context.d.ts.map +1 -0
  49. package/build/mobileSelectorPerformanceOptimizer/utils/timing.d.ts +7 -0
  50. package/build/mobileSelectorPerformanceOptimizer/utils/timing.d.ts.map +1 -0
  51. package/build/mobileSelectorPerformanceOptimizer/utils/xpath-class-chain.d.ts +10 -0
  52. package/build/mobileSelectorPerformanceOptimizer/utils/xpath-class-chain.d.ts.map +1 -0
  53. package/build/mobileSelectorPerformanceOptimizer/utils/xpath-conditions.d.ts +26 -0
  54. package/build/mobileSelectorPerformanceOptimizer/utils/xpath-conditions.d.ts.map +1 -0
  55. package/build/mobileSelectorPerformanceOptimizer/utils/xpath-constants.d.ts +64 -0
  56. package/build/mobileSelectorPerformanceOptimizer/utils/xpath-constants.d.ts.map +1 -0
  57. package/build/mobileSelectorPerformanceOptimizer/utils/xpath-converter.d.ts +14 -0
  58. package/build/mobileSelectorPerformanceOptimizer/utils/xpath-converter.d.ts.map +1 -0
  59. package/build/mobileSelectorPerformanceOptimizer/utils/xpath-detection.d.ts +30 -0
  60. package/build/mobileSelectorPerformanceOptimizer/utils/xpath-detection.d.ts.map +1 -0
  61. package/build/mobileSelectorPerformanceOptimizer/utils/xpath-page-source-executor.d.ts +30 -0
  62. package/build/mobileSelectorPerformanceOptimizer/utils/xpath-page-source-executor.d.ts.map +1 -0
  63. package/build/mobileSelectorPerformanceOptimizer/utils/xpath-page-source.d.ts +20 -0
  64. package/build/mobileSelectorPerformanceOptimizer/utils/xpath-page-source.d.ts.map +1 -0
  65. package/build/mobileSelectorPerformanceOptimizer/utils/xpath-parser.d.ts +9 -0
  66. package/build/mobileSelectorPerformanceOptimizer/utils/xpath-parser.d.ts.map +1 -0
  67. package/build/mobileSelectorPerformanceOptimizer/utils/xpath-predicate.d.ts +18 -0
  68. package/build/mobileSelectorPerformanceOptimizer/utils/xpath-predicate.d.ts.map +1 -0
  69. package/build/mobileSelectorPerformanceOptimizer/utils/xpath-selector-builder.d.ts +11 -0
  70. package/build/mobileSelectorPerformanceOptimizer/utils/xpath-selector-builder.d.ts.map +1 -0
  71. package/build/mobileSelectorPerformanceOptimizer/utils/xpath-types.d.ts +68 -0
  72. package/build/mobileSelectorPerformanceOptimizer/utils/xpath-types.d.ts.map +1 -0
  73. package/build/types.d.ts +46 -0
  74. package/build/types.d.ts.map +1 -1
  75. package/package.json +9 -6
@@ -19,7 +19,7 @@ export default class AppiumLauncher implements Services.ServiceInstance {
19
19
  private _setCapabilities;
20
20
  onPrepare(): Promise<void>;
21
21
  private promisifiedTreeKill;
22
- onComplete(): Promise<void>;
22
+ onComplete(exitCode: number, config: Options.Testrunner, capabilities: Capabilities.TestrunnerCapabilities): Promise<void>;
23
23
  private _startAppium;
24
24
  private _redirectLogStream;
25
25
  private static _getAppiumCommand;
@@ -1 +1 @@
1
- {"version":3,"file":"launcher.d.ts","sourceRoot":"","sources":["../src/launcher.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAIlE,OAAO,KAAK,EAAyB,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAa5E,MAAM,CAAC,OAAO,OAAO,cAAe,YAAW,QAAQ,CAAC,eAAe;;IAQ/D,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,aAAa;IACrB,OAAO,CAAC,OAAO,CAAC;IATpB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAQ;IAClC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAe;IAC9C,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAuB;IAC7C,OAAO,CAAC,QAAQ,CAAC,CAA+C;IAChE,OAAO,CAAC,eAAe,CAAiB;gBAG5B,QAAQ,EAAE,mBAAmB,EAC7B,aAAa,EAAE,YAAY,CAAC,sBAAsB,EAClD,OAAO,CAAC,EAAE,OAAO,CAAC,UAAU,YAAA;YAS1B,WAAW;IAqBzB;;;OAGG;IACH,OAAO,CAAC,gBAAgB;IAyDlB,SAAS;IAuDf,OAAO,CAAC,mBAAmB,CAAsC;IAC3D,UAAU;IAmChB,OAAO,CAAC,YAAY;YAgHN,kBAAkB;mBAeX,iBAAiB;CAezC"}
1
+ {"version":3,"file":"launcher.d.ts","sourceRoot":"","sources":["../src/launcher.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAIlE,OAAO,KAAK,EAAyB,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAe5E,MAAM,CAAC,OAAO,OAAO,cAAe,YAAW,QAAQ,CAAC,eAAe;;IAQ/D,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,aAAa;IACrB,OAAO,CAAC,OAAO,CAAC;IATpB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAQ;IAClC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAe;IAC9C,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAuB;IAC7C,OAAO,CAAC,QAAQ,CAAC,CAA+C;IAChE,OAAO,CAAC,eAAe,CAAiB;gBAG5B,QAAQ,EAAE,mBAAmB,EAC7B,aAAa,EAAE,YAAY,CAAC,sBAAsB,EAClD,OAAO,CAAC,EAAE,OAAO,CAAC,UAAU,YAAA;YAS1B,WAAW;IAqBzB;;;OAGG;IACH,OAAO,CAAC,gBAAgB;IAyDlB,SAAS;IAuDf,OAAO,CAAC,mBAAmB,CAAsC;IAC3D,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,UAAU,EAAE,YAAY,EAAE,YAAY,CAAC,sBAAsB;IA2DhH,OAAO,CAAC,YAAY;YAgHN,kBAAkB;mBAeX,iBAAiB;CAezC"}
@@ -0,0 +1,16 @@
1
+ import type { Capabilities } from '@wdio/types';
2
+ import type { ReportOptions } from './reporting-types.js';
3
+ /**
4
+ * Aggregates selector performance data from all worker files and generates a report
5
+ * @param capabilities - The capabilities for this runner instance
6
+ * @param maxLineLength - Maximum line length for report output
7
+ * @param writeFn - Optional function to write output (uses console.log if not provided)
8
+ * @param reportDirectory - Report directory path (determined and validated in service constructor)
9
+ * @param options - Report options for controlling output formats
10
+ */
11
+ export declare function aggregateSelectorPerformanceData(capabilities: Capabilities.TestrunnerCapabilities | Capabilities.ResolvedTestrunnerCapabilities, maxLineLength: number, writeFn?: (message: string) => void, reportDirectory?: string, options?: ReportOptions): Promise<void>;
12
+ /**
13
+ * Extract device name from capabilities
14
+ */
15
+ export declare function getDeviceName(capabilities: Capabilities.TestrunnerCapabilities | Capabilities.ResolvedTestrunnerCapabilities): string;
16
+ //# sourceMappingURL=aggregator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aggregator.d.ts","sourceRoot":"","sources":["../../src/mobileSelectorPerformanceOptimizer/aggregator.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE/C,OAAO,KAAK,EAAE,aAAa,EAAiD,MAAM,sBAAsB,CAAA;AA8HxG;;;;;;;GAOG;AACH,wBAAsB,gCAAgC,CAClD,YAAY,EAAE,YAAY,CAAC,sBAAsB,GAAG,YAAY,CAAC,8BAA8B,EAC/F,aAAa,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,EACnC,eAAe,CAAC,EAAE,MAAM,EACxB,OAAO,CAAC,EAAE,aAAa,GACxB,OAAO,CAAC,IAAI,CAAC,CAuJf;AAmID;;GAEG;AACH,wBAAgB,aAAa,CAAC,YAAY,EAAE,YAAY,CAAC,sBAAsB,GAAG,YAAY,CAAC,8BAA8B,GAAG,MAAM,CA+DrI"}
@@ -0,0 +1,11 @@
1
+ import type { SelectorPerformanceData } from './types.js';
2
+ import type { RunTimingInfo } from './reporting-types.js';
3
+ /**
4
+ * Generates a properly formatted markdown report for the selector performance data
5
+ * @param optimizedSelectors - The performance data for optimized selectors
6
+ * @param deviceName - The device name for the report header
7
+ * @param timingInfo - Optional timing information for the test run
8
+ * @param projectRoot - Optional project root path for creating relative file links
9
+ */
10
+ export declare function generateMarkdownReport(optimizedSelectors: SelectorPerformanceData[], deviceName: string, timingInfo?: RunTimingInfo, projectRoot?: string): string;
11
+ //# sourceMappingURL=markdown-formatter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdown-formatter.d.ts","sourceRoot":"","sources":["../../src/mobileSelectorPerformanceOptimizer/markdown-formatter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAA;AACzD,OAAO,KAAK,EAAE,aAAa,EAAkC,MAAM,sBAAsB,CAAA;AA6MzF;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAClC,kBAAkB,EAAE,uBAAuB,EAAE,EAC7C,UAAU,EAAE,MAAM,EAClB,UAAU,CAAC,EAAE,aAAa,EAC1B,WAAW,CAAC,EAAE,MAAM,GACrB,MAAM,CAkNR"}
@@ -0,0 +1,45 @@
1
+ import WDIOReporter, { type SuiteStats, type TestStats } from '@wdio/reporter';
2
+ interface MobileSelectorPerformanceReporterOptions extends Record<string, unknown> {
3
+ reportDirectory?: string;
4
+ }
5
+ export default class MobileSelectorPerformanceReporter extends WDIOReporter {
6
+ private _reportDirectory?;
7
+ constructor(options: MobileSelectorPerformanceReporterOptions);
8
+ /**
9
+ * Get the current suite from the reporter's suite tracking
10
+ * Returns the most nested suite (skips root suite)
11
+ * Matches spec-reporter approach: uses currentSuites array
12
+ * WDIOReporter base class manages currentSuites - last item is most nested
13
+ */
14
+ private getCurrentSuite;
15
+ /**
16
+ * Update context from current suite (helper to avoid duplication)
17
+ */
18
+ private updateContextFromCurrentSuite;
19
+ /**
20
+ * Extract test file path from suite, matching spec-reporter logic
21
+ * Spec reporter: suite.file?.replace(process.cwd(), '')
22
+ * Then slices leading '/' when displaying: .slice(1)
23
+ */
24
+ private extractTestFile;
25
+ /**
26
+ * Extract suite name from suite title, matching spec-reporter logic
27
+ * Only skip root suite which has "(root)" title
28
+ */
29
+ private extractSuiteName;
30
+ /**
31
+ * Extract test name from test title, matching spec-reporter logic
32
+ * Spec reporter uses test.title directly for all frameworks
33
+ */
34
+ private extractTestName;
35
+ onSuiteStart(suite: SuiteStats): void;
36
+ onTestStart(test: TestStats): void;
37
+ onTestPass(_test: TestStats): void;
38
+ onTestFail(_test: TestStats): void;
39
+ onTestSkip(test: TestStats): void;
40
+ onTestPending(test: TestStats): void;
41
+ onHookStart(): void;
42
+ onHookEnd(): void;
43
+ }
44
+ export {};
45
+ //# sourceMappingURL=mspo-reporter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mspo-reporter.d.ts","sourceRoot":"","sources":["../../src/mobileSelectorPerformanceOptimizer/mspo-reporter.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,EAAE,EAAE,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAO9E,UAAU,wCAAyC,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC9E,eAAe,CAAC,EAAE,MAAM,CAAA;CAC3B;AAED,MAAM,CAAC,OAAO,OAAO,iCAAkC,SAAQ,YAAY;IACvE,OAAO,CAAC,gBAAgB,CAAC,CAAQ;gBAErB,OAAO,EAAE,wCAAwC;IAK7D;;;;;OAKG;IACH,OAAO,CAAC,eAAe;IAmBvB;;OAEG;IACH,OAAO,CAAC,6BAA6B;IAerC;;;;OAIG;IACH,OAAO,CAAC,eAAe;IASvB;;;OAGG;IACH,OAAO,CAAC,gBAAgB;IASxB;;;OAGG;IACH,OAAO,CAAC,eAAe;IAIvB,YAAY,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAWrC,WAAW,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI;IASlC,UAAU,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI;IAIlC,UAAU,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI;IAIlC,UAAU,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI;IAOjC,aAAa,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI;IAOpC,WAAW,IAAI,IAAI;IAInB,SAAS,IAAI,IAAI;CAGpB"}
@@ -0,0 +1,27 @@
1
+ import type { Services, Options } from '@wdio/types';
2
+ import type { AppiumServiceConfig } from '../types.js';
3
+ export default class SelectorPerformanceService implements Services.ServiceInstance {
4
+ private _options;
5
+ private _config?;
6
+ private _enabled;
7
+ private _enableCliReport;
8
+ private _enableMarkdownReport;
9
+ private _reportDirectory?;
10
+ private _pageObjectPaths;
11
+ private _browser?;
12
+ private _isReplacingSelectorRef;
13
+ private _commandTimings;
14
+ private _userCommands;
15
+ private _internalCommands;
16
+ constructor(_options: AppiumServiceConfig, _config?: Options.Testrunner | undefined);
17
+ beforeSession(config: Options.Testrunner, _capabilities: never, _specs: never): Promise<void>;
18
+ before(_capabilities: never, _specs: never, browser: WebdriverIO.Browser | WebdriverIO.MultiRemoteBrowser): Promise<void>;
19
+ beforeCommand(commandName: string, args: unknown[]): Promise<void>;
20
+ afterCommand(commandName: string, args: unknown[], _result: unknown, _error?: Error): Promise<void>;
21
+ afterSession(): Promise<void>;
22
+ /**
23
+ * Extract device name from browser capabilities
24
+ */
25
+ private _extractDeviceName;
26
+ }
27
+ //# sourceMappingURL=mspo-service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mspo-service.d.ts","sourceRoot":"","sources":["../../src/mobileSelectorPerformanceOptimizer/mspo-service.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAa,MAAM,aAAa,CAAA;AAC/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAqBtD,MAAM,CAAC,OAAO,OAAO,0BAA2B,YAAW,QAAQ,CAAC,eAAe;IAoB3E,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,OAAO,CAAC;IAnBpB,OAAO,CAAC,QAAQ,CAAiB;IACjC,OAAO,CAAC,gBAAgB,CAAiB;IACzC,OAAO,CAAC,qBAAqB,CAAiB;IAC9C,OAAO,CAAC,gBAAgB,CAAC,CAAQ;IACjC,OAAO,CAAC,gBAAgB,CAAe;IAEvC,OAAO,CAAC,QAAQ,CAAC,CAAsD;IACvE,OAAO,CAAC,uBAAuB,CAAuC;IACtE,OAAO,CAAC,eAAe,CAAwC;IAE/D,OAAO,CAAC,aAAa,CAAiC;IAEtD,OAAO,CAAC,iBAAiB,CAGvB;gBAGU,QAAQ,EAAE,mBAAmB,EAC7B,OAAO,CAAC,EAAE,OAAO,CAAC,UAAU,YAAA;IA+BlC,aAAa,CACf,MAAM,EAAE,OAAO,CAAC,UAAU,EAC1B,aAAa,EAAE,KAAK,EACpB,MAAM,EAAE,KAAK;IAmBX,MAAM,CACR,aAAa,EAAE,KAAK,EACpB,MAAM,EAAE,KAAK,EACb,OAAO,EAAE,WAAW,CAAC,OAAO,GAAG,WAAW,CAAC,kBAAkB;IAmC3D,aAAa,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE;IAsElD,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,KAAK;IAoDnF,YAAY;IAwBlB;;OAEG;IACH,OAAO,CAAC,kBAAkB;CAa7B"}
@@ -0,0 +1,50 @@
1
+ import type { SelectorPerformanceData } from './types.js';
2
+ /**
3
+ * Update current suite name
4
+ */
5
+ export declare function setCurrentSuiteName(suiteName: string): void;
6
+ /**
7
+ * Get current suite name
8
+ */
9
+ export declare function getCurrentSuiteName(): string | undefined;
10
+ /**
11
+ * Update current test file
12
+ */
13
+ export declare function setCurrentTestFile(testFile: string): void;
14
+ /**
15
+ * Get current test file
16
+ */
17
+ export declare function getCurrentTestFile(): string | undefined;
18
+ /**
19
+ * Update current test name
20
+ */
21
+ export declare function setCurrentTestName(testName: string): void;
22
+ /**
23
+ * Get current test name
24
+ */
25
+ export declare function getCurrentTestName(): string | undefined;
26
+ /**
27
+ * Update current device name
28
+ */
29
+ export declare function setCurrentDeviceName(deviceName: string): void;
30
+ /**
31
+ * Get current device name
32
+ */
33
+ export declare function getCurrentDeviceName(): string | undefined;
34
+ /**
35
+ * Add performance data to the store
36
+ */
37
+ export declare function addPerformanceData(data: SelectorPerformanceData): void;
38
+ /**
39
+ * Get all performance data
40
+ */
41
+ export declare function getPerformanceData(): SelectorPerformanceData[];
42
+ /**
43
+ * Clear all performance data
44
+ */
45
+ export declare function clearPerformanceData(): void;
46
+ /**
47
+ * Clear the store (useful for cleanup)
48
+ */
49
+ export declare function clearStore(): void;
50
+ //# sourceMappingURL=mspo-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mspo-store.d.ts","sourceRoot":"","sources":["../../src/mobileSelectorPerformanceOptimizer/mspo-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAA;AAQzD;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAE3D;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,GAAG,SAAS,CAExD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAEzD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,GAAG,SAAS,CAEvD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAEzD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,GAAG,SAAS,CAEvD;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAE7D;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,GAAG,SAAS,CAEzD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,uBAAuB,GAAG,IAAI,CAEtE;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,uBAAuB,EAAE,CAE9D;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CAE3C;AAED;;GAEG;AACH,wBAAgB,UAAU,IAAI,IAAI,CAMjC"}
@@ -0,0 +1,10 @@
1
+ import type { OptimizationOptions } from './types.js';
2
+ /**
3
+ * Main optimization flow for a single element selector
4
+ */
5
+ export declare function optimizeSingleSelector(commandName: string, selector: string, originalFunc: (selector: unknown) => Promise<WebdriverIO.Element>, browser: WebdriverIO.Browser | WebdriverIO.MultiRemoteBrowser, options: OptimizationOptions): Promise<WebdriverIO.Element>;
6
+ /**
7
+ * Main optimization flow for multiple elements selector
8
+ */
9
+ export declare function optimizeMultipleSelectors(commandName: string, selector: string, originalFunc: (selector: unknown) => Promise<WebdriverIO.Element[]>, browser: WebdriverIO.Browser | WebdriverIO.MultiRemoteBrowser, options: OptimizationOptions): Promise<WebdriverIO.Element[]>;
10
+ //# sourceMappingURL=optimizer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"optimizer.d.ts","sourceRoot":"","sources":["../../src/mobileSelectorPerformanceOptimizer/optimizer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAyIrD;;GAEG;AACH,wBAAsB,sBAAsB,CACxC,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,EACjE,OAAO,EAAE,WAAW,CAAC,OAAO,GAAG,WAAW,CAAC,kBAAkB,EAC7D,OAAO,EAAE,mBAAmB,GAC7B,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAE9B;AAED;;GAEG;AACH,wBAAsB,yBAAyB,CAC3C,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,OAAO,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC,EACnE,OAAO,EAAE,WAAW,CAAC,OAAO,GAAG,WAAW,CAAC,kBAAkB,EAC7D,OAAO,EAAE,mBAAmB,GAC7B,OAAO,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC,CAEhC"}
@@ -0,0 +1,6 @@
1
+ import type { OptimizationOptions } from './types.js';
2
+ /**
3
+ * Overwrites all user commands to replace XPath selectors with optimized alternatives
4
+ */
5
+ export declare function overwriteUserCommands(browser: WebdriverIO.Browser | WebdriverIO.MultiRemoteBrowser, options: OptimizationOptions): void;
6
+ //# sourceMappingURL=overwrite.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"overwrite.d.ts","sourceRoot":"","sources":["../../src/mobileSelectorPerformanceOptimizer/overwrite.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAIrD;;GAEG;AACH,wBAAgB,qBAAqB,CACjC,OAAO,EAAE,WAAW,CAAC,OAAO,GAAG,WAAW,CAAC,kBAAkB,EAC7D,OAAO,EAAE,mBAAmB,GAC7B,IAAI,CAsCN"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Timing information for the test run
3
+ */
4
+ export interface RunTimingInfo {
5
+ startTime: number;
6
+ endTime: number;
7
+ totalRunDurationMs: number;
8
+ }
9
+ /**
10
+ * Report options for controlling output formats
11
+ */
12
+ export interface ReportOptions {
13
+ /**
14
+ * Enable CLI report output to terminal
15
+ * @default false
16
+ */
17
+ enableCliReport?: boolean;
18
+ /**
19
+ * Enable markdown report file generation
20
+ * @default false
21
+ */
22
+ enableMarkdownReport?: boolean;
23
+ }
24
+ /**
25
+ * Grouped optimization data for reporting
26
+ */
27
+ export interface GroupedOptimization {
28
+ selector: string;
29
+ optimizedSelector: string;
30
+ improvementMs: number;
31
+ improvementPercent: number;
32
+ lineNumber?: number;
33
+ selectorFile?: string;
34
+ testFile: string;
35
+ usageCount: number;
36
+ duration?: number;
37
+ optimizedDuration?: number;
38
+ }
39
+ /**
40
+ * File-based grouping with subtotals for reporting
41
+ */
42
+ export interface FileGroup {
43
+ filePath: string;
44
+ optimizations: GroupedOptimization[];
45
+ totalSavingsMs: number;
46
+ totalSavingsWithUsage: number;
47
+ }
48
+ //# sourceMappingURL=reporting-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reporting-types.d.ts","sourceRoot":"","sources":["../../src/mobileSelectorPerformanceOptimizer/reporting-types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,aAAa;IAC1B,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,kBAAkB,EAAE,MAAM,CAAA;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC1B;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB;;;OAGG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAA;CACjC;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAChC,QAAQ,EAAE,MAAM,CAAA;IAChB,iBAAiB,EAAE,MAAM,CAAA;IACzB,aAAa,EAAE,MAAM,CAAA;IACrB,kBAAkB,EAAE,MAAM,CAAA;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACtB,QAAQ,EAAE,MAAM,CAAA;IAChB,aAAa,EAAE,mBAAmB,EAAE,CAAA;IACpC,cAAc,EAAE,MAAM,CAAA;IACtB,qBAAqB,EAAE,MAAM,CAAA;CAChC"}
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Performance data for a selector operation
3
+ */
4
+ export interface SelectorPerformanceData {
5
+ testFile: string;
6
+ suiteName: string;
7
+ testName: string;
8
+ lineNumber?: number;
9
+ selectorFile?: string;
10
+ selector: string;
11
+ selectorType: string;
12
+ duration: number;
13
+ timestamp: number;
14
+ deviceName?: string;
15
+ optimizedSelector?: string;
16
+ optimizedDuration?: number;
17
+ improvementMs?: number;
18
+ improvementPercent?: number;
19
+ }
20
+ /**
21
+ * Timing information for a command execution
22
+ */
23
+ export interface CommandTiming {
24
+ startTime: number;
25
+ commandName: string;
26
+ selector: string;
27
+ formattedSelector: string;
28
+ selectorType?: string;
29
+ timingId: string;
30
+ isUserCommand: boolean;
31
+ lineNumber?: number;
32
+ }
33
+ /**
34
+ * Test context information
35
+ */
36
+ export interface TestContext {
37
+ testFile?: string;
38
+ suiteName: string;
39
+ testName: string;
40
+ lineNumber?: number;
41
+ selectorFile?: string;
42
+ }
43
+ /**
44
+ * Options for selector optimization
45
+ */
46
+ export interface OptimizationOptions {
47
+ browser: WebdriverIO.Browser | WebdriverIO.MultiRemoteBrowser;
48
+ isReplacingSelector: {
49
+ value: boolean;
50
+ };
51
+ pageObjectPaths: string[];
52
+ }
53
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/mobileSelectorPerformanceOptimizer/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACpC,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,EAAE,MAAM,CAAA;IAChB,YAAY,EAAE,MAAM,CAAA;IACpB,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAA;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC1B,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,iBAAiB,EAAE,MAAM,CAAA;IACzB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,EAAE,MAAM,CAAA;IAChB,aAAa,EAAE,OAAO,CAAA;IACtB,UAAU,CAAC,EAAE,MAAM,CAAA;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,YAAY,CAAC,EAAE,MAAM,CAAA;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAChC,OAAO,EAAE,WAAW,CAAC,OAAO,GAAG,WAAW,CAAC,kBAAkB,CAAA;IAC7D,mBAAmB,EAAE;QAAE,KAAK,EAAE,OAAO,CAAA;KAAE,CAAA;IACvC,eAAe,EAAE,MAAM,EAAE,CAAA;CAC5B"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Checks if the browser is in native context.
3
+ * MSPO only works in native context, not in webview context.
4
+ */
5
+ export declare function isNativeContext(browser?: WebdriverIO.Browser | WebdriverIO.MultiRemoteBrowser): boolean;
6
+ //# sourceMappingURL=browser-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser-utils.d.ts","sourceRoot":"","sources":["../../../src/mobileSelectorPerformanceOptimizer/utils/browser-utils.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,wBAAgB,eAAe,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC,OAAO,GAAG,WAAW,CAAC,kBAAkB,GAAG,OAAO,CAiBvG"}
@@ -0,0 +1,10 @@
1
+ import type { CommandTiming } from '../types.js';
2
+ /**
3
+ * Finds the most recent user command that hasn't been matched with an internal command yet.
4
+ */
5
+ export declare function findMostRecentUnmatchedUserCommand(commandTimings: Map<string, CommandTiming>): [string, CommandTiming] | undefined;
6
+ /**
7
+ * Finds the matching internal command timing entry for a given formatted selector and selector type.
8
+ */
9
+ export declare function findMatchingInternalCommandTiming(commandTimings: Map<string, CommandTiming>, formattedSelector: string, selectorType: string): [string, CommandTiming] | undefined;
10
+ //# sourceMappingURL=command-timing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command-timing.d.ts","sourceRoot":"","sources":["../../../src/mobileSelectorPerformanceOptimizer/utils/command-timing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAEhD;;GAEG;AACH,wBAAgB,kCAAkC,CAC9C,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,GAC3C,CAAC,MAAM,EAAE,aAAa,CAAC,GAAG,SAAS,CAIrC;AAED;;GAEG;AACH,wBAAgB,iCAAiC,CAC7C,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,EAC1C,iBAAiB,EAAE,MAAM,EACzB,YAAY,EAAE,MAAM,GACrB,CAAC,MAAM,EAAE,aAAa,CAAC,GAAG,SAAS,CAQrC"}
@@ -0,0 +1,14 @@
1
+ export declare const LOG_PREFIX = "Mobile Selector Performance";
2
+ export declare const SINGLE_ELEMENT_COMMANDS: readonly ["$", "custom$"];
3
+ export declare const MULTIPLE_ELEMENT_COMMANDS: readonly ["$$", "custom$$"];
4
+ export declare const USER_COMMANDS: readonly ["$", "custom$", "$$", "custom$$"];
5
+ export declare const REPORT_INDENT_SUMMARY = " ";
6
+ export declare const REPORT_INDENT_FILE = " ";
7
+ export declare const REPORT_INDENT_SUITE = " ";
8
+ export declare const REPORT_INDENT_TEST = " ";
9
+ export declare const REPORT_INDENT_SELECTOR = " ";
10
+ export declare const REPORT_INDENT_SHARED = " ";
11
+ export declare const REPORT_INDENT_SHARED_DETAIL = " ";
12
+ export declare const REPORT_INDENT_WHY_CHANGE = " ";
13
+ export declare const REPORT_INDENT_DOCS = " ";
14
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/mobileSelectorPerformanceOptimizer/utils/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,gCAAgC,CAAA;AAEvD,eAAO,MAAM,uBAAuB,2BAA4B,CAAA;AAChE,eAAO,MAAM,yBAAyB,6BAA8B,CAAA;AACpE,eAAO,MAAM,aAAa,6CAAsE,CAAA;AAEhG,eAAO,MAAM,qBAAqB,QAAQ,CAAA;AAC1C,eAAO,MAAM,kBAAkB,QAAQ,CAAA;AACvC,eAAO,MAAM,mBAAmB,WAAW,CAAA;AAC3C,eAAO,MAAM,kBAAkB,cAAc,CAAA;AAC7C,eAAO,MAAM,sBAAsB,iBAAiB,CAAA;AACpD,eAAO,MAAM,oBAAoB,WAAW,CAAA;AAC5C,eAAO,MAAM,2BAA2B,cAAc,CAAA;AACtD,eAAO,MAAM,wBAAwB,WAAW,CAAA;AAChD,eAAO,MAAM,kBAAkB,aAAa,CAAA"}
@@ -0,0 +1,15 @@
1
+ import type { SelectorLocation } from './selector-location.js';
2
+ /**
3
+ * Formats a selector for display/logging purposes (truncates long selectors).
4
+ */
5
+ export declare function formatSelectorForDisplay(selector: string | object, maxLength?: number): string;
6
+ /**
7
+ * Formats selector locations into a human-readable string for CLI output.
8
+ * Handles single, multiple, and no locations.
9
+ */
10
+ export declare function formatSelectorLocations(locations: SelectorLocation[]): string;
11
+ /**
12
+ * Logs the optimization conclusion.
13
+ */
14
+ export declare function logOptimizationConclusion(timeDifference: number, improvementPercent: number, originalSelector: string, optimizedSelector: string, locationInfo?: string): void;
15
+ //# sourceMappingURL=formatting.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatting.d.ts","sourceRoot":"","sources":["../../../src/mobileSelectorPerformanceOptimizer/utils/formatting.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAK9D;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,SAAS,GAAE,MAAY,GAAG,MAAM,CASnG;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,gBAAgB,EAAE,GAAG,MAAM,CAiB7E;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CACrC,cAAc,EAAE,MAAM,EACtB,kBAAkB,EAAE,MAAM,EAC1B,gBAAgB,EAAE,MAAM,EACxB,iBAAiB,EAAE,MAAM,EACzB,YAAY,GAAE,MAAW,GAC1B,IAAI,CAeN"}
@@ -0,0 +1,22 @@
1
+ export * from './constants.js';
2
+ export * from './test-context.js';
3
+ export * from './selector-location.js';
4
+ export * from './selector-utils.js';
5
+ export * from './browser-utils.js';
6
+ export * from './timing.js';
7
+ export * from './selector-testing.js';
8
+ export * from './optimization.js';
9
+ export * from './formatting.js';
10
+ export * from './performance-data.js';
11
+ export * from './command-timing.js';
12
+ export * from './reporter.js';
13
+ export * from './xpath-types.js';
14
+ export * from './xpath-constants.js';
15
+ export * from './xpath-detection.js';
16
+ export * from './xpath-conditions.js';
17
+ export * from './xpath-predicate.js';
18
+ export * from './xpath-class-chain.js';
19
+ export * from './xpath-page-source.js';
20
+ export * from './xpath-selector-builder.js';
21
+ export * from './xpath-converter.js';
22
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/mobileSelectorPerformanceOptimizer/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,mBAAmB,CAAA;AACjC,cAAc,wBAAwB,CAAA;AACtC,cAAc,qBAAqB,CAAA;AACnC,cAAc,oBAAoB,CAAA;AAClC,cAAc,aAAa,CAAA;AAC3B,cAAc,uBAAuB,CAAA;AACrC,cAAc,mBAAmB,CAAA;AACjC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,uBAAuB,CAAA;AACrC,cAAc,qBAAqB,CAAA;AACnC,cAAc,eAAe,CAAA;AAE7B,cAAc,kBAAkB,CAAA;AAChC,cAAc,sBAAsB,CAAA;AACpC,cAAc,sBAAsB,CAAA;AACpC,cAAc,uBAAuB,CAAA;AACrC,cAAc,sBAAsB,CAAA;AACpC,cAAc,wBAAwB,CAAA;AACtC,cAAc,wBAAwB,CAAA;AACtC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,sBAAsB,CAAA"}
@@ -0,0 +1,8 @@
1
+ import type { XPathConversionResult } from './xpath-types.js';
2
+ /**
3
+ * Finds an optimized selector for a given XPath.
4
+ */
5
+ export declare function findOptimizedSelector(xpath: string, options: {
6
+ browser: WebdriverIO.Browser | WebdriverIO.MultiRemoteBrowser;
7
+ }): Promise<XPathConversionResult | null>;
8
+ //# sourceMappingURL=optimization.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"optimization.d.ts","sourceRoot":"","sources":["../../../src/mobileSelectorPerformanceOptimizer/utils/optimization.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAA;AAO7D;;GAEG;AACH,wBAAsB,qBAAqB,CACvC,KAAK,EAAE,MAAM,EACb,OAAO,EAAE;IACL,OAAO,EAAE,WAAW,CAAC,OAAO,GAAG,WAAW,CAAC,kBAAkB,CAAA;CAChE,GACF,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC,CAUvC"}
@@ -0,0 +1,10 @@
1
+ import type { TestContext, SelectorPerformanceData, CommandTiming } from '../types.js';
2
+ /**
3
+ * Creates optimized selector performance data object.
4
+ */
5
+ export declare function createOptimizedSelectorData(testContext: TestContext, originalSelector: string, originalDuration: number, optimizedSelector: string, optimizedDuration: number): SelectorPerformanceData;
6
+ /**
7
+ * Stores performance data for a selector operation.
8
+ */
9
+ export declare function storePerformanceData(timing: CommandTiming, duration: number, testContext: TestContext): void;
10
+ //# sourceMappingURL=performance-data.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"performance-data.d.ts","sourceRoot":"","sources":["../../../src/mobileSelectorPerformanceOptimizer/utils/performance-data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAGtF;;GAEG;AACH,wBAAgB,2BAA2B,CACvC,WAAW,EAAE,WAAW,EACxB,gBAAgB,EAAE,MAAM,EACxB,gBAAgB,EAAE,MAAM,EACxB,iBAAiB,EAAE,MAAM,EACzB,iBAAiB,EAAE,MAAM,GAC1B,uBAAuB,CAoBzB;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAChC,MAAM,EAAE,aAAa,EACrB,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,WAAW,GACzB,IAAI,CAcN"}
@@ -0,0 +1,16 @@
1
+ import type { Options, Reporters } from '@wdio/types';
2
+ import type { AppiumServiceConfig } from '../../types.js';
3
+ /**
4
+ * Checks if a reporter with the given name is already registered in the config.
5
+ */
6
+ export declare function isReporterRegistered(reporters: Reporters.ReporterEntry[], reporterName: string): boolean;
7
+ /**
8
+ * Determines the report directory path using the fallback chain:
9
+ * 1. reportPath from trackSelectorPerformance service options
10
+ * 2. config.outputDir
11
+ * 3. appiumServiceOptions.logPath
12
+ * 4. appiumServiceOptions.args.log (directory from log file path)
13
+ * 5. Throws error if none are set
14
+ */
15
+ export declare function determineReportDirectory(reportPath?: string, config?: Options.Testrunner, appiumServiceOptions?: AppiumServiceConfig): string;
16
+ //# sourceMappingURL=reporter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reporter.d.ts","sourceRoot":"","sources":["../../../src/mobileSelectorPerformanceOptimizer/utils/reporter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACrD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AAEzD;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,SAAS,CAAC,aAAa,EAAE,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAcxG;AAED;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CACpC,UAAU,CAAC,EAAE,MAAM,EACnB,MAAM,CAAC,EAAE,OAAO,CAAC,UAAU,EAC3B,oBAAoB,CAAC,EAAE,mBAAmB,GAC3C,MAAM,CA4BR"}
@@ -0,0 +1,20 @@
1
+ export interface SelectorLocation {
2
+ file: string;
3
+ line: number;
4
+ isPageObject: boolean;
5
+ }
6
+ /**
7
+ * Searches for a selector in the test file and related page object files.
8
+ * Returns all locations where the selector is defined.
9
+ *
10
+ * Strategy:
11
+ * 1. First search the test file itself
12
+ * 2. If pageObjectPaths provided, search those directories
13
+ * 3. Otherwise, search related page object files (guessing from test file name)
14
+ * 4. Return all matches with file and line number
15
+ *
16
+ * IMPORTANT: Only searches for XPath selectors (starting with // or /).
17
+ * This prevents searching for optimized selectors like accessibility IDs or class chains.
18
+ */
19
+ export declare function findSelectorLocation(testFile: string | undefined, selector: string, pageObjectPaths?: string[]): SelectorLocation[];
20
+ //# sourceMappingURL=selector-location.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"selector-location.d.ts","sourceRoot":"","sources":["../../../src/mobileSelectorPerformanceOptimizer/utils/selector-location.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,gBAAgB;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,YAAY,EAAE,OAAO,CAAA;CACxB;AAkJD;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CAChC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,QAAQ,EAAE,MAAM,EAChB,eAAe,CAAC,EAAE,MAAM,EAAE,GAC3B,gBAAgB,EAAE,CAoEpB"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Tests an optimized selector and returns the element reference and duration.
3
+ */
4
+ export declare function testOptimizedSelector(browser: WebdriverIO.Browser | WebdriverIO.MultiRemoteBrowser, using: string, value: string, isMultiple: boolean, debug?: boolean): Promise<{
5
+ elementRefs: Array<{
6
+ [key: string]: string;
7
+ }>;
8
+ duration: number;
9
+ } | null>;
10
+ //# sourceMappingURL=selector-testing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"selector-testing.d.ts","sourceRoot":"","sources":["../../../src/mobileSelectorPerformanceOptimizer/utils/selector-testing.ts"],"names":[],"mappings":"AA4GA;;GAEG;AACH,wBAAsB,qBAAqB,CACvC,OAAO,EAAE,WAAW,CAAC,OAAO,GAAG,WAAW,CAAC,kBAAkB,EAC7D,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,OAAO,EACnB,KAAK,GAAE,OAAe,GACvB,OAAO,CAAC;IAAE,WAAW,EAAE,KAAK,CAAC;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,CAiIrF"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Checks if a command is an element find command ($, $$, custom$, etc.).
3
+ * These commands return elements and should NOT be tracked as element actions.
4
+ * Based on WebdriverIO source: packages/webdriverio/src/commands/element/
5
+ * - $, $$, custom$, custom$$, shadow$, shadow$$ are marked as @type utility
6
+ * - getElement, getElements, nextElement, previousElement, parentElement are also @type utility
7
+ */
8
+ export declare function isElementFindCommand(commandName: string): boolean;
9
+ /**
10
+ * Extracts a selector string from command arguments.
11
+ */
12
+ export declare function extractSelectorFromArgs(args: unknown[]): string | null;
13
+ /**
14
+ * Checks if a selector is an XPath selector.
15
+ * Uses pattern matching to distinguish XPath from CSS selectors.
16
+ *
17
+ * XPath patterns detected:
18
+ * - Absolute path: /html, //div, //*
19
+ * - Relative path: ./div, ../parent
20
+ * - Descendant any: asterisk followed by slash, e.g. asterisk/child
21
+ * - Grouped expressions: (//div)[1] - must contain XPath-like content
22
+ *
23
+ * Not XPath (CSS selectors):
24
+ * - Pseudo-selectors starting with (: e.g., (:has(...))
25
+ * - Class selectors: .class
26
+ * - ID selectors: #id
27
+ * - Tag selectors: div, button
28
+ */
29
+ export declare function isXPathSelector(selector: unknown): selector is string;
30
+ /**
31
+ * Parses an optimized selector string into WebDriver using/value format.
32
+ */
33
+ export declare function parseOptimizedSelector(optimizedSelector: string): {
34
+ using: string;
35
+ value: string;
36
+ } | null;
37
+ //# sourceMappingURL=selector-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"selector-utils.d.ts","sourceRoot":"","sources":["../../../src/mobileSelectorPerformanceOptimizer/utils/selector-utils.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CASjE;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,GAAG,IAAI,CAoBtE;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,MAAM,CAoBrE;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,iBAAiB,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAoBzG"}
@@ -0,0 +1,24 @@
1
+ import type { Frameworks } from '@wdio/types';
2
+ import type { TestContext } from '../types.js';
3
+ /**
4
+ * Extracts the test file path from a test or suite object.
5
+ * Follows the same pattern as wdio-spec-reporter for consistency.
6
+ *
7
+ * For suites: uses suite.file directly (works for Mocha, Jasmine, Cucumber)
8
+ * For tests: uses test.file if available, otherwise gets from parent suite
9
+ */
10
+ export declare function extractTestFile(test?: Frameworks.Test, suite?: Frameworks.Suite): string | undefined;
11
+ /**
12
+ * Extracts the suite name from a test object.
13
+ */
14
+ export declare function extractSuiteName(test?: Frameworks.Test): string;
15
+ /**
16
+ * Extracts the test name from a test object.
17
+ */
18
+ export declare function extractTestName(test?: Frameworks.Test): string;
19
+ /**
20
+ * Builds a complete test context object from a test object and test file.
21
+ * Note: Line numbers are not included here as they require a specific selector to search for.
22
+ */
23
+ export declare function buildTestContext(test?: Frameworks.Test, testFile?: string): TestContext;
24
+ //# sourceMappingURL=test-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-context.d.ts","sourceRoot":"","sources":["../../../src/mobileSelectorPerformanceOptimizer/utils/test-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAE9C;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,UAAU,CAAC,KAAK,GAAG,MAAM,GAAG,SAAS,CAuBpG;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC,IAAI,GAAG,MAAM,CAoB/D;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC,IAAI,GAAG,MAAM,CAM9D;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC,IAAI,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,WAAW,CAOvF"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Gets high-resolution time in milliseconds.
3
+ * Uses performance.now() which is available in Node.js v18+ (WebdriverIO's minimum requirement)
4
+ * and provides microsecond precision.
5
+ */
6
+ export declare function getHighResTime(): number;
7
+ //# sourceMappingURL=timing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timing.d.ts","sourceRoot":"","sources":["../../../src/mobileSelectorPerformanceOptimizer/utils/timing.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAEvC"}
@@ -0,0 +1,10 @@
1
+ import type { XPathConversionResult } from './xpath-types.js';
2
+ /**
3
+ * Attempts to convert XPath to iOS Class Chain.
4
+ * Handles hierarchy traversal and element filtering.
5
+ *
6
+ * @param xpath - The XPath selector to convert
7
+ * @returns Conversion result with class chain selector, or null if not applicable
8
+ */
9
+ export declare function convertXPathToClassChain(xpath: string): XPathConversionResult | null;
10
+ //# sourceMappingURL=xpath-class-chain.d.ts.map