Class PageObjectUtil
- java.lang.Object
-
- org.uitnet.testing.smartfwk.ui.core.utils.PageObjectUtil
-
public class PageObjectUtil extends Object
- Author:
- Madhav Krishna
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static voidapplyParamsToLocator(FieldValue fv, Map<String,String> locatorParams, SmartCucumberScenarioContext scenarioContext)static voidfillUiInputFieldInfo(PageObjectInfo poInfo, InputValue inputValue, SmartCucumberScenarioContext scenarioContext)Used to fill the form field data.static org.openqa.selenium.KeysfindSeleniumKeysByName(String keyName)static FieldValuegetPageObject(PageObjectInfo poInfo)static PageObjectInfogetPageObjectInfo(String pageObject)Page object should be specified using the format.static PageObjectInfogetPageObjectInfo(String pageObject, SmartCucumberScenarioContext scenarioContext)static ObjectgetPageObjectValidator(PageObjectInfo poInfo, SmartCucumberScenarioContext scenarioContext)static ObjectinvokeValidatorMethod(String methodName, String[] methodArgTypes, Object[] methodArgValues, PageObjectInfo poInfo, SmartCucumberScenarioContext scenarioContext)static String[]prepareKeysChord(List<String> keyList)static StringprepareParamValue(String paramValue, SmartCucumberScenarioContext scenarioContext)paramValue may contain the variable like ${variableName} and this variable value should be extracted from scenarioContext.static voidvalidateFormFieldData(PageObjectInfo poInfo, String operator, ExpectedInfo expectedInfo, SmartCucumberScenarioContext scenarioContext)
-
-
-
Method Detail
-
getPageObjectInfo
public static PageObjectInfo getPageObjectInfo(String pageObject)
Page object should be specified using the format. When POs are in ./src/main/page_objects/ directory: ". {maxTimeToWaitInSeconds: 10, params: {p1: 'v1', p2: '${variable1}'} }" When POs are in sub directory of ./src/main/page_objects/ directory: " . . PO in JSON format: {name: " . ", maxTimeToWaitInSeconds: 4, params: {p1: 'v1', p2: 'v2'} } - Parameters:
pageObject-- Returns:
-
getPageObjectInfo
public static PageObjectInfo getPageObjectInfo(String pageObject, SmartCucumberScenarioContext scenarioContext)
-
getPageObject
public static FieldValue getPageObject(PageObjectInfo poInfo)
-
getPageObjectValidator
public static Object getPageObjectValidator(PageObjectInfo poInfo, SmartCucumberScenarioContext scenarioContext)
-
invokeValidatorMethod
public static Object invokeValidatorMethod(String methodName, String[] methodArgTypes, Object[] methodArgValues, PageObjectInfo poInfo, SmartCucumberScenarioContext scenarioContext)
-
applyParamsToLocator
protected static void applyParamsToLocator(FieldValue fv, Map<String,String> locatorParams, SmartCucumberScenarioContext scenarioContext)
-
prepareParamValue
public static String prepareParamValue(String paramValue, SmartCucumberScenarioContext scenarioContext)
paramValue may contain the variable like ${variableName} and this variable value should be extracted from scenarioContext.- Parameters:
paramValue-scenarioContext-- Returns:
-
validateFormFieldData
public static void validateFormFieldData(PageObjectInfo poInfo, String operator, ExpectedInfo expectedInfo, SmartCucumberScenarioContext scenarioContext)
-
fillUiInputFieldInfo
public static void fillUiInputFieldInfo(PageObjectInfo poInfo, InputValue inputValue, SmartCucumberScenarioContext scenarioContext)
Used to fill the form field data.- Parameters:
poInfo-inputValue-scenarioContext-
-
findSeleniumKeysByName
public static org.openqa.selenium.Keys findSeleniumKeysByName(String keyName)
-
-