import ActionButton from '../../../pages/actionButton/actionButton.page'; import DpOverview from '../../../pages/dp/dpOverview.page'; import SubSideMenu from '../../../pages/sideMenu/subSideMenu.page'; import * as stepVariableMap from '../../../util/stepVariableMap'; export async function fillInDpOverview(scenario: string, dataTable: any) { const data = dataTable.rowsHash(); const subSideMenu = new SubSideMenu(); const dpOverview = new DpOverview(); const actionButton = new ActionButton(); const svm = stepVariableMap.getStepVariableMap(scenario); const selectPresentTo = dpOverview.getSelectPresentTo(); const selectPresentThrough = dpOverview.getSelectPresentThrough(); const saveAndNextButton = actionButton.getSaveAndNextButton(); const drawingAmount = dpOverview.getDrawingAmount(); await subSideMenu.getSubMenuSubOption('Overview').clickElement(); if (data['Drawing Amount']) { await drawingAmount.setInputField(data['Drawing Amount']); } await selectPresentTo.selectOptionByVisibleText(svm[data['Present to']]); if (data['Present through']) { await selectPresentThrough.selectOptionByVisibleText(svm[data['Present through']]); } await saveAndNextButton.clickElement(); }