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, SmartCucumberUiScenarioContext scenarioContext)static FieldValuegetPageObject(PageObjectInfo poInfo)static PageObjectInfogetPageObjectInfo(String pageObject)Page object should be specified using the format.static ObjectgetPageObjectValidator(PageObjectInfo poInfo, SmartCucumberUiScenarioContext scenarioContext)static ObjectinvokeValidatorMethod(String methodName, Class<?>[] methodArgTypes, Object[] methodArgValues, PageObjectInfo poInfo, SmartCucumberUiScenarioContext scenarioContext)static StringprepareParamValue(String paramValue, SmartCucumberUiScenarioContext scenarioContext)paramValue may contain the variable like ${variableName} and this variable value should be extracted from 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: " . . {maxTimeToWaitInSeconds: 10}" - Parameters:
pageObject-- Returns:
-
getPageObject
public static FieldValue getPageObject(PageObjectInfo poInfo)
-
getPageObjectValidator
public static Object getPageObjectValidator(PageObjectInfo poInfo, SmartCucumberUiScenarioContext scenarioContext)
-
invokeValidatorMethod
public static Object invokeValidatorMethod(String methodName, Class<?>[] methodArgTypes, Object[] methodArgValues, PageObjectInfo poInfo, SmartCucumberUiScenarioContext scenarioContext)
-
applyParamsToLocator
protected static void applyParamsToLocator(FieldValue fv, Map<String,String> locatorParams, SmartCucumberUiScenarioContext scenarioContext)
-
prepareParamValue
public static String prepareParamValue(String paramValue, SmartCucumberUiScenarioContext scenarioContext)
paramValue may contain the variable like ${variableName} and this variable value should be extracted from scenarioContext.- Parameters:
paramValue-scenarioContext-- Returns:
-
-