@zohodesk/testinglibrary 0.0.5-exp.21 → 0.0.5-exp.22

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.
@@ -28,8 +28,8 @@ function verifyIfMultipleStepsExists(steps) {
28
28
  });
29
29
  return isMultipleStepsFound;
30
30
  }
31
- function extractExamplesToSeperateFile(examples, scenarioIndex, filePath) {
32
- let exampleFileContent = `export const scenario${scenarioIndex} = ${JSON.stringify(examples, null, 2)}`;
31
+ function extractExamplesToSeperateFile(examples, scenarioIndex, filePath, featureName) {
32
+ let exampleFileContent = `export const ${featureName.toUpperCase()}_SCENARIO_${scenarioIndex} = ${JSON.stringify(examples, null, 2)};\r\n`;
33
33
  try {
34
34
  (0, _fileUtils.writeFileContents)(filePath, exampleFileContent, {
35
35
  flag: 'a'
@@ -50,6 +50,7 @@ function verifyFeatureFileWithSpecFile() {
50
50
  // Construct the corresponding .spec.js filename
51
51
  const specFile = featureFile.replace(/\.feature$/, '.spec.js').replace(/\/feature-files\//, '/steps/');
52
52
  let featureFileNameExtract = featureFile.split('/').pop();
53
+ let featurePrefixName = featureFileNameExtract.split('.')[0];
53
54
  _logger.Logger.log(_logger.Logger.INFO_TYPE, `parsing feature file ${featureFileNameExtract}...`);
54
55
  // Check if the .spec.js file exists
55
56
 
@@ -71,7 +72,7 @@ function verifyFeatureFileWithSpecFile() {
71
72
  let scenario = scenarios[i];
72
73
  const scenarioName = scenario.name;
73
74
  const scenarioExamples = scenario.examples;
74
- extractExamplesToSeperateFile(scenarioExamples, i, testDataFilePath);
75
+ extractExamplesToSeperateFile(scenarioExamples, i, testDataFilePath, featurePrefixName);
75
76
 
76
77
  // spec file check
77
78
  if (!specLines.some(line => line.includes(scenarioName))) {
package/changelog.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## Framework that abstracts the configuration for playwright and Jest
4
4
 
5
+ # 0.0.5-exp.22
6
+
7
+ - Bug fixes while creating examples file
8
+
5
9
  # 0.0.5-exp.21
6
10
 
7
11
  - Bug fixes while creating examples file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/testinglibrary",
3
- "version": "0.0.5-exp.21",
3
+ "version": "0.0.5-exp.22",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "scripts": {