@dev-blinq/cucumber_client 1.0.1455-dev → 1.0.1457-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.
|
@@ -32,7 +32,14 @@ class PromisifiedSocketServer {
|
|
|
32
32
|
}
|
|
33
33
|
this.socket.emit("response", { id, value: response, roomId, socketId });
|
|
34
34
|
} catch (error) {
|
|
35
|
-
socketLogger.error("Error handling request", {
|
|
35
|
+
socketLogger.error("Error handling request", {
|
|
36
|
+
event,
|
|
37
|
+
input,
|
|
38
|
+
id,
|
|
39
|
+
roomId,
|
|
40
|
+
socketId,
|
|
41
|
+
error: error instanceof Error ? `${error.message}\n${error.stack}` : error,
|
|
42
|
+
});
|
|
36
43
|
this.socket.emit("response", {
|
|
37
44
|
id,
|
|
38
45
|
error: {
|
|
@@ -309,14 +309,7 @@ const _toRecordingStep = (cmd) => {
|
|
|
309
309
|
};
|
|
310
310
|
|
|
311
311
|
function getBestStrategy(allStrategyLocators) {
|
|
312
|
-
const orderedPriorities = [
|
|
313
|
-
"custom",
|
|
314
|
-
"context",
|
|
315
|
-
"basic",
|
|
316
|
-
"text_with_index",
|
|
317
|
-
"ignore_digit",
|
|
318
|
-
"no_text",
|
|
319
|
-
];
|
|
312
|
+
const orderedPriorities = ["custom", "context", "basic", "text_with_index", "ignore_digit", "no_text"];
|
|
320
313
|
for (const strategy of orderedPriorities) {
|
|
321
314
|
if (allStrategyLocators[strategy] && allStrategyLocators[strategy].length > 0) {
|
|
322
315
|
return strategy;
|
|
@@ -325,7 +318,6 @@ function getBestStrategy(allStrategyLocators) {
|
|
|
325
318
|
return null;
|
|
326
319
|
}
|
|
327
320
|
|
|
328
|
-
|
|
329
321
|
const _parameterizeLocators = (locators, replacementFromValue, replacementToValue) => {
|
|
330
322
|
for (const loc of locators) {
|
|
331
323
|
if (loc?.css?.includes(replacementFromValue)) {
|
|
@@ -339,27 +331,24 @@ const _parameterizeLocators = (locators, replacementFromValue, replacementToValu
|
|
|
339
331
|
}
|
|
340
332
|
}
|
|
341
333
|
return locators;
|
|
342
|
-
}
|
|
343
|
-
const parameterizeLocators = ({
|
|
344
|
-
cmd, locs, isValueVariable, isTextVariable,
|
|
345
|
-
parametersMap
|
|
346
|
-
}) => {
|
|
334
|
+
};
|
|
335
|
+
const parameterizeLocators = ({ cmd, locs, isValueVariable, isTextVariable, parametersMap }) => {
|
|
347
336
|
if (isValueVariable) {
|
|
348
337
|
const variable = cmd.value.slice(1, -1);
|
|
349
338
|
const val = parametersMap[variable];
|
|
350
339
|
const replacementFromValue = val.trim();
|
|
351
|
-
const replacementToValue = `{${variable}}
|
|
340
|
+
const replacementToValue = `{${variable}}`;
|
|
352
341
|
locs = _parameterizeLocators(locs, replacementFromValue, replacementToValue);
|
|
353
342
|
}
|
|
354
343
|
if (isTextVariable) {
|
|
355
344
|
const variable = cmd.text.slice(1, -1);
|
|
356
345
|
const val = parametersMap[variable];
|
|
357
346
|
const replacementFromValue = val.trim();
|
|
358
|
-
const replacementToValue = `{${variable}}
|
|
347
|
+
const replacementToValue = `{${variable}}`;
|
|
359
348
|
locs = _parameterizeLocators(locs, replacementFromValue, replacementToValue);
|
|
360
349
|
}
|
|
361
|
-
return locs
|
|
362
|
-
}
|
|
350
|
+
return locs;
|
|
351
|
+
};
|
|
363
352
|
|
|
364
353
|
//TODO: IMPORTAN
|
|
365
354
|
export const toRecordingStep = (cmd, parametersMap) => {
|
|
@@ -387,7 +376,7 @@ export const toRecordingStep = (cmd, parametersMap) => {
|
|
|
387
376
|
|
|
388
377
|
if (isValueVariable) {
|
|
389
378
|
step.dataSource = "parameters";
|
|
390
|
-
step.dataKey = convertToIdentifier(cmd.value.slice(1, -1))
|
|
379
|
+
step.dataKey = convertToIdentifier(cmd.value.slice(1, -1));
|
|
391
380
|
}
|
|
392
381
|
const allStrategyLocators = JSON.parse(JSON.stringify(cmd?.allStrategyLocators ?? null));
|
|
393
382
|
|
|
@@ -398,12 +387,12 @@ export const toRecordingStep = (cmd, parametersMap) => {
|
|
|
398
387
|
locs,
|
|
399
388
|
isValueVariable,
|
|
400
389
|
isTextVariable,
|
|
401
|
-
parametersMap
|
|
390
|
+
parametersMap,
|
|
402
391
|
});
|
|
403
392
|
locatorsObject.locators = locs;
|
|
404
393
|
return {
|
|
405
394
|
...step,
|
|
406
|
-
locators: locatorsObject
|
|
395
|
+
locators: locatorsObject,
|
|
407
396
|
};
|
|
408
397
|
}
|
|
409
398
|
|
|
@@ -417,7 +406,7 @@ export const toRecordingStep = (cmd, parametersMap) => {
|
|
|
417
406
|
locs: locators,
|
|
418
407
|
isValueVariable,
|
|
419
408
|
isTextVariable,
|
|
420
|
-
parametersMap
|
|
409
|
+
parametersMap,
|
|
421
410
|
});
|
|
422
411
|
}
|
|
423
412
|
|
|
@@ -427,9 +416,9 @@ export const toRecordingStep = (cmd, parametersMap) => {
|
|
|
427
416
|
...step,
|
|
428
417
|
locators: locatorsObject,
|
|
429
418
|
allStrategyLocators,
|
|
430
|
-
isLocatorsAssigned: true
|
|
419
|
+
isLocatorsAssigned: true,
|
|
431
420
|
};
|
|
432
|
-
}
|
|
421
|
+
};
|
|
433
422
|
|
|
434
423
|
export const toMethodName = (str) => {
|
|
435
424
|
// Remove any non-word characters (excluding underscore) and trim spaces
|
|
@@ -854,7 +843,14 @@ export async function updateStepDefinitions({ scenario, featureName, projectDir
|
|
|
854
843
|
const stepDefsFilePath = locateDefinitionPath(featureFolder, pageName);
|
|
855
844
|
// path.join(stepDefinitionFolderPath, pageName + "_page.mjs");
|
|
856
845
|
let codePage = getCodePage(stepDefsFilePath);
|
|
857
|
-
codePage = await saveRecording({
|
|
846
|
+
codePage = await saveRecording({
|
|
847
|
+
step,
|
|
848
|
+
cucumberStep,
|
|
849
|
+
codePage,
|
|
850
|
+
projectDir,
|
|
851
|
+
stepsDefinitions,
|
|
852
|
+
parametersMap: scenario.parametersMap,
|
|
853
|
+
});
|
|
858
854
|
if (!codePage) {
|
|
859
855
|
continue;
|
|
860
856
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dev-blinq/cucumber_client",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1457-dev",
|
|
4
4
|
"description": " ",
|
|
5
5
|
"main": "bin/index.js",
|
|
6
6
|
"types": "bin/index.d.ts",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@cucumber/tag-expressions": "^6.1.1",
|
|
40
40
|
"@dev-blinq/cucumber-js": "1.0.185-dev",
|
|
41
41
|
"@faker-js/faker": "^8.1.0",
|
|
42
|
-
"automation_model": "1.0.
|
|
42
|
+
"automation_model": "1.0.843-dev",
|
|
43
43
|
"axios": "^1.7.4",
|
|
44
44
|
"chokidar": "^3.6.0",
|
|
45
45
|
"create-require": "^1.1.1",
|