pw-core 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +777 -0
- package/dist/codegen/config/context-weights.d.ts +8 -0
- package/dist/codegen/config/context-weights.js +11 -0
- package/dist/codegen/config/ignored-attributes.d.ts +1 -0
- package/dist/codegen/config/ignored-attributes.js +4 -0
- package/dist/codegen/config/ignored-classes.d.ts +1 -0
- package/dist/codegen/config/ignored-classes.js +144 -0
- package/dist/codegen/config/ignored-values.d.ts +1 -0
- package/dist/codegen/config/ignored-values.js +4 -0
- package/dist/codegen/config/index.d.ts +29 -0
- package/dist/codegen/config/index.js +17 -0
- package/dist/codegen/config/strategy-order.d.ts +1 -0
- package/dist/codegen/config/strategy-order.js +18 -0
- package/dist/codegen/config/weights.d.ts +15 -0
- package/dist/codegen/config/weights.js +18 -0
- package/dist/codegen/floating-panel/client.d.ts +1 -0
- package/dist/codegen/floating-panel/client.js +248 -0
- package/dist/codegen/floating-panel/index.d.ts +4 -0
- package/dist/codegen/floating-panel/index.js +20 -0
- package/dist/codegen/floating-panel/manager.d.ts +19 -0
- package/dist/codegen/floating-panel/manager.js +90 -0
- package/dist/codegen/floating-panel/template.d.ts +2 -0
- package/dist/codegen/floating-panel/template.js +58 -0
- package/dist/codegen/floating-panel/types.d.ts +7 -0
- package/dist/codegen/floating-panel/types.js +2 -0
- package/dist/codegen/generator/action.validator.d.ts +5 -0
- package/dist/codegen/generator/action.validator.js +27 -0
- package/dist/codegen/generator/index.d.ts +13 -0
- package/dist/codegen/generator/index.js +724 -0
- package/dist/codegen/generator/locator.restricted.d.ts +36 -0
- package/dist/codegen/generator/locator.restricted.js +127 -0
- package/dist/codegen/generator/locator.validator.d.ts +8 -0
- package/dist/codegen/generator/locator.validator.js +38 -0
- package/dist/codegen/hover-tracker/client.d.ts +1 -0
- package/dist/codegen/hover-tracker/client.js +75 -0
- package/dist/codegen/hover-tracker/index.d.ts +3 -0
- package/dist/codegen/hover-tracker/index.js +19 -0
- package/dist/codegen/hover-tracker/manager.d.ts +11 -0
- package/dist/codegen/hover-tracker/manager.js +28 -0
- package/dist/codegen/hover-tracker/types.d.ts +3 -0
- package/dist/codegen/hover-tracker/types.js +2 -0
- package/dist/codegen/index.d.ts +35 -0
- package/dist/codegen/index.js +1147 -0
- package/dist/codegen/key-utils.d.ts +23 -0
- package/dist/codegen/key-utils.js +68 -0
- package/dist/codegen/scorer/base-score.d.ts +1 -0
- package/dist/codegen/scorer/base-score.js +7 -0
- package/dist/codegen/scorer/context-score.d.ts +2 -0
- package/dist/codegen/scorer/context-score.js +27 -0
- package/dist/codegen/scorer/index.d.ts +5 -0
- package/dist/codegen/scorer/index.js +23 -0
- package/dist/codegen/scorer/locator.ranking.d.ts +15 -0
- package/dist/codegen/scorer/locator.ranking.js +83 -0
- package/dist/codegen/scorer/semantic-score.d.ts +1 -0
- package/dist/codegen/scorer/semantic-score.js +47 -0
- package/dist/codegen/types.d.ts +35 -0
- package/dist/codegen/types.js +2 -0
- package/dist/component/table.js +14 -10
- package/dist/constants/methods.d.ts +2 -0
- package/dist/constants/methods.js +33 -0
- package/dist/constants/strategies.d.ts +2 -0
- package/dist/constants/strategies.js +47 -0
- package/dist/page/actions/locator-actions.js +15 -4
- package/dist/page/assertions/verify-chain.d.ts +39 -32
- package/dist/page/assertions/verify-chain.js +18 -4
- package/dist/page/assertions/verify-helpers.js +12 -3
- package/dist/page/config.d.ts +109 -71
- package/dist/page/config.js +10 -31
- package/dist/page/locators/dynamic-locator-resolver.js +29 -9
- package/dist/page/locators/resolver.d.ts +15 -15
- package/dist/page/locators/resolver.js +151 -32
- package/dist/page/registry.d.ts +43 -6
- package/dist/page/registry.js +90 -18
- package/dist/page/typed-page.d.ts +33 -29
- package/dist/page/typed-page.js +40 -11
- package/dist/page/types/proxy-methods.d.ts +69 -54
- package/dist/page/types/validation.d.ts +48 -1
- package/dist/page/utils/caller-location.js +13 -9
- package/dist/page/utils/formatter.js +6 -3
- package/dist/types/methods.d.ts +4 -0
- package/dist/types/methods.js +2 -0
- package/dist/types/strategies.d.ts +17 -0
- package/dist/types/strategies.js +2 -0
- package/package.json +8 -1
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export declare const exactUtilities: string[];
|
|
2
|
+
export declare const tailwindPrefixes: string[];
|
|
3
|
+
export declare const stateClasses: string[];
|
|
4
|
+
export declare const decorativeList: string[];
|
|
5
|
+
export declare const PATTERNS: {
|
|
6
|
+
stylePatterns: {
|
|
7
|
+
marginPadding: string;
|
|
8
|
+
displayLayout: string;
|
|
9
|
+
positioning: string;
|
|
10
|
+
dimensions: string;
|
|
11
|
+
colorsAndBorders: string;
|
|
12
|
+
typography: string;
|
|
13
|
+
flexboxGridAlign: string;
|
|
14
|
+
spacing: string;
|
|
15
|
+
transitionsAnimations: string;
|
|
16
|
+
miscStyles: string;
|
|
17
|
+
interactivity: string;
|
|
18
|
+
easeCurves: string;
|
|
19
|
+
flexGridGrowShrink: string;
|
|
20
|
+
layoutOverflow: string;
|
|
21
|
+
};
|
|
22
|
+
restrictedTexts: {
|
|
23
|
+
welcome: string;
|
|
24
|
+
ago: string;
|
|
25
|
+
dollar: string;
|
|
26
|
+
colon: string;
|
|
27
|
+
};
|
|
28
|
+
unstableIdentifiers: {
|
|
29
|
+
uuidPattern: string;
|
|
30
|
+
numericPattern: string;
|
|
31
|
+
hexHashPattern: string;
|
|
32
|
+
longAlphaNumPattern: string;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export declare const stylePatterns: string[];
|
|
36
|
+
export declare function isRestrictedClass(cName: string): boolean;
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.stylePatterns = exports.PATTERNS = exports.decorativeList = exports.stateClasses = exports.tailwindPrefixes = exports.exactUtilities = void 0;
|
|
4
|
+
exports.isRestrictedClass = isRestrictedClass;
|
|
5
|
+
exports.exactUtilities = [
|
|
6
|
+
'flex',
|
|
7
|
+
'grid',
|
|
8
|
+
'relative',
|
|
9
|
+
'absolute',
|
|
10
|
+
'sticky',
|
|
11
|
+
'group',
|
|
12
|
+
'dark',
|
|
13
|
+
'light',
|
|
14
|
+
'transition',
|
|
15
|
+
'transition-all',
|
|
16
|
+
'duration',
|
|
17
|
+
'rounded',
|
|
18
|
+
'shadow'
|
|
19
|
+
];
|
|
20
|
+
exports.tailwindPrefixes = [
|
|
21
|
+
'm-',
|
|
22
|
+
'mt-',
|
|
23
|
+
'mb-',
|
|
24
|
+
'ml-',
|
|
25
|
+
'mx-',
|
|
26
|
+
'my-',
|
|
27
|
+
'p-',
|
|
28
|
+
'px-',
|
|
29
|
+
'py-',
|
|
30
|
+
'text-',
|
|
31
|
+
'bg-',
|
|
32
|
+
'flex-',
|
|
33
|
+
'grid-',
|
|
34
|
+
'justify-',
|
|
35
|
+
'items-',
|
|
36
|
+
'gap-',
|
|
37
|
+
'space-',
|
|
38
|
+
'w-',
|
|
39
|
+
'h-',
|
|
40
|
+
'min-',
|
|
41
|
+
'max-',
|
|
42
|
+
'translate-',
|
|
43
|
+
'scale-',
|
|
44
|
+
'rotate-',
|
|
45
|
+
'duration-',
|
|
46
|
+
'transition-',
|
|
47
|
+
'opacity-',
|
|
48
|
+
'border-',
|
|
49
|
+
'rounded-',
|
|
50
|
+
'shadow-',
|
|
51
|
+
'cursor-',
|
|
52
|
+
'delay-',
|
|
53
|
+
'ease-',
|
|
54
|
+
'overflow-'
|
|
55
|
+
];
|
|
56
|
+
exports.stateClasses = [
|
|
57
|
+
'active',
|
|
58
|
+
'selected',
|
|
59
|
+
'open',
|
|
60
|
+
'expanded',
|
|
61
|
+
'collapsed',
|
|
62
|
+
'hover',
|
|
63
|
+
'focused',
|
|
64
|
+
'scale-105',
|
|
65
|
+
'opacity-100'
|
|
66
|
+
];
|
|
67
|
+
exports.decorativeList = [
|
|
68
|
+
'dot',
|
|
69
|
+
'icon',
|
|
70
|
+
'circle',
|
|
71
|
+
'line',
|
|
72
|
+
'separator',
|
|
73
|
+
'bullet',
|
|
74
|
+
'caret',
|
|
75
|
+
'arrow',
|
|
76
|
+
'chevron',
|
|
77
|
+
'svg',
|
|
78
|
+
'polygon',
|
|
79
|
+
'polyline',
|
|
80
|
+
'path',
|
|
81
|
+
'marker',
|
|
82
|
+
'logo'
|
|
83
|
+
];
|
|
84
|
+
exports.PATTERNS = {
|
|
85
|
+
stylePatterns: {
|
|
86
|
+
marginPadding: '^[mp][trblxy]?-?\\d+$',
|
|
87
|
+
displayLayout: '^(flex|grid|block|inline|hidden|table)$',
|
|
88
|
+
positioning: '^(relative|absolute|fixed|sticky)$',
|
|
89
|
+
dimensions: '^(w|h|min-w|min-h|max-w|max-h)-\\d+$',
|
|
90
|
+
colorsAndBorders: '^(text|bg|border|ring|divide|from|to|via)-[a-z]+',
|
|
91
|
+
typography: '^(font|leading|tracking|whitespace|break|align|list|underline|line-through)-',
|
|
92
|
+
flexboxGridAlign: '^(items|justify|content|self|place)-',
|
|
93
|
+
spacing: '^(gap|space)-',
|
|
94
|
+
transitionsAnimations: '^(duration|delay|ease|animate|transition|origin|scale|opacity|rotate|skew)-',
|
|
95
|
+
miscStyles: '^(border|rounded|shadow|opacity|z|top|bottom|left|right|inset)-',
|
|
96
|
+
interactivity: '^(select|cursor|pointer-events|resize)-',
|
|
97
|
+
easeCurves: '^ease-',
|
|
98
|
+
flexGridGrowShrink: '^(grow|shrink|order|col|row)-',
|
|
99
|
+
layoutOverflow: '^overflow-'
|
|
100
|
+
},
|
|
101
|
+
restrictedTexts: {
|
|
102
|
+
welcome: 'welcome',
|
|
103
|
+
ago: 'ago',
|
|
104
|
+
dollar: '$',
|
|
105
|
+
colon: ':'
|
|
106
|
+
},
|
|
107
|
+
unstableIdentifiers: {
|
|
108
|
+
uuidPattern: 'uuid|guid|hash',
|
|
109
|
+
numericPattern: '^\\d+$',
|
|
110
|
+
hexHashPattern: '^[a-f0-9]{8,}$',
|
|
111
|
+
longAlphaNumPattern: '^[a-z0-9]{20,}$'
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
exports.stylePatterns = Object.values(exports.PATTERNS.stylePatterns);
|
|
115
|
+
function isRestrictedClass(cName) {
|
|
116
|
+
if (cName.includes('[') && cName.includes(']'))
|
|
117
|
+
return true;
|
|
118
|
+
if (cName.includes(':'))
|
|
119
|
+
return true;
|
|
120
|
+
if (exports.exactUtilities.includes(cName))
|
|
121
|
+
return true;
|
|
122
|
+
if (exports.stateClasses.includes(cName.toLowerCase()))
|
|
123
|
+
return true;
|
|
124
|
+
if (exports.tailwindPrefixes.some((prefix) => cName.startsWith(prefix)))
|
|
125
|
+
return true;
|
|
126
|
+
return exports.stylePatterns.some((pat) => new RegExp(pat).test(cName));
|
|
127
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { LocatorCandidate } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Validates if the selected candidate has a partial of the target element's text.
|
|
4
|
+
* If target element has text, splits the text into words/partials.
|
|
5
|
+
* Checks if candidate.locator or candidate.selector contains any of these words (case-insensitive).
|
|
6
|
+
* If it doesn't, we should choose the text strategy instead.
|
|
7
|
+
*/
|
|
8
|
+
export declare function validateAndSelectLocator(candidate: LocatorCandidate, candidates: LocatorCandidate[], targetText: string): LocatorCandidate;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateAndSelectLocator = validateAndSelectLocator;
|
|
4
|
+
/**
|
|
5
|
+
* Validates if the selected candidate has a partial of the target element's text.
|
|
6
|
+
* If target element has text, splits the text into words/partials.
|
|
7
|
+
* Checks if candidate.locator or candidate.selector contains any of these words (case-insensitive).
|
|
8
|
+
* If it doesn't, we should choose the text strategy instead.
|
|
9
|
+
*/
|
|
10
|
+
function validateAndSelectLocator(candidate, candidates, targetText) {
|
|
11
|
+
if (!targetText) {
|
|
12
|
+
return candidate;
|
|
13
|
+
}
|
|
14
|
+
// Parse words/partials from the target element's text
|
|
15
|
+
// Lowercase, split by whitespace, and remove non-alphanumeric characters
|
|
16
|
+
const words = targetText
|
|
17
|
+
.toLowerCase()
|
|
18
|
+
.split(/\s+/)
|
|
19
|
+
.map(w => w.replace(/[^\w]/g, ''))
|
|
20
|
+
.filter(Boolean);
|
|
21
|
+
if (words.length === 0) {
|
|
22
|
+
return candidate;
|
|
23
|
+
}
|
|
24
|
+
// Check if candidate locator or selector contains any of these words
|
|
25
|
+
const locatorLower = (candidate.locator || '').toLowerCase();
|
|
26
|
+
const selectorLower = (candidate.selector || '').toLowerCase();
|
|
27
|
+
const matches = words.some(word => locatorLower.includes(word) || selectorLower.includes(word));
|
|
28
|
+
if (matches) {
|
|
29
|
+
return candidate;
|
|
30
|
+
}
|
|
31
|
+
// Else you have to choose the text as your locator strategy
|
|
32
|
+
// Find the text candidate that targets the element directly (source === 'target')
|
|
33
|
+
const textCandidate = candidates.find(c => c.strategy === 'text' && c.source === 'target');
|
|
34
|
+
if (textCandidate) {
|
|
35
|
+
return textCandidate;
|
|
36
|
+
}
|
|
37
|
+
return candidate;
|
|
38
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function clientHoverTracker(): void;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.clientHoverTracker = clientHoverTracker;
|
|
4
|
+
function clientHoverTracker() {
|
|
5
|
+
let lastHoveredElement = null;
|
|
6
|
+
let hoverEntryTime = 0;
|
|
7
|
+
let lastRecordedHover = null;
|
|
8
|
+
let lastMutationTime = 0;
|
|
9
|
+
const getUniqueCssSelector = (el) => {
|
|
10
|
+
if (el.getAttribute('data-testid')) {
|
|
11
|
+
return `[data-testid="${el.getAttribute('data-testid')}"]`;
|
|
12
|
+
}
|
|
13
|
+
if (el.getAttribute('data-parent-id')) {
|
|
14
|
+
return `[data-parent-id="${el.getAttribute('data-parent-id')}"]`;
|
|
15
|
+
}
|
|
16
|
+
if (el.id) {
|
|
17
|
+
return `#${el.id}`;
|
|
18
|
+
}
|
|
19
|
+
if (el.tagName === 'BODY')
|
|
20
|
+
return 'body';
|
|
21
|
+
let path = el.tagName.toLowerCase();
|
|
22
|
+
if (el.className) {
|
|
23
|
+
const firstClass = el.className.split(/\s+/)[0];
|
|
24
|
+
if (firstClass && !firstClass.includes('[') && !firstClass.includes(':')) {
|
|
25
|
+
path += `.${firstClass}`;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return path;
|
|
29
|
+
};
|
|
30
|
+
const observer = new MutationObserver(() => {
|
|
31
|
+
lastMutationTime = Date.now();
|
|
32
|
+
// Case 2: Delayed mutation happens after 150ms of hover
|
|
33
|
+
if (lastHoveredElement && lastRecordedHover !== lastHoveredElement) {
|
|
34
|
+
const elapsed = Date.now() - hoverEntryTime;
|
|
35
|
+
if (elapsed >= 150) {
|
|
36
|
+
lastRecordedHover = lastHoveredElement;
|
|
37
|
+
const selector = getUniqueCssSelector(lastHoveredElement);
|
|
38
|
+
if (selector && window.__pwCoreRecordHover) {
|
|
39
|
+
;
|
|
40
|
+
window.__pwCoreRecordHover(selector);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
observer.observe(document.documentElement, {
|
|
46
|
+
childList: true,
|
|
47
|
+
subtree: true,
|
|
48
|
+
attributes: true
|
|
49
|
+
});
|
|
50
|
+
document.addEventListener('mouseover', (e) => {
|
|
51
|
+
const target = e.target;
|
|
52
|
+
if (!target || target.closest('#pw-core-codegen-panel'))
|
|
53
|
+
return;
|
|
54
|
+
const hoverTarget = target.closest('button, a, [role="menuitem"], [role="option"], .menu-item, [data-testid], svg, path, [data-parent-id]') || target;
|
|
55
|
+
if (hoverTarget !== lastHoveredElement) {
|
|
56
|
+
lastHoveredElement = hoverTarget;
|
|
57
|
+
hoverEntryTime = Date.now();
|
|
58
|
+
const currentTarget = hoverTarget;
|
|
59
|
+
// Case 1: Fast mutation happens during the first 150ms of hover
|
|
60
|
+
setTimeout(() => {
|
|
61
|
+
if (lastHoveredElement === currentTarget && lastRecordedHover !== currentTarget) {
|
|
62
|
+
const sinceMutation = Date.now() - lastMutationTime;
|
|
63
|
+
if (sinceMutation < 400) {
|
|
64
|
+
lastRecordedHover = currentTarget;
|
|
65
|
+
const selector = getUniqueCssSelector(currentTarget);
|
|
66
|
+
if (selector && window.__pwCoreRecordHover) {
|
|
67
|
+
;
|
|
68
|
+
window.__pwCoreRecordHover(selector);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}, 150);
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./types"), exports);
|
|
18
|
+
__exportStar(require("./client"), exports);
|
|
19
|
+
__exportStar(require("./manager"), exports);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BrowserContext } from '@playwright/test';
|
|
2
|
+
import { HoverTrackerOptions } from './types';
|
|
3
|
+
export declare class HoverTrackerManager {
|
|
4
|
+
private context;
|
|
5
|
+
private options;
|
|
6
|
+
constructor(context: BrowserContext, options: HoverTrackerOptions);
|
|
7
|
+
/**
|
|
8
|
+
* Initialize the hover tracking hooks on the browser context.
|
|
9
|
+
*/
|
|
10
|
+
initialize(): Promise<void>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HoverTrackerManager = void 0;
|
|
4
|
+
const client_1 = require("./client");
|
|
5
|
+
class HoverTrackerManager {
|
|
6
|
+
context;
|
|
7
|
+
options;
|
|
8
|
+
constructor(context, options) {
|
|
9
|
+
this.context = context;
|
|
10
|
+
this.options = options;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Initialize the hover tracking hooks on the browser context.
|
|
14
|
+
*/
|
|
15
|
+
async initialize() {
|
|
16
|
+
// 1. Expose function to browser context
|
|
17
|
+
await this.context.exposeFunction('__pwCoreRecordHover', (selector) => {
|
|
18
|
+
return this.options.onRecordHover(selector);
|
|
19
|
+
});
|
|
20
|
+
const fnStr = client_1.clientHoverTracker.toString();
|
|
21
|
+
// 2. Add client script as init script
|
|
22
|
+
await this.context.addInitScript((scriptStr) => {
|
|
23
|
+
const fn = new Function(`return ${scriptStr}`)();
|
|
24
|
+
fn();
|
|
25
|
+
}, fnStr);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.HoverTrackerManager = HoverTrackerManager;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export interface SelectorMatch {
|
|
2
|
+
type: string;
|
|
3
|
+
val: string;
|
|
4
|
+
}
|
|
5
|
+
export interface MatchResult {
|
|
6
|
+
pageKey: string;
|
|
7
|
+
elementKey: string;
|
|
8
|
+
val: string;
|
|
9
|
+
type: string;
|
|
10
|
+
isNew: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare function getSelectorValue(selector: string): SelectorMatch;
|
|
13
|
+
export declare function findRegistryFile(dir: string): string | null;
|
|
14
|
+
export declare function findPlaywrightConfig(dir: string): string | null;
|
|
15
|
+
export declare function parseRegistry(filePath: string): any;
|
|
16
|
+
export declare function matchDynamicEntry(val: string, entry: any, isTestId: boolean): {
|
|
17
|
+
matches: boolean;
|
|
18
|
+
matchedValue?: string;
|
|
19
|
+
placeholderName?: string;
|
|
20
|
+
};
|
|
21
|
+
export declare function writeRegistry(filePath: string, registryObj: any, overrideMode?: boolean, usedPageKeys?: Set<string> | string[]): Record<string, string>;
|
|
22
|
+
export declare function findPageKey(url: string, title: string, registryObj: any, overrideMode?: boolean): string;
|
|
23
|
+
export declare function toCamelCase(str: string): string;
|
|
24
|
+
export declare function findMatchInDict(val: string, strategyType: string, pageKey: string, registryObj: any, overrideMode?: boolean): MatchResult | null;
|
|
25
|
+
export declare function findElementKey(selector: string, pageKey: string, registryObj: any, overrideMode?: boolean, extra?: {
|
|
26
|
+
targetTestId?: string;
|
|
27
|
+
targetId?: string;
|
|
28
|
+
targetParentId?: string;
|
|
29
|
+
overrideType?: string;
|
|
30
|
+
}): MatchResult;
|
|
31
|
+
export declare function formatActionCall(pageKey: string, elementKey: string, action: any, isTextSelector?: boolean, textValue?: string): string;
|
|
32
|
+
export * from './config';
|
|
33
|
+
export * from './generator/index';
|
|
34
|
+
export * from './types';
|
|
35
|
+
export * from './scorer';
|