Class BaseTLV
- Direct Known Subclasses:
TlvIE
public class BaseTLV
extends java.lang.Object
-
Field Summary
Fields Modifier and Type Field Description protected UIContext
context
protected org.openqa.selenium.WebDriver
driver
protected FilterOverlay
filterOverlay
protected org.openqa.selenium.WebElement
finishCustomizationBtn
protected java.util.List<org.openqa.selenium.WebElement>
headerRows
protected static PlatformLogger
LOG
protected org.openqa.selenium.WebElement
manageCustomizationBtn
protected org.openqa.selenium.WebElement
resetCustomizationBtn
protected java.util.List<org.openqa.selenium.WebElement>
rows
protected org.openqa.selenium.WebElement
save
protected org.openqa.selenium.WebElement
startCustomizationBtn
protected org.openqa.selenium.WebElement
tableEl
protected TLV
tlv
protected org.openqa.selenium.WebElement
tlvEl
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description protected void
addDM(int rowIdx, java.lang.String menuItemName)
Adds a user-defined data-measure by clicking related UI elements.void
addDMAbove(int rowIdx, java.lang.String name, java.lang.String expr)
Adds a user-defined Data Measure above the one specified by [rowIdx].void
addDMAbove(int rowIdx, java.lang.String name, java.lang.String expr, java.lang.Boolean isGroup)
Overloaded version to work with IsGroup field.void
addDMBelow(int rowIdx, java.lang.String name, java.lang.String expr)
Adds a user-defined Data Measure below the one specified by [rowIdx].void
addDMBelow(int rowIdx, java.lang.String name, java.lang.String expr, java.lang.Boolean isGroup)
Overloaded version to work with IsGroup field.void
clickDownPage()
Click the "down page" button and await reload if there is onevoid
clickDownPageNeo()
Click the "down page" button and await reload if there is onevoid
clickGraphCheckBox(int rowIdx)
To check/uncheck Graph check box if Graph is availablevoid
clickGraphCheckBox(java.lang.String dmName, java.lang.String... hierarchyColumnValues)
To check/uncheck Graph check box if Graph and column hierarchy is availableprotected void
clickGraphCheckBoxEl(org.openqa.selenium.WebElement checkBox)
void
clickNextPage()
Click the "next page" button and await reloadvoid
clickNextPageNeo()
void
clickPrevPage()
Click the "prev page" button and await reloadvoid
clickPrevPageNeo()
Click the "prev page" button and await reloadvoid
clickUpPage()
Click the "up page" button and await reload if there is onevoid
clickUpPageNeo()
Click the "up page" button and await reload if there is onevoid
deleteDM(int rowIdx)
Deletes the user-defined Data Measure specified by [rowIdx].void
displayGraph(boolean display)
Expand/collapse Graph, if presentvoid
displayHeaderReport(boolean display)
Expand/collapse Header Report, if presentvoid
dragAndDropDM(int sourceDMIndex, int targetDMIndex, TLV.DnDOperation operation)
Moves sourceDM relative to targetDM in Customization mode.void
dragAndDropDMForNeo(int sourceDMIndex, int targetDMIndex, TLV.DnDOperation operation, int offsetY)
void
editDM(int rowIdx, java.lang.String name, java.lang.String expr)
Edits the user-defined Data Measure specified by [rowIdx].void
editDM(int rowIdx, java.lang.String name, java.lang.String expr, java.lang.Boolean isGroup)
Overloaded version to work with IsGroup field Edits the user-defined Data Measure specified by [rowIdx].void
executeSave()
void
executeSearch()
Delegates toFilterOverlay.executeSearch()
, and then waits for the page to reload.int
findDMIndex(int rowIdx, <any> condition)
For each column in the row specified by [rowIdx], the function [condition] is passed the value of that cell.void
finishCustomization()
Clicks the "Finish Customizing" button.java.util.List<java.lang.String>
getBuckets()
Returns list of bucket headers as string.int
getBucketsCount()
Returns number of buckets.org.openqa.selenium.WebElement
getCell(java.lang.String dmName, int colIdx)
Returns cell by DM name and column indexint
getColumnHierarchyCount()
java.lang.String
getDMName(int rowIdx)
Returns the Data Measure's name.java.lang.String
getDMValue(int rowIdx, int colIdx)
Returns the value in the cell provided by [rowIdx] and [colIdx].java.util.List<java.lang.String>
getDMValuesByHierarchy(java.lang.String dmName, java.lang.String... hierarchyColumnValues)
Returns the list of values in buckets for specified column hierarchy values and DM name.org.openqa.selenium.WebElement
getErrorMessage()
Return the error message area of the TLV if available, else nullFilterOverlay
getFilterOverlay()
Returns theFilterOverlay
, or throws aTimeoutException
if the filter overlay can't be found.org.openqa.selenium.WebElement
getHeaderReport()
Returns Header Report WebElement, if present otherwise null.java.util.List<org.openqa.selenium.WebElement>
getHiddenRows()
Returns a list of the DM row elements which are hidden.java.util.List<org.openqa.selenium.WebElement>
getRows()
Returns a list of the row elements.org.openqa.selenium.WebElement
getTableEl()
Returns this TLV's table element, or null if it hasn't been constructed yet.Window
getWindow()
Returns the Add/Modify DM popup Window of TLVvoid
hideDM(int rowIdx)
Hides Data Measure specified by [rowIdx] if its not hided.protected void
initComponents()
protected java.util.List<org.openqa.selenium.WebElement>
initializeHiddenRows()
boolean
isGraphPresent()
java.lang.Boolean
isGroupDM(int rowIdx)
Returns true if DM is group DMprotected void
modifyDMInWindow(java.lang.String name, java.lang.String expr, java.lang.String btnText, java.lang.String isGroup, boolean isEdit)
Tab
openManageCustomizationReport()
This method will open Manage Customization report in a new tab and return Tab object.void
resetToDefault()
Clicks the "Reset To Default" button in old Tlv page.void
resetToDefaultForNeo(NeoDesktop neoDesktop)
Clicks the "Reset To Default" button in old Tlv page.void
setEditableDMValue(java.lang.String dataMeasureName, int dmInstance, int bucketIndex, java.lang.String val)
Sets the value of an editable data measure bucket.void
showDM(int rowIdx)
Shows hidden Data Measure specified by [rowIdx].void
startCustomization(TLV.TLV_CUSTOMIZATION_LEVEL level)
Clicks the "Customize" button.void
waitUntilReloaded()
Waits until the TLV has been reloaded and then resets the WebElements; this should be called after any action that causes the TLV to reload.void
waitUntilRowsUpdated()
Waits until the TLV rows has been has been updated after adding/deleting user-defined DMs
-
Field Details
-
LOG
-
tlvEl
protected org.openqa.selenium.WebElement tlvEl -
filterOverlay
-
tableEl
protected org.openqa.selenium.WebElement tableEl -
rows
protected java.util.List<org.openqa.selenium.WebElement> rows -
headerRows
protected java.util.List<org.openqa.selenium.WebElement> headerRows -
startCustomizationBtn
protected org.openqa.selenium.WebElement startCustomizationBtn -
save
protected org.openqa.selenium.WebElement save -
finishCustomizationBtn
protected org.openqa.selenium.WebElement finishCustomizationBtn -
resetCustomizationBtn
protected org.openqa.selenium.WebElement resetCustomizationBtn -
manageCustomizationBtn
protected org.openqa.selenium.WebElement manageCustomizationBtn -
context
-
driver
protected org.openqa.selenium.WebDriver driver -
tlv
-
-
Constructor Details
-
Method Details
-
initComponents
protected void initComponents() -
getFilterOverlay
Returns theFilterOverlay
, or throws aTimeoutException
if the filter overlay can't be found.- Returns:
-
getHeaderReport
public org.openqa.selenium.WebElement getHeaderReport()Returns Header Report WebElement, if present otherwise null. -
displayHeaderReport
public void displayHeaderReport(boolean display)Expand/collapse Header Report, if present- Parameters:
display
- true for expanding and false for collapsing.
-
isGraphPresent
public boolean isGraphPresent() -
displayGraph
public void displayGraph(boolean display)Expand/collapse Graph, if present- Parameters:
display
- true for expanding and false for collapsing.
-
getTableEl
public org.openqa.selenium.WebElement getTableEl()Returns this TLV's table element, or null if it hasn't been constructed yet.- Returns:
-
executeSearch
public void executeSearch()Delegates toFilterOverlay.executeSearch()
, and then waits for the page to reload. -
getColumnHierarchyCount
public int getColumnHierarchyCount() -
getBuckets
public java.util.List<java.lang.String> getBuckets()Returns list of bucket headers as string.- Returns:
-
getBucketsCount
public int getBucketsCount()Returns number of buckets.- Returns:
-
getRows
public java.util.List<org.openqa.selenium.WebElement> getRows()Returns a list of the row elements.- Returns:
-
getHiddenRows
public java.util.List<org.openqa.selenium.WebElement> getHiddenRows()Returns a list of the DM row elements which are hidden.- Returns:
-
initializeHiddenRows
protected java.util.List<org.openqa.selenium.WebElement> initializeHiddenRows() -
startCustomization
Clicks the "Customize" button. If it doesn't exist, this method will throw a NullPointerException. -
finishCustomization
public void finishCustomization()Clicks the "Finish Customizing" button. -
openManageCustomizationReport
This method will open Manage Customization report in a new tab and return Tab object.- Returns:
-
resetToDefault
public void resetToDefault()Clicks the "Reset To Default" button in old Tlv page. For new Tlv page it will open Manage Customization report in a new tab and delete all customization records. After deleting these records it will close report and refresh Tlv to reflect changes. -
resetToDefaultForNeo
Clicks the "Reset To Default" button in old Tlv page. For new Tlv page it will open Manage Customization report in a new tab and delete all customization records. After deleting these records it will close report and refresh Tlv to reflect changes. -
executeSave
public void executeSave() -
getDMName
public java.lang.String getDMName(int rowIdx)Returns the Data Measure's name.- Parameters:
rowIdx
-- Returns:
-
getDMValue
public java.lang.String getDMValue(int rowIdx, int colIdx)Returns the value in the cell provided by [rowIdx] and [colIdx]. Both indices are 0-based, and if [colIdx] is 0 it will return the Data Measure's name. (Or if this TLV contains categories, then the category columns will be first, followed by DMs, followed by values) -
findDMIndex
public int findDMIndex(int rowIdx, <any> condition)For each column in the row specified by [rowIdx], the function [condition] is passed the value of that cell. If [condition] returns true, then the index of that cell is returned. If no cell matches the condition, then -1 is returned. This method performs faster than iterating a row externally with getDMValue(rowIdx, colIdx) -
getDMValuesByHierarchy
public java.util.List<java.lang.String> getDMValuesByHierarchy(java.lang.String dmName, java.lang.String... hierarchyColumnValues)Returns the list of values in buckets for specified column hierarchy values and DM name.
NOTE: This method only checks the values in current visible page.- Parameters:
dmName
- Data Measure's namehierarchyColumnValues
- values for column hierarchy in left to right order.
-
clickGraphCheckBox
public void clickGraphCheckBox(int rowIdx)To check/uncheck Graph check box if Graph is available- Parameters:
rowIdx
- Row Index (starts from 0)
-
clickGraphCheckBoxEl
protected void clickGraphCheckBoxEl(org.openqa.selenium.WebElement checkBox) -
clickGraphCheckBox
public void clickGraphCheckBox(java.lang.String dmName, java.lang.String... hierarchyColumnValues)To check/uncheck Graph check box if Graph and column hierarchy is available- Parameters:
dmName
- Data Measure's namehierarchyColumnValues
- values for column hierarchy in left to right order.
-
getCell
public org.openqa.selenium.WebElement getCell(java.lang.String dmName, int colIdx)Returns cell by DM name and column index- Parameters:
dmName
- DM namecolIdx
- Column index. If 0, DM name el is returned- Returns:
WebElement
-
addDM
protected void addDM(int rowIdx, java.lang.String menuItemName)Adds a user-defined data-measure by clicking related UI elements.- Parameters:
rowIdx
-menuItemName
-
-
addDMAbove
public void addDMAbove(int rowIdx, java.lang.String name, java.lang.String expr)Adds a user-defined Data Measure above the one specified by [rowIdx].Note: This method will wait for the TLV to be reloaded, so you can assume it has been completely deleted after it returns.
- Parameters:
rowIdx
-name
-expr
-
-
addDMAbove
public void addDMAbove(int rowIdx, java.lang.String name, java.lang.String expr, java.lang.Boolean isGroup)Overloaded version to work with IsGroup field. Adds a user-defined Data Measure above the one specified by [rowIdx].Note: This method will wait for the TLV to be reloaded, so you can assume it has been completely deleted after it returns.
- Parameters:
rowIdx
-name
-expr
-isGroup
-
-
addDMBelow
public void addDMBelow(int rowIdx, java.lang.String name, java.lang.String expr)Adds a user-defined Data Measure below the one specified by [rowIdx]. If [expr] is null, it will add a Data Entry DM instead of Computed.Note: This method will wait for the TLV to be reloaded, so you can assume it has been completely deleted after it returns.
- Parameters:
rowIdx
-name
-expr
-
-
addDMBelow
public void addDMBelow(int rowIdx, java.lang.String name, java.lang.String expr, java.lang.Boolean isGroup)Overloaded version to work with IsGroup field. Adds a user-defined Data Measure below the one specified by [rowIdx]. If [expr] is null, it will add a Data Entry DM instead of Computed.Note: This method will wait for the TLV to be reloaded, so you can assume it has been completely deleted after it returns.
- Parameters:
rowIdx
-name
-expr
-
-
editDM
public void editDM(int rowIdx, java.lang.String name, java.lang.String expr)Edits the user-defined Data Measure specified by [rowIdx].Note: This method will wait for the TLV to be reloaded, so you can assume it has been completely deleted after it returns.
- Parameters:
rowIdx
-name
-expr
-
-
editDM
public void editDM(int rowIdx, java.lang.String name, java.lang.String expr, java.lang.Boolean isGroup)Overloaded version to work with IsGroup field Edits the user-defined Data Measure specified by [rowIdx].Note: This method will wait for the TLV to be reloaded, so you can assume it has been completely deleted after it returns.
- Parameters:
rowIdx
-name
-expr
-
-
deleteDM
public void deleteDM(int rowIdx)Deletes the user-defined Data Measure specified by [rowIdx].Note: This method will wait for the TLV to be reloaded, so you can assume it has been completely deleted after it returns.
- Parameters:
rowIdx
-
-
hideDM
public void hideDM(int rowIdx)Hides Data Measure specified by [rowIdx] if its not hided.Note: This method will wait for the TLV to be reloaded, so you can assume Data Measure has been hided (grey out in customization mode) after it returns.
- Parameters:
rowIdx
-
-
showDM
public void showDM(int rowIdx)Shows hidden Data Measure specified by [rowIdx].Note: This method will wait for the TLV to be reloaded, so you can assume Data Measure has been shown after it returns.
- Parameters:
rowIdx
-
-
modifyDMInWindow
protected void modifyDMInWindow(java.lang.String name, java.lang.String expr, java.lang.String btnText, java.lang.String isGroup, boolean isEdit) -
waitUntilReloaded
public void waitUntilReloaded()Waits until the TLV has been reloaded and then resets the WebElements; this should be called after any action that causes the TLV to reload. All the methods within this class that cause the TLV to reload will call this on their own. -
waitUntilRowsUpdated
public void waitUntilRowsUpdated()Waits until the TLV rows has been has been updated after adding/deleting user-defined DMs -
setEditableDMValue
public void setEditableDMValue(java.lang.String dataMeasureName, int dmInstance, int bucketIndex, java.lang.String val)Sets the value of an editable data measure bucket.- Parameters:
dataMeasureName
- internal data measure namedmInstance
- instance number of the data measure within thet page - usually zero, unless you are using "ColumnHierarchy" to split your DMs by a parentbucketIndex
- bucket index, starting from ZEROval
- value to be set Ex- If in a row of 20 columns only last 5 are editable, then the dmInstance for 1st editable column is considered as [0][0] and not as [0][15]
-
getErrorMessage
public org.openqa.selenium.WebElement getErrorMessage()Return the error message area of the TLV if available, else null -
clickNextPage
public void clickNextPage()Click the "next page" button and await reload -
clickDownPage
public void clickDownPage()Click the "down page" button and await reload if there is one -
clickUpPage
public void clickUpPage()Click the "up page" button and await reload if there is one -
clickPrevPage
public void clickPrevPage()Click the "prev page" button and await reload -
dragAndDropDM
Moves sourceDM relative to targetDM in Customization mode.- Parameters:
sourceDMIndex
-targetDMIndex
-operation
- See TLV.DnDOperation
-
dragAndDropDMForNeo
public void dragAndDropDMForNeo(int sourceDMIndex, int targetDMIndex, TLV.DnDOperation operation, int offsetY) -
isGroupDM
public java.lang.Boolean isGroupDM(int rowIdx)Returns true if DM is group DM- Parameters:
rowIdx
-- Returns:
-
getWindow
Returns the Add/Modify DM popup Window of TLV -
clickDownPageNeo
public void clickDownPageNeo()Click the "down page" button and await reload if there is one -
clickUpPageNeo
public void clickUpPageNeo()Click the "up page" button and await reload if there is one -
clickPrevPageNeo
public void clickPrevPageNeo()Click the "prev page" button and await reload -
clickNextPageNeo
public void clickNextPageNeo()
-