import { When } from '@cucumber/cucumber'; import { ContourSelect } from '../../elements/contourSelect'; import DC_SCENARIO from '../../enum/dcScenario'; import * as stepVariableMap from '../../util/stepVariableMap'; const ACTION = { SET: 'set', PICK: 'pick' }; When( /^I (set|pick) "([^"]+)?" to the contourSelect "([^"]+)?"."([^"]+)?"$/, async function (action, input, page, element) { const contourSelect = new ContourSelect(contourfet.getPageElement(page, element)); const svm = stepVariableMap.getStepVariableMap(DC_SCENARIO.SC1); if (action == ACTION.SET) { await contourSelect.setInputField(svm[input] ?? input); } else if (action == ACTION.PICK) { await contourSelect.selectOptionByVisibleText(svm[input] ?? input); } } );