UNPKG

@uuv/assistant

Version:

UUV Helper used to improve the life of testers and developers by generating cucumber phrases from the GUI.

43 lines (42 loc) 1.84 kB
"use strict"; /** * 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.WithinTranslator = void 0; const abstract_translator_1 = require("./abstract-translator"); const model_1 = require("./model"); const stepCase = model_1.StepCaseEnum.WHEN; class WithinTranslator extends abstract_translator_1.Translator { getSentenceFromAccessibleRoleAndName(accessibleRole, accessibleName) { const response = this.initResponse(); const computedKey = "key.when.withinElement.roleAndName"; const sentence = this.computeSentenceFromKeyRoleAndName(computedKey, accessibleRole, accessibleName); response.sentences = [stepCase + sentence]; return response; } getSentenceFromAccessibleRoleAndNameAndContent(accessibleRole, accessibleName, content) { const response = this.initResponse(); const computedKey = "key.when.withinElement.roleAndName"; const sentence = this.computeSentenceFromKeyRoleNameAndContent(computedKey, accessibleRole, accessibleName, content); response.sentences = [stepCase + sentence]; return response; } getSentenceFromDomSelector(domSelector, htmlElem) { const response = this.initResponse(); const computedKey = "key.when.withinElement.selector"; const sentence = this.computeSentenceFromKeyAndSelector(computedKey, domSelector); response.sentences = [stepCase + sentence]; return response; } } exports.WithinTranslator = WithinTranslator;