cypress-ag-grid 2.0.0 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.circleci/config.yml +13 -13
- package/README.md +378 -346
- package/app/grid-basic.js +70 -70
- package/app/grid-grouped.js +71 -71
- package/app/index.html +14 -14
- package/cypress/e2e/ag-grid-data.cy.js +506 -482
- package/cypress/e2e/ag-grid-elements.cy.js +59 -59
- package/cypress/fixtures/cardata.json +21 -21
- package/cypress/plugins/index.js +22 -22
- package/cypress/support/commands.js +25 -25
- package/cypress/support/e2e.js +21 -21
- package/package.json +29 -29
- package/src/agGrid/agGridInteractions.js +538 -507
- package/src/agGrid/agGridValidations.js +38 -37
- package/src/agGrid/filterOperator.enum.js +13 -13
- package/src/agGrid/menuTab.enum.js +6 -6
- package/src/agGrid/sort.enum.js +5 -5
- package/src/index.d.ts +1 -0
- package/src/index.js +18 -18
|
@@ -1,37 +1,38 @@
|
|
|
1
|
-
export function validateEmptyTable(agGridElement, actualTableData){
|
|
2
|
-
expect(actualTableData).to.be.empty;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
export function validateTableExactOrder(agGridElement, actualTableData,expectedTableData, showFullError = true){
|
|
6
|
-
let errorMessage = `The expected table data did not match the actual table data`
|
|
7
|
-
|
|
8
|
-
if(showFullError){
|
|
9
|
-
errorMessage = errorMessage + ` \r\nEXPECTED:\r\n${JSON.stringify(expectedTableData)}\r\nACTUAL:\r\n:${JSON.stringify(actualTableData)}`
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
expect(actualTableData, errorMessage).to.deep.equal(expectedTableData);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export function validateTableRowSubset(agGridElement, actualTableData,expectedTableData, showFullError = true){
|
|
16
|
-
let errorMessage = `The expected item does not exist in the actual table data`
|
|
17
|
-
|
|
18
|
-
if(showFullError){
|
|
19
|
-
errorMessage = errorMessage + ` \r\nEXPECTED:\r\n${JSON.stringify(expectedTableData)}\r\nACTUAL:\r\n:${JSON.stringify(actualTableData)}`
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
expectedTableData.forEach((item)=> expect(actualTableData, errorMessage).to.deep.include(item));
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export function validateTablePages(agGridElement,expectedPaginatedTableData, onlyColumns = {}) {
|
|
26
|
-
let iterator = 0;
|
|
27
|
-
expectedPaginatedTableData.forEach((expectedPage) => {
|
|
28
|
-
cy.get(
|
|
29
|
-
|
|
30
|
-
.
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
1
|
+
export function validateEmptyTable(agGridElement, actualTableData){
|
|
2
|
+
expect(actualTableData).to.be.empty;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
export function validateTableExactOrder(agGridElement, actualTableData,expectedTableData, showFullError = true){
|
|
6
|
+
let errorMessage = `The expected table data did not match the actual table data`
|
|
7
|
+
|
|
8
|
+
if(showFullError){
|
|
9
|
+
errorMessage = errorMessage + ` \r\nEXPECTED:\r\n${JSON.stringify(expectedTableData)}\r\nACTUAL:\r\n:${JSON.stringify(actualTableData)}`
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
expect(actualTableData, errorMessage).to.deep.equal(expectedTableData);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function validateTableRowSubset(agGridElement, actualTableData,expectedTableData, showFullError = true){
|
|
16
|
+
let errorMessage = `The expected item does not exist in the actual table data`
|
|
17
|
+
|
|
18
|
+
if(showFullError){
|
|
19
|
+
errorMessage = errorMessage + ` \r\nEXPECTED:\r\n${JSON.stringify(expectedTableData)}\r\nACTUAL:\r\n:${JSON.stringify(actualTableData)}`
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
expectedTableData.forEach((item)=> expect(actualTableData, errorMessage).to.deep.include(item));
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function validateTablePages(agGridElement,expectedPaginatedTableData, onlyColumns = {}) {
|
|
26
|
+
let iterator = 0;
|
|
27
|
+
expectedPaginatedTableData.forEach((expectedPage) => {
|
|
28
|
+
cy.get('.ag-cell').should('be.visible');
|
|
29
|
+
cy.get(agGridElement)
|
|
30
|
+
.getAgGridData(onlyColumns)
|
|
31
|
+
.then((table) => {
|
|
32
|
+
const actualPage = JSON.parse(JSON.stringify(table));
|
|
33
|
+
validateTableExactOrder(agGridElement, actualPage, expectedPage, true);
|
|
34
|
+
cy.get(agGridElement).find(".ag-icon-next").click();
|
|
35
|
+
iterator++;
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export const filterOperator = {
|
|
2
|
-
contains: "Contains",
|
|
3
|
-
notContains: "Not contains",
|
|
4
|
-
equals: "Equals",
|
|
5
|
-
notEquals: "Not equals",
|
|
6
|
-
startsWith: "Starts with",
|
|
7
|
-
endsWith: "Ends with",
|
|
8
|
-
lessThan: "Less than",
|
|
9
|
-
lessThanOrEquals: "Less than or equals",
|
|
10
|
-
greaterThan: "Greater than",
|
|
11
|
-
greaterThanOrEquals: "Greater than or equals",
|
|
12
|
-
inRange: "In range"
|
|
13
|
-
}
|
|
1
|
+
export const filterOperator = {
|
|
2
|
+
contains: "Contains",
|
|
3
|
+
notContains: "Not contains",
|
|
4
|
+
equals: "Equals",
|
|
5
|
+
notEquals: "Not equals",
|
|
6
|
+
startsWith: "Starts with",
|
|
7
|
+
endsWith: "Ends with",
|
|
8
|
+
lessThan: "Less than",
|
|
9
|
+
lessThanOrEquals: "Less than or equals",
|
|
10
|
+
greaterThan: "Greater than",
|
|
11
|
+
greaterThanOrEquals: "Greater than or equals",
|
|
12
|
+
inRange: "In range"
|
|
13
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export const filterTab = {
|
|
2
|
-
columns: "columns",
|
|
3
|
-
filter: "filter",
|
|
4
|
-
search: "search",
|
|
5
|
-
general: "general"
|
|
6
|
-
}
|
|
1
|
+
export const filterTab = {
|
|
2
|
+
columns: "columns",
|
|
3
|
+
filter: "filter",
|
|
4
|
+
search: "search",
|
|
5
|
+
general: "general"
|
|
6
|
+
}
|
package/src/agGrid/sort.enum.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export const sort = {
|
|
2
|
-
ascending: "ascending",
|
|
3
|
-
descending: "descending",
|
|
4
|
-
none: "none"
|
|
5
|
-
}
|
|
1
|
+
export const sort = {
|
|
2
|
+
ascending: "ascending",
|
|
3
|
+
descending: "descending",
|
|
4
|
+
none: "none"
|
|
5
|
+
}
|
package/src/index.d.ts
CHANGED
|
@@ -44,6 +44,7 @@ declare namespace Cypress {
|
|
|
44
44
|
* @param options.searchCriteria.columnName name of the column to filter
|
|
45
45
|
* @param options.searchCriteria.filterValue value to input into the filter textbox
|
|
46
46
|
* @param options.searchCriteria.operator [Optional] Use if using a search operator (i.e. Less Than, Equals, etc...use filterOperator.enum values).
|
|
47
|
+
* @param options.searchCriteria.isMultiFilter [Optional] Use if floating filter is multiselect checkboxes vs free form input.
|
|
47
48
|
* @param options.hasApplyButton [Optional] True if "Apply" button is used, false if filters by text input automatically.
|
|
48
49
|
*/
|
|
49
50
|
agGridColumnFilterTextFloating<E extends Node = HTMLElement>(options: {}): Chainable<JQuery<E>>;
|
package/src/index.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
/// <reference types="cypress" />
|
|
2
|
-
|
|
3
|
-
import {getAgGridData, getAgGridElements, sortColumnBy} from "./agGrid/agGridInteractions"
|
|
4
|
-
import {validateTablePages, validateTableExactOrder, validateEmptyTable, validateTableRowSubset} from "./agGrid/agGridValidations"
|
|
5
|
-
import {filterByCheckboxColumnMenu, filterBySearchTextColumnFloatingFilter, filterBySearchTextColumnMenu, toggleColumnFromSideBar} from "./agGrid/agGridInteractions";
|
|
6
|
-
|
|
7
|
-
Cypress.Commands.add('getAgGridData', { prevSubject: true }, getAgGridData);
|
|
8
|
-
Cypress.Commands.add('getAgGridElements', {prevSubject: true}, getAgGridElements);
|
|
9
|
-
Cypress.Commands.add('agGridSortColumn', {prevSubject: true}, sortColumnBy);
|
|
10
|
-
Cypress.Commands.add('agGridColumnFilterCheckboxMenu', {prevSubject: true}, filterByCheckboxColumnMenu)
|
|
11
|
-
Cypress.Commands.add('agGridColumnFilterTextMenu', {prevSubject: true}, filterBySearchTextColumnMenu)
|
|
12
|
-
Cypress.Commands.add('agGridColumnFilterTextFloating', {prevSubject: true}, filterBySearchTextColumnFloatingFilter)
|
|
13
|
-
|
|
14
|
-
Cypress.Commands.add('agGridValidatePaginatedTable', {prevSubject: 'optional'}, validateTablePages)
|
|
15
|
-
Cypress.Commands.add('agGridValidateRowsExactOrder', {prevSubject: 'optional'}, validateTableExactOrder)
|
|
16
|
-
Cypress.Commands.add('agGridValidateRowsSubset', {prevSubject: 'optional'}, validateTableRowSubset)
|
|
17
|
-
Cypress.Commands.add('agGridValidateEmptyTable', {prevSubject: 'optional'}, validateEmptyTable)
|
|
18
|
-
|
|
1
|
+
/// <reference types="cypress" />
|
|
2
|
+
|
|
3
|
+
import {getAgGridData, getAgGridElements, sortColumnBy} from "./agGrid/agGridInteractions"
|
|
4
|
+
import {validateTablePages, validateTableExactOrder, validateEmptyTable, validateTableRowSubset} from "./agGrid/agGridValidations"
|
|
5
|
+
import {filterByCheckboxColumnMenu, filterBySearchTextColumnFloatingFilter, filterBySearchTextColumnMenu, toggleColumnFromSideBar} from "./agGrid/agGridInteractions";
|
|
6
|
+
|
|
7
|
+
Cypress.Commands.add('getAgGridData', { prevSubject: true }, getAgGridData);
|
|
8
|
+
Cypress.Commands.add('getAgGridElements', {prevSubject: true}, getAgGridElements);
|
|
9
|
+
Cypress.Commands.add('agGridSortColumn', {prevSubject: true}, sortColumnBy);
|
|
10
|
+
Cypress.Commands.add('agGridColumnFilterCheckboxMenu', {prevSubject: true}, filterByCheckboxColumnMenu)
|
|
11
|
+
Cypress.Commands.add('agGridColumnFilterTextMenu', {prevSubject: true}, filterBySearchTextColumnMenu)
|
|
12
|
+
Cypress.Commands.add('agGridColumnFilterTextFloating', {prevSubject: true}, filterBySearchTextColumnFloatingFilter)
|
|
13
|
+
|
|
14
|
+
Cypress.Commands.add('agGridValidatePaginatedTable', {prevSubject: 'optional'}, validateTablePages)
|
|
15
|
+
Cypress.Commands.add('agGridValidateRowsExactOrder', {prevSubject: 'optional'}, validateTableExactOrder)
|
|
16
|
+
Cypress.Commands.add('agGridValidateRowsSubset', {prevSubject: 'optional'}, validateTableRowSubset)
|
|
17
|
+
Cypress.Commands.add('agGridValidateEmptyTable', {prevSubject: 'optional'}, validateEmptyTable)
|
|
18
|
+
|
|
19
19
|
Cypress.Commands.add('agGridToggleColumnsSideBar', {prevSubject: true}, toggleColumnFromSideBar)
|