@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.
- package/build/parser/verifier.js +4 -3
- package/changelog.md +4 -0
- package/package.json +1 -1
package/build/parser/verifier.js
CHANGED
|
@@ -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
|
|
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