@applitools/eyes-testcafe 1.15.0 → 1.15.4
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 +29 -0
- package/dist/api.js +4 -5
- package/dist/index-legacy.js +0 -1
- package/dist/index.js +0 -1
- package/dist/legacy.js +5 -5
- package/dist/spec-driver.js +20 -30
- package/package.json +26 -20
- package/types/index-legacy.d.ts +2 -3
- package/types/index.d.ts +1460 -2029
- package/dist/api.js.map +0 -1
- package/dist/index-legacy.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/legacy.js.map +0 -1
- package/dist/spec-driver.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,35 @@
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
5
|
|
|
6
|
+
## 1.15.4 - 2022/2/16
|
|
7
|
+
|
|
8
|
+
- fixing: Screenshotter dependency consuming 40+ MB of space
|
|
9
|
+
- updated to @applitools/eyes-api@1.1.8 (from 1.1.7)
|
|
10
|
+
- updated to @applitools/eyes-sdk-core@13.0.5 (from 13.0.0)
|
|
11
|
+
- updated to @applitools/utils@1.2.13 (from 1.2.11)
|
|
12
|
+
- updated to @applitools/visual-grid-client@15.8.65 (from 15.8.62)
|
|
13
|
+
- updated to @applitools/visual-grid-client@15.8.65 (from 15.8.62)
|
|
14
|
+
## 1.15.3 - 2022/1/24
|
|
15
|
+
|
|
16
|
+
- updated 'Agent ID' to 'eyes.testcafe' (from 'eyes.webdriverio')
|
|
17
|
+
- updated to @applitools/eyes-api@1.1.7 (from 1.1.6)
|
|
18
|
+
- updated to @applitools/eyes-sdk-core@13.0.0 (from 12.24.13)
|
|
19
|
+
- updated to @applitools/visual-grid-client@15.8.62 (from 15.8.60)
|
|
20
|
+
|
|
21
|
+
## 1.15.2 - 2022/1/14
|
|
22
|
+
|
|
23
|
+
- remove `esModuleInterop` ts compile option
|
|
24
|
+
|
|
25
|
+
## 1.15.1 - 2022/1/13
|
|
26
|
+
|
|
27
|
+
- set failTestcafeOnDiff default value to true
|
|
28
|
+
- updated to @applitools/eyes-api@1.1.6 (from 1.1.0)
|
|
29
|
+
- updated to @applitools/eyes-sdk-core@12.24.9 (from 12.23.3)
|
|
30
|
+
- updated to @applitools/utils@1.2.11 (from 1.2.2)
|
|
31
|
+
- updated to @applitools/visual-grid-client@15.8.55 (from 15.8.24)
|
|
32
|
+
- updated to @applitools/eyes-sdk-core@12.24.13 (from 12.24.9)
|
|
33
|
+
- updated to @applitools/visual-grid-client@15.8.60 (from 15.8.55)
|
|
34
|
+
|
|
6
35
|
## 1.15.0 - 2021/9/6
|
|
7
36
|
|
|
8
37
|
- updated to @applitools/eyes-api@1.1.0 (from 1.0.7)
|
package/dist/api.js
CHANGED
|
@@ -13,18 +13,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
13
13
|
exports.BatchClose = exports.Target = exports.CheckSettings = exports.Configuration = exports.Eyes = void 0;
|
|
14
14
|
const eyes_sdk_core_1 = require("@applitools/eyes-sdk-core");
|
|
15
15
|
const api = require("@applitools/eyes-api");
|
|
16
|
-
const spec = require("./spec-driver");
|
|
17
16
|
const legacy = require("./legacy");
|
|
17
|
+
const spec = require("./spec-driver");
|
|
18
18
|
process.env.APPLITOOLS_SCRIPT_RESULT_MAX_BYTE_LENGTH = '4718592';
|
|
19
19
|
process.env.APPLITOOLS_SCRIPT_REMOVE_REVERSE_PROXY_URL_PREFIXES = 'true';
|
|
20
|
-
const sdk = eyes_sdk_core_1.makeSDK({
|
|
21
|
-
name: 'eyes.
|
|
20
|
+
const sdk = (0, eyes_sdk_core_1.makeSDK)({
|
|
21
|
+
name: 'eyes.testcafe',
|
|
22
22
|
version: require('../package.json').version,
|
|
23
23
|
spec,
|
|
24
24
|
VisualGridClient: require('@applitools/visual-grid-client'),
|
|
25
25
|
});
|
|
26
26
|
__exportStar(require("@applitools/eyes-api"), exports);
|
|
27
|
-
class Eyes extends legacy.
|
|
27
|
+
class Eyes extends legacy.LegacyTestCafeEyesMixin(api.Eyes) {
|
|
28
28
|
}
|
|
29
29
|
exports.Eyes = Eyes;
|
|
30
30
|
Eyes._spec = sdk;
|
|
@@ -41,4 +41,3 @@ class BatchClose extends api.BatchClose {
|
|
|
41
41
|
}
|
|
42
42
|
exports.BatchClose = BatchClose;
|
|
43
43
|
BatchClose._spec = sdk;
|
|
44
|
-
//# sourceMappingURL=api.js.map
|
package/dist/index-legacy.js
CHANGED
package/dist/index.js
CHANGED
package/dist/legacy.js
CHANGED
|
@@ -11,21 +11,22 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
return t;
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.transformCheckSettings = exports.transformConfig = exports.
|
|
14
|
+
exports.transformCheckSettings = exports.transformConfig = exports.LegacyTestCafeEyesMixin = void 0;
|
|
15
15
|
const utils = require("@applitools/utils");
|
|
16
16
|
const api = require("@applitools/eyes-api");
|
|
17
17
|
const fs = require("fs");
|
|
18
18
|
const path = require("path");
|
|
19
19
|
const spec = require("./spec-driver");
|
|
20
20
|
const eyes_sdk_core_1 = require("@applitools/eyes-sdk-core");
|
|
21
|
-
function
|
|
21
|
+
function LegacyTestCafeEyesMixin(Eyes) {
|
|
22
22
|
return class TestCafeEyes extends Eyes {
|
|
23
23
|
constructor(runnerOrConfigOrOptions, configOrRunner) {
|
|
24
|
-
var _a, _b, _c;
|
|
24
|
+
var _a, _b, _c, _d;
|
|
25
25
|
if (utils.types.isNull(runnerOrConfigOrOptions) || utils.types.has(runnerOrConfigOrOptions, 'configPath')) {
|
|
26
26
|
const testcafeConfig = eyes_sdk_core_1.ConfigUtils.getConfig({ configPath: runnerOrConfigOrOptions === null || runnerOrConfigOrOptions === void 0 ? void 0 : runnerOrConfigOrOptions.configPath });
|
|
27
27
|
const runner = (_a = runnerOrConfigOrOptions === null || runnerOrConfigOrOptions === void 0 ? void 0 : runnerOrConfigOrOptions.runner) !== null && _a !== void 0 ? _a : new api.VisualGridRunner({ testConcurrency: (_c = (_b = testcafeConfig.concurrency) !== null && _b !== void 0 ? _b : testcafeConfig.testConcurrency) !== null && _c !== void 0 ? _c : 1 });
|
|
28
28
|
super(runner, transformConfig(testcafeConfig));
|
|
29
|
+
(_d = testcafeConfig.failTestcafeOnDiff) !== null && _d !== void 0 ? _d : (testcafeConfig.failTestcafeOnDiff = true);
|
|
29
30
|
this._testcafeConfig = testcafeConfig;
|
|
30
31
|
}
|
|
31
32
|
else {
|
|
@@ -75,7 +76,7 @@ function TestCafeEyes(Eyes) {
|
|
|
75
76
|
}
|
|
76
77
|
};
|
|
77
78
|
}
|
|
78
|
-
exports.
|
|
79
|
+
exports.LegacyTestCafeEyesMixin = LegacyTestCafeEyesMixin;
|
|
79
80
|
function transformConfig(options) {
|
|
80
81
|
const config = Object.assign({}, options);
|
|
81
82
|
if (options.concurrency)
|
|
@@ -182,4 +183,3 @@ function transformCheckSettings(options) {
|
|
|
182
183
|
return settings;
|
|
183
184
|
}
|
|
184
185
|
exports.transformCheckSettings = transformCheckSettings;
|
|
185
|
-
//# sourceMappingURL=legacy.js.map
|
package/dist/spec-driver.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.build = exports.waitUntilDisplayed = exports.scrollIntoView = exports.hover = exports.type = exports.click = exports.takeScreenshot = exports.visit = exports.getUrl = exports.getTitle = exports.
|
|
4
|
-
const utils = require("@applitools/utils");
|
|
3
|
+
exports.build = exports.waitUntilDisplayed = exports.scrollIntoView = exports.hover = exports.type = exports.click = exports.takeScreenshot = exports.visit = exports.getUrl = exports.getTitle = exports.getDriverInfo = exports.setViewportSize = exports.findElements = exports.findElement = exports.childContext = exports.mainContext = exports.executeScript = exports.isStaleElementError = exports.extractSelector = exports.transformSelector = exports.transformElement = exports.isSelector = exports.isElement = exports.isDriver = void 0;
|
|
5
4
|
const testcafe = require("testcafe");
|
|
6
5
|
const fs = require("fs");
|
|
6
|
+
const utils = require("@applitools/utils");
|
|
7
7
|
function XPathSelector(selector, options) {
|
|
8
8
|
const getElementsByXPath = testcafe.Selector(xpath => {
|
|
9
9
|
const iterator = document.evaluate(xpath, document, null, XPathResult.UNORDERED_NODE_ITERATOR_TYPE, null);
|
|
@@ -17,14 +17,6 @@ function XPathSelector(selector, options) {
|
|
|
17
17
|
}, options);
|
|
18
18
|
return testcafe.Selector(getElementsByXPath(selector), options);
|
|
19
19
|
}
|
|
20
|
-
function transformSelector(selector) {
|
|
21
|
-
if (utils.types.has(selector, 'selector')) {
|
|
22
|
-
if (selector.type === 'xpath')
|
|
23
|
-
return XPathSelector(selector.selector);
|
|
24
|
-
return testcafe.Selector(selector.selector);
|
|
25
|
-
}
|
|
26
|
-
return testcafe.Selector(selector);
|
|
27
|
-
}
|
|
28
20
|
function deserializeResult(result, elements) {
|
|
29
21
|
if (!result) {
|
|
30
22
|
return result;
|
|
@@ -122,16 +114,26 @@ exports.isElement = isElement;
|
|
|
122
114
|
function isSelector(selector) {
|
|
123
115
|
if (!selector)
|
|
124
116
|
return;
|
|
125
|
-
return (
|
|
126
|
-
utils.types.isString(selector) ||
|
|
127
|
-
Boolean(selector.addCustomMethods && selector.find && selector.parent) ||
|
|
128
|
-
(utils.types.has(selector, ['selector']) && isSelector(selector.selector) && selector.constructor.name === 'Object'));
|
|
117
|
+
return Boolean(selector.addCustomMethods && selector.find && selector.parent);
|
|
129
118
|
}
|
|
130
119
|
exports.isSelector = isSelector;
|
|
131
120
|
function transformElement(element) {
|
|
132
121
|
return utils.types.isFunction(element.selector) ? element.selector : element;
|
|
133
122
|
}
|
|
134
123
|
exports.transformElement = transformElement;
|
|
124
|
+
function transformSelector(selector) {
|
|
125
|
+
if (utils.types.has(selector, 'selector')) {
|
|
126
|
+
let current = selector;
|
|
127
|
+
let transformed = selector.type === 'xpath' ? XPathSelector(current.selector) : testcafe.Selector(current.selector);
|
|
128
|
+
while (current.shadow) {
|
|
129
|
+
current = utils.types.has(current.shadow, 'selector') ? current.shadow : { selector: current.shadow };
|
|
130
|
+
transformed = transformed.shadowRoot().find(current.selector);
|
|
131
|
+
}
|
|
132
|
+
return transformed;
|
|
133
|
+
}
|
|
134
|
+
return testcafe.Selector(selector);
|
|
135
|
+
}
|
|
136
|
+
exports.transformSelector = transformSelector;
|
|
135
137
|
function extractSelector(element) {
|
|
136
138
|
return utils.types.isFunction(element.selector) ? element.selector : element;
|
|
137
139
|
}
|
|
@@ -140,16 +142,6 @@ function isStaleElementError(_err) {
|
|
|
140
142
|
return false;
|
|
141
143
|
}
|
|
142
144
|
exports.isStaleElementError = isStaleElementError;
|
|
143
|
-
async function isEqualElements(t, element1, element2) {
|
|
144
|
-
if (!element1 || !element2)
|
|
145
|
-
return false;
|
|
146
|
-
const compareElements = testcafe.ClientFunction(() => element1() === element2(), {
|
|
147
|
-
boundTestRun: t,
|
|
148
|
-
dependencies: { element1, element2 },
|
|
149
|
-
});
|
|
150
|
-
return compareElements();
|
|
151
|
-
}
|
|
152
|
-
exports.isEqualElements = isEqualElements;
|
|
153
145
|
async function executeScript(t, script, arg) {
|
|
154
146
|
script = utils.types.isFunction(script) ? script.toString() : script;
|
|
155
147
|
const { result, resultId, elementsCount } = await scriptRunner.with({
|
|
@@ -185,15 +177,14 @@ async function findElements(t, selector) {
|
|
|
185
177
|
return Array.from({ length: await elements.count }, (_, index) => elements.nth(index));
|
|
186
178
|
}
|
|
187
179
|
exports.findElements = findElements;
|
|
188
|
-
async function getElementRect(_t, element) {
|
|
189
|
-
const { left: x, top: y, width, height } = await element.boundingClientRect;
|
|
190
|
-
return { x, y, width, height };
|
|
191
|
-
}
|
|
192
|
-
exports.getElementRect = getElementRect;
|
|
193
180
|
async function setViewportSize(t, size) {
|
|
194
181
|
await t.resizeWindow(size.width, size.height);
|
|
195
182
|
}
|
|
196
183
|
exports.setViewportSize = setViewportSize;
|
|
184
|
+
async function getDriverInfo(_t) {
|
|
185
|
+
return { features: { shadowSelector: true } };
|
|
186
|
+
}
|
|
187
|
+
exports.getDriverInfo = getDriverInfo;
|
|
197
188
|
async function getTitle(t) {
|
|
198
189
|
try {
|
|
199
190
|
return await testcafe.Selector('title', { boundTestRun: t }).innerText;
|
|
@@ -262,4 +253,3 @@ function build() {
|
|
|
262
253
|
return [undefined, () => void 0];
|
|
263
254
|
}
|
|
264
255
|
exports.build = build;
|
|
265
|
-
//# sourceMappingURL=spec-driver.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applitools/eyes-testcafe",
|
|
3
|
-
"version": "1.15.
|
|
3
|
+
"version": "1.15.4",
|
|
4
4
|
"description": "Applitools Eyes SDK for TestCafe",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eyes-testcafe",
|
|
@@ -24,6 +24,11 @@
|
|
|
24
24
|
"dist",
|
|
25
25
|
"types"
|
|
26
26
|
],
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "https://github.com/applitools/eyes.sdk.javascript1.git",
|
|
30
|
+
"directory": "packages/eyes-testcafe"
|
|
31
|
+
},
|
|
27
32
|
"main": "./dist/index-legacy.js",
|
|
28
33
|
"types": "./types/index-legacy.d.ts",
|
|
29
34
|
"scripts": {
|
|
@@ -36,11 +41,9 @@
|
|
|
36
41
|
"run:testcafe:8": "./node_modules/testcafe-8/bin/testcafe-with-v8-flag-filter.js",
|
|
37
42
|
"run:testcafe:7": "./node_modules/testcafe-7/bin/testcafe-with-v8-flag-filter.js",
|
|
38
43
|
"lint": "eslint '**/*.ts' '**/*.js'",
|
|
39
|
-
"build": "
|
|
40
|
-
"build:dist": "tsc",
|
|
41
|
-
"build:types": "api-extractor ./src/index.ts --out ./types/index.d.ts",
|
|
44
|
+
"build": "ttsc",
|
|
42
45
|
"generate:tests": "coverage-tests generate ./test/coverage/config.js --name 'eyes-testcafe'",
|
|
43
|
-
"test": "yarn
|
|
46
|
+
"test": "yarn test:it && yarn test:coverage",
|
|
44
47
|
"test:unit": "mocha --no-timeouts ./test/unit/*.spec.js",
|
|
45
48
|
"test:it": "testcafe chrome:headless test/it && yarn test:it:firefox:headless",
|
|
46
49
|
"test:it:chrome": "testcafe chrome test/it/spec-driver.spec.js",
|
|
@@ -54,8 +57,8 @@
|
|
|
54
57
|
"test:coverage:custom": "yarn generate:tests && APPLITOOLS_USE_PRELOADED_CONFIG=true APPLITOOLS_BATCH_NAME='JS Coverage Tests: eyes-testcafe (custom)' APPLITOOLS_BATCH_ID=$(uuidgen) testcafe chrome:headless test/custom --reporter spec,xunit:coverage-test-report.xml",
|
|
55
58
|
"report": "coverage-tests report ./test/coverage/config.js --name 'eyes-testcafe'",
|
|
56
59
|
"deps": "bongo deps",
|
|
57
|
-
"gh:test": "gh workflow run test.yml --ref $(git rev-parse --abbrev-ref HEAD) -f packages='testcafe' -f links='eyes-sdk-core eyes-api types test-utils utils driver screenshoter sdk-shared visual-grid-client' -f linking-depth=
|
|
58
|
-
"gh:publish": "gh workflow run publish.yml --ref $(git rev-parse --abbrev-ref HEAD)
|
|
60
|
+
"gh:test": "gh workflow run test.yml --ref $(git rev-parse --abbrev-ref HEAD) -f packages='testcafe' -f links='eyes-sdk-core eyes-api types test-utils utils driver snippets screenshoter sdk-shared visual-grid-client' -f linking-depth=3",
|
|
61
|
+
"gh:publish": "gh workflow run publish-testcafe.yml --ref $(git rev-parse --abbrev-ref HEAD)",
|
|
59
62
|
"preversion": "yarn deps && bongo preversion && yarn build",
|
|
60
63
|
"version": "bongo version",
|
|
61
64
|
"postversion": "bongo postversion"
|
|
@@ -66,19 +69,19 @@
|
|
|
66
69
|
}
|
|
67
70
|
},
|
|
68
71
|
"dependencies": {
|
|
69
|
-
"@applitools/eyes-api": "1.1.
|
|
70
|
-
"@applitools/eyes-sdk-core": "
|
|
71
|
-
"@applitools/utils": "1.2.
|
|
72
|
-
"@applitools/visual-grid-client": "15.8.
|
|
72
|
+
"@applitools/eyes-api": "1.1.8",
|
|
73
|
+
"@applitools/eyes-sdk-core": "13.0.5",
|
|
74
|
+
"@applitools/utils": "1.2.13",
|
|
75
|
+
"@applitools/visual-grid-client": "15.8.65"
|
|
73
76
|
},
|
|
74
77
|
"devDependencies": {
|
|
75
|
-
"@applitools/api-extractor": "1.
|
|
76
|
-
"@applitools/scripts": "1.0
|
|
77
|
-
"@applitools/sdk-coverage-tests": "^2.3.
|
|
78
|
-
"@applitools/sdk-release-kit": "^0.13.
|
|
79
|
-
"@applitools/sdk-shared": "0.9.
|
|
80
|
-
"@applitools/test-server": "1.0.
|
|
81
|
-
"@applitools/test-utils": "1.0.
|
|
78
|
+
"@applitools/api-extractor": "1.2.7",
|
|
79
|
+
"@applitools/scripts": "1.1.0",
|
|
80
|
+
"@applitools/sdk-coverage-tests": "^2.3.18",
|
|
81
|
+
"@applitools/sdk-release-kit": "^0.13.11",
|
|
82
|
+
"@applitools/sdk-shared": "0.9.11",
|
|
83
|
+
"@applitools/test-server": "1.0.8",
|
|
84
|
+
"@applitools/test-utils": "1.0.12",
|
|
82
85
|
"@typescript-eslint/eslint-plugin": "^4.15.1",
|
|
83
86
|
"@typescript-eslint/parser": "^4.15.1",
|
|
84
87
|
"eslint": "^7.9.0",
|
|
@@ -90,12 +93,15 @@
|
|
|
90
93
|
"husky": "^4.3.8",
|
|
91
94
|
"mocha": "^8.0.1",
|
|
92
95
|
"prettier": "^2.1.2",
|
|
93
|
-
"testcafe": "^1.
|
|
96
|
+
"testcafe": "^1.18.1",
|
|
94
97
|
"testcafe-10": "npm:testcafe@^1.10.0",
|
|
95
98
|
"testcafe-7": "npm:testcafe@1.7.1",
|
|
96
99
|
"testcafe-8": "npm:testcafe@1.8.8",
|
|
97
100
|
"testcafe-9": "npm:testcafe@1.9.4",
|
|
98
|
-
"testcafe-browser-provider-browserstack": "^1.13.2-alpha.1"
|
|
101
|
+
"testcafe-browser-provider-browserstack": "^1.13.2-alpha.1",
|
|
102
|
+
"ts-node": "^10.4.0",
|
|
103
|
+
"ttypescript": "^1.5.12",
|
|
104
|
+
"typescript": "^4.5.4"
|
|
99
105
|
},
|
|
100
106
|
"peerDependencies": {
|
|
101
107
|
"testcafe": "^1.7.1"
|
package/types/index-legacy.d.ts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import {Eyes} from './index'
|
|
2
|
-
|
|
3
|
-
export default Eyes
|
|
1
|
+
import { Eyes } from './index';
|
|
2
|
+
export = Eyes;
|