@checksum-ai/runtime 1.1.28 → 1.1.29
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/checksumlib.js +969 -273
- package/cli.js +51 -51
- package/index.d.ts +1 -0
- package/index.js +4 -4
- package/package.json +1 -1
- package/test-run-monitor.js +7 -7
- package/vtg-build/asset-manifest.json +3 -3
- package/vtg-build/index.html +1 -1
- package/vtg-build/static/js/main.de80c141.js +103 -0
- package/vtg-build/static/js/main.de80c141.js.LICENSE.txt +118 -0
- package/vtg-build/static/js/main.de80c141.js.map +1 -0
package/checksumlib.js
CHANGED
|
@@ -6765,6 +6765,483 @@
|
|
|
6765
6765
|
}
|
|
6766
6766
|
});
|
|
6767
6767
|
|
|
6768
|
+
// ../../node_modules/mousetrap/mousetrap.js
|
|
6769
|
+
var require_mousetrap = __commonJS({
|
|
6770
|
+
"../../node_modules/mousetrap/mousetrap.js"(exports, module) {
|
|
6771
|
+
(function(window2, document2, undefined2) {
|
|
6772
|
+
if (!window2) {
|
|
6773
|
+
return;
|
|
6774
|
+
}
|
|
6775
|
+
var _MAP = {
|
|
6776
|
+
8: "backspace",
|
|
6777
|
+
9: "tab",
|
|
6778
|
+
13: "enter",
|
|
6779
|
+
16: "shift",
|
|
6780
|
+
17: "ctrl",
|
|
6781
|
+
18: "alt",
|
|
6782
|
+
20: "capslock",
|
|
6783
|
+
27: "esc",
|
|
6784
|
+
32: "space",
|
|
6785
|
+
33: "pageup",
|
|
6786
|
+
34: "pagedown",
|
|
6787
|
+
35: "end",
|
|
6788
|
+
36: "home",
|
|
6789
|
+
37: "left",
|
|
6790
|
+
38: "up",
|
|
6791
|
+
39: "right",
|
|
6792
|
+
40: "down",
|
|
6793
|
+
45: "ins",
|
|
6794
|
+
46: "del",
|
|
6795
|
+
91: "meta",
|
|
6796
|
+
93: "meta",
|
|
6797
|
+
224: "meta"
|
|
6798
|
+
};
|
|
6799
|
+
var _KEYCODE_MAP = {
|
|
6800
|
+
106: "*",
|
|
6801
|
+
107: "+",
|
|
6802
|
+
109: "-",
|
|
6803
|
+
110: ".",
|
|
6804
|
+
111: "/",
|
|
6805
|
+
186: ";",
|
|
6806
|
+
187: "=",
|
|
6807
|
+
188: ",",
|
|
6808
|
+
189: "-",
|
|
6809
|
+
190: ".",
|
|
6810
|
+
191: "/",
|
|
6811
|
+
192: "`",
|
|
6812
|
+
219: "[",
|
|
6813
|
+
220: "\\",
|
|
6814
|
+
221: "]",
|
|
6815
|
+
222: "'"
|
|
6816
|
+
};
|
|
6817
|
+
var _SHIFT_MAP = {
|
|
6818
|
+
"~": "`",
|
|
6819
|
+
"!": "1",
|
|
6820
|
+
"@": "2",
|
|
6821
|
+
"#": "3",
|
|
6822
|
+
"$": "4",
|
|
6823
|
+
"%": "5",
|
|
6824
|
+
"^": "6",
|
|
6825
|
+
"&": "7",
|
|
6826
|
+
"*": "8",
|
|
6827
|
+
"(": "9",
|
|
6828
|
+
")": "0",
|
|
6829
|
+
"_": "-",
|
|
6830
|
+
"+": "=",
|
|
6831
|
+
":": ";",
|
|
6832
|
+
'"': "'",
|
|
6833
|
+
"<": ",",
|
|
6834
|
+
">": ".",
|
|
6835
|
+
"?": "/",
|
|
6836
|
+
"|": "\\"
|
|
6837
|
+
};
|
|
6838
|
+
var _SPECIAL_ALIASES = {
|
|
6839
|
+
"option": "alt",
|
|
6840
|
+
"command": "meta",
|
|
6841
|
+
"return": "enter",
|
|
6842
|
+
"escape": "esc",
|
|
6843
|
+
"plus": "+",
|
|
6844
|
+
"mod": /Mac|iPod|iPhone|iPad/.test(navigator.platform) ? "meta" : "ctrl"
|
|
6845
|
+
};
|
|
6846
|
+
var _REVERSE_MAP;
|
|
6847
|
+
for (var i2 = 1; i2 < 20; ++i2) {
|
|
6848
|
+
_MAP[111 + i2] = "f" + i2;
|
|
6849
|
+
}
|
|
6850
|
+
for (i2 = 0; i2 <= 9; ++i2) {
|
|
6851
|
+
_MAP[i2 + 96] = i2.toString();
|
|
6852
|
+
}
|
|
6853
|
+
function _addEvent(object, type, callback) {
|
|
6854
|
+
if (object.addEventListener) {
|
|
6855
|
+
object.addEventListener(type, callback, false);
|
|
6856
|
+
return;
|
|
6857
|
+
}
|
|
6858
|
+
object.attachEvent("on" + type, callback);
|
|
6859
|
+
}
|
|
6860
|
+
__name(_addEvent, "_addEvent");
|
|
6861
|
+
function _characterFromEvent(e2) {
|
|
6862
|
+
if (e2.type == "keypress") {
|
|
6863
|
+
var character = String.fromCharCode(e2.which);
|
|
6864
|
+
if (!e2.shiftKey) {
|
|
6865
|
+
character = character.toLowerCase();
|
|
6866
|
+
}
|
|
6867
|
+
return character;
|
|
6868
|
+
}
|
|
6869
|
+
if (_MAP[e2.which]) {
|
|
6870
|
+
return _MAP[e2.which];
|
|
6871
|
+
}
|
|
6872
|
+
if (_KEYCODE_MAP[e2.which]) {
|
|
6873
|
+
return _KEYCODE_MAP[e2.which];
|
|
6874
|
+
}
|
|
6875
|
+
return String.fromCharCode(e2.which).toLowerCase();
|
|
6876
|
+
}
|
|
6877
|
+
__name(_characterFromEvent, "_characterFromEvent");
|
|
6878
|
+
function _modifiersMatch(modifiers1, modifiers2) {
|
|
6879
|
+
return modifiers1.sort().join(",") === modifiers2.sort().join(",");
|
|
6880
|
+
}
|
|
6881
|
+
__name(_modifiersMatch, "_modifiersMatch");
|
|
6882
|
+
function _eventModifiers(e2) {
|
|
6883
|
+
var modifiers = [];
|
|
6884
|
+
if (e2.shiftKey) {
|
|
6885
|
+
modifiers.push("shift");
|
|
6886
|
+
}
|
|
6887
|
+
if (e2.altKey) {
|
|
6888
|
+
modifiers.push("alt");
|
|
6889
|
+
}
|
|
6890
|
+
if (e2.ctrlKey) {
|
|
6891
|
+
modifiers.push("ctrl");
|
|
6892
|
+
}
|
|
6893
|
+
if (e2.metaKey) {
|
|
6894
|
+
modifiers.push("meta");
|
|
6895
|
+
}
|
|
6896
|
+
return modifiers;
|
|
6897
|
+
}
|
|
6898
|
+
__name(_eventModifiers, "_eventModifiers");
|
|
6899
|
+
function _preventDefault(e2) {
|
|
6900
|
+
if (e2.preventDefault) {
|
|
6901
|
+
e2.preventDefault();
|
|
6902
|
+
return;
|
|
6903
|
+
}
|
|
6904
|
+
e2.returnValue = false;
|
|
6905
|
+
}
|
|
6906
|
+
__name(_preventDefault, "_preventDefault");
|
|
6907
|
+
function _stopPropagation(e2) {
|
|
6908
|
+
if (e2.stopPropagation) {
|
|
6909
|
+
e2.stopPropagation();
|
|
6910
|
+
return;
|
|
6911
|
+
}
|
|
6912
|
+
e2.cancelBubble = true;
|
|
6913
|
+
}
|
|
6914
|
+
__name(_stopPropagation, "_stopPropagation");
|
|
6915
|
+
function _isModifier(key) {
|
|
6916
|
+
return key == "shift" || key == "ctrl" || key == "alt" || key == "meta";
|
|
6917
|
+
}
|
|
6918
|
+
__name(_isModifier, "_isModifier");
|
|
6919
|
+
function _getReverseMap() {
|
|
6920
|
+
if (!_REVERSE_MAP) {
|
|
6921
|
+
_REVERSE_MAP = {};
|
|
6922
|
+
for (var key in _MAP) {
|
|
6923
|
+
if (key > 95 && key < 112) {
|
|
6924
|
+
continue;
|
|
6925
|
+
}
|
|
6926
|
+
if (_MAP.hasOwnProperty(key)) {
|
|
6927
|
+
_REVERSE_MAP[_MAP[key]] = key;
|
|
6928
|
+
}
|
|
6929
|
+
}
|
|
6930
|
+
}
|
|
6931
|
+
return _REVERSE_MAP;
|
|
6932
|
+
}
|
|
6933
|
+
__name(_getReverseMap, "_getReverseMap");
|
|
6934
|
+
function _pickBestAction(key, modifiers, action) {
|
|
6935
|
+
if (!action) {
|
|
6936
|
+
action = _getReverseMap()[key] ? "keydown" : "keypress";
|
|
6937
|
+
}
|
|
6938
|
+
if (action == "keypress" && modifiers.length) {
|
|
6939
|
+
action = "keydown";
|
|
6940
|
+
}
|
|
6941
|
+
return action;
|
|
6942
|
+
}
|
|
6943
|
+
__name(_pickBestAction, "_pickBestAction");
|
|
6944
|
+
function _keysFromString(combination) {
|
|
6945
|
+
if (combination === "+") {
|
|
6946
|
+
return ["+"];
|
|
6947
|
+
}
|
|
6948
|
+
combination = combination.replace(/\+{2}/g, "+plus");
|
|
6949
|
+
return combination.split("+");
|
|
6950
|
+
}
|
|
6951
|
+
__name(_keysFromString, "_keysFromString");
|
|
6952
|
+
function _getKeyInfo(combination, action) {
|
|
6953
|
+
var keys;
|
|
6954
|
+
var key;
|
|
6955
|
+
var i3;
|
|
6956
|
+
var modifiers = [];
|
|
6957
|
+
keys = _keysFromString(combination);
|
|
6958
|
+
for (i3 = 0; i3 < keys.length; ++i3) {
|
|
6959
|
+
key = keys[i3];
|
|
6960
|
+
if (_SPECIAL_ALIASES[key]) {
|
|
6961
|
+
key = _SPECIAL_ALIASES[key];
|
|
6962
|
+
}
|
|
6963
|
+
if (action && action != "keypress" && _SHIFT_MAP[key]) {
|
|
6964
|
+
key = _SHIFT_MAP[key];
|
|
6965
|
+
modifiers.push("shift");
|
|
6966
|
+
}
|
|
6967
|
+
if (_isModifier(key)) {
|
|
6968
|
+
modifiers.push(key);
|
|
6969
|
+
}
|
|
6970
|
+
}
|
|
6971
|
+
action = _pickBestAction(key, modifiers, action);
|
|
6972
|
+
return {
|
|
6973
|
+
key,
|
|
6974
|
+
modifiers,
|
|
6975
|
+
action
|
|
6976
|
+
};
|
|
6977
|
+
}
|
|
6978
|
+
__name(_getKeyInfo, "_getKeyInfo");
|
|
6979
|
+
function _belongsTo(element, ancestor) {
|
|
6980
|
+
if (element === null || element === document2) {
|
|
6981
|
+
return false;
|
|
6982
|
+
}
|
|
6983
|
+
if (element === ancestor) {
|
|
6984
|
+
return true;
|
|
6985
|
+
}
|
|
6986
|
+
return _belongsTo(element.parentNode, ancestor);
|
|
6987
|
+
}
|
|
6988
|
+
__name(_belongsTo, "_belongsTo");
|
|
6989
|
+
function Mousetrap2(targetElement) {
|
|
6990
|
+
var self2 = this;
|
|
6991
|
+
targetElement = targetElement || document2;
|
|
6992
|
+
if (!(self2 instanceof Mousetrap2)) {
|
|
6993
|
+
return new Mousetrap2(targetElement);
|
|
6994
|
+
}
|
|
6995
|
+
self2.target = targetElement;
|
|
6996
|
+
self2._callbacks = {};
|
|
6997
|
+
self2._directMap = {};
|
|
6998
|
+
var _sequenceLevels = {};
|
|
6999
|
+
var _resetTimer;
|
|
7000
|
+
var _ignoreNextKeyup = false;
|
|
7001
|
+
var _ignoreNextKeypress = false;
|
|
7002
|
+
var _nextExpectedAction = false;
|
|
7003
|
+
function _resetSequences(doNotReset) {
|
|
7004
|
+
doNotReset = doNotReset || {};
|
|
7005
|
+
var activeSequences = false, key;
|
|
7006
|
+
for (key in _sequenceLevels) {
|
|
7007
|
+
if (doNotReset[key]) {
|
|
7008
|
+
activeSequences = true;
|
|
7009
|
+
continue;
|
|
7010
|
+
}
|
|
7011
|
+
_sequenceLevels[key] = 0;
|
|
7012
|
+
}
|
|
7013
|
+
if (!activeSequences) {
|
|
7014
|
+
_nextExpectedAction = false;
|
|
7015
|
+
}
|
|
7016
|
+
}
|
|
7017
|
+
__name(_resetSequences, "_resetSequences");
|
|
7018
|
+
function _getMatches(character, modifiers, e2, sequenceName, combination, level) {
|
|
7019
|
+
var i3;
|
|
7020
|
+
var callback;
|
|
7021
|
+
var matches = [];
|
|
7022
|
+
var action = e2.type;
|
|
7023
|
+
if (!self2._callbacks[character]) {
|
|
7024
|
+
return [];
|
|
7025
|
+
}
|
|
7026
|
+
if (action == "keyup" && _isModifier(character)) {
|
|
7027
|
+
modifiers = [character];
|
|
7028
|
+
}
|
|
7029
|
+
for (i3 = 0; i3 < self2._callbacks[character].length; ++i3) {
|
|
7030
|
+
callback = self2._callbacks[character][i3];
|
|
7031
|
+
if (!sequenceName && callback.seq && _sequenceLevels[callback.seq] != callback.level) {
|
|
7032
|
+
continue;
|
|
7033
|
+
}
|
|
7034
|
+
if (action != callback.action) {
|
|
7035
|
+
continue;
|
|
7036
|
+
}
|
|
7037
|
+
if (action == "keypress" && !e2.metaKey && !e2.ctrlKey || _modifiersMatch(modifiers, callback.modifiers)) {
|
|
7038
|
+
var deleteCombo = !sequenceName && callback.combo == combination;
|
|
7039
|
+
var deleteSequence = sequenceName && callback.seq == sequenceName && callback.level == level;
|
|
7040
|
+
if (deleteCombo || deleteSequence) {
|
|
7041
|
+
self2._callbacks[character].splice(i3, 1);
|
|
7042
|
+
}
|
|
7043
|
+
matches.push(callback);
|
|
7044
|
+
}
|
|
7045
|
+
}
|
|
7046
|
+
return matches;
|
|
7047
|
+
}
|
|
7048
|
+
__name(_getMatches, "_getMatches");
|
|
7049
|
+
function _fireCallback(callback, e2, combo, sequence) {
|
|
7050
|
+
if (self2.stopCallback(e2, e2.target || e2.srcElement, combo, sequence)) {
|
|
7051
|
+
return;
|
|
7052
|
+
}
|
|
7053
|
+
if (callback(e2, combo) === false) {
|
|
7054
|
+
_preventDefault(e2);
|
|
7055
|
+
_stopPropagation(e2);
|
|
7056
|
+
}
|
|
7057
|
+
}
|
|
7058
|
+
__name(_fireCallback, "_fireCallback");
|
|
7059
|
+
self2._handleKey = function(character, modifiers, e2) {
|
|
7060
|
+
var callbacks = _getMatches(character, modifiers, e2);
|
|
7061
|
+
var i3;
|
|
7062
|
+
var doNotReset = {};
|
|
7063
|
+
var maxLevel = 0;
|
|
7064
|
+
var processedSequenceCallback = false;
|
|
7065
|
+
for (i3 = 0; i3 < callbacks.length; ++i3) {
|
|
7066
|
+
if (callbacks[i3].seq) {
|
|
7067
|
+
maxLevel = Math.max(maxLevel, callbacks[i3].level);
|
|
7068
|
+
}
|
|
7069
|
+
}
|
|
7070
|
+
for (i3 = 0; i3 < callbacks.length; ++i3) {
|
|
7071
|
+
if (callbacks[i3].seq) {
|
|
7072
|
+
if (callbacks[i3].level != maxLevel) {
|
|
7073
|
+
continue;
|
|
7074
|
+
}
|
|
7075
|
+
processedSequenceCallback = true;
|
|
7076
|
+
doNotReset[callbacks[i3].seq] = 1;
|
|
7077
|
+
_fireCallback(callbacks[i3].callback, e2, callbacks[i3].combo, callbacks[i3].seq);
|
|
7078
|
+
continue;
|
|
7079
|
+
}
|
|
7080
|
+
if (!processedSequenceCallback) {
|
|
7081
|
+
_fireCallback(callbacks[i3].callback, e2, callbacks[i3].combo);
|
|
7082
|
+
}
|
|
7083
|
+
}
|
|
7084
|
+
var ignoreThisKeypress = e2.type == "keypress" && _ignoreNextKeypress;
|
|
7085
|
+
if (e2.type == _nextExpectedAction && !_isModifier(character) && !ignoreThisKeypress) {
|
|
7086
|
+
_resetSequences(doNotReset);
|
|
7087
|
+
}
|
|
7088
|
+
_ignoreNextKeypress = processedSequenceCallback && e2.type == "keydown";
|
|
7089
|
+
};
|
|
7090
|
+
function _handleKeyEvent(e2) {
|
|
7091
|
+
if (typeof e2.which !== "number") {
|
|
7092
|
+
e2.which = e2.keyCode;
|
|
7093
|
+
}
|
|
7094
|
+
var character = _characterFromEvent(e2);
|
|
7095
|
+
if (!character) {
|
|
7096
|
+
return;
|
|
7097
|
+
}
|
|
7098
|
+
if (e2.type == "keyup" && _ignoreNextKeyup === character) {
|
|
7099
|
+
_ignoreNextKeyup = false;
|
|
7100
|
+
return;
|
|
7101
|
+
}
|
|
7102
|
+
self2.handleKey(character, _eventModifiers(e2), e2);
|
|
7103
|
+
}
|
|
7104
|
+
__name(_handleKeyEvent, "_handleKeyEvent");
|
|
7105
|
+
function _resetSequenceTimer() {
|
|
7106
|
+
clearTimeout(_resetTimer);
|
|
7107
|
+
_resetTimer = setTimeout(_resetSequences, 1e3);
|
|
7108
|
+
}
|
|
7109
|
+
__name(_resetSequenceTimer, "_resetSequenceTimer");
|
|
7110
|
+
function _bindSequence(combo, keys, callback, action) {
|
|
7111
|
+
_sequenceLevels[combo] = 0;
|
|
7112
|
+
function _increaseSequence(nextAction) {
|
|
7113
|
+
return function() {
|
|
7114
|
+
_nextExpectedAction = nextAction;
|
|
7115
|
+
++_sequenceLevels[combo];
|
|
7116
|
+
_resetSequenceTimer();
|
|
7117
|
+
};
|
|
7118
|
+
}
|
|
7119
|
+
__name(_increaseSequence, "_increaseSequence");
|
|
7120
|
+
function _callbackAndReset(e2) {
|
|
7121
|
+
_fireCallback(callback, e2, combo);
|
|
7122
|
+
if (action !== "keyup") {
|
|
7123
|
+
_ignoreNextKeyup = _characterFromEvent(e2);
|
|
7124
|
+
}
|
|
7125
|
+
setTimeout(_resetSequences, 10);
|
|
7126
|
+
}
|
|
7127
|
+
__name(_callbackAndReset, "_callbackAndReset");
|
|
7128
|
+
for (var i3 = 0; i3 < keys.length; ++i3) {
|
|
7129
|
+
var isFinal = i3 + 1 === keys.length;
|
|
7130
|
+
var wrappedCallback = isFinal ? _callbackAndReset : _increaseSequence(action || _getKeyInfo(keys[i3 + 1]).action);
|
|
7131
|
+
_bindSingle(keys[i3], wrappedCallback, action, combo, i3);
|
|
7132
|
+
}
|
|
7133
|
+
}
|
|
7134
|
+
__name(_bindSequence, "_bindSequence");
|
|
7135
|
+
function _bindSingle(combination, callback, action, sequenceName, level) {
|
|
7136
|
+
self2._directMap[combination + ":" + action] = callback;
|
|
7137
|
+
combination = combination.replace(/\s+/g, " ");
|
|
7138
|
+
var sequence = combination.split(" ");
|
|
7139
|
+
var info;
|
|
7140
|
+
if (sequence.length > 1) {
|
|
7141
|
+
_bindSequence(combination, sequence, callback, action);
|
|
7142
|
+
return;
|
|
7143
|
+
}
|
|
7144
|
+
info = _getKeyInfo(combination, action);
|
|
7145
|
+
self2._callbacks[info.key] = self2._callbacks[info.key] || [];
|
|
7146
|
+
_getMatches(info.key, info.modifiers, { type: info.action }, sequenceName, combination, level);
|
|
7147
|
+
self2._callbacks[info.key][sequenceName ? "unshift" : "push"]({
|
|
7148
|
+
callback,
|
|
7149
|
+
modifiers: info.modifiers,
|
|
7150
|
+
action: info.action,
|
|
7151
|
+
seq: sequenceName,
|
|
7152
|
+
level,
|
|
7153
|
+
combo: combination
|
|
7154
|
+
});
|
|
7155
|
+
}
|
|
7156
|
+
__name(_bindSingle, "_bindSingle");
|
|
7157
|
+
self2._bindMultiple = function(combinations, callback, action) {
|
|
7158
|
+
for (var i3 = 0; i3 < combinations.length; ++i3) {
|
|
7159
|
+
_bindSingle(combinations[i3], callback, action);
|
|
7160
|
+
}
|
|
7161
|
+
};
|
|
7162
|
+
_addEvent(targetElement, "keypress", _handleKeyEvent);
|
|
7163
|
+
_addEvent(targetElement, "keydown", _handleKeyEvent);
|
|
7164
|
+
_addEvent(targetElement, "keyup", _handleKeyEvent);
|
|
7165
|
+
}
|
|
7166
|
+
__name(Mousetrap2, "Mousetrap");
|
|
7167
|
+
Mousetrap2.prototype.bind = function(keys, callback, action) {
|
|
7168
|
+
var self2 = this;
|
|
7169
|
+
keys = keys instanceof Array ? keys : [keys];
|
|
7170
|
+
self2._bindMultiple.call(self2, keys, callback, action);
|
|
7171
|
+
return self2;
|
|
7172
|
+
};
|
|
7173
|
+
Mousetrap2.prototype.unbind = function(keys, action) {
|
|
7174
|
+
var self2 = this;
|
|
7175
|
+
return self2.bind.call(self2, keys, function() {
|
|
7176
|
+
}, action);
|
|
7177
|
+
};
|
|
7178
|
+
Mousetrap2.prototype.trigger = function(keys, action) {
|
|
7179
|
+
var self2 = this;
|
|
7180
|
+
if (self2._directMap[keys + ":" + action]) {
|
|
7181
|
+
self2._directMap[keys + ":" + action]({}, keys);
|
|
7182
|
+
}
|
|
7183
|
+
return self2;
|
|
7184
|
+
};
|
|
7185
|
+
Mousetrap2.prototype.reset = function() {
|
|
7186
|
+
var self2 = this;
|
|
7187
|
+
self2._callbacks = {};
|
|
7188
|
+
self2._directMap = {};
|
|
7189
|
+
return self2;
|
|
7190
|
+
};
|
|
7191
|
+
Mousetrap2.prototype.stopCallback = function(e2, element) {
|
|
7192
|
+
var self2 = this;
|
|
7193
|
+
if ((" " + element.className + " ").indexOf(" mousetrap ") > -1) {
|
|
7194
|
+
return false;
|
|
7195
|
+
}
|
|
7196
|
+
if (_belongsTo(element, self2.target)) {
|
|
7197
|
+
return false;
|
|
7198
|
+
}
|
|
7199
|
+
if ("composedPath" in e2 && typeof e2.composedPath === "function") {
|
|
7200
|
+
var initialEventTarget = e2.composedPath()[0];
|
|
7201
|
+
if (initialEventTarget !== e2.target) {
|
|
7202
|
+
element = initialEventTarget;
|
|
7203
|
+
}
|
|
7204
|
+
}
|
|
7205
|
+
return element.tagName == "INPUT" || element.tagName == "SELECT" || element.tagName == "TEXTAREA" || element.isContentEditable;
|
|
7206
|
+
};
|
|
7207
|
+
Mousetrap2.prototype.handleKey = function() {
|
|
7208
|
+
var self2 = this;
|
|
7209
|
+
return self2._handleKey.apply(self2, arguments);
|
|
7210
|
+
};
|
|
7211
|
+
Mousetrap2.addKeycodes = function(object) {
|
|
7212
|
+
for (var key in object) {
|
|
7213
|
+
if (object.hasOwnProperty(key)) {
|
|
7214
|
+
_MAP[key] = object[key];
|
|
7215
|
+
}
|
|
7216
|
+
}
|
|
7217
|
+
_REVERSE_MAP = null;
|
|
7218
|
+
};
|
|
7219
|
+
Mousetrap2.init = function() {
|
|
7220
|
+
var documentMousetrap = Mousetrap2(document2);
|
|
7221
|
+
for (var method in documentMousetrap) {
|
|
7222
|
+
if (method.charAt(0) !== "_") {
|
|
7223
|
+
Mousetrap2[method] = /* @__PURE__ */ function(method2) {
|
|
7224
|
+
return function() {
|
|
7225
|
+
return documentMousetrap[method2].apply(documentMousetrap, arguments);
|
|
7226
|
+
};
|
|
7227
|
+
}(method);
|
|
7228
|
+
}
|
|
7229
|
+
}
|
|
7230
|
+
};
|
|
7231
|
+
Mousetrap2.init();
|
|
7232
|
+
window2.Mousetrap = Mousetrap2;
|
|
7233
|
+
if (typeof module !== "undefined" && module.exports) {
|
|
7234
|
+
module.exports = Mousetrap2;
|
|
7235
|
+
}
|
|
7236
|
+
if (typeof define === "function" && define.amd) {
|
|
7237
|
+
define(function() {
|
|
7238
|
+
return Mousetrap2;
|
|
7239
|
+
});
|
|
7240
|
+
}
|
|
7241
|
+
})(typeof window !== "undefined" ? window : null, typeof window !== "undefined" ? document : null);
|
|
7242
|
+
}
|
|
7243
|
+
});
|
|
7244
|
+
|
|
6768
7245
|
// ../js-lib/src/esra/config.ts
|
|
6769
7246
|
var ESRAConfig = {
|
|
6770
7247
|
examinedAttributes: [
|
|
@@ -28379,6 +28856,8 @@
|
|
|
28379
28856
|
}
|
|
28380
28857
|
handleNativeDialog(data, event) {
|
|
28381
28858
|
}
|
|
28859
|
+
handleRecordAssertion(data, event) {
|
|
28860
|
+
}
|
|
28382
28861
|
};
|
|
28383
28862
|
|
|
28384
28863
|
// src/lib/session-digester/session-digester-event-handlers.ts
|
|
@@ -28786,6 +29265,10 @@
|
|
|
28786
29265
|
// ../browser-lib/src/session-record-replay/event-processor.ts
|
|
28787
29266
|
var EventProcessor = class {
|
|
28788
29267
|
constructor({ eventHandlers }) {
|
|
29268
|
+
this.filter = {
|
|
29269
|
+
only: [],
|
|
29270
|
+
exclude: []
|
|
29271
|
+
};
|
|
28789
29272
|
this.preCastEvent = /* @__PURE__ */ __name(async (event) => {
|
|
28790
29273
|
return this.handlers.preCastEvent(event);
|
|
28791
29274
|
}, "preCastEvent");
|
|
@@ -28798,6 +29281,34 @@
|
|
|
28798
29281
|
this.skipEvents = /* @__PURE__ */ __name(async (events) => {
|
|
28799
29282
|
return this.handlers.skipEvents(events);
|
|
28800
29283
|
}, "skipEvents");
|
|
29284
|
+
this.shouldProcess = /* @__PURE__ */ __name((event) => {
|
|
29285
|
+
const { only, exclude } = this.filter;
|
|
29286
|
+
const matchFilter = /* @__PURE__ */ __name((filter) => {
|
|
29287
|
+
if (
|
|
29288
|
+
// Filter events are always processed
|
|
29289
|
+
event.type === EventType.Custom && event.data.tag === "filter" /* Filter */
|
|
29290
|
+
) {
|
|
29291
|
+
return true;
|
|
29292
|
+
}
|
|
29293
|
+
if (filter.type !== event.type) {
|
|
29294
|
+
return false;
|
|
29295
|
+
}
|
|
29296
|
+
if (event.type === EventType.Custom) {
|
|
29297
|
+
return filter.tag === event.data.tag;
|
|
29298
|
+
}
|
|
29299
|
+
if (event.type === EventType.IncrementalSnapshot) {
|
|
29300
|
+
return event.data.source === filter.source;
|
|
29301
|
+
}
|
|
29302
|
+
return true;
|
|
29303
|
+
}, "matchFilter");
|
|
29304
|
+
if (only.length > 0 && !only.some(matchFilter)) {
|
|
29305
|
+
return false;
|
|
29306
|
+
}
|
|
29307
|
+
if (exclude.length > 0 && exclude.some(matchFilter)) {
|
|
29308
|
+
return false;
|
|
29309
|
+
}
|
|
29310
|
+
return true;
|
|
29311
|
+
}, "shouldProcess");
|
|
28801
29312
|
this.handlers = eventHandlers;
|
|
28802
29313
|
}
|
|
28803
29314
|
static {
|
|
@@ -28807,6 +29318,9 @@
|
|
|
28807
29318
|
this.handlers = eventHandlers;
|
|
28808
29319
|
}
|
|
28809
29320
|
async handleEvent(event) {
|
|
29321
|
+
if (!this.shouldProcess(event)) {
|
|
29322
|
+
return;
|
|
29323
|
+
}
|
|
28810
29324
|
switch (event.type) {
|
|
28811
29325
|
case EventType.Meta:
|
|
28812
29326
|
return this.handlers.handleMeta(event.data, event);
|
|
@@ -28839,6 +29353,13 @@
|
|
|
28839
29353
|
return this.handlers.handleURLChange(event.data.payload, event);
|
|
28840
29354
|
case "native-dialog-event" /* NativeDialogEvent */:
|
|
28841
29355
|
return this.handlers.handleNativeDialog(event.data.payload, event);
|
|
29356
|
+
case "assertion" /* Assertion */:
|
|
29357
|
+
return this.handlers.handleRecordAssertion(
|
|
29358
|
+
event.data.payload,
|
|
29359
|
+
event
|
|
29360
|
+
);
|
|
29361
|
+
case "filter" /* Filter */:
|
|
29362
|
+
this.handleFilterEvent(event.data.payload);
|
|
28842
29363
|
}
|
|
28843
29364
|
break;
|
|
28844
29365
|
default:
|
|
@@ -28863,6 +29384,10 @@
|
|
|
28863
29384
|
break;
|
|
28864
29385
|
}
|
|
28865
29386
|
}
|
|
29387
|
+
handleFilterEvent(data) {
|
|
29388
|
+
this.filter.exclude = data.filter.exclude;
|
|
29389
|
+
this.filter.only = data.filter.only;
|
|
29390
|
+
}
|
|
28866
29391
|
};
|
|
28867
29392
|
|
|
28868
29393
|
// ../browser-lib/src/session-record-replay/session-replayer.ts
|
|
@@ -33342,96 +33867,409 @@
|
|
|
33342
33867
|
}
|
|
33343
33868
|
};
|
|
33344
33869
|
|
|
33345
|
-
// src/
|
|
33346
|
-
var
|
|
33347
|
-
|
|
33348
|
-
|
|
33349
|
-
this.
|
|
33350
|
-
|
|
33351
|
-
|
|
33352
|
-
this.
|
|
33353
|
-
this.
|
|
33354
|
-
|
|
33355
|
-
this.
|
|
33356
|
-
this.
|
|
33357
|
-
|
|
33358
|
-
|
|
33359
|
-
this.
|
|
33360
|
-
|
|
33361
|
-
|
|
33362
|
-
|
|
33363
|
-
|
|
33364
|
-
|
|
33365
|
-
|
|
33366
|
-
|
|
33367
|
-
}
|
|
33368
|
-
betterTemplatizr(node2) {
|
|
33369
|
-
return bettertemplatize(node2);
|
|
33370
|
-
}
|
|
33371
|
-
/**
|
|
33372
|
-
* Custom playwright selectors generator for a given element.
|
|
33373
|
-
*
|
|
33374
|
-
* @param element element, or checksumId of the element
|
|
33375
|
-
* @param keyFeatures key CSS features to be used in the selector
|
|
33376
|
-
* @param options options
|
|
33377
|
-
* @param root root node to generate the selector from
|
|
33378
|
-
*/
|
|
33379
|
-
async buildCustomPlaywrightSelectors(element, keyFeatures = [], options = {}, root2 = document) {
|
|
33380
|
-
if (typeof element === "string") {
|
|
33381
|
-
element = this.htmlReducer.getElementForChecksumId(
|
|
33382
|
-
element
|
|
33383
|
-
);
|
|
33384
|
-
}
|
|
33385
|
-
const keyFeaturesElements = keyFeatures.map((feature) => ({
|
|
33386
|
-
...feature,
|
|
33387
|
-
element: this.parentChainReducer.getElementForChecksumId(
|
|
33388
|
-
feature.checksumId
|
|
33389
|
-
)
|
|
33390
|
-
})).filter(({ element: element2 }) => !!element2);
|
|
33391
|
-
return await new PlaywrightCustomLocatorGenerator(root2).generate(
|
|
33392
|
-
element,
|
|
33393
|
-
keyFeaturesElements,
|
|
33394
|
-
{
|
|
33395
|
-
isPartOfListItem: false,
|
|
33396
|
-
isForContextElement: false,
|
|
33397
|
-
addCSSSelectorGenerator: true,
|
|
33398
|
-
expandCSSKeyElements: true,
|
|
33399
|
-
...options
|
|
33870
|
+
// ../browser-lib/src/element-inspector/element-inspector.ts
|
|
33871
|
+
var ElementInspector = class _ElementInspector {
|
|
33872
|
+
constructor(rootDocument = document, defaultView, topLevelInspector) {
|
|
33873
|
+
this.rootDocument = rootDocument;
|
|
33874
|
+
this.defaultView = defaultView;
|
|
33875
|
+
this.topLevelInspector = topLevelInspector;
|
|
33876
|
+
this.wasHoveredElementSelected = false;
|
|
33877
|
+
this.selected = [];
|
|
33878
|
+
this.singleSelection = true;
|
|
33879
|
+
this.subDocumentInspector = null;
|
|
33880
|
+
this.listening = false;
|
|
33881
|
+
this.onMouseOut = /* @__PURE__ */ __name((event) => {
|
|
33882
|
+
elementHighlighter.clearHighlights();
|
|
33883
|
+
}, "onMouseOut");
|
|
33884
|
+
this.onMouseOver = /* @__PURE__ */ __name(async (event) => {
|
|
33885
|
+
const target = event.composedPath()[0];
|
|
33886
|
+
if ("getRootNode" in target) {
|
|
33887
|
+
const rootNode = target.getRootNode();
|
|
33888
|
+
if (rootNode !== this.rootDocument) {
|
|
33889
|
+
this.handleSubDocument(rootNode, this.defaultView);
|
|
33890
|
+
return;
|
|
33891
|
+
}
|
|
33400
33892
|
}
|
|
33401
|
-
|
|
33402
|
-
|
|
33403
|
-
|
|
33404
|
-
|
|
33405
|
-
|
|
33406
|
-
|
|
33407
|
-
|
|
33408
|
-
|
|
33409
|
-
|
|
33410
|
-
|
|
33411
|
-
|
|
33412
|
-
|
|
33413
|
-
|
|
33414
|
-
|
|
33415
|
-
|
|
33416
|
-
|
|
33417
|
-
|
|
33418
|
-
|
|
33419
|
-
|
|
33420
|
-
|
|
33421
|
-
|
|
33422
|
-
|
|
33423
|
-
|
|
33424
|
-
|
|
33425
|
-
);
|
|
33426
|
-
|
|
33427
|
-
|
|
33428
|
-
|
|
33429
|
-
|
|
33430
|
-
|
|
33431
|
-
|
|
33432
|
-
|
|
33433
|
-
|
|
33434
|
-
|
|
33893
|
+
if (target instanceof this.defaultView.HTMLIFrameElement) {
|
|
33894
|
+
this.handleSubDocument(
|
|
33895
|
+
target.contentDocument,
|
|
33896
|
+
target.contentDocument.defaultView
|
|
33897
|
+
);
|
|
33898
|
+
return;
|
|
33899
|
+
}
|
|
33900
|
+
if (this.subDocumentInspector) {
|
|
33901
|
+
this.stopSubDocumentInspector(true);
|
|
33902
|
+
}
|
|
33903
|
+
if (!(target instanceof this.defaultView.Element)) {
|
|
33904
|
+
return;
|
|
33905
|
+
}
|
|
33906
|
+
if (target === this.hoveredElement || target.matches(".element-inspector-ignore")) {
|
|
33907
|
+
return;
|
|
33908
|
+
}
|
|
33909
|
+
elementHighlighter.clearHighlights();
|
|
33910
|
+
if (this.hoveredElement) {
|
|
33911
|
+
this.hoveredElement.removeEventListener("click", this.onClick, {
|
|
33912
|
+
capture: true
|
|
33913
|
+
});
|
|
33914
|
+
}
|
|
33915
|
+
const { locator, selector, parentFramesSelectors } = await this.playwrightElementSelectorGenerator.getSelectorAndLocator(
|
|
33916
|
+
target
|
|
33917
|
+
);
|
|
33918
|
+
elementHighlighter.highlightElement(target, {
|
|
33919
|
+
text: locator.replace("frameLocator('iframe').", ""),
|
|
33920
|
+
textPosition: "below",
|
|
33921
|
+
textWidthType: "auto",
|
|
33922
|
+
pointerEvents: "none",
|
|
33923
|
+
classNames: ["element-inspector-ignore"]
|
|
33924
|
+
});
|
|
33925
|
+
const elementByLocator = await this.playwrightElementSelectorGenerator.selector(
|
|
33926
|
+
selector,
|
|
33927
|
+
parentFramesSelectors
|
|
33928
|
+
);
|
|
33929
|
+
if (elementByLocator !== target) {
|
|
33930
|
+
elementHighlighter.highlightElement(elementByLocator, {
|
|
33931
|
+
// highlightStyle: { outlineColor: "blue" },
|
|
33932
|
+
clear: false,
|
|
33933
|
+
pointerEvents: "none",
|
|
33934
|
+
classNames: ["element-inspector-ignore"]
|
|
33935
|
+
});
|
|
33936
|
+
}
|
|
33937
|
+
this.hoveredElement = target;
|
|
33938
|
+
this.hoveredElementSelection = { locator, selector, parentFramesSelectors };
|
|
33939
|
+
this.wasHoveredElementSelected = false;
|
|
33940
|
+
target.addEventListener("click", this.onClick, {
|
|
33941
|
+
capture: true
|
|
33942
|
+
});
|
|
33943
|
+
}, "onMouseOver");
|
|
33944
|
+
this.onClick = /* @__PURE__ */ __name(async (event) => {
|
|
33945
|
+
event.stopPropagation();
|
|
33946
|
+
event.preventDefault();
|
|
33947
|
+
if (this.wasHoveredElementSelected) {
|
|
33948
|
+
return;
|
|
33949
|
+
}
|
|
33950
|
+
this.wasHoveredElementSelected = true;
|
|
33951
|
+
this.selected.push(this.hoveredElementSelection);
|
|
33952
|
+
if (this.singleSelection) {
|
|
33953
|
+
this.topLevelInspector ? this.topLevelInspector.stop() : this.stop();
|
|
33954
|
+
}
|
|
33955
|
+
window.parent.postMessage(
|
|
33956
|
+
{
|
|
33957
|
+
type: "inspector-selection",
|
|
33958
|
+
data: this.selected.at(this.selected.length - 1)
|
|
33959
|
+
},
|
|
33960
|
+
"*"
|
|
33961
|
+
);
|
|
33962
|
+
console.log("selected", this.selected);
|
|
33963
|
+
}, "onClick");
|
|
33964
|
+
this.handleSubDocument = /* @__PURE__ */ __name((newRootDocument, defaultView) => {
|
|
33965
|
+
if (this.subDocumentInspector) {
|
|
33966
|
+
if (this.subDocumentInspector.rootDocument === newRootDocument) {
|
|
33967
|
+
return true;
|
|
33968
|
+
}
|
|
33969
|
+
this.stopSubDocumentInspector(true);
|
|
33970
|
+
}
|
|
33971
|
+
this.subDocumentInspector = new _ElementInspector(
|
|
33972
|
+
newRootDocument,
|
|
33973
|
+
defaultView,
|
|
33974
|
+
this.topLevelInspector ?? this
|
|
33975
|
+
);
|
|
33976
|
+
this.subDocumentInspector.start(this.singleSelection);
|
|
33977
|
+
return true;
|
|
33978
|
+
}, "handleSubDocument");
|
|
33979
|
+
this.stopSubDocumentInspector = /* @__PURE__ */ __name((clean) => {
|
|
33980
|
+
if (this.subDocumentInspector) {
|
|
33981
|
+
this.subDocumentInspector.stop(clean);
|
|
33982
|
+
this.subDocumentInspector = null;
|
|
33983
|
+
}
|
|
33984
|
+
}, "stopSubDocumentInspector");
|
|
33985
|
+
this.playwrightElementSelectorGenerator = new PlaywrightElementSelectorGenerator();
|
|
33986
|
+
if (!defaultView) {
|
|
33987
|
+
this.defaultView = this.rootDocument.nodeType === Node.DOCUMENT_NODE ? this.rootDocument.defaultView : window;
|
|
33988
|
+
}
|
|
33989
|
+
}
|
|
33990
|
+
static {
|
|
33991
|
+
__name(this, "ElementInspector");
|
|
33992
|
+
}
|
|
33993
|
+
start(singleSelection = true) {
|
|
33994
|
+
this.singleSelection = singleSelection;
|
|
33995
|
+
this.stop();
|
|
33996
|
+
this.cleanSelection();
|
|
33997
|
+
this.rootDocument.addEventListener("mouseover", this.onMouseOver);
|
|
33998
|
+
this.rootDocument.addEventListener("mouseout", this.onMouseOut);
|
|
33999
|
+
this.listening = true;
|
|
34000
|
+
}
|
|
34001
|
+
stop(clean = false) {
|
|
34002
|
+
if (!this.listening) {
|
|
34003
|
+
return;
|
|
34004
|
+
}
|
|
34005
|
+
this.listening = false;
|
|
34006
|
+
if (this.subDocumentInspector) {
|
|
34007
|
+
this.stopSubDocumentInspector(clean);
|
|
34008
|
+
}
|
|
34009
|
+
elementHighlighter.clearHighlights();
|
|
34010
|
+
if (this.hoveredElement) {
|
|
34011
|
+
this.hoveredElement.removeEventListener("click", this.onClick, {
|
|
34012
|
+
capture: true
|
|
34013
|
+
});
|
|
34014
|
+
}
|
|
34015
|
+
this.hoveredElement = null;
|
|
34016
|
+
this.wasHoveredElementSelected = false;
|
|
34017
|
+
this.rootDocument.removeEventListener("mouseover", this.onMouseOver);
|
|
34018
|
+
if (clean) {
|
|
34019
|
+
this.cleanSelection();
|
|
34020
|
+
}
|
|
34021
|
+
}
|
|
34022
|
+
cleanSelection() {
|
|
34023
|
+
if (this.subDocumentInspector) {
|
|
34024
|
+
this.subDocumentInspector.cleanSelection();
|
|
34025
|
+
}
|
|
34026
|
+
this.selected = [];
|
|
34027
|
+
}
|
|
34028
|
+
consumeSelections() {
|
|
34029
|
+
if (this.subDocumentInspector) {
|
|
34030
|
+
return this.subDocumentInspector.consumeSelections();
|
|
34031
|
+
}
|
|
34032
|
+
const selected = this.selected;
|
|
34033
|
+
this.cleanSelection();
|
|
34034
|
+
return selected;
|
|
34035
|
+
}
|
|
34036
|
+
};
|
|
34037
|
+
|
|
34038
|
+
// src/lib/test-generator/assertions-observer/keybindings-manager.ts
|
|
34039
|
+
var import_mousetrap = __toESM(require_mousetrap());
|
|
34040
|
+
var KeybindingsManager = class {
|
|
34041
|
+
constructor() {
|
|
34042
|
+
this.listeners = {};
|
|
34043
|
+
}
|
|
34044
|
+
static {
|
|
34045
|
+
__name(this, "KeybindingsManager");
|
|
34046
|
+
}
|
|
34047
|
+
addKeybinding(options) {
|
|
34048
|
+
const key = options.key.toLowerCase();
|
|
34049
|
+
const callback = options.callback;
|
|
34050
|
+
if (this.listeners[key]) {
|
|
34051
|
+
return;
|
|
34052
|
+
}
|
|
34053
|
+
this.listeners[key] = this._addKeybinding({ key, callback });
|
|
34054
|
+
}
|
|
34055
|
+
_addKeybinding({ key, callback }) {
|
|
34056
|
+
return import_mousetrap.default.bind(key, (e2) => {
|
|
34057
|
+
e2.preventDefault();
|
|
34058
|
+
callback(e2);
|
|
34059
|
+
});
|
|
34060
|
+
}
|
|
34061
|
+
};
|
|
34062
|
+
|
|
34063
|
+
// src/lib/test-generator/assertions-observer/assertions-observer.ts
|
|
34064
|
+
var AssertionsObserver = class {
|
|
34065
|
+
/**
|
|
34066
|
+
* Constructor adds keybindings listeners for creating assertions.
|
|
34067
|
+
*/
|
|
34068
|
+
constructor(sessionRecorder) {
|
|
34069
|
+
this.keybindingsManager = new KeybindingsManager();
|
|
34070
|
+
this.createHandler = /* @__PURE__ */ __name((handler) => {
|
|
34071
|
+
return {
|
|
34072
|
+
handlerFunc: /* @__PURE__ */ __name((messageEvent) => {
|
|
34073
|
+
try {
|
|
34074
|
+
handler.handlerFunc(messageEvent);
|
|
34075
|
+
} finally {
|
|
34076
|
+
this.stopObserver();
|
|
34077
|
+
}
|
|
34078
|
+
}, "handlerFunc"),
|
|
34079
|
+
handlerType: handler.handlerType
|
|
34080
|
+
};
|
|
34081
|
+
}, "createHandler");
|
|
34082
|
+
this.toHaveTextHandler = /* @__PURE__ */ __name(() => (messageEvent) => {
|
|
34083
|
+
const data = messageEvent?.data?.data;
|
|
34084
|
+
const result2 = window.prompt(
|
|
34085
|
+
`Please enter the expected text for the element:
|
|
34086
|
+
${data.locator}`
|
|
34087
|
+
);
|
|
34088
|
+
if (result2 === null) {
|
|
34089
|
+
return;
|
|
34090
|
+
}
|
|
34091
|
+
this.sessionRecorder.addCustomEvent("assertion" /* Assertion */, {
|
|
34092
|
+
matcher: `toHaveText("${result2}")`,
|
|
34093
|
+
locator: data.locator,
|
|
34094
|
+
thought: `Element should have text: ${result2}`
|
|
34095
|
+
});
|
|
34096
|
+
}, "toHaveTextHandler");
|
|
34097
|
+
this.toBeVisibleHandler = /* @__PURE__ */ __name(() => (messageEvent) => {
|
|
34098
|
+
const data = messageEvent?.data?.data;
|
|
34099
|
+
this.sessionRecorder.addCustomEvent("assertion" /* Assertion */, {
|
|
34100
|
+
matcher: `toBeVisible()`,
|
|
34101
|
+
locator: data.locator,
|
|
34102
|
+
thought: `Element ${data.locator} should be visible`
|
|
34103
|
+
});
|
|
34104
|
+
}, "toBeVisibleHandler");
|
|
34105
|
+
this.sessionRecorder = sessionRecorder;
|
|
34106
|
+
}
|
|
34107
|
+
static {
|
|
34108
|
+
__name(this, "AssertionsObserver");
|
|
34109
|
+
}
|
|
34110
|
+
init() {
|
|
34111
|
+
this.keybindingsManager.addKeybinding({
|
|
34112
|
+
key: "ctrl+meta+a",
|
|
34113
|
+
callback: /* @__PURE__ */ __name(() => this.toggleObserver({
|
|
34114
|
+
handlerFunc: this.toHaveTextHandler(),
|
|
34115
|
+
handlerType: "toHaveText" /* toHaveText */
|
|
34116
|
+
}), "callback")
|
|
34117
|
+
});
|
|
34118
|
+
this.keybindingsManager.addKeybinding({
|
|
34119
|
+
key: "ctrl+meta+s",
|
|
34120
|
+
callback: /* @__PURE__ */ __name(() => this.toggleObserver({
|
|
34121
|
+
handlerFunc: this.toBeVisibleHandler(),
|
|
34122
|
+
handlerType: "toBeVisible" /* toBeVisible */
|
|
34123
|
+
}), "callback")
|
|
34124
|
+
});
|
|
34125
|
+
}
|
|
34126
|
+
/**
|
|
34127
|
+
* Switches the active assertion handler by removing any existing message listener,
|
|
34128
|
+
* stopping the current `ElementInspector` if active, and starting a new observer with the provided handler.
|
|
34129
|
+
* It then adds a one-time message event listener for the new handler.
|
|
34130
|
+
*/
|
|
34131
|
+
toggleObserver(handler) {
|
|
34132
|
+
const wrappedHandler = this.createHandler(handler);
|
|
34133
|
+
if (this.activeHandler) {
|
|
34134
|
+
window.removeEventListener("message", this.activeHandler.handlerFunc);
|
|
34135
|
+
this.stopObserver();
|
|
34136
|
+
if (this.activeHandler.handlerType === handler.handlerType) {
|
|
34137
|
+
this.activeHandler = null;
|
|
34138
|
+
return;
|
|
34139
|
+
}
|
|
34140
|
+
}
|
|
34141
|
+
this.activeHandler = wrappedHandler;
|
|
34142
|
+
this.startObserver();
|
|
34143
|
+
window.addEventListener("message", wrappedHandler.handlerFunc, {
|
|
34144
|
+
once: true
|
|
34145
|
+
});
|
|
34146
|
+
}
|
|
34147
|
+
isInspectorActive() {
|
|
34148
|
+
return !!this.elementInspector;
|
|
34149
|
+
}
|
|
34150
|
+
enableEventsFilter() {
|
|
34151
|
+
this.sessionRecorder.addCustomEvent("filter" /* Filter */, {
|
|
34152
|
+
filter: {
|
|
34153
|
+
only: [
|
|
34154
|
+
{ type: EventType.Custom, tag: "assertion" /* Assertion */ }
|
|
34155
|
+
],
|
|
34156
|
+
exclude: []
|
|
34157
|
+
}
|
|
34158
|
+
});
|
|
34159
|
+
}
|
|
34160
|
+
disableEventsFilter() {
|
|
34161
|
+
this.sessionRecorder.addCustomEvent("filter" /* Filter */, {
|
|
34162
|
+
filter: {
|
|
34163
|
+
only: [],
|
|
34164
|
+
exclude: []
|
|
34165
|
+
}
|
|
34166
|
+
});
|
|
34167
|
+
}
|
|
34168
|
+
startObserver() {
|
|
34169
|
+
this.elementInspector = new ElementInspector(window.document);
|
|
34170
|
+
this.elementInspector.start();
|
|
34171
|
+
this.enableEventsFilter();
|
|
34172
|
+
}
|
|
34173
|
+
stopObserver() {
|
|
34174
|
+
if (!this.isInspectorActive()) {
|
|
34175
|
+
return;
|
|
34176
|
+
}
|
|
34177
|
+
this.elementInspector.stop();
|
|
34178
|
+
this.elementInspector = null;
|
|
34179
|
+
this.disableEventsFilter();
|
|
34180
|
+
}
|
|
34181
|
+
};
|
|
34182
|
+
|
|
34183
|
+
// src/lib/test-generator/test-generator.ts
|
|
34184
|
+
var LOGS_PREFIX = "$checksum";
|
|
34185
|
+
var ChecksumTestGenerator = class {
|
|
34186
|
+
constructor(options = {}) {
|
|
34187
|
+
this.options = {
|
|
34188
|
+
skipElementHighlighting: false
|
|
34189
|
+
};
|
|
34190
|
+
this.testIdCounter = 0;
|
|
34191
|
+
this.initialized = false;
|
|
34192
|
+
FrontendLogger.setPrefix(LOGS_PREFIX);
|
|
34193
|
+
this.elementSelector = new PlaywrightElementSelectorGenerator();
|
|
34194
|
+
this.options = { ...this.options, ...options };
|
|
34195
|
+
this.htmlReducer = new HTMLReducer();
|
|
34196
|
+
this.parentChainReducer = new ParentChainReducer();
|
|
34197
|
+
this.compoundSelector = new CompoundSelector(this.htmlReducer);
|
|
34198
|
+
}
|
|
34199
|
+
static {
|
|
34200
|
+
__name(this, "ChecksumTestGenerator");
|
|
34201
|
+
}
|
|
34202
|
+
// -------- [Improved Selectors] -------- //
|
|
34203
|
+
getCompoundSelector() {
|
|
34204
|
+
return this.compoundSelector;
|
|
34205
|
+
}
|
|
34206
|
+
betterTemplatizr(node2) {
|
|
34207
|
+
return bettertemplatize(node2);
|
|
34208
|
+
}
|
|
34209
|
+
/**
|
|
34210
|
+
* Custom playwright selectors generator for a given element.
|
|
34211
|
+
*
|
|
34212
|
+
* @param element element, or checksumId of the element
|
|
34213
|
+
* @param keyFeatures key CSS features to be used in the selector
|
|
34214
|
+
* @param options options
|
|
34215
|
+
* @param root root node to generate the selector from
|
|
34216
|
+
*/
|
|
34217
|
+
async buildCustomPlaywrightSelectors(element, keyFeatures = [], options = {}, root2 = document) {
|
|
34218
|
+
if (typeof element === "string") {
|
|
34219
|
+
element = this.htmlReducer.getElementForChecksumId(
|
|
34220
|
+
element
|
|
34221
|
+
);
|
|
34222
|
+
}
|
|
34223
|
+
const keyFeaturesElements = keyFeatures.map((feature) => ({
|
|
34224
|
+
...feature,
|
|
34225
|
+
element: this.parentChainReducer.getElementForChecksumId(
|
|
34226
|
+
feature.checksumId
|
|
34227
|
+
)
|
|
34228
|
+
})).filter(({ element: element2 }) => !!element2);
|
|
34229
|
+
return await new PlaywrightCustomLocatorGenerator(root2).generate(
|
|
34230
|
+
element,
|
|
34231
|
+
keyFeaturesElements,
|
|
34232
|
+
{
|
|
34233
|
+
isPartOfListItem: false,
|
|
34234
|
+
isForContextElement: false,
|
|
34235
|
+
addCSSSelectorGenerator: true,
|
|
34236
|
+
expandCSSKeyElements: true,
|
|
34237
|
+
...options
|
|
34238
|
+
}
|
|
34239
|
+
);
|
|
34240
|
+
}
|
|
34241
|
+
/**
|
|
34242
|
+
* Generates a selector for an element in a list item, where any item in the list can be selected
|
|
34243
|
+
*
|
|
34244
|
+
* @param element element, or checksumId of the element
|
|
34245
|
+
*/
|
|
34246
|
+
async buildArbitraryListItem(element) {
|
|
34247
|
+
if (typeof element === "string") {
|
|
34248
|
+
element = this.htmlReducer.getElementForChecksumId(
|
|
34249
|
+
element
|
|
34250
|
+
);
|
|
34251
|
+
}
|
|
34252
|
+
return new PlaywrightCustomLocatorGenerator().generateArbitraryItemListSelector(
|
|
34253
|
+
element
|
|
34254
|
+
);
|
|
34255
|
+
}
|
|
34256
|
+
/**
|
|
34257
|
+
* Tests a selector for a given element.
|
|
34258
|
+
*/
|
|
34259
|
+
testElementSelector(selector, element, testVariables, testUniqueness = true) {
|
|
34260
|
+
if (typeof element === "string") {
|
|
34261
|
+
element = this.htmlReducer.getElementForChecksumId(
|
|
34262
|
+
element
|
|
34263
|
+
);
|
|
34264
|
+
}
|
|
34265
|
+
return new PlaywrightCustomLocatorGenerator().testSelector(
|
|
34266
|
+
selector,
|
|
34267
|
+
element,
|
|
34268
|
+
testVariables,
|
|
34269
|
+
testUniqueness
|
|
34270
|
+
);
|
|
34271
|
+
}
|
|
34272
|
+
/**
|
|
33435
34273
|
* Generates parent chain reduced HTML for a given element.
|
|
33436
34274
|
*
|
|
33437
34275
|
* @param element element, or checksumId of the element
|
|
@@ -33455,6 +34293,7 @@
|
|
|
33455
34293
|
init(appSpecificRules, config = {}, {
|
|
33456
34294
|
sessionRecorder: initSessionRecorder = true,
|
|
33457
34295
|
filesObserver: initFilesObserver = false,
|
|
34296
|
+
assertionsObserver: initAssertionsObserver = false,
|
|
33458
34297
|
nativeDialogObserver: initNativeDialogObserver = false
|
|
33459
34298
|
} = {}, options = {}) {
|
|
33460
34299
|
this.appSpecificRules = appSpecificRules;
|
|
@@ -33476,6 +34315,10 @@
|
|
|
33476
34315
|
this.filesObserver = new FilesObserver(this.sessionMirror);
|
|
33477
34316
|
this.filesObserver.init();
|
|
33478
34317
|
}
|
|
34318
|
+
if (initAssertionsObserver) {
|
|
34319
|
+
this.assertionsObserver = new AssertionsObserver(this.sessionMirror);
|
|
34320
|
+
this.assertionsObserver.init();
|
|
34321
|
+
}
|
|
33479
34322
|
if (initNativeDialogObserver) {
|
|
33480
34323
|
this.nativeDialogObserver = new NativeDialogObserver(this.sessionMirror);
|
|
33481
34324
|
this.nativeDialogObserver.init();
|
|
@@ -34551,7 +35394,7 @@
|
|
|
34551
35394
|
super();
|
|
34552
35395
|
this.events = [];
|
|
34553
35396
|
this.previousEvent = null;
|
|
34554
|
-
this.
|
|
35397
|
+
this.steps = [];
|
|
34555
35398
|
this.lastInteractionEventIndex = 0;
|
|
34556
35399
|
this.sequences = [];
|
|
34557
35400
|
this.sequenceMatcher = new SequenceMatcher();
|
|
@@ -34559,14 +35402,17 @@
|
|
|
34559
35402
|
this.clickFilter = void 0;
|
|
34560
35403
|
this.releasePendingInputAction = /* @__PURE__ */ __name(() => {
|
|
34561
35404
|
clearTimeout(this.inputFilter.timeout);
|
|
34562
|
-
this.
|
|
35405
|
+
this.addStep({
|
|
35406
|
+
step: this.inputFilter.action,
|
|
35407
|
+
type: "action" /* Action */
|
|
35408
|
+
});
|
|
34563
35409
|
this.inputFilter = void 0;
|
|
34564
35410
|
}, "releasePendingInputAction");
|
|
34565
35411
|
this.releasePendingClickActions = /* @__PURE__ */ __name((addInteractions = true) => {
|
|
34566
35412
|
clearTimeout(this.clickFilter.timeout);
|
|
34567
35413
|
if (addInteractions) {
|
|
34568
35414
|
this.clickFilter.actions.forEach(
|
|
34569
|
-
(action) => this.
|
|
35415
|
+
(action) => this.addStep({ step: action, type: "action" /* Action */ })
|
|
34570
35416
|
);
|
|
34571
35417
|
}
|
|
34572
35418
|
this.clickFilter = void 0;
|
|
@@ -34650,8 +35496,8 @@
|
|
|
34650
35496
|
this.sessionReplayer.start({ firstEventTimestamp: Date.now() });
|
|
34651
35497
|
}
|
|
34652
35498
|
// -------- [API] -------- //
|
|
34653
|
-
|
|
34654
|
-
return this.
|
|
35499
|
+
getSteps(fromIndex = 0) {
|
|
35500
|
+
return this.steps.slice(fromIndex);
|
|
34655
35501
|
}
|
|
34656
35502
|
// -------- [Events Lifecycle] -------- //
|
|
34657
35503
|
preEvent(event) {
|
|
@@ -34709,7 +35555,7 @@
|
|
|
34709
35555
|
action.files = [];
|
|
34710
35556
|
action.files.push(data.text.split("\\").pop());
|
|
34711
35557
|
}
|
|
34712
|
-
this.
|
|
35558
|
+
this.addStep({ step: action, type: "action" /* Action */ });
|
|
34713
35559
|
}
|
|
34714
35560
|
isConsecutiveInputEvent(event) {
|
|
34715
35561
|
if (!this.inputFilter) {
|
|
@@ -34755,11 +35601,18 @@
|
|
|
34755
35601
|
nativeDialog
|
|
34756
35602
|
}
|
|
34757
35603
|
);
|
|
34758
|
-
this.
|
|
35604
|
+
this.addStep({ step: action, type: "action" /* Action */ });
|
|
34759
35605
|
} catch (e2) {
|
|
34760
35606
|
console.error("handleNativeDialog", e2);
|
|
34761
35607
|
}
|
|
34762
35608
|
}
|
|
35609
|
+
// -------- [Assertions] -------- //
|
|
35610
|
+
handleRecordAssertion(data, event) {
|
|
35611
|
+
this.addStep({
|
|
35612
|
+
step: this.makeAssertion(data),
|
|
35613
|
+
type: "assertion" /* Assertion */
|
|
35614
|
+
});
|
|
35615
|
+
}
|
|
34763
35616
|
// -------- [Key Stroke] -------- //
|
|
34764
35617
|
handleKeyStroke(data, event) {
|
|
34765
35618
|
}
|
|
@@ -34801,7 +35654,7 @@
|
|
|
34801
35654
|
}
|
|
34802
35655
|
const { selector } = await this.getNodeAndSelector(data.id);
|
|
34803
35656
|
const action = this.makePageAction("double_click" /* DoubleClick */, event, selector);
|
|
34804
|
-
this.
|
|
35657
|
+
this.addStep({ step: action, type: "action" /* Action */ });
|
|
34805
35658
|
this.releasePendingClickActions(false);
|
|
34806
35659
|
}
|
|
34807
35660
|
buildSequences() {
|
|
@@ -34817,7 +35670,9 @@
|
|
|
34817
35670
|
if (result2) {
|
|
34818
35671
|
const actions = await sequence.handler(result2);
|
|
34819
35672
|
if (actions) {
|
|
34820
|
-
actions.forEach(
|
|
35673
|
+
actions.forEach(
|
|
35674
|
+
(action) => this.addStep({ step: action, type: "action" /* Action */ })
|
|
35675
|
+
);
|
|
34821
35676
|
}
|
|
34822
35677
|
}
|
|
34823
35678
|
}
|
|
@@ -34849,13 +35704,21 @@
|
|
|
34849
35704
|
return false;
|
|
34850
35705
|
}
|
|
34851
35706
|
}
|
|
34852
|
-
|
|
34853
|
-
if (!
|
|
34854
|
-
|
|
35707
|
+
addStep(step) {
|
|
35708
|
+
if (step.type === "action" /* Action */ && !step.step.id) {
|
|
35709
|
+
step.step.id = Date.now().toString();
|
|
34855
35710
|
}
|
|
34856
|
-
this.
|
|
35711
|
+
this.steps.push(step);
|
|
34857
35712
|
this.lastInteractionEventIndex = this.events.length;
|
|
34858
35713
|
}
|
|
35714
|
+
makeAssertion(data) {
|
|
35715
|
+
return {
|
|
35716
|
+
matcher: data.matcher,
|
|
35717
|
+
locator: data.locator,
|
|
35718
|
+
thought: data.thought,
|
|
35719
|
+
id: data?.id || Date.now().toString()
|
|
35720
|
+
};
|
|
35721
|
+
}
|
|
34859
35722
|
makePageAction(eventCode, event, selector, data = {}) {
|
|
34860
35723
|
console.log(
|
|
34861
35724
|
"making action with ts",
|
|
@@ -34863,7 +35726,7 @@
|
|
|
34863
35726
|
Date.now() - event.timestamp
|
|
34864
35727
|
);
|
|
34865
35728
|
return {
|
|
34866
|
-
nodeId: this.
|
|
35729
|
+
nodeId: this.steps.length.toString(),
|
|
34867
35730
|
eventCode,
|
|
34868
35731
|
selector: selector.playwrightSelector,
|
|
34869
35732
|
locator: selector.playwrightLocator,
|
|
@@ -34871,6 +35734,7 @@
|
|
|
34871
35734
|
esraMetadata: selector.esraMetadata,
|
|
34872
35735
|
pageId: void 0,
|
|
34873
35736
|
timestamp: event.timestamp,
|
|
35737
|
+
id: data?.id || Date.now().toString(),
|
|
34874
35738
|
...data
|
|
34875
35739
|
};
|
|
34876
35740
|
}
|
|
@@ -34928,174 +35792,6 @@
|
|
|
34928
35792
|
}
|
|
34929
35793
|
};
|
|
34930
35794
|
|
|
34931
|
-
// ../browser-lib/src/element-inspector/element-inspector.ts
|
|
34932
|
-
var ElementInspector = class _ElementInspector {
|
|
34933
|
-
constructor(rootDocument = document, defaultView, topLevelInspector) {
|
|
34934
|
-
this.rootDocument = rootDocument;
|
|
34935
|
-
this.defaultView = defaultView;
|
|
34936
|
-
this.topLevelInspector = topLevelInspector;
|
|
34937
|
-
this.wasHoveredElementSelected = false;
|
|
34938
|
-
this.selected = [];
|
|
34939
|
-
this.singleSelection = true;
|
|
34940
|
-
this.subDocumentInspector = null;
|
|
34941
|
-
this.listening = false;
|
|
34942
|
-
this.onMouseOut = /* @__PURE__ */ __name((event) => {
|
|
34943
|
-
elementHighlighter.clearHighlights();
|
|
34944
|
-
}, "onMouseOut");
|
|
34945
|
-
this.onMouseOver = /* @__PURE__ */ __name(async (event) => {
|
|
34946
|
-
const target = event.composedPath()[0];
|
|
34947
|
-
if ("getRootNode" in target) {
|
|
34948
|
-
const rootNode = target.getRootNode();
|
|
34949
|
-
if (rootNode !== this.rootDocument) {
|
|
34950
|
-
this.handleSubDocument(rootNode, this.defaultView);
|
|
34951
|
-
return;
|
|
34952
|
-
}
|
|
34953
|
-
}
|
|
34954
|
-
if (target instanceof this.defaultView.HTMLIFrameElement) {
|
|
34955
|
-
this.handleSubDocument(
|
|
34956
|
-
target.contentDocument,
|
|
34957
|
-
target.contentDocument.defaultView
|
|
34958
|
-
);
|
|
34959
|
-
return;
|
|
34960
|
-
}
|
|
34961
|
-
if (this.subDocumentInspector) {
|
|
34962
|
-
this.stopSubDocumentInspector(true);
|
|
34963
|
-
}
|
|
34964
|
-
if (!(target instanceof this.defaultView.Element)) {
|
|
34965
|
-
return;
|
|
34966
|
-
}
|
|
34967
|
-
if (target === this.hoveredElement || target.matches(".element-inspector-ignore")) {
|
|
34968
|
-
return;
|
|
34969
|
-
}
|
|
34970
|
-
elementHighlighter.clearHighlights();
|
|
34971
|
-
if (this.hoveredElement) {
|
|
34972
|
-
this.hoveredElement.removeEventListener("click", this.onClick, {
|
|
34973
|
-
capture: true
|
|
34974
|
-
});
|
|
34975
|
-
}
|
|
34976
|
-
const { locator, selector, parentFramesSelectors } = await this.playwrightElementSelectorGenerator.getSelectorAndLocator(
|
|
34977
|
-
target
|
|
34978
|
-
);
|
|
34979
|
-
elementHighlighter.highlightElement(target, {
|
|
34980
|
-
text: locator.replace("frameLocator('iframe').", ""),
|
|
34981
|
-
textPosition: "below",
|
|
34982
|
-
textWidthType: "auto",
|
|
34983
|
-
pointerEvents: "none",
|
|
34984
|
-
classNames: ["element-inspector-ignore"]
|
|
34985
|
-
});
|
|
34986
|
-
const elementByLocator = await this.playwrightElementSelectorGenerator.selector(
|
|
34987
|
-
selector,
|
|
34988
|
-
parentFramesSelectors
|
|
34989
|
-
);
|
|
34990
|
-
if (elementByLocator !== target) {
|
|
34991
|
-
elementHighlighter.highlightElement(elementByLocator, {
|
|
34992
|
-
// highlightStyle: { outlineColor: "blue" },
|
|
34993
|
-
clear: false,
|
|
34994
|
-
pointerEvents: "none",
|
|
34995
|
-
classNames: ["element-inspector-ignore"]
|
|
34996
|
-
});
|
|
34997
|
-
}
|
|
34998
|
-
this.hoveredElement = target;
|
|
34999
|
-
this.hoveredElementSelection = { locator, selector, parentFramesSelectors };
|
|
35000
|
-
this.wasHoveredElementSelected = false;
|
|
35001
|
-
target.addEventListener("click", this.onClick, {
|
|
35002
|
-
capture: true
|
|
35003
|
-
});
|
|
35004
|
-
}, "onMouseOver");
|
|
35005
|
-
this.onClick = /* @__PURE__ */ __name(async (event) => {
|
|
35006
|
-
event.stopPropagation();
|
|
35007
|
-
event.preventDefault();
|
|
35008
|
-
if (this.wasHoveredElementSelected) {
|
|
35009
|
-
return;
|
|
35010
|
-
}
|
|
35011
|
-
this.wasHoveredElementSelected = true;
|
|
35012
|
-
this.selected.push(this.hoveredElementSelection);
|
|
35013
|
-
if (this.singleSelection) {
|
|
35014
|
-
this.topLevelInspector ? this.topLevelInspector.stop() : this.stop();
|
|
35015
|
-
}
|
|
35016
|
-
window.parent.postMessage(
|
|
35017
|
-
{
|
|
35018
|
-
type: "inspector-selection",
|
|
35019
|
-
data: this.selected.at(this.selected.length - 1)
|
|
35020
|
-
},
|
|
35021
|
-
"*"
|
|
35022
|
-
);
|
|
35023
|
-
console.log("selected", this.selected);
|
|
35024
|
-
}, "onClick");
|
|
35025
|
-
this.handleSubDocument = /* @__PURE__ */ __name((newRootDocument, defaultView) => {
|
|
35026
|
-
if (this.subDocumentInspector) {
|
|
35027
|
-
if (this.subDocumentInspector.rootDocument === newRootDocument) {
|
|
35028
|
-
return true;
|
|
35029
|
-
}
|
|
35030
|
-
this.stopSubDocumentInspector(true);
|
|
35031
|
-
}
|
|
35032
|
-
this.subDocumentInspector = new _ElementInspector(
|
|
35033
|
-
newRootDocument,
|
|
35034
|
-
defaultView,
|
|
35035
|
-
this.topLevelInspector ?? this
|
|
35036
|
-
);
|
|
35037
|
-
this.subDocumentInspector.start(this.singleSelection);
|
|
35038
|
-
return true;
|
|
35039
|
-
}, "handleSubDocument");
|
|
35040
|
-
this.stopSubDocumentInspector = /* @__PURE__ */ __name((clean) => {
|
|
35041
|
-
if (this.subDocumentInspector) {
|
|
35042
|
-
this.subDocumentInspector.stop(clean);
|
|
35043
|
-
this.subDocumentInspector = null;
|
|
35044
|
-
}
|
|
35045
|
-
}, "stopSubDocumentInspector");
|
|
35046
|
-
this.playwrightElementSelectorGenerator = new PlaywrightElementSelectorGenerator();
|
|
35047
|
-
if (!defaultView) {
|
|
35048
|
-
this.defaultView = this.rootDocument.nodeType === Node.DOCUMENT_NODE ? this.rootDocument.defaultView : window;
|
|
35049
|
-
}
|
|
35050
|
-
}
|
|
35051
|
-
static {
|
|
35052
|
-
__name(this, "ElementInspector");
|
|
35053
|
-
}
|
|
35054
|
-
start(singleSelection = true) {
|
|
35055
|
-
this.singleSelection = singleSelection;
|
|
35056
|
-
this.stop();
|
|
35057
|
-
this.cleanSelection();
|
|
35058
|
-
this.rootDocument.addEventListener("mouseover", this.onMouseOver);
|
|
35059
|
-
this.rootDocument.addEventListener("mouseout", this.onMouseOut);
|
|
35060
|
-
this.listening = true;
|
|
35061
|
-
}
|
|
35062
|
-
stop(clean = false) {
|
|
35063
|
-
if (!this.listening) {
|
|
35064
|
-
return;
|
|
35065
|
-
}
|
|
35066
|
-
this.listening = false;
|
|
35067
|
-
if (this.subDocumentInspector) {
|
|
35068
|
-
this.stopSubDocumentInspector(clean);
|
|
35069
|
-
}
|
|
35070
|
-
elementHighlighter.clearHighlights();
|
|
35071
|
-
if (this.hoveredElement) {
|
|
35072
|
-
this.hoveredElement.removeEventListener("click", this.onClick, {
|
|
35073
|
-
capture: true
|
|
35074
|
-
});
|
|
35075
|
-
}
|
|
35076
|
-
this.hoveredElement = null;
|
|
35077
|
-
this.wasHoveredElementSelected = false;
|
|
35078
|
-
this.rootDocument.removeEventListener("mouseover", this.onMouseOver);
|
|
35079
|
-
if (clean) {
|
|
35080
|
-
this.cleanSelection();
|
|
35081
|
-
}
|
|
35082
|
-
}
|
|
35083
|
-
cleanSelection() {
|
|
35084
|
-
if (this.subDocumentInspector) {
|
|
35085
|
-
this.subDocumentInspector.cleanSelection();
|
|
35086
|
-
}
|
|
35087
|
-
this.selected = [];
|
|
35088
|
-
}
|
|
35089
|
-
consumeSelections() {
|
|
35090
|
-
if (this.subDocumentInspector) {
|
|
35091
|
-
return this.subDocumentInspector.consumeSelections();
|
|
35092
|
-
}
|
|
35093
|
-
const selected = this.selected;
|
|
35094
|
-
this.cleanSelection();
|
|
35095
|
-
return selected;
|
|
35096
|
-
}
|
|
35097
|
-
};
|
|
35098
|
-
|
|
35099
35795
|
// ../browser-lib/src/visual-test-generator/visual-test-generator.ts
|
|
35100
35796
|
var VisualTestGenerator = class {
|
|
35101
35797
|
constructor(timeMachine) {
|
|
@@ -35110,12 +35806,12 @@
|
|
|
35110
35806
|
this.timeMachine.setEventHandlers(this.eventHandlers, true);
|
|
35111
35807
|
}
|
|
35112
35808
|
consumeInteractions() {
|
|
35113
|
-
const interactions = this.eventHandlers.
|
|
35809
|
+
const interactions = this.eventHandlers.getSteps(
|
|
35114
35810
|
this.lengthOfConsumedInteractions
|
|
35115
35811
|
);
|
|
35116
35812
|
this.lengthOfConsumedInteractions += interactions.length;
|
|
35117
35813
|
window.checksumSendMessage("vtg", {
|
|
35118
|
-
type: "consume-
|
|
35814
|
+
type: "consume-steps",
|
|
35119
35815
|
data: interactions
|
|
35120
35816
|
});
|
|
35121
35817
|
return interactions;
|