@dev-blinq/cucumber_client 1.0.1179-dev → 1.0.1180-dev
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.
|
@@ -304,13 +304,16 @@ function findMatchingElements(inputSnapshot, objectSet) {
|
|
|
304
304
|
|
|
305
305
|
// For each subtree, check for matches in the object set
|
|
306
306
|
subtrees.forEach((subtree) => {
|
|
307
|
-
const subtreeText = subtree.join("\n");
|
|
307
|
+
const subtreeText = subtree.map((t) => t.trim()).join("\n");
|
|
308
308
|
|
|
309
309
|
// Look for matching snapshots in the object set
|
|
310
310
|
for (const obj of objectSet) {
|
|
311
311
|
// Normalize snapshots for comparison (trim whitespace, etc.)
|
|
312
312
|
const normalizedSubtree = subtreeText.trim();
|
|
313
|
-
const normalizedSnapshot = obj.snapshot
|
|
313
|
+
const normalizedSnapshot = obj.snapshot
|
|
314
|
+
.split("\n")
|
|
315
|
+
.map((s) => s.trim())
|
|
316
|
+
.join("\n");
|
|
314
317
|
|
|
315
318
|
// Check if the current object's snapshot matches our subtree
|
|
316
319
|
if (normalizedSnapshot === normalizedSubtree) {
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { Types } from "../recording.js";
|
|
2
|
-
|
|
3
2
|
import logger from "../../logger.js";
|
|
4
3
|
import { StepsDefinitions } from "../cucumber/steps_definitions.js";
|
|
5
4
|
import path from "path";
|
|
6
5
|
import { CodePage } from "./page_reflection.js";
|
|
7
6
|
import { convertToIdentifier, escapeNonPrintables } from "./utils.js";
|
|
8
|
-
import { all } from "axios";
|
|
9
7
|
const findElementIdentifier = (node, step, userData, elements) => {
|
|
10
8
|
if (node.key) {
|
|
11
9
|
// incase of rerunning implemented steps
|
|
@@ -96,7 +96,7 @@ export function getCommandContent(command) {
|
|
|
96
96
|
return `send a ${command.value.method} API request to ${command.value.url}`;
|
|
97
97
|
}
|
|
98
98
|
case "verify_page_snapshot": {
|
|
99
|
-
return `verify page snapshot stored in ${command.
|
|
99
|
+
return `verify page snapshot stored in ${command.parameters[0]}`;
|
|
100
100
|
}
|
|
101
101
|
default: {
|
|
102
102
|
return "";
|