@applitools/core 4.18.1 → 4.19.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/CHANGELOG.md +96 -0
- package/dist/classic/utils/take-dom-capture.js +1 -0
- package/dist/cli/cli.js +2 -0
- package/dist/troubleshoot/ufg.js +18 -13
- package/dist/ufg/utils/generate-safe-selectors.js +18 -18
- package/dist/ufg/utils/take-dom-snapshots.js +13 -14
- package/package.json +12 -12
- package/types/classic/utils/take-dom-capture.d.ts +8 -0
- package/types/ufg/utils/generate-safe-selectors.d.ts +18 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,101 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [4.19.0](https://github.com/Applitools-Dev/sdk/compare/js/core@4.18.2...js/core@4.19.0) (2024-09-16)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* allow passing arguments to dom-capture from core ([#2531](https://github.com/Applitools-Dev/sdk/issues/2531)) ([9cfc9a5](https://github.com/Applitools-Dev/sdk/commit/9cfc9a5b5d6650afd1e7daf2714d6779a7dc2724))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* stale layout breakpoints elements ([#2479](https://github.com/Applitools-Dev/sdk/issues/2479)) ([f5e4b5a](https://github.com/Applitools-Dev/sdk/commit/f5e4b5ac8077b8c4b7ba67a38c4e58050a55ce75))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Dependencies
|
|
17
|
+
|
|
18
|
+
* @applitools/snippets bumped to 2.5.0
|
|
19
|
+
#### Features
|
|
20
|
+
|
|
21
|
+
* add playwright fixture ([#2412](https://github.com/Applitools-Dev/sdk/issues/2412)) ([0632e93](https://github.com/Applitools-Dev/sdk/commit/0632e93dd7f53029a8c5f4230d22a05abf5fefd4))
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
#### Bug Fixes
|
|
25
|
+
|
|
26
|
+
* stale layout breakpoints elements ([#2479](https://github.com/Applitools-Dev/sdk/issues/2479)) ([f5e4b5a](https://github.com/Applitools-Dev/sdk/commit/f5e4b5ac8077b8c4b7ba67a38c4e58050a55ce75))
|
|
27
|
+
* @applitools/dom-capture bumped to 11.5.0
|
|
28
|
+
#### Features
|
|
29
|
+
|
|
30
|
+
* ability to capture element properties ([#2525](https://github.com/Applitools-Dev/sdk/issues/2525)) ([ab35e1d](https://github.com/Applitools-Dev/sdk/commit/ab35e1dc929ba4bd82e99081527b277c8090f1e0))
|
|
31
|
+
* @applitools/driver bumped to 1.19.1
|
|
32
|
+
#### Bug Fixes
|
|
33
|
+
|
|
34
|
+
* stale layout breakpoints elements ([#2479](https://github.com/Applitools-Dev/sdk/issues/2479)) ([f5e4b5a](https://github.com/Applitools-Dev/sdk/commit/f5e4b5ac8077b8c4b7ba67a38c4e58050a55ce75))
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
* @applitools/spec-driver-webdriver bumped to 1.1.13
|
|
39
|
+
|
|
40
|
+
* @applitools/spec-driver-selenium bumped to 1.5.84
|
|
41
|
+
|
|
42
|
+
* @applitools/spec-driver-puppeteer bumped to 1.4.13
|
|
43
|
+
|
|
44
|
+
* @applitools/screenshoter bumped to 3.8.37
|
|
45
|
+
|
|
46
|
+
* @applitools/nml-client bumped to 1.8.11
|
|
47
|
+
|
|
48
|
+
* @applitools/ec-client bumped to 1.9.5
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
## [4.18.2](https://github.com/Applitools-Dev/sdk/compare/js/core@4.18.1...js/core@4.18.2) (2024-09-10)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
### Bug Fixes
|
|
55
|
+
|
|
56
|
+
* don't call check-network when executing binary and cli ([#2491](https://github.com/Applitools-Dev/sdk/issues/2491)) ([ef00d20](https://github.com/Applitools-Dev/sdk/commit/ef00d205450b7bbe7abc1bc9bce8d6970f769091))
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
### Dependencies
|
|
60
|
+
|
|
61
|
+
* @applitools/dom-capture bumped to 11.4.0
|
|
62
|
+
#### Features
|
|
63
|
+
|
|
64
|
+
* ability to capture all css props in computed style ([#2484](https://github.com/Applitools-Dev/sdk/issues/2484)) ([8769ee5](https://github.com/Applitools-Dev/sdk/commit/8769ee566f2d9e163437c7bcd385ec993f05f370))
|
|
65
|
+
* @applitools/driver bumped to 1.19.0
|
|
66
|
+
#### Features
|
|
67
|
+
|
|
68
|
+
* add support for env var APPLITOOLS_IS_IC ([#2469](https://github.com/Applitools-Dev/sdk/issues/2469)) ([87d7b5c](https://github.com/Applitools-Dev/sdk/commit/87d7b5cc1f7ea774c6b90504e85296f0681d0b1e))
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
#### Bug Fixes
|
|
72
|
+
|
|
73
|
+
* handle userAgent.brands returned as string ([#2453](https://github.com/Applitools-Dev/sdk/issues/2453)) ([dd6328b](https://github.com/Applitools-Dev/sdk/commit/dd6328be3e7d885714124a8e43aabaae3abecde9))
|
|
74
|
+
* searching for scrollable element multiple times ([#2493](https://github.com/Applitools-Dev/sdk/issues/2493)) ([d98db80](https://github.com/Applitools-Dev/sdk/commit/d98db8016c6312f467f244444c6f1a87bc09b7da))
|
|
75
|
+
* @applitools/spec-driver-webdriver bumped to 1.1.12
|
|
76
|
+
|
|
77
|
+
* @applitools/spec-driver-selenium bumped to 1.5.83
|
|
78
|
+
|
|
79
|
+
* @applitools/spec-driver-puppeteer bumped to 1.4.12
|
|
80
|
+
|
|
81
|
+
* @applitools/screenshoter bumped to 3.8.36
|
|
82
|
+
|
|
83
|
+
* @applitools/nml-client bumped to 1.8.10
|
|
84
|
+
|
|
85
|
+
* @applitools/tunnel-client bumped to 1.5.8
|
|
86
|
+
#### Bug Fixes
|
|
87
|
+
|
|
88
|
+
* upgrade execution-grid-tunnel ([#2475](https://github.com/Applitools-Dev/sdk/issues/2475)) ([e5952b4](https://github.com/Applitools-Dev/sdk/commit/e5952b4ca1bd0c065111ce1109b218f1fd68f6fc))
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
* @applitools/core-base bumped to 1.16.1
|
|
93
|
+
#### Bug Fixes
|
|
94
|
+
|
|
95
|
+
* infinity concurrency ([#2477](https://github.com/Applitools-Dev/sdk/issues/2477)) ([f488e16](https://github.com/Applitools-Dev/sdk/commit/f488e162f124acc249ed7b43b714f13c18306dc8))
|
|
96
|
+
* @applitools/ec-client bumped to 1.9.4
|
|
97
|
+
|
|
98
|
+
|
|
3
99
|
## [4.18.1](https://github.com/Applitools-Dev/sdk/compare/js/core@4.18.0...js/core@4.18.1) (2024-08-12)
|
|
4
100
|
|
|
5
101
|
|
|
@@ -11,6 +11,7 @@ async function takeDomCapture({ driver, settings, logger, }) {
|
|
|
11
11
|
const arg = {
|
|
12
12
|
chunkByteLength: (_a = settings === null || settings === void 0 ? void 0 : settings.chunkByteLength) !== null && _a !== void 0 ? _a : (Number(process.env.APPLITOOLS_SCRIPT_RESULT_MAX_BYTE_LENGTH) ||
|
|
13
13
|
(environment.isIOS ? 100000 : 250 * 1024 * 1024)),
|
|
14
|
+
...settings === null || settings === void 0 ? void 0 : settings.domCaptureArgs,
|
|
14
15
|
};
|
|
15
16
|
const scripts = {
|
|
16
17
|
main: features.canExecuteOnlyFunctionScripts
|
package/dist/cli/cli.js
CHANGED
|
@@ -34,6 +34,7 @@ const logs_1 = require("../troubleshoot/logs");
|
|
|
34
34
|
const check_network_1 = require("../troubleshoot/check-network");
|
|
35
35
|
const yargs_1 = __importDefault(require("yargs"));
|
|
36
36
|
const utils = __importStar(require("@applitools/utils"));
|
|
37
|
+
const fs_1 = __importDefault(require("fs"));
|
|
37
38
|
yargs_1.default
|
|
38
39
|
.example([
|
|
39
40
|
['eyes universal', 'Run Eyes Universal server on default port (21077)'],
|
|
@@ -43,6 +44,7 @@ yargs_1.default
|
|
|
43
44
|
['eyes universal --shutdown-mode stdin', 'Run Eyes Universal server which will close once stdin stream will end'],
|
|
44
45
|
['eyes check-network', ''],
|
|
45
46
|
])
|
|
47
|
+
.version(JSON.parse(fs_1.default.readFileSync(require.resolve('../../package.json'), 'utf-8')).version)
|
|
46
48
|
.command({
|
|
47
49
|
command: 'universal',
|
|
48
50
|
builder: yargs => yargs.options({
|
package/dist/troubleshoot/ufg.js
CHANGED
|
@@ -48,16 +48,21 @@ const resource = {
|
|
|
48
48
|
contentType,
|
|
49
49
|
};
|
|
50
50
|
const UFG_PUT_RESOURCE_URL = `https://render-wus.applitools.com/sha256/${resource.hash.hash}?render-id=fake`;
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
51
|
+
const getAccessToken = (() => {
|
|
52
|
+
let accessToken;
|
|
53
|
+
return async () => {
|
|
54
|
+
if (!accessToken) {
|
|
55
|
+
const { stdout } = await utils.process.execute(`curl -s ${eyes_1.RENDER_INFO_URL} ${(0, utils_1.getProxyCurlArg)()}`, {
|
|
56
|
+
maxBuffer: 10000000,
|
|
57
|
+
});
|
|
58
|
+
accessToken = JSON.parse(stdout).accessToken;
|
|
59
|
+
if (!accessToken)
|
|
60
|
+
throw new Error('could not receive auth token since cURL command to get it failed.');
|
|
61
|
+
}
|
|
62
|
+
return accessToken;
|
|
63
|
+
};
|
|
64
|
+
})();
|
|
65
|
+
const getCmd = async () => `curl -X PUT -H "Content-Type: application/json" -H "X-Auth-Token: ${await getAccessToken()}" -d '${resource.rawValue}' ${UFG_PUT_RESOURCE_URL} ${(0, utils_1.getProxyCurlArg)()}`;
|
|
61
66
|
exports.getCmd = getCmd;
|
|
62
67
|
const validateVgResult = (res, sha) => {
|
|
63
68
|
if (!res || res.hash !== sha) {
|
|
@@ -70,7 +75,7 @@ exports.default = {
|
|
|
70
75
|
method: 'PUT',
|
|
71
76
|
headers: {
|
|
72
77
|
'Content-Type': 'x-applitools-html/cdt',
|
|
73
|
-
'X-Auth-Token': await
|
|
78
|
+
'X-Auth-Token': await getAccessToken(),
|
|
74
79
|
},
|
|
75
80
|
body: resource.value,
|
|
76
81
|
});
|
|
@@ -93,7 +98,7 @@ exports.default = {
|
|
|
93
98
|
testServer: async () => {
|
|
94
99
|
const url = new URL(UFG_PUT_RESOURCE_URL);
|
|
95
100
|
const requests = (0, ufg_client_1.makeUFGRequests)({
|
|
96
|
-
settings: { ufgServerUrl: url.origin, accessToken: await
|
|
101
|
+
settings: { ufgServerUrl: url.origin, accessToken: await getAccessToken() },
|
|
97
102
|
logger: (0, logger_1.makeLogger)(),
|
|
98
103
|
});
|
|
99
104
|
await requests.uploadResource({ resource });
|
|
@@ -107,7 +112,7 @@ exports.default = {
|
|
|
107
112
|
method: 'PUT',
|
|
108
113
|
headers: {
|
|
109
114
|
'Content-Type': 'x-applitools-html/cdt',
|
|
110
|
-
'X-Auth-Token': await
|
|
115
|
+
'X-Auth-Token': await getAccessToken(),
|
|
111
116
|
},
|
|
112
117
|
});
|
|
113
118
|
request.on('response', response => {
|
|
@@ -27,37 +27,37 @@ exports.generateSafeSelectors = void 0;
|
|
|
27
27
|
const utils = __importStar(require("@applitools/utils"));
|
|
28
28
|
const { addElementIds, cleanupElementIds } = require('@applitools/snippets');
|
|
29
29
|
async function generateSafeSelectors({ context, elementReferences, }) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
30
|
+
if (!(elementReferences === null || elementReferences === void 0 ? void 0 : elementReferences.length))
|
|
31
|
+
return;
|
|
32
|
+
const mapping = await Promise.all(elementReferences.map(async (ref) => {
|
|
33
|
+
const elements = await context.elements(ref);
|
|
34
|
+
return {
|
|
35
|
+
ref,
|
|
36
|
+
elements,
|
|
37
|
+
id: utils.general.guid(), // same id for all elements that match the same ref
|
|
38
|
+
};
|
|
39
|
+
}));
|
|
40
|
+
// we can't structure elementsWithIds as object because it's not supported in safari webdriver (https://stackoverflow.com/questions/78953951/ios-safari-webdriver-executescript-fails-to-serialize-objects-with-elements)
|
|
41
|
+
const elementsWithIds = mapping.map(({ elements, id }) => [elements, id]);
|
|
42
|
+
const generatedSelectors = (await context.execute(addElementIds, elementsWithIds)).flat();
|
|
43
43
|
let offset = 0;
|
|
44
|
-
const selectors = mapping.
|
|
44
|
+
const selectors = mapping.map(({ elements, ref }) => {
|
|
45
45
|
if (elements.length === 0)
|
|
46
|
-
return { safeSelector: null, originalSelector: null, elementReference:
|
|
46
|
+
return { safeSelector: null, originalSelector: null, elementReference: ref };
|
|
47
47
|
const safeSelector = generatedSelectors[offset].reduceRight((selector, value) => {
|
|
48
48
|
return selector ? { type: 'css', selector: value, shadow: selector } : { type: 'css', selector: value };
|
|
49
49
|
}, undefined);
|
|
50
50
|
offset += elements.length;
|
|
51
|
-
return { safeSelector, originalSelector: elements[0].commonSelector, elementReference:
|
|
51
|
+
return { safeSelector, originalSelector: elements[0].commonSelector, elementReference: ref };
|
|
52
52
|
});
|
|
53
53
|
return {
|
|
54
54
|
selectors,
|
|
55
55
|
cleanupGeneratedSelectors,
|
|
56
56
|
};
|
|
57
57
|
async function cleanupGeneratedSelectors() {
|
|
58
|
-
if (!mapping.
|
|
58
|
+
if (!mapping.length)
|
|
59
59
|
return;
|
|
60
|
-
await context.execute(cleanupElementIds, [mapping.elements.flat()]);
|
|
60
|
+
await context.execute(cleanupElementIds, [mapping.map(({ elements }) => elements).flat()]);
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
exports.generateSafeSelectors = generateSafeSelectors;
|
|
@@ -51,13 +51,10 @@ async function takeDomSnapshots({ driver, settings, hooks, provides, logger, })
|
|
|
51
51
|
logger.log(`taking single dom snapshot`);
|
|
52
52
|
await beforeEachSnapshot();
|
|
53
53
|
// it's important that we calculate safe selectors as close as possible to taking the dom snapshot
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
elementReferences: settings.elementReferences,
|
|
59
|
-
});
|
|
60
|
-
}
|
|
54
|
+
const safeSelectorResult = await (0, generate_safe_selectors_1.generateSafeSelectors)({
|
|
55
|
+
context: currentContext,
|
|
56
|
+
elementReferences: settings.elementReferences,
|
|
57
|
+
});
|
|
61
58
|
const snapshot = await (0, take_dom_snapshot_1.takeDomSnapshot)({ context: currentContext, settings, logger });
|
|
62
59
|
await ((_b = safeSelectorResult === null || safeSelectorResult === void 0 ? void 0 : safeSelectorResult.cleanupGeneratedSelectors) === null || _b === void 0 ? void 0 : _b.call(safeSelectorResult));
|
|
63
60
|
return Array(settings.environments.length).fill({ ...snapshot, generatedSelectors: safeSelectorResult === null || safeSelectorResult === void 0 ? void 0 : safeSelectorResult.selectors });
|
|
@@ -94,7 +91,11 @@ async function takeDomSnapshots({ driver, settings, hooks, provides, logger, })
|
|
|
94
91
|
}
|
|
95
92
|
requiredWidths.forEach((browsers, requiredWidth) => entries.push({ viewportSize: { width: requiredWidth, height: initialViewportSize.height }, browsers }));
|
|
96
93
|
logger.log(`All entries to take dom snapshots for`, entries);
|
|
97
|
-
|
|
94
|
+
// making safe selectors before any resize in order to make sure fallback selectors are created
|
|
95
|
+
let safeSelectorResult = await (0, generate_safe_selectors_1.generateSafeSelectors)({
|
|
96
|
+
context: currentContext,
|
|
97
|
+
elementReferences: settings.elementReferences,
|
|
98
|
+
});
|
|
98
99
|
const snapshots = Array(settings.environments.length);
|
|
99
100
|
for (const [index, { viewportSize, browsers }] of entries.entries()) {
|
|
100
101
|
logger.log(`Taking dom snapshot for viewport size ${viewportSize}`);
|
|
@@ -132,12 +133,10 @@ async function takeDomSnapshots({ driver, settings, hooks, provides, logger, })
|
|
|
132
133
|
}
|
|
133
134
|
await beforeEachSnapshot();
|
|
134
135
|
// it's important that we calculate safe selectors as close as possible to taking the dom snapshot
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
});
|
|
140
|
-
}
|
|
136
|
+
safeSelectorResult = await (0, generate_safe_selectors_1.generateSafeSelectors)({
|
|
137
|
+
context: currentContext,
|
|
138
|
+
elementReferences: settings.elementReferences,
|
|
139
|
+
});
|
|
141
140
|
const snapshot = await (0, take_dom_snapshot_1.takeDomSnapshot)({ context: currentContext, settings, logger });
|
|
142
141
|
browsers.forEach(({ index }) => (snapshots[index] = { ...snapshot, generatedSelectors: safeSelectorResult === null || safeSelectorResult === void 0 ? void 0 : safeSelectorResult.selectors }));
|
|
143
142
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applitools/core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.19.0",
|
|
4
4
|
"homepage": "https://applitools.com",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/applitools/eyes.sdk.javascript1/issues"
|
|
@@ -74,18 +74,18 @@
|
|
|
74
74
|
}
|
|
75
75
|
},
|
|
76
76
|
"dependencies": {
|
|
77
|
-
"@applitools/core-base": "1.16.
|
|
78
|
-
"@applitools/dom-capture": "11.
|
|
77
|
+
"@applitools/core-base": "1.16.1",
|
|
78
|
+
"@applitools/dom-capture": "11.5.0",
|
|
79
79
|
"@applitools/dom-snapshot": "4.11.3",
|
|
80
|
-
"@applitools/driver": "1.
|
|
81
|
-
"@applitools/ec-client": "1.9.
|
|
80
|
+
"@applitools/driver": "1.19.1",
|
|
81
|
+
"@applitools/ec-client": "1.9.5",
|
|
82
82
|
"@applitools/logger": "2.0.18",
|
|
83
|
-
"@applitools/nml-client": "1.8.
|
|
83
|
+
"@applitools/nml-client": "1.8.11",
|
|
84
84
|
"@applitools/req": "1.7.2",
|
|
85
|
-
"@applitools/screenshoter": "3.8.
|
|
86
|
-
"@applitools/snippets": "2.
|
|
85
|
+
"@applitools/screenshoter": "3.8.37",
|
|
86
|
+
"@applitools/snippets": "2.5.0",
|
|
87
87
|
"@applitools/socket": "1.1.18",
|
|
88
|
-
"@applitools/spec-driver-webdriver": "1.1.
|
|
88
|
+
"@applitools/spec-driver-webdriver": "1.1.13",
|
|
89
89
|
"@applitools/ufg-client": "1.12.3",
|
|
90
90
|
"@applitools/utils": "1.7.4",
|
|
91
91
|
"@types/ws": "8.5.5",
|
|
@@ -100,11 +100,11 @@
|
|
|
100
100
|
"devDependencies": {
|
|
101
101
|
"@applitools/bongo": "^5.10.0",
|
|
102
102
|
"@applitools/sea": "^1.0.0",
|
|
103
|
-
"@applitools/spec-driver-puppeteer": "^1.4.
|
|
104
|
-
"@applitools/spec-driver-selenium": "^1.5.
|
|
103
|
+
"@applitools/spec-driver-puppeteer": "^1.4.13",
|
|
104
|
+
"@applitools/spec-driver-selenium": "^1.5.84",
|
|
105
105
|
"@applitools/test-server": "^1.2.2",
|
|
106
106
|
"@applitools/test-utils": "^1.5.17",
|
|
107
|
-
"@applitools/tunnel-client": "^1.5.
|
|
107
|
+
"@applitools/tunnel-client": "^1.5.8",
|
|
108
108
|
"@types/node": "^12.20.55",
|
|
109
109
|
"@types/selenium-webdriver": "^4.1.2",
|
|
110
110
|
"@types/semver": "^7.5.8",
|
|
@@ -8,6 +8,14 @@ export type DomCaptureSettings = {
|
|
|
8
8
|
chunkByteLength?: number;
|
|
9
9
|
proxy?: Proxy;
|
|
10
10
|
fetch?: Fetch;
|
|
11
|
+
domCaptureArgs?: {
|
|
12
|
+
styleProps?: string[] | boolean;
|
|
13
|
+
rectProps?: string[];
|
|
14
|
+
elementProps?: string[];
|
|
15
|
+
capturePseudo?: boolean;
|
|
16
|
+
addStats?: boolean;
|
|
17
|
+
fetchTimeLimit?: number;
|
|
18
|
+
};
|
|
11
19
|
};
|
|
12
20
|
export declare function takeDomCapture<TSpec extends SpecType>({ driver, settings, logger, }: {
|
|
13
21
|
driver: Driver<TSpec>;
|
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
import { type SpecType, type Context, type ElementReference, type CommonSelector } from '@applitools/driver';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}): Promise<{
|
|
6
|
-
selectors: ({
|
|
7
|
-
safeSelector: null;
|
|
8
|
-
originalSelector: null;
|
|
9
|
-
elementReference: ElementReference<TSpec>;
|
|
10
|
-
} | {
|
|
11
|
-
safeSelector: CommonSelector;
|
|
2
|
+
type GeneratedSafeSelector<TSpec extends SpecType> = {
|
|
3
|
+
selectors: {
|
|
4
|
+
safeSelector: CommonSelector | null;
|
|
12
5
|
originalSelector: CommonSelector | null;
|
|
13
6
|
elementReference: ElementReference<TSpec>;
|
|
14
|
-
}
|
|
7
|
+
}[];
|
|
15
8
|
cleanupGeneratedSelectors: () => Promise<void>;
|
|
16
|
-
}
|
|
9
|
+
};
|
|
10
|
+
export declare function generateSafeSelectors<TSpec extends SpecType>({ context, elementReferences, }: {
|
|
11
|
+
context: Context<TSpec>;
|
|
12
|
+
elementReferences: ElementReference<TSpec>[];
|
|
13
|
+
}): Promise<GeneratedSafeSelector<TSpec>>;
|
|
14
|
+
export declare function generateSafeSelectors<TSpec extends SpecType>({ context, elementReferences, }: {
|
|
15
|
+
context: Context<TSpec>;
|
|
16
|
+
elementReferences: undefined | [];
|
|
17
|
+
}): Promise<undefined>;
|
|
18
|
+
export declare function generateSafeSelectors<TSpec extends SpecType>({ context, elementReferences, }: {
|
|
19
|
+
context: Context<TSpec>;
|
|
20
|
+
elementReferences?: ElementReference<TSpec>[];
|
|
21
|
+
}): Promise<GeneratedSafeSelector<TSpec> | undefined>;
|
|
22
|
+
export {};
|