@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.
@@ -113,4 +113,3 @@ export const findStepDefinitionReferences = async (projectDir) => {
113
113
  }
114
114
  return referencesList;
115
115
  };
116
-
@@ -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 = textAnchorParse.type === "literal" ? textAnchorParse.value : toVariableName(textAnchorParse.dataKey);
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 = textToVerifyParse.type === "literal" ? textToVerifyParse.value : toVariableName(textToVerifyParse.dataKey);
383
+ const textToVerify =
384
+ textToVerifyParse.type === "literal" ? textToVerifyParse.value : toVariableName(textToVerifyParse.dataKey);
383
385
  step.parameters = [textAnchor, climb, textToVerify];
384
386
  break;
385
387
  }
@@ -41,10 +41,10 @@ const generateTestData = (featureFile) => {
41
41
  try {
42
42
  const fake = faker.helpers.fake(match[0]);
43
43
 
44
- if(fake === match[0]){
44
+ if (fake === match[0]) {
45
45
  continue;
46
46
  }
47
-
47
+
48
48
  otherFakeData.push({
49
49
  var: match[0],
50
50
  fake,
@@ -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 = (folder, featureName = null, scenarioName = null, supressErrors = false, errors = []) => {
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(this.isTemp ? process.env.tempFeaturesFolderPath ?? "__temp_features" : "features", mjsFile),
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
- AstBuilder,
3
- GherkinClassicTokenMatcher,
4
- Parser,
5
- } from '@cucumber/gherkin'
6
- import { readFileSync, writeFileSync } from 'fs'
7
- import { loadArgs, showUsage, validateCLIArg } from './cli_helpers.js'
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, 'utf8')
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 = 'Usage: node parse_feature_file.js <featureFilePath> [<outputFilePath>] \n\nExample: node parseFeatureFile.js ./features/my.feature ./features/my.feature.json\n\n'
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, '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
- "baseUrl": "https://google.com"
3
- }
2
+ "baseUrl": "https://google.com"
3
+ }
@@ -42,6 +42,7 @@ async function evaluate(frame, script) {
42
42
  }
43
43
 
44
44
  async function findNestedFrameSelector(frame, obj) {
45
+ console.log("Testing new version");
45
46
  try {
46
47
  const parent = frame.parentFrame();
47
48
  if (!parent) return { children: obj };
@@ -2,4 +2,4 @@
2
2
 
3
3
  // getImplementedSteps('/Users/yash/Library/Application Support/blinq.io/67d7c7ffb099a8da65d7e204').then((implementedSteps) => {
4
4
  // console.log(JSON.stringify(implementedSteps, null, 2));
5
- // });
5
+ // });
@@ -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.1451-dev",
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.841-dev",
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",