Skip to content

DevExpress/TestCafe-Wrappers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

TestCafe-Wrappers

TestCafe wrappers are a set of JavaScript classes that help you work with the DevExpress ASP.NET controls in TestCafe.

#Contents

How to install
Example of usage
Need more help to get started?
Contents API
API

#How to install

  1. Download the latest tagged archive (choose the "zip" option).
  2. Unzip the archive.
  3. Copy the "wrappers" folder to the directory that contains your TestCafe tests. So the tests' and wrappers' folder must be located at the same directory level.
  4. Define modules section in the Directory Configuration File file as shown below:
"modules": {
        "dx": [
            "../wrappers/dx.js",
            "../wrappers/web/ASPxGridViewWrapper.js"
        ]
    }

#Example of usage

"@fixture Master Detail test";
"@page https://demos.devexpress.com/ASPxGridViewDemos/MasterDetail/MasterDetail.aspx";

"@require :dx";

"@test"["master-detail test"] = {
    '1.Check if a detail row visible': function() {
        var detailDataRowsCount = getGrid().getDetailRows().length;
        eq(detailDataRowsCount, 1);
    },
    '2. Expand the second row': function() {
        act.click(getGrid().getDetailButtons()[1]);
    },
    '3.Check if two detail grids are visible': function() {
        var detailDataRowsCount = getGrid().getDetailRows().length;
        eq(detailDataRowsCount, 2);
    },
    '4.Collapse the first row': function() {
        act.click(getGrid().getDetailButtons()[0]);
    },
    '5.Collapse the second row': function() {
        act.click(getGrid().getDetailButtons()[1]);
    },
    '6.Check if there is no visible detail grids': function() {
        var detailDataRowsCount = getGrid().getDetailRows().length;
        eq(detailDataRowsCount, 0);
    },
    '7.Click the "Keep a single expanded row at a time" check box': function() {
        act.click("#ContentHolder_chkSingleExpanded_S_D");
    },
    '8.Expand the first row': function() {
        act.click(getGrid().getDetailButtons()[0]);
    },
    '9.Expand the second row': function() {
        act.click(getGrid().getDetailButtons()[1]);
    },
    '10.Check the "Allow single row to be expanded" property': function() {
        var detailDataRowsCount = getGrid().getDetailRows().length;
        eq(detailDataRowsCount, 1);
    }    
};

// helpers
var getGrid = function(){
    return dx.grid("grid");
};

#Need more help to get started?

Visit TestCafé guide and TestCafé API references. If you have any additional questions or suggestions, don't hesitate to ask using the DevExpress Support Center.

#Contents API

grid(id)
getColumnHeaders()
getColumnHeader(fieldCaption)
getColumnHeaderFilterButton(fieldCaption)
isColumnSorted(fieldCaption, isAscending)
getColumnValuesOnPage(fieldCaption)
getDetailRows()
getPreviewRows()
getGroupRows()
getDataRows()
getDataRow(index)
getEmptyDataRow()
getGroupRowButtons(isCollapse)
getEditingRow()
getClearFilterButton()
getApplyFilterButton()
getFilterRowEditor(columnIndex)
getFilterRowMenuIcon(columnIndex)
getFilterRowButton(fieldCaption)
getFilterApplyButton()
getShowFilterControlAnchor()
getFooter()
getFooterCell(index)
getGroupPanelContextMenu()
getColumnsContextMenu()
getRowsContextMenu()
getFooterContextMenu()
getDetailButtons()
getNewRowButtons()
getNewRowButton(rowIndex)
getNewRowButtonFromHeader()
getDeleteButton(rowIndex)
getEditButton(rowIndex)
getSelectButton(rowIndex)
getEditFormUpdateButton()
getEditFormCancelButton()
getCustomButton(buttonID, rowIndex)
getEditingErrorRow(rowIndex)
getHeadersFromGroupPanel()
getGroupPanel()
getSelectCheckBoxes()
getSelectCheckBox(rowIndex)
getSelectAllCheckBox()
getSelectCheckBoxValue(rowIndex)
getSelectAllCheckBoxValue()
getSelectCheckBoxesValues()
getTopPager()
getBottomPager()
getFilterRowMenu()
getHeaderFilterListBox()
getHeaderFilterSelectAllCheckBox()
getHeaderFilterOkButton()
getHeaderFilterPopup()
getFilterBuilderPopup()
getFilterBuilder()
getEditFormEditor(indexOrCaption)
getCustomizationWindow()
getDataColumnValues(fieldCaption)
getDataCell(rowIndex, fieldCaption)
isModifiedCell(rowIndex, fieldCaption)
getBottomNextButton()
getBottomPrevButton()

#API

##class: grid

Creates an instance of a grid

Param Type Description
controlID number The grid's ID.
Example
    //How to create a grid instance
    var getGrid = function(){
       return dx.grid("grid");
    };

##getColumnHeaders() Returns a collection of Column Headers.

##getColumnHeader(fieldCaption) Returns the Column Header for a specified data column.

Param Type Description
fieldCaption string A string value that specifies a column caption text

##getColumnHeaderFilterButton(fieldCaption) Returns the Header Filter button for a specified data column.

Param Type Description
fieldCaption string A string value that specifies a column caption text

##isColumnSorted(fieldCaption, isAscending) Checks whether a column has been sorted in ascending order.

Param Type Description
fieldCaption string A string value that specifies a column caption text
isAscending boolean A boolean value that identifies if a column is sorted in ascending order

##getColumnValuesOnPage(fieldCaption) Returns the values of rows displayed within the current page.

