@checksum-ai/runtime 1.1.29 → 1.1.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/checksumlib.js +388 -79
- package/cli.js +47 -47
- package/index.d.ts +15 -11
- package/index.js +38 -38
- package/package.json +1 -1
- package/test-run-monitor.js +2 -2
- package/vtg-build/asset-manifest.json +3 -3
- package/vtg-build/index.html +1 -1
- package/vtg-build/static/js/main.3c227c1e.js +103 -0
- package/vtg-build/static/js/main.3c227c1e.js.LICENSE.txt +118 -0
- package/vtg-build/static/js/main.3c227c1e.js.map +1 -0
- package/vtg-build/static/js/main.6342094c.js +103 -0
- package/vtg-build/static/js/main.6342094c.js.LICENSE.txt +118 -0
- package/vtg-build/static/js/main.6342094c.js.map +1 -0
- package/vtg-build/static/js/main.97e9cba3.js +103 -0
- package/vtg-build/static/js/main.97e9cba3.js.LICENSE.txt +118 -0
- package/vtg-build/static/js/main.97e9cba3.js.map +1 -0
- package/vtg-build/static/js/main.cbed16ea.js +103 -0
- package/vtg-build/static/js/main.cbed16ea.js.LICENSE.txt +118 -0
- package/vtg-build/static/js/main.cbed16ea.js.map +1 -0
package/README.md
CHANGED
|
@@ -325,7 +325,7 @@ interface ChecksumLocator extends Locator {
|
|
|
325
325
|
## CLI Commands
|
|
326
326
|
|
|
327
327
|
1. `init` - Initialize the Checksum directory and configurations.
|
|
328
|
-
2. `test` - Run Checksum tests. Accepts all [Playwright command line flags](https://playwright.dev/docs/test-cli). To override `checksum.config.ts`, pass full or partial JSON as a string, e.g., `--
|
|
328
|
+
2. `test` - Run Checksum tests. Accepts all [Playwright command line flags](https://playwright.dev/docs/test-cli). To override `checksum.config.ts`, pass full or partial JSON as a string, e.g., `--cksm-config='{"baseURL": "https://example.com"}'`.
|
|
329
329
|
3. `show-report` - Locally shows the latest test run HTML report. Only applicable following completion of a test run configured to output an HTML report.
|
|
330
330
|
|
|
331
331
|
## Running with GitHub Actions
|
package/checksumlib.js
CHANGED
|
@@ -2657,12 +2657,12 @@
|
|
|
2657
2657
|
return isDrop ? baseSlice(array, fromRight ? 0 : index2, fromRight ? index2 + 1 : length) : baseSlice(array, fromRight ? index2 + 1 : 0, fromRight ? length : index2);
|
|
2658
2658
|
}
|
|
2659
2659
|
__name(baseWhile, "baseWhile");
|
|
2660
|
-
function baseWrapperValue(value,
|
|
2660
|
+
function baseWrapperValue(value, actions2) {
|
|
2661
2661
|
var result3 = value;
|
|
2662
2662
|
if (result3 instanceof LazyWrapper) {
|
|
2663
2663
|
result3 = result3.value();
|
|
2664
2664
|
}
|
|
2665
|
-
return arrayReduce(
|
|
2665
|
+
return arrayReduce(actions2, function(result4, action) {
|
|
2666
2666
|
return action.func.apply(action.thisArg, arrayPush([result4], action.args));
|
|
2667
2667
|
}, result3);
|
|
2668
2668
|
}
|
|
@@ -5883,8 +5883,8 @@
|
|
|
5883
5883
|
object.prototype[methodName] = function() {
|
|
5884
5884
|
var chainAll = this.__chain__;
|
|
5885
5885
|
if (chain2 || chainAll) {
|
|
5886
|
-
var result3 = object(this.__wrapped__),
|
|
5887
|
-
|
|
5886
|
+
var result3 = object(this.__wrapped__), actions2 = result3.__actions__ = copyArray(this.__actions__);
|
|
5887
|
+
actions2.push({ "func": func, "args": arguments, "thisArg": object });
|
|
5888
5888
|
result3.__chain__ = chainAll;
|
|
5889
5889
|
return result3;
|
|
5890
5890
|
}
|
|
@@ -11462,7 +11462,6 @@
|
|
|
11462
11462
|
inspectInteractableElements = this.defaultModulesState.inspectInteractableElements
|
|
11463
11463
|
} = {}) {
|
|
11464
11464
|
if (!node2) return null;
|
|
11465
|
-
console.log("[SessionDigesterSelector] generating for node", node2);
|
|
11466
11465
|
const selector = {};
|
|
11467
11466
|
if (extractEsraMetadata) {
|
|
11468
11467
|
console.log("extracting ESRA metadata...");
|
|
@@ -26169,13 +26168,13 @@
|
|
|
26169
26168
|
static {
|
|
26170
26169
|
__name(this, "Timer");
|
|
26171
26170
|
}
|
|
26172
|
-
constructor(
|
|
26171
|
+
constructor(actions2 = [], config) {
|
|
26173
26172
|
__publicField(this, "timeOffset", 0);
|
|
26174
26173
|
__publicField(this, "speed");
|
|
26175
26174
|
__publicField(this, "actions");
|
|
26176
26175
|
__publicField(this, "raf", null);
|
|
26177
26176
|
__publicField(this, "lastTimestamp");
|
|
26178
|
-
this.actions =
|
|
26177
|
+
this.actions = actions2;
|
|
26179
26178
|
this.speed = config.speed;
|
|
26180
26179
|
}
|
|
26181
26180
|
/**
|
|
@@ -29507,15 +29506,30 @@
|
|
|
29507
29506
|
if (this.isLive) {
|
|
29508
29507
|
this.liveEvents = this.events;
|
|
29509
29508
|
}
|
|
29509
|
+
const events = getEvents2();
|
|
29510
|
+
if (events.length === this.currentTraveledNumberOfEvents) {
|
|
29511
|
+
return;
|
|
29512
|
+
}
|
|
29513
|
+
const lastCheckoutEventIndex = events.reduce(
|
|
29514
|
+
(lastCheckoutEventIndex2, event, index2) => {
|
|
29515
|
+
return event.isCheckout && event.type === EventType.Meta ? index2 : lastCheckoutEventIndex2;
|
|
29516
|
+
},
|
|
29517
|
+
void 0
|
|
29518
|
+
);
|
|
29519
|
+
if (lastCheckoutEventIndex !== void 0) {
|
|
29520
|
+
console.log(
|
|
29521
|
+
"lastCheckoutEventIndex:",
|
|
29522
|
+
lastCheckoutEventIndex,
|
|
29523
|
+
"number of events to render:",
|
|
29524
|
+
events.length - lastCheckoutEventIndex
|
|
29525
|
+
);
|
|
29526
|
+
events.splice(lastCheckoutEventIndex);
|
|
29527
|
+
}
|
|
29510
29528
|
this.stop();
|
|
29511
29529
|
this.events = [];
|
|
29512
29530
|
this.castedEvents = [];
|
|
29513
29531
|
this.start(this.startOptions);
|
|
29514
29532
|
this.isLive = false;
|
|
29515
|
-
const events = getEvents2();
|
|
29516
|
-
if (events.length === this.currentTraveledNumberOfEvents) {
|
|
29517
|
-
return;
|
|
29518
|
-
}
|
|
29519
29533
|
this.currentTraveledNumberOfEvents = events.length;
|
|
29520
29534
|
await this.fastForward(events, true);
|
|
29521
29535
|
if (sleepAfter) {
|
|
@@ -30831,25 +30845,298 @@
|
|
|
30831
30845
|
}
|
|
30832
30846
|
};
|
|
30833
30847
|
|
|
30848
|
+
// ../../node_modules/deepmerge-ts/dist/index.mjs
|
|
30849
|
+
var actions = {
|
|
30850
|
+
defaultMerge: Symbol("deepmerge-ts: default merge"),
|
|
30851
|
+
skip: Symbol("deepmerge-ts: skip")
|
|
30852
|
+
};
|
|
30853
|
+
var actionsInto = {
|
|
30854
|
+
defaultMerge: actions.defaultMerge
|
|
30855
|
+
};
|
|
30856
|
+
function defaultMetaDataUpdater(previousMeta, metaMeta) {
|
|
30857
|
+
return metaMeta;
|
|
30858
|
+
}
|
|
30859
|
+
__name(defaultMetaDataUpdater, "defaultMetaDataUpdater");
|
|
30860
|
+
function defaultFilterValues(values, meta) {
|
|
30861
|
+
return values.filter((value) => value !== void 0);
|
|
30862
|
+
}
|
|
30863
|
+
__name(defaultFilterValues, "defaultFilterValues");
|
|
30864
|
+
var ObjectType;
|
|
30865
|
+
(function(ObjectType2) {
|
|
30866
|
+
ObjectType2[ObjectType2["NOT"] = 0] = "NOT";
|
|
30867
|
+
ObjectType2[ObjectType2["RECORD"] = 1] = "RECORD";
|
|
30868
|
+
ObjectType2[ObjectType2["ARRAY"] = 2] = "ARRAY";
|
|
30869
|
+
ObjectType2[ObjectType2["SET"] = 3] = "SET";
|
|
30870
|
+
ObjectType2[ObjectType2["MAP"] = 4] = "MAP";
|
|
30871
|
+
ObjectType2[ObjectType2["OTHER"] = 5] = "OTHER";
|
|
30872
|
+
})(ObjectType || (ObjectType = {}));
|
|
30873
|
+
function getObjectType(object) {
|
|
30874
|
+
if (typeof object !== "object" || object === null) {
|
|
30875
|
+
return 0;
|
|
30876
|
+
}
|
|
30877
|
+
if (Array.isArray(object)) {
|
|
30878
|
+
return 2;
|
|
30879
|
+
}
|
|
30880
|
+
if (isRecord(object)) {
|
|
30881
|
+
return 1;
|
|
30882
|
+
}
|
|
30883
|
+
if (object instanceof Set) {
|
|
30884
|
+
return 3;
|
|
30885
|
+
}
|
|
30886
|
+
if (object instanceof Map) {
|
|
30887
|
+
return 4;
|
|
30888
|
+
}
|
|
30889
|
+
return 5;
|
|
30890
|
+
}
|
|
30891
|
+
__name(getObjectType, "getObjectType");
|
|
30892
|
+
function getKeys(objects) {
|
|
30893
|
+
const keys = /* @__PURE__ */ new Set();
|
|
30894
|
+
for (const object of objects) {
|
|
30895
|
+
for (const key of [...Object.keys(object), ...Object.getOwnPropertySymbols(object)]) {
|
|
30896
|
+
keys.add(key);
|
|
30897
|
+
}
|
|
30898
|
+
}
|
|
30899
|
+
return keys;
|
|
30900
|
+
}
|
|
30901
|
+
__name(getKeys, "getKeys");
|
|
30902
|
+
function objectHasProperty(object, property) {
|
|
30903
|
+
return typeof object === "object" && Object.prototype.propertyIsEnumerable.call(object, property);
|
|
30904
|
+
}
|
|
30905
|
+
__name(objectHasProperty, "objectHasProperty");
|
|
30906
|
+
function getIterableOfIterables(iterables) {
|
|
30907
|
+
let m_iterablesIndex = 0;
|
|
30908
|
+
let m_iterator = iterables[0]?.[Symbol.iterator]();
|
|
30909
|
+
return {
|
|
30910
|
+
[Symbol.iterator]() {
|
|
30911
|
+
return {
|
|
30912
|
+
next() {
|
|
30913
|
+
do {
|
|
30914
|
+
if (m_iterator === void 0) {
|
|
30915
|
+
return { done: true, value: void 0 };
|
|
30916
|
+
}
|
|
30917
|
+
const result2 = m_iterator.next();
|
|
30918
|
+
if (result2.done === true) {
|
|
30919
|
+
m_iterablesIndex += 1;
|
|
30920
|
+
m_iterator = iterables[m_iterablesIndex]?.[Symbol.iterator]();
|
|
30921
|
+
continue;
|
|
30922
|
+
}
|
|
30923
|
+
return {
|
|
30924
|
+
done: false,
|
|
30925
|
+
value: result2.value
|
|
30926
|
+
};
|
|
30927
|
+
} while (true);
|
|
30928
|
+
}
|
|
30929
|
+
};
|
|
30930
|
+
}
|
|
30931
|
+
};
|
|
30932
|
+
}
|
|
30933
|
+
__name(getIterableOfIterables, "getIterableOfIterables");
|
|
30934
|
+
var validRecordToStringValues = ["[object Object]", "[object Module]"];
|
|
30935
|
+
function isRecord(value) {
|
|
30936
|
+
if (!validRecordToStringValues.includes(Object.prototype.toString.call(value))) {
|
|
30937
|
+
return false;
|
|
30938
|
+
}
|
|
30939
|
+
const { constructor } = value;
|
|
30940
|
+
if (constructor === void 0) {
|
|
30941
|
+
return true;
|
|
30942
|
+
}
|
|
30943
|
+
const prototype = constructor.prototype;
|
|
30944
|
+
if (prototype === null || typeof prototype !== "object" || !validRecordToStringValues.includes(Object.prototype.toString.call(prototype))) {
|
|
30945
|
+
return false;
|
|
30946
|
+
}
|
|
30947
|
+
if (!prototype.hasOwnProperty("isPrototypeOf")) {
|
|
30948
|
+
return false;
|
|
30949
|
+
}
|
|
30950
|
+
return true;
|
|
30951
|
+
}
|
|
30952
|
+
__name(isRecord, "isRecord");
|
|
30953
|
+
function mergeRecords$1(values, utils, meta) {
|
|
30954
|
+
const result2 = {};
|
|
30955
|
+
for (const key of getKeys(values)) {
|
|
30956
|
+
const propValues = [];
|
|
30957
|
+
for (const value of values) {
|
|
30958
|
+
if (objectHasProperty(value, key)) {
|
|
30959
|
+
propValues.push(value[key]);
|
|
30960
|
+
}
|
|
30961
|
+
}
|
|
30962
|
+
if (propValues.length === 0) {
|
|
30963
|
+
continue;
|
|
30964
|
+
}
|
|
30965
|
+
const updatedMeta = utils.metaDataUpdater(meta, {
|
|
30966
|
+
key,
|
|
30967
|
+
parents: values
|
|
30968
|
+
});
|
|
30969
|
+
const propertyResult = mergeUnknowns(propValues, utils, updatedMeta);
|
|
30970
|
+
if (propertyResult === actions.skip) {
|
|
30971
|
+
continue;
|
|
30972
|
+
}
|
|
30973
|
+
if (key === "__proto__") {
|
|
30974
|
+
Object.defineProperty(result2, key, {
|
|
30975
|
+
value: propertyResult,
|
|
30976
|
+
configurable: true,
|
|
30977
|
+
enumerable: true,
|
|
30978
|
+
writable: true
|
|
30979
|
+
});
|
|
30980
|
+
} else {
|
|
30981
|
+
result2[key] = propertyResult;
|
|
30982
|
+
}
|
|
30983
|
+
}
|
|
30984
|
+
return result2;
|
|
30985
|
+
}
|
|
30986
|
+
__name(mergeRecords$1, "mergeRecords$1");
|
|
30987
|
+
function mergeArrays$1(values) {
|
|
30988
|
+
return values.flat();
|
|
30989
|
+
}
|
|
30990
|
+
__name(mergeArrays$1, "mergeArrays$1");
|
|
30991
|
+
function mergeSets$1(values) {
|
|
30992
|
+
return new Set(getIterableOfIterables(values));
|
|
30993
|
+
}
|
|
30994
|
+
__name(mergeSets$1, "mergeSets$1");
|
|
30995
|
+
function mergeMaps$1(values) {
|
|
30996
|
+
return new Map(getIterableOfIterables(values));
|
|
30997
|
+
}
|
|
30998
|
+
__name(mergeMaps$1, "mergeMaps$1");
|
|
30999
|
+
function mergeOthers$1(values) {
|
|
31000
|
+
return values.at(-1);
|
|
31001
|
+
}
|
|
31002
|
+
__name(mergeOthers$1, "mergeOthers$1");
|
|
31003
|
+
var mergeFunctions = {
|
|
31004
|
+
mergeRecords: mergeRecords$1,
|
|
31005
|
+
mergeArrays: mergeArrays$1,
|
|
31006
|
+
mergeSets: mergeSets$1,
|
|
31007
|
+
mergeMaps: mergeMaps$1,
|
|
31008
|
+
mergeOthers: mergeOthers$1
|
|
31009
|
+
};
|
|
31010
|
+
function deepmerge(...objects) {
|
|
31011
|
+
return deepmergeCustom({})(...objects);
|
|
31012
|
+
}
|
|
31013
|
+
__name(deepmerge, "deepmerge");
|
|
31014
|
+
function deepmergeCustom(options, rootMetaData) {
|
|
31015
|
+
const utils = getUtils(options, customizedDeepmerge);
|
|
31016
|
+
function customizedDeepmerge(...objects) {
|
|
31017
|
+
return mergeUnknowns(objects, utils, rootMetaData);
|
|
31018
|
+
}
|
|
31019
|
+
__name(customizedDeepmerge, "customizedDeepmerge");
|
|
31020
|
+
return customizedDeepmerge;
|
|
31021
|
+
}
|
|
31022
|
+
__name(deepmergeCustom, "deepmergeCustom");
|
|
31023
|
+
function getUtils(options, customizedDeepmerge) {
|
|
31024
|
+
return {
|
|
31025
|
+
defaultMergeFunctions: mergeFunctions,
|
|
31026
|
+
mergeFunctions: {
|
|
31027
|
+
...mergeFunctions,
|
|
31028
|
+
...Object.fromEntries(Object.entries(options).filter(([key, option]) => Object.hasOwn(mergeFunctions, key)).map(([key, option]) => option === false ? [key, mergeFunctions.mergeOthers] : [key, option]))
|
|
31029
|
+
},
|
|
31030
|
+
metaDataUpdater: options.metaDataUpdater ?? defaultMetaDataUpdater,
|
|
31031
|
+
deepmerge: customizedDeepmerge,
|
|
31032
|
+
useImplicitDefaultMerging: options.enableImplicitDefaultMerging ?? false,
|
|
31033
|
+
filterValues: options.filterValues === false ? void 0 : options.filterValues ?? defaultFilterValues,
|
|
31034
|
+
actions
|
|
31035
|
+
};
|
|
31036
|
+
}
|
|
31037
|
+
__name(getUtils, "getUtils");
|
|
31038
|
+
function mergeUnknowns(values, utils, meta) {
|
|
31039
|
+
const filteredValues = utils.filterValues?.(values, meta) ?? values;
|
|
31040
|
+
if (filteredValues.length === 0) {
|
|
31041
|
+
return void 0;
|
|
31042
|
+
}
|
|
31043
|
+
if (filteredValues.length === 1) {
|
|
31044
|
+
return mergeOthers(filteredValues, utils, meta);
|
|
31045
|
+
}
|
|
31046
|
+
const type = getObjectType(filteredValues[0]);
|
|
31047
|
+
if (type !== 0 && type !== 5) {
|
|
31048
|
+
for (let m_index = 1; m_index < filteredValues.length; m_index++) {
|
|
31049
|
+
if (getObjectType(filteredValues[m_index]) === type) {
|
|
31050
|
+
continue;
|
|
31051
|
+
}
|
|
31052
|
+
return mergeOthers(filteredValues, utils, meta);
|
|
31053
|
+
}
|
|
31054
|
+
}
|
|
31055
|
+
switch (type) {
|
|
31056
|
+
case 1: {
|
|
31057
|
+
return mergeRecords(filteredValues, utils, meta);
|
|
31058
|
+
}
|
|
31059
|
+
case 2: {
|
|
31060
|
+
return mergeArrays(filteredValues, utils, meta);
|
|
31061
|
+
}
|
|
31062
|
+
case 3: {
|
|
31063
|
+
return mergeSets(filteredValues, utils, meta);
|
|
31064
|
+
}
|
|
31065
|
+
case 4: {
|
|
31066
|
+
return mergeMaps(filteredValues, utils, meta);
|
|
31067
|
+
}
|
|
31068
|
+
default: {
|
|
31069
|
+
return mergeOthers(filteredValues, utils, meta);
|
|
31070
|
+
}
|
|
31071
|
+
}
|
|
31072
|
+
}
|
|
31073
|
+
__name(mergeUnknowns, "mergeUnknowns");
|
|
31074
|
+
function mergeRecords(values, utils, meta) {
|
|
31075
|
+
const result2 = utils.mergeFunctions.mergeRecords(values, utils, meta);
|
|
31076
|
+
if (result2 === actions.defaultMerge || utils.useImplicitDefaultMerging && result2 === void 0 && utils.mergeFunctions.mergeRecords !== utils.defaultMergeFunctions.mergeRecords) {
|
|
31077
|
+
return utils.defaultMergeFunctions.mergeRecords(values, utils, meta);
|
|
31078
|
+
}
|
|
31079
|
+
return result2;
|
|
31080
|
+
}
|
|
31081
|
+
__name(mergeRecords, "mergeRecords");
|
|
31082
|
+
function mergeArrays(values, utils, meta) {
|
|
31083
|
+
const result2 = utils.mergeFunctions.mergeArrays(values, utils, meta);
|
|
31084
|
+
if (result2 === actions.defaultMerge || utils.useImplicitDefaultMerging && result2 === void 0 && utils.mergeFunctions.mergeArrays !== utils.defaultMergeFunctions.mergeArrays) {
|
|
31085
|
+
return utils.defaultMergeFunctions.mergeArrays(values);
|
|
31086
|
+
}
|
|
31087
|
+
return result2;
|
|
31088
|
+
}
|
|
31089
|
+
__name(mergeArrays, "mergeArrays");
|
|
31090
|
+
function mergeSets(values, utils, meta) {
|
|
31091
|
+
const result2 = utils.mergeFunctions.mergeSets(values, utils, meta);
|
|
31092
|
+
if (result2 === actions.defaultMerge || utils.useImplicitDefaultMerging && result2 === void 0 && utils.mergeFunctions.mergeSets !== utils.defaultMergeFunctions.mergeSets) {
|
|
31093
|
+
return utils.defaultMergeFunctions.mergeSets(values);
|
|
31094
|
+
}
|
|
31095
|
+
return result2;
|
|
31096
|
+
}
|
|
31097
|
+
__name(mergeSets, "mergeSets");
|
|
31098
|
+
function mergeMaps(values, utils, meta) {
|
|
31099
|
+
const result2 = utils.mergeFunctions.mergeMaps(values, utils, meta);
|
|
31100
|
+
if (result2 === actions.defaultMerge || utils.useImplicitDefaultMerging && result2 === void 0 && utils.mergeFunctions.mergeMaps !== utils.defaultMergeFunctions.mergeMaps) {
|
|
31101
|
+
return utils.defaultMergeFunctions.mergeMaps(values);
|
|
31102
|
+
}
|
|
31103
|
+
return result2;
|
|
31104
|
+
}
|
|
31105
|
+
__name(mergeMaps, "mergeMaps");
|
|
31106
|
+
function mergeOthers(values, utils, meta) {
|
|
31107
|
+
const result2 = utils.mergeFunctions.mergeOthers(values, utils, meta);
|
|
31108
|
+
if (result2 === actions.defaultMerge || utils.useImplicitDefaultMerging && result2 === void 0 && utils.mergeFunctions.mergeOthers !== utils.defaultMergeFunctions.mergeOthers) {
|
|
31109
|
+
return utils.defaultMergeFunctions.mergeOthers(values);
|
|
31110
|
+
}
|
|
31111
|
+
return result2;
|
|
31112
|
+
}
|
|
31113
|
+
__name(mergeOthers, "mergeOthers");
|
|
31114
|
+
|
|
30834
31115
|
// ../browser-lib/src/session-recorder/session-recorder.ts
|
|
31116
|
+
var DefaultOptions = {
|
|
31117
|
+
sampling: {
|
|
31118
|
+
mousemove: false
|
|
31119
|
+
},
|
|
31120
|
+
//mousemoveWait: 100,
|
|
31121
|
+
userTriggeredOnInput: true,
|
|
31122
|
+
maskInputOptions: {
|
|
31123
|
+
password: false
|
|
31124
|
+
// Do not mask password inputs
|
|
31125
|
+
}
|
|
31126
|
+
};
|
|
30835
31127
|
var SessionRecorder = class {
|
|
30836
|
-
|
|
31128
|
+
// private currentURL;
|
|
31129
|
+
constructor(eventHandler, options = {}) {
|
|
31130
|
+
this.eventHandler = eventHandler;
|
|
31131
|
+
this.options = options;
|
|
30837
31132
|
this.logNativeMutationObserver = false;
|
|
30838
31133
|
this.stopRRWebRecording = /* @__PURE__ */ __name(() => {
|
|
30839
31134
|
}, "stopRRWebRecording");
|
|
30840
31135
|
this.start = /* @__PURE__ */ __name(() => {
|
|
31136
|
+
console.log("starting with options", this.options);
|
|
30841
31137
|
this.stopRRWebRecording = record({
|
|
30842
|
-
|
|
30843
|
-
|
|
30844
|
-
sampling: {
|
|
30845
|
-
mousemove: false
|
|
30846
|
-
},
|
|
30847
|
-
//mousemoveWait: 100,
|
|
30848
|
-
userTriggeredOnInput: true,
|
|
30849
|
-
maskInputOptions: {
|
|
30850
|
-
password: false
|
|
30851
|
-
// Do not mask password inputs
|
|
30852
|
-
}
|
|
31138
|
+
...this.options,
|
|
31139
|
+
emit: this.eventHandler
|
|
30853
31140
|
});
|
|
30854
31141
|
if (this.logNativeMutationObserver) {
|
|
30855
31142
|
this.selfObserve();
|
|
@@ -30927,7 +31214,7 @@
|
|
|
30927
31214
|
return record.mirror.getMeta(node2);
|
|
30928
31215
|
}, "getMeta");
|
|
30929
31216
|
this.eventHandler = eventHandler;
|
|
30930
|
-
this.
|
|
31217
|
+
this.options = deepmerge(DefaultOptions, options);
|
|
30931
31218
|
}
|
|
30932
31219
|
static {
|
|
30933
31220
|
__name(this, "SessionRecorder");
|
|
@@ -32476,21 +32763,23 @@
|
|
|
32476
32763
|
}));
|
|
32477
32764
|
}
|
|
32478
32765
|
}
|
|
32479
|
-
let
|
|
32766
|
+
let filteredCandidates = [];
|
|
32480
32767
|
try {
|
|
32481
|
-
|
|
32768
|
+
for (const candidate of locatorsCandidates) {
|
|
32482
32769
|
this.checkTimeout();
|
|
32483
|
-
|
|
32484
|
-
|
|
32485
|
-
|
|
32486
|
-
|
|
32487
|
-
|
|
32770
|
+
if (candidate.elements.length === 1) {
|
|
32771
|
+
filteredCandidates.push(candidate);
|
|
32772
|
+
continue;
|
|
32773
|
+
}
|
|
32774
|
+
await awaitSleep(100);
|
|
32775
|
+
filteredCandidates.push(...this.reduceMultiCandidates(candidate));
|
|
32776
|
+
}
|
|
32488
32777
|
} catch (error) {
|
|
32489
32778
|
if (error instanceof TimeoutError) {
|
|
32490
32779
|
console.log("Timeout error");
|
|
32491
32780
|
}
|
|
32492
32781
|
}
|
|
32493
|
-
if (!
|
|
32782
|
+
if (!filteredCandidates?.length) {
|
|
32494
32783
|
console.log("no single element selector found");
|
|
32495
32784
|
if (!expandCSSKeyElements) {
|
|
32496
32785
|
return this.generate(element, cssKeyElements, {
|
|
@@ -32505,19 +32794,19 @@
|
|
|
32505
32794
|
if (addCSSSelectorGenerator) {
|
|
32506
32795
|
const cssSelection = await this.addCSSSelectorGenerator();
|
|
32507
32796
|
if (cssSelection) {
|
|
32508
|
-
|
|
32797
|
+
filteredCandidates.unshift(cssSelection);
|
|
32509
32798
|
}
|
|
32510
32799
|
}
|
|
32511
32800
|
if (this.rootNode === document && useTextContent) {
|
|
32512
32801
|
const { selector, locator } = await new PlaywrightElementSelectorGenerator().getSelectorAndLocator(
|
|
32513
32802
|
this.targetElement
|
|
32514
32803
|
);
|
|
32515
|
-
|
|
32804
|
+
filteredCandidates.unshift({
|
|
32516
32805
|
selector,
|
|
32517
32806
|
locator
|
|
32518
32807
|
});
|
|
32519
32808
|
}
|
|
32520
|
-
return
|
|
32809
|
+
return filteredCandidates.map(({ selector, locator }) => ({
|
|
32521
32810
|
selector,
|
|
32522
32811
|
locator
|
|
32523
32812
|
}));
|
|
@@ -32613,20 +32902,33 @@
|
|
|
32613
32902
|
({ name, value }) => value.length < 30 && !COVERED_ATTRIBUTES.includes(name)
|
|
32614
32903
|
);
|
|
32615
32904
|
newFeatures.forEach((feature) => {
|
|
32616
|
-
|
|
32617
|
-
|
|
32618
|
-
|
|
32619
|
-
|
|
32620
|
-
|
|
32621
|
-
|
|
32622
|
-
|
|
32623
|
-
|
|
32624
|
-
|
|
32625
|
-
|
|
32626
|
-
selector
|
|
32627
|
-
|
|
32628
|
-
|
|
32629
|
-
|
|
32905
|
+
try {
|
|
32906
|
+
if (added.length > limit - 1) {
|
|
32907
|
+
return;
|
|
32908
|
+
}
|
|
32909
|
+
const selector = `[${feature.name}${feature.value ? `="${feature.value}"` : ""}]`;
|
|
32910
|
+
try {
|
|
32911
|
+
if (!element.parentElement || element.parentElement.querySelectorAll(selector).length > 1) {
|
|
32912
|
+
return;
|
|
32913
|
+
}
|
|
32914
|
+
} catch (error) {
|
|
32915
|
+
console.warn(`Error checking selector - ${selector}, continuing`);
|
|
32916
|
+
return;
|
|
32917
|
+
}
|
|
32918
|
+
if (!cssKeyElements.some((el) => el.selector.includes(selector)) && this.getLocatorBase(element).locator(selector).element === element) {
|
|
32919
|
+
const newFeature = {
|
|
32920
|
+
element,
|
|
32921
|
+
selector
|
|
32922
|
+
};
|
|
32923
|
+
cssKeyElements.push(newFeature);
|
|
32924
|
+
added.push(newFeature);
|
|
32925
|
+
}
|
|
32926
|
+
} catch (error) {
|
|
32927
|
+
console.warn(
|
|
32928
|
+
"Error processing css key feature",
|
|
32929
|
+
{ name: feature.name, value: feature.value },
|
|
32930
|
+
error
|
|
32931
|
+
);
|
|
32630
32932
|
}
|
|
32631
32933
|
});
|
|
32632
32934
|
element = element.parentElement;
|
|
@@ -33208,7 +33510,14 @@
|
|
|
33208
33510
|
});
|
|
33209
33511
|
const commonParents = this.getSmallestCommonParents(elementGroups).map(this.calculateElementSize).sort((a2, b) => a2.size - b.size).map((e2) => e2.element);
|
|
33210
33512
|
if (!targetSelector) {
|
|
33211
|
-
return commonParents.map((cp) =>
|
|
33513
|
+
return commonParents.map((cp) => {
|
|
33514
|
+
const pw = getElementWindowPlaywright(cp);
|
|
33515
|
+
if (!pw) {
|
|
33516
|
+
console.warn("Failed getting playwright for element", cp);
|
|
33517
|
+
return null;
|
|
33518
|
+
}
|
|
33519
|
+
return getElementWindowPlaywright(cp).selector(cp);
|
|
33520
|
+
}).filter((s2) => s2);
|
|
33212
33521
|
}
|
|
33213
33522
|
return commonParents.map((cp) => {
|
|
33214
33523
|
const playwright = getElementWindowPlaywright(cp);
|
|
@@ -34183,15 +34492,11 @@ ${data.locator}`
|
|
|
34183
34492
|
// src/lib/test-generator/test-generator.ts
|
|
34184
34493
|
var LOGS_PREFIX = "$checksum";
|
|
34185
34494
|
var ChecksumTestGenerator = class {
|
|
34186
|
-
constructor(
|
|
34187
|
-
this.options = {
|
|
34188
|
-
skipElementHighlighting: false
|
|
34189
|
-
};
|
|
34495
|
+
constructor() {
|
|
34190
34496
|
this.testIdCounter = 0;
|
|
34191
34497
|
this.initialized = false;
|
|
34192
34498
|
FrontendLogger.setPrefix(LOGS_PREFIX);
|
|
34193
34499
|
this.elementSelector = new PlaywrightElementSelectorGenerator();
|
|
34194
|
-
this.options = { ...this.options, ...options };
|
|
34195
34500
|
this.htmlReducer = new HTMLReducer();
|
|
34196
34501
|
this.parentChainReducer = new ParentChainReducer();
|
|
34197
34502
|
this.compoundSelector = new CompoundSelector(this.htmlReducer);
|
|
@@ -34295,20 +34600,20 @@ ${data.locator}`
|
|
|
34295
34600
|
filesObserver: initFilesObserver = false,
|
|
34296
34601
|
assertionsObserver: initAssertionsObserver = false,
|
|
34297
34602
|
nativeDialogObserver: initNativeDialogObserver = false
|
|
34298
|
-
} = {}
|
|
34603
|
+
} = {}) {
|
|
34299
34604
|
this.appSpecificRules = appSpecificRules;
|
|
34300
34605
|
this.config = config;
|
|
34301
|
-
this.options = { ...this.options, ...options };
|
|
34302
34606
|
if (this.initialized) {
|
|
34303
34607
|
return;
|
|
34304
34608
|
} else {
|
|
34305
34609
|
this.initialized = true;
|
|
34306
34610
|
}
|
|
34307
34611
|
if (initSessionRecorder) {
|
|
34308
|
-
this.sessionMirror = new SessionRecorder((event) => {
|
|
34612
|
+
this.sessionMirror = new SessionRecorder((event, isCheckout) => {
|
|
34613
|
+
event.isCheckout = isCheckout;
|
|
34309
34614
|
window.checksumSendBroadcastMessage?.("rrweb", [event]);
|
|
34310
34615
|
rrwebEventsStorageManager.onRRwebEvent(event);
|
|
34311
|
-
});
|
|
34616
|
+
}, config.recordOptions);
|
|
34312
34617
|
rrwebEventsStorageManager.initRRwebEvents();
|
|
34313
34618
|
}
|
|
34314
34619
|
if (initFilesObserver) {
|
|
@@ -34813,7 +35118,7 @@ ${data.locator}`
|
|
|
34813
35118
|
* Highlights the given element on the page.
|
|
34814
35119
|
*/
|
|
34815
35120
|
highlightElement(element, options = {}) {
|
|
34816
|
-
if (this.
|
|
35121
|
+
if (this.config.skipElementHighlighting) {
|
|
34817
35122
|
return;
|
|
34818
35123
|
}
|
|
34819
35124
|
elementHighlighter.highlightElement(element, options);
|
|
@@ -35168,7 +35473,7 @@ ${data.locator}`
|
|
|
35168
35473
|
setShouldHandleEvents(shouldHandleEvents) {
|
|
35169
35474
|
this.shouldHandleEvents = shouldHandleEvents;
|
|
35170
35475
|
}
|
|
35171
|
-
goBack(timestamp, options = {}) {
|
|
35476
|
+
async goBack(timestamp, options = {}) {
|
|
35172
35477
|
if (!timestamp) {
|
|
35173
35478
|
return this.goLive();
|
|
35174
35479
|
}
|
|
@@ -35201,7 +35506,6 @@ ${data.locator}`
|
|
|
35201
35506
|
if (!node2) {
|
|
35202
35507
|
return null;
|
|
35203
35508
|
}
|
|
35204
|
-
console.log("[SessionDigesterSelector] generating for node", node2);
|
|
35205
35509
|
const selector = {};
|
|
35206
35510
|
if (extractEsraMetadata) {
|
|
35207
35511
|
try {
|
|
@@ -35390,8 +35694,9 @@ ${data.locator}`
|
|
|
35390
35694
|
|
|
35391
35695
|
// ../browser-lib/src/visual-test-generator/time-machine-event-handlers.ts
|
|
35392
35696
|
var VisualTestGenerationTimeMachineEventHandlers = class extends EventHandlersBase {
|
|
35393
|
-
constructor() {
|
|
35697
|
+
constructor(onStep) {
|
|
35394
35698
|
super();
|
|
35699
|
+
this.onStep = onStep;
|
|
35395
35700
|
this.events = [];
|
|
35396
35701
|
this.previousEvent = null;
|
|
35397
35702
|
this.steps = [];
|
|
@@ -35668,9 +35973,9 @@ ${data.locator}`
|
|
|
35668
35973
|
sequence.events
|
|
35669
35974
|
);
|
|
35670
35975
|
if (result2) {
|
|
35671
|
-
const
|
|
35672
|
-
if (
|
|
35673
|
-
|
|
35976
|
+
const actions2 = await sequence.handler(result2);
|
|
35977
|
+
if (actions2) {
|
|
35978
|
+
actions2.forEach(
|
|
35674
35979
|
(action) => this.addStep({ step: action, type: "action" /* Action */ })
|
|
35675
35980
|
);
|
|
35676
35981
|
}
|
|
@@ -35710,6 +36015,7 @@ ${data.locator}`
|
|
|
35710
36015
|
}
|
|
35711
36016
|
this.steps.push(step);
|
|
35712
36017
|
this.lastInteractionEventIndex = this.events.length;
|
|
36018
|
+
this.onStep?.(step);
|
|
35713
36019
|
}
|
|
35714
36020
|
makeAssertion(data) {
|
|
35715
36021
|
return {
|
|
@@ -35726,7 +36032,6 @@ ${data.locator}`
|
|
|
35726
36032
|
Date.now() - event.timestamp
|
|
35727
36033
|
);
|
|
35728
36034
|
return {
|
|
35729
|
-
nodeId: this.steps.length.toString(),
|
|
35730
36035
|
eventCode,
|
|
35731
36036
|
selector: selector.playwrightSelector,
|
|
35732
36037
|
locator: selector.playwrightLocator,
|
|
@@ -35796,8 +36101,20 @@ ${data.locator}`
|
|
|
35796
36101
|
var VisualTestGenerator = class {
|
|
35797
36102
|
constructor(timeMachine) {
|
|
35798
36103
|
this.timeMachine = timeMachine;
|
|
35799
|
-
|
|
35800
|
-
this.
|
|
36104
|
+
// private lengthOfConsumedInteractions = 0;
|
|
36105
|
+
this.sendRecordedSteps = false;
|
|
36106
|
+
this.onNewRecordedStep = /* @__PURE__ */ __name((recordedStep) => {
|
|
36107
|
+
if (!this.sendRecordedSteps) {
|
|
36108
|
+
return;
|
|
36109
|
+
}
|
|
36110
|
+
window.parent.postMessage({
|
|
36111
|
+
type: "new-recorded-step",
|
|
36112
|
+
data: [recordedStep]
|
|
36113
|
+
});
|
|
36114
|
+
}, "onNewRecordedStep");
|
|
36115
|
+
this.eventHandlers = new VisualTestGenerationTimeMachineEventHandlers(
|
|
36116
|
+
this.onNewRecordedStep
|
|
36117
|
+
);
|
|
35801
36118
|
}
|
|
35802
36119
|
static {
|
|
35803
36120
|
__name(this, "VisualTestGenerator");
|
|
@@ -35805,16 +36122,8 @@ ${data.locator}`
|
|
|
35805
36122
|
init() {
|
|
35806
36123
|
this.timeMachine.setEventHandlers(this.eventHandlers, true);
|
|
35807
36124
|
}
|
|
35808
|
-
|
|
35809
|
-
|
|
35810
|
-
this.lengthOfConsumedInteractions
|
|
35811
|
-
);
|
|
35812
|
-
this.lengthOfConsumedInteractions += interactions.length;
|
|
35813
|
-
window.checksumSendMessage("vtg", {
|
|
35814
|
-
type: "consume-steps",
|
|
35815
|
-
data: interactions
|
|
35816
|
-
});
|
|
35817
|
-
return interactions;
|
|
36125
|
+
setSendRecordedSteps(sendRecordedSteps) {
|
|
36126
|
+
this.sendRecordedSteps = sendRecordedSteps;
|
|
35818
36127
|
}
|
|
35819
36128
|
startInspector(singleSelection = true, rootDocument) {
|
|
35820
36129
|
this.elementInspector = new ElementInspector(
|