import { Given, When } from '@cucumber/cucumber'; import { BNOSelect } from '../../../elements/bnoSelect/bnoSelect'; import * as glue from './glue'; Given(/^I open loginBNO page$/, glue.loginBNO); Given(/^I login to bno page successfully$/, glue.loginToMainBNOPage); const ACTION = { SET: 'set', PICK: 'pick' }; When(/^I (set|pick) "([^"]+)?" to the BNOSelect "([^"]+)?"."([^"]+)?"$/, async function (action, input, page, element) { const contourSelect = new BNOSelect(contourfet.getPageElement(page, element)); if (action == ACTION.SET) { await contourSelect.setInputField(input); } else if (action == ACTION.PICK) { await contourSelect.selectOptionByVisibleText(input); } });