@dev-blinq/cucumber_client 1.0.1451-dev → 1.0.1453-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.
- package/bin/assets/bundled_scripts/recorder.js +1 -1
- package/bin/assets/preload/css_gen.js +10 -10
- package/bin/assets/preload/toolbar.js +27 -29
- package/bin/assets/preload/unique_locators.js +1 -1
- package/bin/assets/preload/yaml.js +288 -275
- package/bin/assets/scripts/aria_snapshot.js +223 -220
- package/bin/assets/scripts/dom_attr.js +329 -329
- package/bin/assets/scripts/dom_parent.js +169 -174
- package/bin/assets/scripts/event_utils.js +94 -94
- package/bin/assets/scripts/pw.js +2050 -1949
- package/bin/assets/scripts/recorder.js +3 -3
- package/bin/assets/scripts/snapshot_capturer.js +153 -146
- package/bin/assets/scripts/unique_locators.js +1 -2
- package/bin/assets/scripts/yaml.js +796 -783
- package/bin/client/code_cleanup/find_step_definition_references.js +0 -1
- package/bin/client/code_gen/api_codegen.js +2 -2
- package/bin/client/code_gen/code_inversion.js +4 -2
- package/bin/client/cucumber/feature_data.js +2 -2
- package/bin/client/cucumber/project_to_document.js +8 -2
- package/bin/client/cucumber/steps_definitions.js +6 -3
- package/bin/client/parse_feature_file.js +23 -26
- package/bin/client/playground/projects/env.json +2 -2
- package/bin/client/recorderv3/bvt_recorder.js +1 -0
- package/bin/client/recorderv3/scriptTest.js +1 -1
- package/bin/client/recorderv3/step_runner.js +2 -3
- package/bin/client/upload-service.js +2 -2
- package/package.json +2 -2
|
@@ -50,7 +50,7 @@ const generateApiCode = async (
|
|
|
50
50
|
// create new codePage
|
|
51
51
|
mjsFullPath = path.join(
|
|
52
52
|
projectDir,
|
|
53
|
-
stepsDefinitions.isTemp ? process.env.tempFeaturesFolderPath ?? "__temp_features" : "features",
|
|
53
|
+
stepsDefinitions.isTemp ? (process.env.tempFeaturesFolderPath ?? "__temp_features") : "features",
|
|
54
54
|
"step_definitions",
|
|
55
55
|
`api_tests_page.mjs`
|
|
56
56
|
);
|
|
@@ -60,7 +60,7 @@ const generateApiCode = async (
|
|
|
60
60
|
if (!codePage) {
|
|
61
61
|
mjsFullPath = path.join(
|
|
62
62
|
projectDir,
|
|
63
|
-
stepsDefinitions.isTemp ? process.env.tempFeaturesFolderPath ?? "__temp_features" : "features",
|
|
63
|
+
stepsDefinitions.isTemp ? (process.env.tempFeaturesFolderPath ?? "__temp_features") : "features",
|
|
64
64
|
"step_definitions",
|
|
65
65
|
`api_tests_page.mjs`
|
|
66
66
|
);
|
|
@@ -375,11 +375,13 @@ const invertStableCommand = (call, elements, stepParams) => {
|
|
|
375
375
|
case "verifyTextRelatedToText": {
|
|
376
376
|
step.type = Types.VERIFY_TEXT_RELATED_TO_TEXT;
|
|
377
377
|
const textAnchorParse = parseDataSource(call.arguments[0], stepParams);
|
|
378
|
-
const textAnchor =
|
|
378
|
+
const textAnchor =
|
|
379
|
+
textAnchorParse.type === "literal" ? textAnchorParse.value : toVariableName(textAnchorParse.dataKey);
|
|
379
380
|
const climbParse = parseDataSource(call.arguments[1], stepParams);
|
|
380
381
|
const climb = climbParse.type === "literal" ? climbParse.value : toVariableName(climbParse.dataKey);
|
|
381
382
|
const textToVerifyParse = parseDataSource(call.arguments[2], stepParams);
|
|
382
|
-
const textToVerify =
|
|
383
|
+
const textToVerify =
|
|
384
|
+
textToVerifyParse.type === "literal" ? textToVerifyParse.value : toVariableName(textToVerifyParse.dataKey);
|
|
383
385
|
step.parameters = [textAnchor, climb, textToVerify];
|
|
384
386
|
break;
|
|
385
387
|
}
|
|
@@ -4,7 +4,13 @@ import { AstBuilder, GherkinClassicTokenMatcher, Parser } from "@cucumber/gherki
|
|
|
4
4
|
import { Feature } from "./feature.js";
|
|
5
5
|
import { StepsDefinitions } from "./steps_definitions.js";
|
|
6
6
|
|
|
7
|
-
export const projectDocument = (
|
|
7
|
+
export const projectDocument = (
|
|
8
|
+
folder,
|
|
9
|
+
featureName = null,
|
|
10
|
+
scenarioName = null,
|
|
11
|
+
supressErrors = false,
|
|
12
|
+
errors = []
|
|
13
|
+
) => {
|
|
8
14
|
const uuidFn = () => (23212).toString(16);
|
|
9
15
|
const builder = new AstBuilder(uuidFn);
|
|
10
16
|
const matcher = new GherkinClassicTokenMatcher();
|
|
@@ -59,4 +65,4 @@ export const projectDocument = (folder, featureName = null, scenarioName = null,
|
|
|
59
65
|
// const documents = projectDocument(projectDir, featureName, scenarioName, true, errors);
|
|
60
66
|
// const args = process.argv.slice(2);
|
|
61
67
|
|
|
62
|
-
// console.log(JSON.stringify(documents));
|
|
68
|
+
// console.log(JSON.stringify(documents));
|
|
@@ -45,7 +45,10 @@ class StepsDefinitions {
|
|
|
45
45
|
if (method && expression.keyword && pattern && expression.methodName) {
|
|
46
46
|
this.steps[pattern] = {
|
|
47
47
|
// file: path.join(this.isTemp ? "__temp_features" : "features", mjsFile),
|
|
48
|
-
file: path.join(
|
|
48
|
+
file: path.join(
|
|
49
|
+
this.isTemp ? (process.env.tempFeaturesFolderPath ?? "__temp_features") : "features",
|
|
50
|
+
mjsFile
|
|
51
|
+
),
|
|
49
52
|
functionName: expression.methodName,
|
|
50
53
|
name: pattern,
|
|
51
54
|
source: this.findKey(method.codePart, "source"),
|
|
@@ -56,7 +59,7 @@ class StepsDefinitions {
|
|
|
56
59
|
}
|
|
57
60
|
load(print = true, supressErrors = false, errors = []) {
|
|
58
61
|
const mjsFiles = findFilesWithExtension(
|
|
59
|
-
path.join(this.baseFolder, this.isTemp ? process.env.tempFeaturesFolderPath ?? "__temp_features" : "features"),
|
|
62
|
+
path.join(this.baseFolder, this.isTemp ? (process.env.tempFeaturesFolderPath ?? "__temp_features") : "features"),
|
|
60
63
|
"mjs"
|
|
61
64
|
);
|
|
62
65
|
// console.log({ mjsFiles });
|
|
@@ -64,7 +67,7 @@ class StepsDefinitions {
|
|
|
64
67
|
const mjsFile = mjsFiles[i];
|
|
65
68
|
const filePath = path.join(
|
|
66
69
|
this.baseFolder,
|
|
67
|
-
this.isTemp ? process.env.tempFeaturesFolderPath ?? "__temp_features" : "features",
|
|
70
|
+
this.isTemp ? (process.env.tempFeaturesFolderPath ?? "__temp_features") : "features",
|
|
68
71
|
mjsFile
|
|
69
72
|
);
|
|
70
73
|
const codePage = new CodePage(filePath);
|
|
@@ -1,37 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
let id =0;
|
|
9
|
-
const uuidFn = () => (++id).toString(16)
|
|
10
|
-
const builder = new AstBuilder(uuidFn)
|
|
11
|
-
const matcher = new GherkinClassicTokenMatcher()
|
|
1
|
+
import { AstBuilder, GherkinClassicTokenMatcher, Parser } from "@cucumber/gherkin";
|
|
2
|
+
import { readFileSync, writeFileSync } from "fs";
|
|
3
|
+
import { loadArgs, showUsage, validateCLIArg } from "./cli_helpers.js";
|
|
4
|
+
let id = 0;
|
|
5
|
+
const uuidFn = () => (++id).toString(16);
|
|
6
|
+
const builder = new AstBuilder(uuidFn);
|
|
7
|
+
const matcher = new GherkinClassicTokenMatcher();
|
|
12
8
|
|
|
13
|
-
const parser = new Parser(builder, matcher)
|
|
9
|
+
const parser = new Parser(builder, matcher);
|
|
14
10
|
|
|
15
11
|
const parseFeatureFile = (featureFilePath) => {
|
|
16
|
-
const source = readFileSync(featureFilePath,
|
|
17
|
-
const gherkinDocument = parser.parse(source)
|
|
18
|
-
return gherkinDocument
|
|
19
|
-
}
|
|
12
|
+
const source = readFileSync(featureFilePath, "utf8");
|
|
13
|
+
const gherkinDocument = parser.parse(source);
|
|
14
|
+
return gherkinDocument;
|
|
15
|
+
};
|
|
20
16
|
|
|
21
|
-
const args = loadArgs()
|
|
22
|
-
const featureFilePath = args[0]
|
|
23
|
-
const outputFilePath = args[1]
|
|
24
|
-
const usage =
|
|
17
|
+
const args = loadArgs();
|
|
18
|
+
const featureFilePath = args[0];
|
|
19
|
+
const outputFilePath = args[1];
|
|
20
|
+
const usage =
|
|
21
|
+
"Usage: node parse_feature_file.js <featureFilePath> [<outputFilePath>] \n\nExample: node parseFeatureFile.js ./features/my.feature ./features/my.feature.json\n\n";
|
|
25
22
|
try {
|
|
26
|
-
validateCLIArg(featureFilePath,
|
|
23
|
+
validateCLIArg(featureFilePath, "featureFilePath");
|
|
27
24
|
} catch (error) {
|
|
28
|
-
showUsage(error, usage)
|
|
25
|
+
showUsage(error, usage);
|
|
29
26
|
}
|
|
30
|
-
const gherkinDocument = parseFeatureFile(featureFilePath)
|
|
27
|
+
const gherkinDocument = parseFeatureFile(featureFilePath);
|
|
31
28
|
if (outputFilePath) {
|
|
32
|
-
writeFileSync(outputFilePath, JSON.stringify(gherkinDocument, null, 2))
|
|
29
|
+
writeFileSync(outputFilePath, JSON.stringify(gherkinDocument, null, 2));
|
|
33
30
|
} else {
|
|
34
|
-
console.log(JSON.stringify(gherkinDocument, null, 2))
|
|
31
|
+
console.log(JSON.stringify(gherkinDocument, null, 2));
|
|
35
32
|
}
|
|
36
33
|
|
|
37
|
-
export { parseFeatureFile }
|
|
34
|
+
export { parseFeatureFile };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
}
|
|
2
|
+
"baseUrl": "https://google.com"
|
|
3
|
+
}
|
|
@@ -265,8 +265,8 @@ export class BVTStepRunner {
|
|
|
265
265
|
|
|
266
266
|
for (const cmdId of cmdIDs) {
|
|
267
267
|
this.liveExecutionMap.set(cmdId, {
|
|
268
|
-
resolve: () => {
|
|
269
|
-
reject: () => {
|
|
268
|
+
resolve: () => {},
|
|
269
|
+
reject: () => {},
|
|
270
270
|
});
|
|
271
271
|
}
|
|
272
272
|
|
|
@@ -380,7 +380,6 @@ export class BVTStepRunner {
|
|
|
380
380
|
this.#currentStepController = null;
|
|
381
381
|
global.__BVT_STEP_ABORT_SIGNAL = null;
|
|
382
382
|
|
|
383
|
-
|
|
384
383
|
try {
|
|
385
384
|
// Clean up temp folder
|
|
386
385
|
const __temp_features_FolderName = process.env.tempFeaturesFolderPath;
|
|
@@ -37,7 +37,7 @@ class ScenarioUploadService {
|
|
|
37
37
|
},
|
|
38
38
|
});
|
|
39
39
|
|
|
40
|
-
if(response.status === 401) {
|
|
40
|
+
if (response.status === 401) {
|
|
41
41
|
throw new Error("Your trial plan has ended. Cannot upload reports and perform retraining");
|
|
42
42
|
}
|
|
43
43
|
|
|
@@ -63,7 +63,7 @@ class ScenarioUploadService {
|
|
|
63
63
|
}
|
|
64
64
|
);
|
|
65
65
|
|
|
66
|
-
if(response.status === 403) {
|
|
66
|
+
if (response.status === 403) {
|
|
67
67
|
throw new Error("Your trial plan has ended. Cannot upload reports and perform retraining");
|
|
68
68
|
}
|
|
69
69
|
|
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.1453-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.184-dev",
|
|
41
41
|
"@faker-js/faker": "^8.1.0",
|
|
42
|
-
"automation_model": "1.0.
|
|
42
|
+
"automation_model": "1.0.842-dev",
|
|
43
43
|
"axios": "^1.7.4",
|
|
44
44
|
"chokidar": "^3.6.0",
|
|
45
45
|
"create-require": "^1.1.1",
|