testcafe 2.6.2 → 3.4.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/lib/api/exportable-lib/index.js +5 -1
- package/lib/api/request-hooks/request-logger.js +6 -3
- package/lib/api/structure/fixture.js +6 -1
- package/lib/api/structure/interfaces.js +1 -1
- package/lib/api/structure/test-file.js +2 -2
- package/lib/api/structure/testing-unit.js +2 -1
- package/lib/api/test-controller/assertion.js +1 -1
- package/lib/api/test-controller/index.js +9 -19
- package/lib/api/test-page-url.js +2 -2
- package/lib/assertions/executor.js +1 -1
- package/lib/browser/connection/gateway/index.js +1 -4
- package/lib/browser/connection/index.js +6 -1
- package/lib/browser/provider/built-in/dedicated/firefox/marionette-client/index.js +4 -1
- package/lib/cli/argument-parser/index.js +3 -8
- package/lib/cli/remotes-wizard.js +3 -1
- package/lib/client/automation/index.js +153 -192
- package/lib/client/automation/index.min.js +1 -1
- package/lib/client/automation/playback/press/shortcut-type.js +24 -0
- package/lib/client/browser/idle-page/index.html.mustache +1 -1
- package/lib/client/browser/idle-page/index.js +5 -1
- package/lib/client/core/index.js +101 -330
- package/lib/client/core/index.min.js +1 -1
- package/lib/client/core/utils/array.js +3 -18
- package/lib/client/core/utils/dom.js +12 -32
- package/lib/client/driver/index.js +65 -77
- package/lib/client/driver/index.min.js +1 -1
- package/lib/client/driver/status.js +1 -2
- package/lib/client/test-run/index.js.mustache +1 -6
- package/lib/client/ui/index.js +77 -50
- package/lib/client/ui/index.min.js +1 -1
- package/lib/client/ui/styles.css +81 -3
- package/lib/client-functions/client-function-builder.js +7 -28
- package/lib/client-functions/selectors/add-api.js +3 -61
- package/lib/client-functions/selectors/selector-builder.js +3 -6
- package/lib/client-functions/selectors/selector-text-filter.js +1 -3
- package/lib/compiler/test-file/formats/dev-tools/compiler.js +8 -2
- package/lib/compiler/test-file/formats/typescript/compiler.js +2 -1
- package/lib/configuration/configuration-base.js +10 -8
- package/lib/configuration/default-values.js +3 -3
- package/lib/configuration/option-names.js +2 -3
- package/lib/configuration/run-option-names.js +2 -2
- package/lib/configuration/testcafe-configuration.js +4 -12
- package/lib/configuration/types.js +1 -1
- package/lib/custom-client-scripts/client-script.js +4 -1
- package/lib/custom-client-scripts/routing.js +3 -4
- package/lib/errors/get-callsite.js +3 -3
- package/lib/errors/runtime/index.js +64 -5
- package/lib/errors/runtime/templates.js +24 -15
- package/lib/errors/test-run/render-error-template/utils.js +2 -2
- package/lib/errors/test-run/templates.js +2 -2
- package/lib/errors/test-run/utils.js +2 -2
- package/lib/errors/types.js +5 -2
- package/lib/index.js +6 -4
- package/lib/native-automation/client/deps/hammerhead.js +25 -0
- package/lib/native-automation/client/event-descriptor.js +14 -1
- package/lib/native-automation/client/input.js +17 -5
- package/lib/native-automation/client/key-press/utils.js +13 -2
- package/lib/native-automation/cookie-provider.js +15 -4
- package/lib/native-automation/index.js +3 -2
- package/lib/native-automation/request-hooks/event-factory/request-paused-event-based.js +9 -5
- package/lib/native-automation/request-hooks/event-provider.js +14 -4
- package/lib/native-automation/request-pipeline/index.js +77 -48
- package/lib/native-automation/request-pipeline/safe-api.js +15 -10
- package/lib/native-automation/request-pipeline/test-run-bridge.js +13 -1
- package/lib/native-automation/resource-injector.js +3 -1
- package/lib/native-automation/types.js +1 -1
- package/lib/native-automation/utils/headers.js +2 -10
- package/lib/notifications/warning-message.js +3 -4
- package/lib/reporter/index.js +30 -21
- package/lib/reporter/module-prefix.js +6 -0
- package/lib/reporter/plugin-host.js +3 -12
- package/lib/role/index.js +1 -4
- package/lib/role/role.js +9 -1
- package/lib/runner/bootstrapper.js +45 -16
- package/lib/runner/browser-job.js +33 -5
- package/lib/runner/fixture-hook-controller.js +4 -3
- package/lib/runner/index.js +4 -19
- package/lib/runner/task/index.js +2 -4
- package/lib/runner/test-run-controller.js +24 -9
- package/lib/screenshots/capturer.js +8 -19
- package/lib/screenshots/index.js +4 -23
- package/lib/test-run/bookmark.js +1 -1
- package/lib/test-run/commands/observation.js +2 -10
- package/lib/test-run/commands/service.js +2 -9
- package/lib/test-run/commands/type.js +1 -2
- package/lib/test-run/index.js +10 -20
- package/lib/test-run/request/create-request-options.js +1 -1
- package/lib/test-run/request/interfaces.js +1 -1
- package/lib/test-run/request/send.js +2 -2
- package/lib/testcafe.js +3 -2
- package/lib/utils/debug-loggers.js +9 -2
- package/lib/utils/escape-unsafe-chars.js +13 -0
- package/lib/utils/get-browser.js +3 -2
- package/lib/utils/get-options/index.js +2 -4
- package/lib/utils/get-renderes.js +2 -2
- package/lib/utils/get-test-and-fixture-info.js +20 -0
- package/lib/utils/get-testcafe-version.js +3 -3
- package/lib/utils/lowercase-object-keys.js +12 -0
- package/lib/utils/match-collection.js +3 -3
- package/lib/utils/prerender-callsite.js +1 -1
- package/lib/utils/render-callsite-sync.js +2 -2
- package/lib/utils/reporter.js +8 -4
- package/lib/video-recorder/recorder.js +2 -2
- package/package.json +25 -27
- package/ts-defs/index.d.ts +49 -12
- package/ts-defs/selectors.d.ts +42 -8
- package/ts-defs/testcafe-scripts.d.ts +52 -8
- package/CHANGELOG.md +0 -4879
- package/lib/client/driver/command-executors/client-functions/selector-executor/check-element-delay.js +0 -5
- package/lib/client-functions/selector-api-execution-mode.js +0 -22
- package/lib/custom-client-scripts/get-url.js +0 -8
- package/lib/utils/is-repl.js +0 -12
|
@@ -18,7 +18,6 @@ class DriverStatus extends assignable_1.default {
|
|
|
18
18
|
this.isPendingWindowSwitching = false;
|
|
19
19
|
this.isObservingFileDownloadingInNewWindow = false;
|
|
20
20
|
this.isFirstRequestAfterWindowSwitching = false;
|
|
21
|
-
this.debug = '';
|
|
22
21
|
this.warnings = null;
|
|
23
22
|
this._assignFrom(obj, true);
|
|
24
23
|
}
|
|
@@ -37,4 +36,4 @@ class DriverStatus extends assignable_1.default {
|
|
|
37
36
|
}
|
|
38
37
|
}
|
|
39
38
|
exports.default = DriverStatus;
|
|
40
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
39
|
+
//# s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ICAgICAgICAgICAgICAgICAgICAgPSBudWxsO1xuICAgICAgICB0aGlzLmNvbnNvbGVNZXNzYWdlcyAgICAgICAgICAgICAgICAgICAgICAgPSBudWxsO1xuICAgICAgICB0aGlzLmlzUGVuZGluZ1dpbmRvd1N3aXRjaGluZyAgICAgICAgICAgICAgPSBmYWxzZTtcbiAgICAgICAgdGhpcy5pc09ic2VydmluZ0ZpbGVEb3dubG9hZGluZ0luTmV3V2luZG93ID0gZmFsc2U7XG4gICAgICAgIHRoaXMuaXNGaXJzdFJlcXVlc3RBZnRlcldpbmRvd1N3aXRjaGluZyAgICA9IGZhbHNlO1xuICAgICAgICB0aGlzLndhcm5pbmdzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPSBudWxsO1xuXG4gICAgICAgIHRoaXMuX2Fzc2lnbkZyb20ob2JqLCB0cnVlKTtcbiAgICB9XG5cbiAgICBnZXRBc3NpZ25hYmxlUHJvcGVydGllcyAoKSB7XG4gICAgICAgIHJldHVybiBbXG4gICAgICAgICAgICB7IG5hbWU6ICdpc0NvbW1hbmRSZXN1bHQnIH0sXG4gICAgICAgICAgICB7IG5hbWU6ICdleGVjdXRpb25FcnJvcicgfSxcbiAgICAgICAgICAgIHsgbmFtZTogJ3BhZ2VFcnJvcicgfSxcbiAgICAgICAgICAgIHsgbmFtZTogJ3Jlc3VsdCcgfSxcbiAgICAgICAgICAgIHsgbmFtZTogJ2NvbnNvbGVNZXNzYWdlcycgfSxcbiAgICAgICAgICAgIHsgbmFtZTogJ2lzUGVuZGluZ1dpbmRvd1N3aXRjaGluZycgfSxcbiAgICAgICAgICAgIHsgbmFtZTogJ2lzT2JzZXJ2aW5nRmlsZURvd25sb2FkaW5nSW5OZXdXaW5kb3cnIH0sXG4gICAgICAgICAgICB7IG5hbWU6ICdpc0ZpcnN0UmVxdWVzdEFmdGVyV2luZG93U3dpdGNoaW5nJyB9LFxuICAgICAgICAgICAgeyBuYW1lOiAnd2FybmluZ3MnIH0sXG4gICAgICAgIF07XG4gICAgfVxufVxuIl19
|
|
@@ -2,12 +2,7 @@
|
|
|
2
2
|
if (window !== window.top)
|
|
3
3
|
return;
|
|
4
4
|
|
|
5
|
-
var origin
|
|
6
|
-
|
|
7
|
-
// NOTE: location.origin doesn't exist in IE11 on Windows 10.10240 LTSB
|
|
8
|
-
if (!origin)
|
|
9
|
-
origin = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '');
|
|
10
|
-
|
|
5
|
+
var origin = location.origin;
|
|
11
6
|
var nativeAutomation = {{{nativeAutomation}}};
|
|
12
7
|
|
|
13
8
|
if (nativeAutomation)
|
package/lib/client/ui/index.js
CHANGED
|
@@ -68,7 +68,7 @@ window['%hammerhead%'].utils.removeInjectedScript();
|
|
|
68
68
|
var selectController = testCafeCore__default.selectController;
|
|
69
69
|
var OPTION_LIST_CLASS = 'tcOptionList';
|
|
70
70
|
var DISABLED_CLASS = 'disabled';
|
|
71
|
-
var MAX_OPTION_LIST_LENGTH =
|
|
71
|
+
var MAX_OPTION_LIST_LENGTH = 20;
|
|
72
72
|
function onDocumentMouseDown(e) {
|
|
73
73
|
var target = nativeMethods.eventTargetGetter.call(e);
|
|
74
74
|
var curSelectEl = selectController.currentEl;
|
|
@@ -93,25 +93,22 @@ window['%hammerhead%'].utils.removeInjectedScript();
|
|
|
93
93
|
var curSelectIndex = curSelectEl.selectedIndex;
|
|
94
94
|
var realOption = curSelectEl.getElementsByTagName('option')[optionIndex];
|
|
95
95
|
var clickLeadChanges = !isOptionDisabled && optionIndex !== curSelectIndex;
|
|
96
|
-
if (clickLeadChanges
|
|
96
|
+
if (clickLeadChanges)
|
|
97
97
|
curSelectEl.selectedIndex = optionIndex;
|
|
98
|
-
if (!browserUtils.isFirefox &&
|
|
98
|
+
if (!browserUtils.isFirefox && clickLeadChanges) {
|
|
99
99
|
eventSimulator.input(curSelectEl);
|
|
100
100
|
eventSimulator.change(curSelectEl);
|
|
101
101
|
}
|
|
102
|
-
if (browserUtils.isFirefox
|
|
102
|
+
if (browserUtils.isFirefox)
|
|
103
103
|
eventSimulator.mousedown(browserUtils.isFirefox ? realOption : curSelectEl);
|
|
104
104
|
if (!featureDetection.isTouchDevice)
|
|
105
105
|
eventSimulator.mouseup(browserUtils.isFirefox ? realOption : curSelectEl);
|
|
106
|
-
if (
|
|
107
|
-
|
|
108
|
-
curSelectEl.selectedIndex = optionIndex;
|
|
109
|
-
if (!browserUtils.isIE)
|
|
110
|
-
eventSimulator.input(curSelectEl);
|
|
106
|
+
if (browserUtils.isFirefox && clickLeadChanges) {
|
|
107
|
+
eventSimulator.input(curSelectEl);
|
|
111
108
|
eventSimulator.change(curSelectEl);
|
|
112
109
|
}
|
|
113
110
|
if (!featureDetection.isTouchDevice)
|
|
114
|
-
eventSimulator.click(browserUtils.isFirefox
|
|
111
|
+
eventSimulator.click(browserUtils.isFirefox ? realOption : curSelectEl);
|
|
115
112
|
if (!isOptionDisabled)
|
|
116
113
|
collapseOptionList();
|
|
117
114
|
}
|
|
@@ -197,7 +194,7 @@ window['%hammerhead%'].utils.removeInjectedScript();
|
|
|
197
194
|
var selectSize = styleUtils.getSelectElementSize(element);
|
|
198
195
|
var optionListHidden = !styleUtils.hasDimensions(shadowUI.select('.' + OPTION_LIST_CLASS)[0]);
|
|
199
196
|
if (/down|up/.test(command) ||
|
|
200
|
-
|
|
197
|
+
(selectSize <= 1 || browserUtils.isFirefox) &&
|
|
201
198
|
(optionListHidden || browserUtils.isFirefox) && /left|right/.test(command)) {
|
|
202
199
|
var realOptions = element.querySelectorAll('option');
|
|
203
200
|
var enabledOptions = [];
|
|
@@ -210,8 +207,7 @@ window['%hammerhead%'].utils.removeInjectedScript();
|
|
|
210
207
|
var nextIndex = curSelectedOptionIndex + (/down|right/.test(command) ? 1 : -1);
|
|
211
208
|
if (nextIndex >= 0 && nextIndex < enabledOptions.length) {
|
|
212
209
|
element.selectedIndex = arrayUtils.indexOf(realOptions, enabledOptions[nextIndex]);
|
|
213
|
-
|
|
214
|
-
eventSimulator.input(element);
|
|
210
|
+
eventSimulator.input(element);
|
|
215
211
|
eventSimulator.change(element);
|
|
216
212
|
}
|
|
217
213
|
}
|
|
@@ -523,7 +519,7 @@ window['%hammerhead%'].utils.removeInjectedScript();
|
|
|
523
519
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
524
520
|
PERFORMANCE OF THIS SOFTWARE.
|
|
525
521
|
***************************************************************************** */
|
|
526
|
-
/* global Reflect, Promise */
|
|
522
|
+
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
527
523
|
var extendStatics = function (d, b) {
|
|
528
524
|
extendStatics = Object.setPrototypeOf ||
|
|
529
525
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
@@ -626,7 +622,11 @@ window['%hammerhead%'].utils.removeInjectedScript();
|
|
|
626
622
|
throw op[1];
|
|
627
623
|
return { value: op[0] ? op[1] : void 0, done: true };
|
|
628
624
|
}
|
|
629
|
-
}
|
|
625
|
+
}
|
|
626
|
+
var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
627
|
+
var e = new Error(message);
|
|
628
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
629
|
+
};
|
|
630
630
|
|
|
631
631
|
var shadowUI$3 = hammerhead$1__default.shadowUI;
|
|
632
632
|
var nativeMethods$2 = hammerhead$1__default.nativeMethods;
|
|
@@ -877,6 +877,7 @@ window['%hammerhead%'].utils.removeInjectedScript();
|
|
|
877
877
|
var serviceUtils = testCafeCore__default.serviceUtils;
|
|
878
878
|
var arrayUtils$1 = testCafeCore__default.arrayUtils;
|
|
879
879
|
var STATUS_BAR_CLASS = 'status-bar';
|
|
880
|
+
var STATUS_BAR_DEBUGGING_CLASS = 'status-bar-debugging';
|
|
880
881
|
var ICON_CLASS = 'icon';
|
|
881
882
|
var INFO_CONTAINER_CLASS = 'info-container';
|
|
882
883
|
var INFO_TEXT_CONTAINER_CLASS = 'info-text-container';
|
|
@@ -909,13 +910,14 @@ window['%hammerhead%'].utils.removeInjectedScript();
|
|
|
909
910
|
var LOCAL_STORAGE_STATUS_PREFIX_ITEM = '%testCafeStatusPrefix%';
|
|
910
911
|
var StatusBar = /** @class */ (function (_super) {
|
|
911
912
|
__extends(StatusBar, _super);
|
|
912
|
-
function StatusBar(userAgent, fixtureName, testName, contextStorage) {
|
|
913
|
+
function StatusBar(userAgent, fixtureName, testName, contextStorage, nativeAutomation) {
|
|
913
914
|
var _this = _super.call(this) || this;
|
|
914
915
|
_this.UNLOCK_PAGE_BTN_CLICK = 'testcafe|ui|status-bar|unlock-page-btn-click';
|
|
915
916
|
_this.userAgent = userAgent;
|
|
916
917
|
_this.fixtureName = fixtureName;
|
|
917
918
|
_this.testName = testName;
|
|
918
919
|
_this.contextStorage = contextStorage;
|
|
920
|
+
_this.nativeAutomation = nativeAutomation;
|
|
919
921
|
_this.statusBar = null;
|
|
920
922
|
_this.infoContainer = null;
|
|
921
923
|
_this.actionsContainer = null;
|
|
@@ -1113,7 +1115,7 @@ window['%hammerhead%'].utils.removeInjectedScript();
|
|
|
1113
1115
|
};
|
|
1114
1116
|
StatusBar.prototype._bindClickOnce = function (elements, handler) {
|
|
1115
1117
|
var _this = this;
|
|
1116
|
-
var eventName = featureDetection$1.isTouchDevice ? 'touchstart' : 'mousedown';
|
|
1118
|
+
var eventName = !this.nativeAutomation && featureDetection$1.isTouchDevice ? 'touchstart' : 'mousedown';
|
|
1117
1119
|
var downHandler = function (e) {
|
|
1118
1120
|
var target = nativeMethods$4.eventTargetGetter.call(e);
|
|
1119
1121
|
var isTargetElement = !!arrayUtils$1.find(elements, function (el) { return domUtils$1.containsElement(el, target); });
|
|
@@ -1147,6 +1149,7 @@ window['%hammerhead%'].utils.removeInjectedScript();
|
|
|
1147
1149
|
};
|
|
1148
1150
|
StatusBar.prototype._resetState = function () {
|
|
1149
1151
|
this.state.debugging = false;
|
|
1152
|
+
shadowUI$6.removeClass(uiRoot.panelsContainer(), STATUS_BAR_DEBUGGING_CLASS);
|
|
1150
1153
|
this.actionsContainer.style.display = 'none';
|
|
1151
1154
|
this.unlockButton.style.display = 'none';
|
|
1152
1155
|
nativeMethods$4.nodeTextContentSetter.call(this.statusDiv, this._getFullStatusText(''));
|
|
@@ -1183,6 +1186,7 @@ window['%hammerhead%'].utils.removeInjectedScript();
|
|
|
1183
1186
|
return new Promise(function (resolve) {
|
|
1184
1187
|
_this.state.debugging = true;
|
|
1185
1188
|
_this.state.locked = true;
|
|
1189
|
+
shadowUI$6.addClass(uiRoot.panelsContainer(), STATUS_BAR_DEBUGGING_CLASS);
|
|
1186
1190
|
if (isTestError) {
|
|
1187
1191
|
_this.buttons.removeChild(_this.nextButton);
|
|
1188
1192
|
_this.buttons.removeChild(_this.resumeButton);
|
|
@@ -1307,7 +1311,6 @@ window['%hammerhead%'].utils.removeInjectedScript();
|
|
|
1307
1311
|
|
|
1308
1312
|
var Promise$1 = hammerhead$1__default.Promise;
|
|
1309
1313
|
var shadowUI$7 = hammerhead$1__default.shadowUI;
|
|
1310
|
-
var browserUtils$2 = hammerhead$1__default.utils.browser;
|
|
1311
1314
|
var featureDetection$2 = hammerhead$1__default.utils.featureDetection;
|
|
1312
1315
|
var messageSandbox$2 = hammerhead$1__default.eventSandbox.message;
|
|
1313
1316
|
var styleUtils$7 = testCafeCore__default.styleUtils;
|
|
@@ -1348,9 +1351,7 @@ window['%hammerhead%'].utils.removeInjectedScript();
|
|
|
1348
1351
|
_createElement: function () {
|
|
1349
1352
|
this.cursorElement = document.createElement('div');
|
|
1350
1353
|
shadowUI$7.addClass(this.cursorElement, CURSOR_CLASS);
|
|
1351
|
-
|
|
1352
|
-
// because we won't be able to get an element under the cursor
|
|
1353
|
-
if (featureDetection$2.isTouchDevice && !browserUtils$2.isIE) {
|
|
1354
|
+
if (featureDetection$2.isTouchDevice) {
|
|
1354
1355
|
shadowUI$7.addClass(this.cursorElement, TOUCH_CLASS);
|
|
1355
1356
|
// NOTE: in touch mode, the pointer should be in the center of the cursor
|
|
1356
1357
|
this.pointerOffsetX = Math.ceil(styleUtils$7.getWidth(this.cursorElement) / 2);
|
|
@@ -1409,17 +1410,12 @@ window['%hammerhead%'].utils.removeInjectedScript();
|
|
|
1409
1410
|
},
|
|
1410
1411
|
};
|
|
1411
1412
|
|
|
1412
|
-
var browserUtils$3 = hammerhead$1__default.utils.browser;
|
|
1413
|
-
// HACK: In most browsers, the iframe's getElementFromPoint function ignores elements
|
|
1414
|
-
// from the parent frame. But in IE it doesn't, and our cursor overlaps the target
|
|
1415
|
-
// element. So, we move the cursor to a position one pixel farther to avoid this.
|
|
1416
|
-
var RECOGNITION_INCREMENT = browserUtils$3.isIE ? 1 : 0;
|
|
1417
1413
|
var iframeCursorUI = {
|
|
1418
1414
|
move: function (position) {
|
|
1419
1415
|
var msg = {
|
|
1420
1416
|
cmd: CURSOR_UI_MESSAGES.moveRequest,
|
|
1421
|
-
x: position.x
|
|
1422
|
-
y: position.y
|
|
1417
|
+
x: position.x,
|
|
1418
|
+
y: position.y,
|
|
1423
1419
|
};
|
|
1424
1420
|
return testCafeCore.sendRequestToFrame(msg, CURSOR_UI_MESSAGES.moveResponse, window.parent);
|
|
1425
1421
|
},
|
|
@@ -1521,12 +1517,26 @@ window['%hammerhead%'].utils.removeInjectedScript();
|
|
|
1521
1517
|
type: 'button',
|
|
1522
1518
|
value: 'Copy',
|
|
1523
1519
|
};
|
|
1520
|
+
var hideButtonContainer = {
|
|
1521
|
+
class: 'selector-panel-toggle-button-container',
|
|
1522
|
+
};
|
|
1523
|
+
var hideButton = {
|
|
1524
|
+
tag: 'input',
|
|
1525
|
+
type: 'button',
|
|
1526
|
+
class: 'selector-panel-toggle-button',
|
|
1527
|
+
};
|
|
1524
1528
|
var selectorsList = {
|
|
1525
1529
|
class: 'selectors-list',
|
|
1526
1530
|
};
|
|
1531
|
+
var span = {
|
|
1532
|
+
tag: 'span',
|
|
1533
|
+
};
|
|
1527
1534
|
var panel = {
|
|
1528
1535
|
class: 'selector-inspector-panel',
|
|
1529
1536
|
};
|
|
1537
|
+
var panelContainer = {
|
|
1538
|
+
class: 'selector-inspector-panel-container',
|
|
1539
|
+
};
|
|
1530
1540
|
var elementFrame = {
|
|
1531
1541
|
class: 'element-frame',
|
|
1532
1542
|
};
|
|
@@ -4033,22 +4043,7 @@ window['%hammerhead%'].utils.removeInjectedScript();
|
|
|
4033
4043
|
// eslint-disable-next-line no-restricted-properties
|
|
4034
4044
|
childNodeCount: function (node) { return node.childNodes.length; },
|
|
4035
4045
|
hasChildNodes: function (node) { return !!nodeSnapshotPropertyInitializers.childNodeCount(node); },
|
|
4036
|
-
childElementCount: function (node) {
|
|
4037
|
-
var children = node.children;
|
|
4038
|
-
if (children)
|
|
4039
|
-
// eslint-disable-next-line no-restricted-properties
|
|
4040
|
-
return children.length;
|
|
4041
|
-
// NOTE: IE doesn't have `children` for non-element nodes =/
|
|
4042
|
-
var childElementCount = 0;
|
|
4043
|
-
// eslint-disable-next-line no-restricted-properties
|
|
4044
|
-
var childNodeCount = node.childNodes.length;
|
|
4045
|
-
for (var i = 0; i < childNodeCount; i++) {
|
|
4046
|
-
// eslint-disable-next-line no-restricted-properties
|
|
4047
|
-
if (node.childNodes[i].nodeType === 1)
|
|
4048
|
-
childElementCount++;
|
|
4049
|
-
}
|
|
4050
|
-
return childElementCount;
|
|
4051
|
-
},
|
|
4046
|
+
childElementCount: function (node) { var _a; return ((_a = node.children) === null || _a === void 0 ? void 0 : _a.length) || 0; },
|
|
4052
4047
|
// eslint-disable-next-line no-restricted-properties
|
|
4053
4048
|
hasChildElements: function (node) { return !!nodeSnapshotPropertyInitializers.childElementCount(node); },
|
|
4054
4049
|
};
|
|
@@ -4533,6 +4528,37 @@ window['%hammerhead%'].utils.removeInjectedScript();
|
|
|
4533
4528
|
return CopyButton;
|
|
4534
4529
|
}());
|
|
4535
4530
|
|
|
4531
|
+
var nativeMethods$c = hammerhead$1__default.nativeMethods;
|
|
4532
|
+
var eventUtils$6 = testCafeCore__default.eventUtils;
|
|
4533
|
+
var SELECTOR_INSPECTOR_PANEL_HIDDEN_CLASSNAME = 'selector-inspector-panel--hidden-hammerhead-shadow-ui';
|
|
4534
|
+
var HideButton = /** @class */ (function () {
|
|
4535
|
+
function HideButton(selectorInspectorPanel) {
|
|
4536
|
+
var _this = this;
|
|
4537
|
+
var hideButton$1 = createElementFromDescriptor(hideButton);
|
|
4538
|
+
this.element = createElementFromDescriptor(hideButtonContainer);
|
|
4539
|
+
this.element.appendChild(hideButton$1);
|
|
4540
|
+
this.element.appendChild(createElementFromDescriptor(span));
|
|
4541
|
+
eventUtils$6.bind(this.element, 'click', function () { return _this._showAndHide(selectorInspectorPanel); });
|
|
4542
|
+
}
|
|
4543
|
+
HideButton.prototype._showAndHide = function (selectorInspectorPanel) {
|
|
4544
|
+
nativeMethods$c.elementClassListGetter.call(selectorInspectorPanel).toggle(SELECTOR_INSPECTOR_PANEL_HIDDEN_CLASSNAME);
|
|
4545
|
+
};
|
|
4546
|
+
return HideButton;
|
|
4547
|
+
}());
|
|
4548
|
+
|
|
4549
|
+
var MainContainer = /** @class */ (function () {
|
|
4550
|
+
function MainContainer() {
|
|
4551
|
+
var elements = [];
|
|
4552
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
4553
|
+
elements[_i] = arguments[_i];
|
|
4554
|
+
}
|
|
4555
|
+
var _this = this;
|
|
4556
|
+
this.element = createElementFromDescriptor(panelContainer);
|
|
4557
|
+
elements.forEach(function (el) { return _this.element.appendChild(el); });
|
|
4558
|
+
}
|
|
4559
|
+
return MainContainer;
|
|
4560
|
+
}());
|
|
4561
|
+
|
|
4536
4562
|
var SelectorInspectorPanel = /** @class */ (function () {
|
|
4537
4563
|
function SelectorInspectorPanel() {
|
|
4538
4564
|
this.elementPicker = elementPicker;
|
|
@@ -4540,9 +4566,10 @@ window['%hammerhead%'].utils.removeInjectedScript();
|
|
|
4540
4566
|
var pickButton = new PickButton();
|
|
4541
4567
|
var selectorInputContainer = new SelectorInputContainer();
|
|
4542
4568
|
var copyButton = new CopyButton(selectorInputContainer);
|
|
4543
|
-
|
|
4544
|
-
this.element
|
|
4545
|
-
this.element.appendChild(
|
|
4569
|
+
var container = new MainContainer(pickButton.element, selectorInputContainer.element, copyButton.element);
|
|
4570
|
+
var hideButton = new HideButton(this.element);
|
|
4571
|
+
this.element.appendChild(container.element);
|
|
4572
|
+
this.element.appendChild(hideButton.element);
|
|
4546
4573
|
}
|
|
4547
4574
|
SelectorInspectorPanel.prototype.show = function () {
|
|
4548
4575
|
if (!this.element.parentElement)
|
|
@@ -4597,11 +4624,11 @@ window['%hammerhead%'].utils.removeInjectedScript();
|
|
|
4597
4624
|
};
|
|
4598
4625
|
exports$1.showScreenshotMark = function (url) { return screenshotMark.show(url); };
|
|
4599
4626
|
exports$1.hideScreenshotMark = function () { return screenshotMark.hide(); };
|
|
4600
|
-
var nativeMethods$
|
|
4627
|
+
var nativeMethods$d = hammerhead$1__default.nativeMethods;
|
|
4601
4628
|
var evalIframeScript = hammerhead$1__default.EVENTS.evalIframeScript;
|
|
4602
|
-
nativeMethods$
|
|
4629
|
+
nativeMethods$d.objectDefineProperty(window, '%testCafeUI%', { configurable: true, value: exports$1 });
|
|
4603
4630
|
// eslint-disable-next-line no-undef
|
|
4604
|
-
hammerhead$1__default.on(evalIframeScript, function (e) { return initTestCafeUI(nativeMethods$
|
|
4631
|
+
hammerhead$1__default.on(evalIframeScript, function (e) { return initTestCafeUI(nativeMethods$d.contentWindowGetter.call(e.iframe), true); });
|
|
4605
4632
|
|
|
4606
4633
|
}(window['%hammerhead%'], window['%testCafeCore%'], window['%hammerhead%'].Promise));
|
|
4607
4634
|
|