@checksum-ai/runtime 1.1.29 → 1.1.30
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 +337 -54
- 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 +1 -1
- 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.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,15 @@
|
|
|
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
|
+
}
|
|
29510
29513
|
this.stop();
|
|
29511
29514
|
this.events = [];
|
|
29512
29515
|
this.castedEvents = [];
|
|
29513
29516
|
this.start(this.startOptions);
|
|
29514
29517
|
this.isLive = false;
|
|
29515
|
-
const events = getEvents2();
|
|
29516
|
-
if (events.length === this.currentTraveledNumberOfEvents) {
|
|
29517
|
-
return;
|
|
29518
|
-
}
|
|
29519
29518
|
this.currentTraveledNumberOfEvents = events.length;
|
|
29520
29519
|
await this.fastForward(events, true);
|
|
29521
29520
|
if (sleepAfter) {
|
|
@@ -30831,25 +30830,298 @@
|
|
|
30831
30830
|
}
|
|
30832
30831
|
};
|
|
30833
30832
|
|
|
30833
|
+
// ../../node_modules/deepmerge-ts/dist/index.mjs
|
|
30834
|
+
var actions = {
|
|
30835
|
+
defaultMerge: Symbol("deepmerge-ts: default merge"),
|
|
30836
|
+
skip: Symbol("deepmerge-ts: skip")
|
|
30837
|
+
};
|
|
30838
|
+
var actionsInto = {
|
|
30839
|
+
defaultMerge: actions.defaultMerge
|
|
30840
|
+
};
|
|
30841
|
+
function defaultMetaDataUpdater(previousMeta, metaMeta) {
|
|
30842
|
+
return metaMeta;
|
|
30843
|
+
}
|
|
30844
|
+
__name(defaultMetaDataUpdater, "defaultMetaDataUpdater");
|
|
30845
|
+
function defaultFilterValues(values, meta) {
|
|
30846
|
+
return values.filter((value) => value !== void 0);
|
|
30847
|
+
}
|
|
30848
|
+
__name(defaultFilterValues, "defaultFilterValues");
|
|
30849
|
+
var ObjectType;
|
|
30850
|
+
(function(ObjectType2) {
|
|
30851
|
+
ObjectType2[ObjectType2["NOT"] = 0] = "NOT";
|
|
30852
|
+
ObjectType2[ObjectType2["RECORD"] = 1] = "RECORD";
|
|
30853
|
+
ObjectType2[ObjectType2["ARRAY"] = 2] = "ARRAY";
|
|
30854
|
+
ObjectType2[ObjectType2["SET"] = 3] = "SET";
|
|
30855
|
+
ObjectType2[ObjectType2["MAP"] = 4] = "MAP";
|
|
30856
|
+
ObjectType2[ObjectType2["OTHER"] = 5] = "OTHER";
|
|
30857
|
+
})(ObjectType || (ObjectType = {}));
|
|
30858
|
+
function getObjectType(object) {
|
|
30859
|
+
if (typeof object !== "object" || object === null) {
|
|
30860
|
+
return 0;
|
|
30861
|
+
}
|
|
30862
|
+
if (Array.isArray(object)) {
|
|
30863
|
+
return 2;
|
|
30864
|
+
}
|
|
30865
|
+
if (isRecord(object)) {
|
|
30866
|
+
return 1;
|
|
30867
|
+
}
|
|
30868
|
+
if (object instanceof Set) {
|
|
30869
|
+
return 3;
|
|
30870
|
+
}
|
|
30871
|
+
if (object instanceof Map) {
|
|
30872
|
+
return 4;
|
|
30873
|
+
}
|
|
30874
|
+
return 5;
|
|
30875
|
+
}
|
|
30876
|
+
__name(getObjectType, "getObjectType");
|
|
30877
|
+
function getKeys(objects) {
|
|
30878
|
+
const keys = /* @__PURE__ */ new Set();
|
|
30879
|
+
for (const object of objects) {
|
|
30880
|
+
for (const key of [...Object.keys(object), ...Object.getOwnPropertySymbols(object)]) {
|
|
30881
|
+
keys.add(key);
|
|
30882
|
+
}
|
|
30883
|
+
}
|
|
30884
|
+
return keys;
|
|
30885
|
+
}
|
|
30886
|
+
__name(getKeys, "getKeys");
|
|
30887
|
+
function objectHasProperty(object, property) {
|
|
30888
|
+
return typeof object === "object" && Object.prototype.propertyIsEnumerable.call(object, property);
|
|
30889
|
+
}
|
|
30890
|
+
__name(objectHasProperty, "objectHasProperty");
|
|
30891
|
+
function getIterableOfIterables(iterables) {
|
|
30892
|
+
let m_iterablesIndex = 0;
|
|
30893
|
+
let m_iterator = iterables[0]?.[Symbol.iterator]();
|
|
30894
|
+
return {
|
|
30895
|
+
[Symbol.iterator]() {
|
|
30896
|
+
return {
|
|
30897
|
+
next() {
|
|
30898
|
+
do {
|
|
30899
|
+
if (m_iterator === void 0) {
|
|
30900
|
+
return { done: true, value: void 0 };
|
|
30901
|
+
}
|
|
30902
|
+
const result2 = m_iterator.next();
|
|
30903
|
+
if (result2.done === true) {
|
|
30904
|
+
m_iterablesIndex += 1;
|
|
30905
|
+
m_iterator = iterables[m_iterablesIndex]?.[Symbol.iterator]();
|
|
30906
|
+
continue;
|
|
30907
|
+
}
|
|
30908
|
+
return {
|
|
30909
|
+
done: false,
|
|
30910
|
+
value: result2.value
|
|
30911
|
+
};
|
|
30912
|
+
} while (true);
|
|
30913
|
+
}
|
|
30914
|
+
};
|
|
30915
|
+
}
|
|
30916
|
+
};
|
|
30917
|
+
}
|
|
30918
|
+
__name(getIterableOfIterables, "getIterableOfIterables");
|
|
30919
|
+
var validRecordToStringValues = ["[object Object]", "[object Module]"];
|
|
30920
|
+
function isRecord(value) {
|
|
30921
|
+
if (!validRecordToStringValues.includes(Object.prototype.toString.call(value))) {
|
|
30922
|
+
return false;
|
|
30923
|
+
}
|
|
30924
|
+
const { constructor } = value;
|
|
30925
|
+
if (constructor === void 0) {
|
|
30926
|
+
return true;
|
|
30927
|
+
}
|
|
30928
|
+
const prototype = constructor.prototype;
|
|
30929
|
+
if (prototype === null || typeof prototype !== "object" || !validRecordToStringValues.includes(Object.prototype.toString.call(prototype))) {
|
|
30930
|
+
return false;
|
|
30931
|
+
}
|
|
30932
|
+
if (!prototype.hasOwnProperty("isPrototypeOf")) {
|
|
30933
|
+
return false;
|
|
30934
|
+
}
|
|
30935
|
+
return true;
|
|
30936
|
+
}
|
|
30937
|
+
__name(isRecord, "isRecord");
|
|
30938
|
+
function mergeRecords$1(values, utils, meta) {
|
|
30939
|
+
const result2 = {};
|
|
30940
|
+
for (const key of getKeys(values)) {
|
|
30941
|
+
const propValues = [];
|
|
30942
|
+
for (const value of values) {
|
|
30943
|
+
if (objectHasProperty(value, key)) {
|
|
30944
|
+
propValues.push(value[key]);
|
|
30945
|
+
}
|
|
30946
|
+
}
|
|
30947
|
+
if (propValues.length === 0) {
|
|
30948
|
+
continue;
|
|
30949
|
+
}
|
|
30950
|
+
const updatedMeta = utils.metaDataUpdater(meta, {
|
|
30951
|
+
key,
|
|
30952
|
+
parents: values
|
|
30953
|
+
});
|
|
30954
|
+
const propertyResult = mergeUnknowns(propValues, utils, updatedMeta);
|
|
30955
|
+
if (propertyResult === actions.skip) {
|
|
30956
|
+
continue;
|
|
30957
|
+
}
|
|
30958
|
+
if (key === "__proto__") {
|
|
30959
|
+
Object.defineProperty(result2, key, {
|
|
30960
|
+
value: propertyResult,
|
|
30961
|
+
configurable: true,
|
|
30962
|
+
enumerable: true,
|
|
30963
|
+
writable: true
|
|
30964
|
+
});
|
|
30965
|
+
} else {
|
|
30966
|
+
result2[key] = propertyResult;
|
|
30967
|
+
}
|
|
30968
|
+
}
|
|
30969
|
+
return result2;
|
|
30970
|
+
}
|
|
30971
|
+
__name(mergeRecords$1, "mergeRecords$1");
|
|
30972
|
+
function mergeArrays$1(values) {
|
|
30973
|
+
return values.flat();
|
|
30974
|
+
}
|
|
30975
|
+
__name(mergeArrays$1, "mergeArrays$1");
|
|
30976
|
+
function mergeSets$1(values) {
|
|
30977
|
+
return new Set(getIterableOfIterables(values));
|
|
30978
|
+
}
|
|
30979
|
+
__name(mergeSets$1, "mergeSets$1");
|
|
30980
|
+
function mergeMaps$1(values) {
|
|
30981
|
+
return new Map(getIterableOfIterables(values));
|
|
30982
|
+
}
|
|
30983
|
+
__name(mergeMaps$1, "mergeMaps$1");
|
|
30984
|
+
function mergeOthers$1(values) {
|
|
30985
|
+
return values.at(-1);
|
|
30986
|
+
}
|
|
30987
|
+
__name(mergeOthers$1, "mergeOthers$1");
|
|
30988
|
+
var mergeFunctions = {
|
|
30989
|
+
mergeRecords: mergeRecords$1,
|
|
30990
|
+
mergeArrays: mergeArrays$1,
|
|
30991
|
+
mergeSets: mergeSets$1,
|
|
30992
|
+
mergeMaps: mergeMaps$1,
|
|
30993
|
+
mergeOthers: mergeOthers$1
|
|
30994
|
+
};
|
|
30995
|
+
function deepmerge(...objects) {
|
|
30996
|
+
return deepmergeCustom({})(...objects);
|
|
30997
|
+
}
|
|
30998
|
+
__name(deepmerge, "deepmerge");
|
|
30999
|
+
function deepmergeCustom(options, rootMetaData) {
|
|
31000
|
+
const utils = getUtils(options, customizedDeepmerge);
|
|
31001
|
+
function customizedDeepmerge(...objects) {
|
|
31002
|
+
return mergeUnknowns(objects, utils, rootMetaData);
|
|
31003
|
+
}
|
|
31004
|
+
__name(customizedDeepmerge, "customizedDeepmerge");
|
|
31005
|
+
return customizedDeepmerge;
|
|
31006
|
+
}
|
|
31007
|
+
__name(deepmergeCustom, "deepmergeCustom");
|
|
31008
|
+
function getUtils(options, customizedDeepmerge) {
|
|
31009
|
+
return {
|
|
31010
|
+
defaultMergeFunctions: mergeFunctions,
|
|
31011
|
+
mergeFunctions: {
|
|
31012
|
+
...mergeFunctions,
|
|
31013
|
+
...Object.fromEntries(Object.entries(options).filter(([key, option]) => Object.hasOwn(mergeFunctions, key)).map(([key, option]) => option === false ? [key, mergeFunctions.mergeOthers] : [key, option]))
|
|
31014
|
+
},
|
|
31015
|
+
metaDataUpdater: options.metaDataUpdater ?? defaultMetaDataUpdater,
|
|
31016
|
+
deepmerge: customizedDeepmerge,
|
|
31017
|
+
useImplicitDefaultMerging: options.enableImplicitDefaultMerging ?? false,
|
|
31018
|
+
filterValues: options.filterValues === false ? void 0 : options.filterValues ?? defaultFilterValues,
|
|
31019
|
+
actions
|
|
31020
|
+
};
|
|
31021
|
+
}
|
|
31022
|
+
__name(getUtils, "getUtils");
|
|
31023
|
+
function mergeUnknowns(values, utils, meta) {
|
|
31024
|
+
const filteredValues = utils.filterValues?.(values, meta) ?? values;
|
|
31025
|
+
if (filteredValues.length === 0) {
|
|
31026
|
+
return void 0;
|
|
31027
|
+
}
|
|
31028
|
+
if (filteredValues.length === 1) {
|
|
31029
|
+
return mergeOthers(filteredValues, utils, meta);
|
|
31030
|
+
}
|
|
31031
|
+
const type = getObjectType(filteredValues[0]);
|
|
31032
|
+
if (type !== 0 && type !== 5) {
|
|
31033
|
+
for (let m_index = 1; m_index < filteredValues.length; m_index++) {
|
|
31034
|
+
if (getObjectType(filteredValues[m_index]) === type) {
|
|
31035
|
+
continue;
|
|
31036
|
+
}
|
|
31037
|
+
return mergeOthers(filteredValues, utils, meta);
|
|
31038
|
+
}
|
|
31039
|
+
}
|
|
31040
|
+
switch (type) {
|
|
31041
|
+
case 1: {
|
|
31042
|
+
return mergeRecords(filteredValues, utils, meta);
|
|
31043
|
+
}
|
|
31044
|
+
case 2: {
|
|
31045
|
+
return mergeArrays(filteredValues, utils, meta);
|
|
31046
|
+
}
|
|
31047
|
+
case 3: {
|
|
31048
|
+
return mergeSets(filteredValues, utils, meta);
|
|
31049
|
+
}
|
|
31050
|
+
case 4: {
|
|
31051
|
+
return mergeMaps(filteredValues, utils, meta);
|
|
31052
|
+
}
|
|
31053
|
+
default: {
|
|
31054
|
+
return mergeOthers(filteredValues, utils, meta);
|
|
31055
|
+
}
|
|
31056
|
+
}
|
|
31057
|
+
}
|
|
31058
|
+
__name(mergeUnknowns, "mergeUnknowns");
|
|
31059
|
+
function mergeRecords(values, utils, meta) {
|
|
31060
|
+
const result2 = utils.mergeFunctions.mergeRecords(values, utils, meta);
|
|
31061
|
+
if (result2 === actions.defaultMerge || utils.useImplicitDefaultMerging && result2 === void 0 && utils.mergeFunctions.mergeRecords !== utils.defaultMergeFunctions.mergeRecords) {
|
|
31062
|
+
return utils.defaultMergeFunctions.mergeRecords(values, utils, meta);
|
|
31063
|
+
}
|
|
31064
|
+
return result2;
|
|
31065
|
+
}
|
|
31066
|
+
__name(mergeRecords, "mergeRecords");
|
|
31067
|
+
function mergeArrays(values, utils, meta) {
|
|
31068
|
+
const result2 = utils.mergeFunctions.mergeArrays(values, utils, meta);
|
|
31069
|
+
if (result2 === actions.defaultMerge || utils.useImplicitDefaultMerging && result2 === void 0 && utils.mergeFunctions.mergeArrays !== utils.defaultMergeFunctions.mergeArrays) {
|
|
31070
|
+
return utils.defaultMergeFunctions.mergeArrays(values);
|
|
31071
|
+
}
|
|
31072
|
+
return result2;
|
|
31073
|
+
}
|
|
31074
|
+
__name(mergeArrays, "mergeArrays");
|
|
31075
|
+
function mergeSets(values, utils, meta) {
|
|
31076
|
+
const result2 = utils.mergeFunctions.mergeSets(values, utils, meta);
|
|
31077
|
+
if (result2 === actions.defaultMerge || utils.useImplicitDefaultMerging && result2 === void 0 && utils.mergeFunctions.mergeSets !== utils.defaultMergeFunctions.mergeSets) {
|
|
31078
|
+
return utils.defaultMergeFunctions.mergeSets(values);
|
|
31079
|
+
}
|
|
31080
|
+
return result2;
|
|
31081
|
+
}
|
|
31082
|
+
__name(mergeSets, "mergeSets");
|
|
31083
|
+
function mergeMaps(values, utils, meta) {
|
|
31084
|
+
const result2 = utils.mergeFunctions.mergeMaps(values, utils, meta);
|
|
31085
|
+
if (result2 === actions.defaultMerge || utils.useImplicitDefaultMerging && result2 === void 0 && utils.mergeFunctions.mergeMaps !== utils.defaultMergeFunctions.mergeMaps) {
|
|
31086
|
+
return utils.defaultMergeFunctions.mergeMaps(values);
|
|
31087
|
+
}
|
|
31088
|
+
return result2;
|
|
31089
|
+
}
|
|
31090
|
+
__name(mergeMaps, "mergeMaps");
|
|
31091
|
+
function mergeOthers(values, utils, meta) {
|
|
31092
|
+
const result2 = utils.mergeFunctions.mergeOthers(values, utils, meta);
|
|
31093
|
+
if (result2 === actions.defaultMerge || utils.useImplicitDefaultMerging && result2 === void 0 && utils.mergeFunctions.mergeOthers !== utils.defaultMergeFunctions.mergeOthers) {
|
|
31094
|
+
return utils.defaultMergeFunctions.mergeOthers(values);
|
|
31095
|
+
}
|
|
31096
|
+
return result2;
|
|
31097
|
+
}
|
|
31098
|
+
__name(mergeOthers, "mergeOthers");
|
|
31099
|
+
|
|
30834
31100
|
// ../browser-lib/src/session-recorder/session-recorder.ts
|
|
31101
|
+
var DefaultOptions = {
|
|
31102
|
+
sampling: {
|
|
31103
|
+
mousemove: false
|
|
31104
|
+
},
|
|
31105
|
+
//mousemoveWait: 100,
|
|
31106
|
+
userTriggeredOnInput: true,
|
|
31107
|
+
maskInputOptions: {
|
|
31108
|
+
password: false
|
|
31109
|
+
// Do not mask password inputs
|
|
31110
|
+
}
|
|
31111
|
+
};
|
|
30835
31112
|
var SessionRecorder = class {
|
|
30836
|
-
|
|
31113
|
+
// private currentURL;
|
|
31114
|
+
constructor(eventHandler, options = {}) {
|
|
31115
|
+
this.eventHandler = eventHandler;
|
|
31116
|
+
this.options = options;
|
|
30837
31117
|
this.logNativeMutationObserver = false;
|
|
30838
31118
|
this.stopRRWebRecording = /* @__PURE__ */ __name(() => {
|
|
30839
31119
|
}, "stopRRWebRecording");
|
|
30840
31120
|
this.start = /* @__PURE__ */ __name(() => {
|
|
31121
|
+
console.log("starting with options", this.options);
|
|
30841
31122
|
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
|
-
}
|
|
31123
|
+
...this.options,
|
|
31124
|
+
emit: this.eventHandler
|
|
30853
31125
|
});
|
|
30854
31126
|
if (this.logNativeMutationObserver) {
|
|
30855
31127
|
this.selfObserve();
|
|
@@ -30927,7 +31199,7 @@
|
|
|
30927
31199
|
return record.mirror.getMeta(node2);
|
|
30928
31200
|
}, "getMeta");
|
|
30929
31201
|
this.eventHandler = eventHandler;
|
|
30930
|
-
this.
|
|
31202
|
+
this.options = deepmerge(DefaultOptions, options);
|
|
30931
31203
|
}
|
|
30932
31204
|
static {
|
|
30933
31205
|
__name(this, "SessionRecorder");
|
|
@@ -32617,7 +32889,12 @@
|
|
|
32617
32889
|
return;
|
|
32618
32890
|
}
|
|
32619
32891
|
const selector = `[${feature.name}${feature.value ? `="${feature.value}"` : ""}]`;
|
|
32620
|
-
|
|
32892
|
+
try {
|
|
32893
|
+
if (element.parentElement?.querySelectorAll(selector).length > 1) {
|
|
32894
|
+
return;
|
|
32895
|
+
}
|
|
32896
|
+
} catch (error) {
|
|
32897
|
+
console.warn(`Error checking selector - ${selector}, continuing`);
|
|
32621
32898
|
return;
|
|
32622
32899
|
}
|
|
32623
32900
|
if (!cssKeyElements.some((el) => el.selector.includes(selector)) && this.getLocatorBase(element).locator(selector).element === element) {
|
|
@@ -33208,7 +33485,14 @@
|
|
|
33208
33485
|
});
|
|
33209
33486
|
const commonParents = this.getSmallestCommonParents(elementGroups).map(this.calculateElementSize).sort((a2, b) => a2.size - b.size).map((e2) => e2.element);
|
|
33210
33487
|
if (!targetSelector) {
|
|
33211
|
-
return commonParents.map((cp) =>
|
|
33488
|
+
return commonParents.map((cp) => {
|
|
33489
|
+
const pw = getElementWindowPlaywright(cp);
|
|
33490
|
+
if (!pw) {
|
|
33491
|
+
console.warn("Failed getting playwright for element", cp);
|
|
33492
|
+
return null;
|
|
33493
|
+
}
|
|
33494
|
+
return getElementWindowPlaywright(cp).selector(cp);
|
|
33495
|
+
}).filter((s2) => s2);
|
|
33212
33496
|
}
|
|
33213
33497
|
return commonParents.map((cp) => {
|
|
33214
33498
|
const playwright = getElementWindowPlaywright(cp);
|
|
@@ -34183,15 +34467,11 @@ ${data.locator}`
|
|
|
34183
34467
|
// src/lib/test-generator/test-generator.ts
|
|
34184
34468
|
var LOGS_PREFIX = "$checksum";
|
|
34185
34469
|
var ChecksumTestGenerator = class {
|
|
34186
|
-
constructor(
|
|
34187
|
-
this.options = {
|
|
34188
|
-
skipElementHighlighting: false
|
|
34189
|
-
};
|
|
34470
|
+
constructor() {
|
|
34190
34471
|
this.testIdCounter = 0;
|
|
34191
34472
|
this.initialized = false;
|
|
34192
34473
|
FrontendLogger.setPrefix(LOGS_PREFIX);
|
|
34193
34474
|
this.elementSelector = new PlaywrightElementSelectorGenerator();
|
|
34194
|
-
this.options = { ...this.options, ...options };
|
|
34195
34475
|
this.htmlReducer = new HTMLReducer();
|
|
34196
34476
|
this.parentChainReducer = new ParentChainReducer();
|
|
34197
34477
|
this.compoundSelector = new CompoundSelector(this.htmlReducer);
|
|
@@ -34295,10 +34575,9 @@ ${data.locator}`
|
|
|
34295
34575
|
filesObserver: initFilesObserver = false,
|
|
34296
34576
|
assertionsObserver: initAssertionsObserver = false,
|
|
34297
34577
|
nativeDialogObserver: initNativeDialogObserver = false
|
|
34298
|
-
} = {}
|
|
34578
|
+
} = {}) {
|
|
34299
34579
|
this.appSpecificRules = appSpecificRules;
|
|
34300
34580
|
this.config = config;
|
|
34301
|
-
this.options = { ...this.options, ...options };
|
|
34302
34581
|
if (this.initialized) {
|
|
34303
34582
|
return;
|
|
34304
34583
|
} else {
|
|
@@ -34308,7 +34587,7 @@ ${data.locator}`
|
|
|
34308
34587
|
this.sessionMirror = new SessionRecorder((event) => {
|
|
34309
34588
|
window.checksumSendBroadcastMessage?.("rrweb", [event]);
|
|
34310
34589
|
rrwebEventsStorageManager.onRRwebEvent(event);
|
|
34311
|
-
});
|
|
34590
|
+
}, config.recordOptions);
|
|
34312
34591
|
rrwebEventsStorageManager.initRRwebEvents();
|
|
34313
34592
|
}
|
|
34314
34593
|
if (initFilesObserver) {
|
|
@@ -34813,7 +35092,7 @@ ${data.locator}`
|
|
|
34813
35092
|
* Highlights the given element on the page.
|
|
34814
35093
|
*/
|
|
34815
35094
|
highlightElement(element, options = {}) {
|
|
34816
|
-
if (this.
|
|
35095
|
+
if (this.config.skipElementHighlighting) {
|
|
34817
35096
|
return;
|
|
34818
35097
|
}
|
|
34819
35098
|
elementHighlighter.highlightElement(element, options);
|
|
@@ -35168,7 +35447,7 @@ ${data.locator}`
|
|
|
35168
35447
|
setShouldHandleEvents(shouldHandleEvents) {
|
|
35169
35448
|
this.shouldHandleEvents = shouldHandleEvents;
|
|
35170
35449
|
}
|
|
35171
|
-
goBack(timestamp, options = {}) {
|
|
35450
|
+
async goBack(timestamp, options = {}) {
|
|
35172
35451
|
if (!timestamp) {
|
|
35173
35452
|
return this.goLive();
|
|
35174
35453
|
}
|
|
@@ -35201,7 +35480,6 @@ ${data.locator}`
|
|
|
35201
35480
|
if (!node2) {
|
|
35202
35481
|
return null;
|
|
35203
35482
|
}
|
|
35204
|
-
console.log("[SessionDigesterSelector] generating for node", node2);
|
|
35205
35483
|
const selector = {};
|
|
35206
35484
|
if (extractEsraMetadata) {
|
|
35207
35485
|
try {
|
|
@@ -35390,8 +35668,9 @@ ${data.locator}`
|
|
|
35390
35668
|
|
|
35391
35669
|
// ../browser-lib/src/visual-test-generator/time-machine-event-handlers.ts
|
|
35392
35670
|
var VisualTestGenerationTimeMachineEventHandlers = class extends EventHandlersBase {
|
|
35393
|
-
constructor() {
|
|
35671
|
+
constructor(onStep) {
|
|
35394
35672
|
super();
|
|
35673
|
+
this.onStep = onStep;
|
|
35395
35674
|
this.events = [];
|
|
35396
35675
|
this.previousEvent = null;
|
|
35397
35676
|
this.steps = [];
|
|
@@ -35668,9 +35947,9 @@ ${data.locator}`
|
|
|
35668
35947
|
sequence.events
|
|
35669
35948
|
);
|
|
35670
35949
|
if (result2) {
|
|
35671
|
-
const
|
|
35672
|
-
if (
|
|
35673
|
-
|
|
35950
|
+
const actions2 = await sequence.handler(result2);
|
|
35951
|
+
if (actions2) {
|
|
35952
|
+
actions2.forEach(
|
|
35674
35953
|
(action) => this.addStep({ step: action, type: "action" /* Action */ })
|
|
35675
35954
|
);
|
|
35676
35955
|
}
|
|
@@ -35710,6 +35989,7 @@ ${data.locator}`
|
|
|
35710
35989
|
}
|
|
35711
35990
|
this.steps.push(step);
|
|
35712
35991
|
this.lastInteractionEventIndex = this.events.length;
|
|
35992
|
+
this.onStep?.(step);
|
|
35713
35993
|
}
|
|
35714
35994
|
makeAssertion(data) {
|
|
35715
35995
|
return {
|
|
@@ -35726,7 +36006,6 @@ ${data.locator}`
|
|
|
35726
36006
|
Date.now() - event.timestamp
|
|
35727
36007
|
);
|
|
35728
36008
|
return {
|
|
35729
|
-
nodeId: this.steps.length.toString(),
|
|
35730
36009
|
eventCode,
|
|
35731
36010
|
selector: selector.playwrightSelector,
|
|
35732
36011
|
locator: selector.playwrightLocator,
|
|
@@ -35796,8 +36075,20 @@ ${data.locator}`
|
|
|
35796
36075
|
var VisualTestGenerator = class {
|
|
35797
36076
|
constructor(timeMachine) {
|
|
35798
36077
|
this.timeMachine = timeMachine;
|
|
35799
|
-
|
|
35800
|
-
this.
|
|
36078
|
+
// private lengthOfConsumedInteractions = 0;
|
|
36079
|
+
this.sendRecordedSteps = false;
|
|
36080
|
+
this.onNewRecordedStep = /* @__PURE__ */ __name((recordedStep) => {
|
|
36081
|
+
if (!this.sendRecordedSteps) {
|
|
36082
|
+
return;
|
|
36083
|
+
}
|
|
36084
|
+
window.parent.postMessage({
|
|
36085
|
+
type: "new-recorded-step",
|
|
36086
|
+
data: [recordedStep]
|
|
36087
|
+
});
|
|
36088
|
+
}, "onNewRecordedStep");
|
|
36089
|
+
this.eventHandlers = new VisualTestGenerationTimeMachineEventHandlers(
|
|
36090
|
+
this.onNewRecordedStep
|
|
36091
|
+
);
|
|
35801
36092
|
}
|
|
35802
36093
|
static {
|
|
35803
36094
|
__name(this, "VisualTestGenerator");
|
|
@@ -35805,16 +36096,8 @@ ${data.locator}`
|
|
|
35805
36096
|
init() {
|
|
35806
36097
|
this.timeMachine.setEventHandlers(this.eventHandlers, true);
|
|
35807
36098
|
}
|
|
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;
|
|
36099
|
+
setSendRecordedSteps(sendRecordedSteps) {
|
|
36100
|
+
this.sendRecordedSteps = sendRecordedSteps;
|
|
35818
36101
|
}
|
|
35819
36102
|
startInspector(singleSelection = true, rootDocument) {
|
|
35820
36103
|
this.elementInspector = new ElementInspector(
|