@uuv/assistant
Version:
UUV Helper used to improve the life of testers and developers by generating cucumber phrases from the GUI.
41 lines (40 loc) • 1.52 kB
JavaScript
;
/**
* Software Name : UUV
*
* SPDX-License-Identifier: MIT
*
* This software is distributed under the MIT License,
* see the "LICENSE" file for more details
*
* Authors: NJAKO MOLOM Louis Fredice & SERVICAL Stanley
* Software description: Make test writing fast, understandable by any human
* understanding English or French.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.StepCaseEnum = exports.Suggestion = void 0;
exports.getSentencesAsStringArray = getSentencesAsStringArray;
exports.getStepAsString = getStepAsString;
class Suggestion {
constructor(accessibleAttribute = "", accessibleValue = "", code = "", sentenceAfterCorrection = []) {
this.accessibleAttribute = accessibleAttribute;
this.accessibleValue = accessibleValue;
this.code = code;
this.sentenceAfterCorrection = sentenceAfterCorrection;
}
}
exports.Suggestion = Suggestion;
var StepCaseEnum;
(function (StepCaseEnum) {
StepCaseEnum["WHEN"] = "When";
StepCaseEnum["THEN"] = "Then";
StepCaseEnum["GIVEN"] = "Given";
StepCaseEnum["AND"] = "And";
})(StepCaseEnum || (exports.StepCaseEnum = StepCaseEnum = {}));
function getSentencesAsStringArray(translatedSentence) {
var _a;
return (_a = translatedSentence === null || translatedSentence === void 0 ? void 0 : translatedSentence.steps.map(step => getStepAsString(step))) !== null && _a !== void 0 ? _a : [];
}
function getStepAsString(step) {
return `${step.keyword} ${step.sentence}`;
}