Param Type Description
fieldCaption string A string value that specifies a column caption text

##getDetailRows() Returns a collection of Detail Rows.

##getPreviewRows() Returns a collection of Preview Rows.

##getGroupRows() Returns a collection of Group Rows.

##getDataRows() Returns a collection of Data Rows.

##getDataRow(index) Returns the specified Data Row.

Param Type Description
index number A numeric value that specifies a row index

##getEmptyDataRow() Returns an Empty Data Row.

##getGroupRowButtons(isCollapse) Returns a collection of Group Row buttons.

Param Type Description
isCollapse boolean A boolean value that identifies if a Group Row is collapsed

##getEditingRow() Returns the Edit Form.

##getClearFilterButton() Returns the ClearFilter button.

##getApplyFilterButton() Returns the ApplyFilter button.

##getFilterRowEditor(columnIndex) Returns the editor used to edit the value in the Filter Row for a specified data column.

Param Type Description
columnIndex mumber A numeric value that specifies a column index

##getFilterRowMenuIcon(columnIndex) Returns the Filter Row menu icon for a specified data column.

Param Type Description
columnIndex mumber A numeric value that specifies a column index

##getFilterRowButton(fieldCaption) Returns the header filter button for a specified data column.

Param Type Description
fieldCaption string A string value that specifies a column caption text

##getFilterApplyButton() Returns the ApplyFilter button.

##getShowFilterControlAnchor() Returns the ShowFilterControl anchor.

##getFooter() Returns the Footer.

##getFooterCell(index) Returns the Footer cell for a specified data column.

Param Type Description
index mumber A numeric value that specifies a column index

##getGroupPanelContextMenu() Returns the GroupPanel Context Menu.

##getColumnsContextMenu() Returns the Columns Context Menu.

##getRowsContextMenu() Returns the Rows Context Menu.

##getFooterContextMenu() Returns the Footer Context Menu.

##getDetailButtons() Returns a collection of detail row buttons.

##getNewRowButtons() Returns a collection of new row buttons.

##getNewRowButton(rowIndex) Returns the New Row button for a specified data row.

Param Type Description
rowIndex mumber A numeric value that specifies a row index

##getNewRowButtonFromHeader() Returns the New Row button located in a grid header.

##getDeleteButton(rowIndex) Returns the Delete Row button for a specified data row.

Param Type Description
rowIndex mumber A numeric value that specifies a row index

##getEditButton(rowIndex) Returns the Edit Row button for a specified data row.

Param Type Description
rowIndex mumber A numeric value that specifies a row index

##getSelectButton(rowIndex) Returns the Select Row button for a specified data row.

Param Type Description
rowIndex mumber A numeric value that specifies a row index

##getEditFormUpdateButton() Returns the Edit Form Update button.

##getEditFormCancelButton() Returns the Edit Form Cancel button.

##getCustomButton(buttonID, rowIndex) Returns a Custom button for a specified data row.

Param Type Description
buttonID string A string value that specifies a custom button ID
rowIndex mumber A numeric value that specifies a row index

##getEditingErrorRow(rowIndex) Returns the Error Row.

Param Type Description
rowIndex mumber A numeric value that specifies a row index

##getHeadersFromGroupPanel() Returns a collection of headers located inside the GroupPanel.

##getGroupPanel() Returns the Group Panel.

##getSelectCheckBoxes() Returns a collection of Select check boxes located on a current page.

##getSelectCheckBox(rowIndex) Returns the Select check box for a specified data row.

Param Type Description
rowIndex mumber A numeric value that specifies a row index

##getSelectAllCheckBox() Returns the SelectAll check box.

##getSelectCheckBoxValue(rowIndex) Returns the Select check box value for a specified data row.

Param Type Description
rowIndex mumber A numeric value that specifies a row index

##getSelectAllCheckBoxValue() Returns the SelectAll check box value.

##getSelectCheckBoxesValues() Returns a collection of Select check box values located on a current page.

##getTopPager() Returns the top Pager.

##getBottomPager() Returns the bottom Pager.

##getFilterRowMenu() Returns the FilterRow menu.

##getHeaderFilterListBox() Returns a list box of the currently open Header Filter.

##getHeaderFilterSelectAllCheckBox() Returns the SelectAll check box of the currently open Header Filter.

##getHeaderFilterOkButton() Returns the Ok button of the currently open Header Filter.

##getHeaderFilterPopup() Returns the currently open Header Filter.

##getFilterBuilderPopup() Returns the main area of the Filter Builder.

##getFilterBuilder() Returns the Filter Builder.

##getEditFormEditor(indexOrCaption) Returns the Edit Cell used to edit the specified column's values.

Param Type Description
indexOrCaption number | string A column index or caption

##getCustomizationWindow() Returns the Customization Window.

##getDataColumnValues(fieldCaption) Returns row values for a specified data column displayed within a current page.

Param Type Description
fieldCaption string A string value that specifies a column caption text

##getDataCell(rowIndex, fieldCaption) Returns the Data Cell.

Param Type Description
rowIndex number A numeric value that specifies a row index
fieldCaption string A string value that specifies a column caption text

##isModifiedCell(rowIndex, fieldCaption) Checks if a BatchEdit cell has been modified.

Param Type Description
rowIndex number A numeric value that specifies a row index
fieldCaption string A string value that specifies a column caption text

##getBottomNextButton() Returns the bottom Pager Next button.

##getBottomPrevButton() Returns the bottom Pager Prev button.

About

TestCafe wrappers are a set of JavaScript classes that help you work with the DevExpress ASP.NET controls in TestCafe

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published