cypress-ag-grid 3.2.2 → 3.3.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/src/index.d.ts CHANGED
@@ -1,98 +1,125 @@
1
1
  /// <reference types="cypress" />
2
2
 
3
3
  declare namespace Cypress {
4
- interface Chainable<Subject> {
5
- getAgGridData(options?: {}): Chainable<Array<Record<string, string>>>;
6
- getAgGridElements<E extends Node = HTMLElement>(options?: {}): Chainable<JQuery<E>>;
7
- /**
8
- * * Performs sorting operation on the specified column
9
- * @param {*} subject The get() selector for which ag grid table you wish to retrieve.
10
- * @param columnName The name of the column you wish to sort
11
- * @param sortDirection sort enum value
12
- * @returns
13
- */
14
- agGridSortColumn<E extends Node = HTMLElement>(columnName: string, sortDirection: string): Chainable<JQuery<E>>;
15
-
16
- /**
17
- * * Performs a filter operation on the specified column and selects only the provided filterValue
18
- * @param subject The get() selector for which ag grid table you wish to retrieve.
19
- * @param {{searchCriteria:[{columnName:string,filterValue:string], hasApplyButton?:boolean}} options JSON with search values and options
20
- * @param options.searchCriteria [REQUIRED] JSON with search properties
21
- * @param options.searchCriteria.columnName [REQUIRED] name of the column to filter
22
- * @param options.searchCriteria.filterValue [REQUIRED] value to input into the filter textbox
23
- * @param options.hasApplyButton [Optional] True if "Apply" button is used, false if filters by text input automatically.
24
- */
25
- agGridColumnFilterCheckboxMenu<E extends Node = HTMLElement>(options: {}): Chainable<JQuery<E>>;
26
-
27
- /**
28
- * * Performs a filter operation on the specified column via the context menu using plain text search
29
- * @param subject The get() selector for which ag grid table you wish to retrieve.
30
- * @param {{searchCriteria:[{columnName:string,filterValue:string,operator?:string}], hasApplyButton?:boolean}} options JSON with search properties
31
- * @param options.searchCriteria JSON with search properties
32
- * @param options.searchCriteria.columnName [REQUIRED] name of the column to filter
33
- * @param options.searchCriteria.filterValue [REQUIRED] value to input into the filter textbox
34
- * @param options.searchCriteria.operator [Optional] Use if using a search operator (i.e. Less Than, Equals, etc...use filterOperator.enum values).
35
- * @param options.hasApplyButton [Optional] True if "Apply" button is used, false if filters by text input automatically.
36
- */
37
- agGridColumnFilterTextMenu<E extends Node = HTMLElement>(options: {}): Chainable<JQuery<E>>;
38
-
39
- /**
40
- * * Performs a filter operation on the specified column via the column's floating filter field using plain text search
41
- * @param subject The get() selector for which ag grid table you wish to retrieve.
42
- * @param {{searchCriteria:[{columnName:string,filterValue:string,operator?:string}], hasApplyButton?:boolean}} options JSON with search properties
43
- * @param options.searchCriteria JSON with search properties and options
44
- * @param options.searchCriteria.columnName name of the column to filter
45
- * @param options.searchCriteria.filterValue value to input into the filter textbox
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.
48
- * @param options.hasApplyButton [Optional] True if "Apply" button is used, false if filters by text input automatically.
49
- */
50
- agGridColumnFilterTextFloating<E extends Node = HTMLElement>(options: {}): Chainable<JQuery<E>>;
51
-
52
- /**
53
- * * Validates the grid data across its pages. Performs a validation that he data exists on each page, not accounting for order.
54
- * @param {*} expectedPaginatedTableData Your paginated array to match the grid data.
55
- * @param {*} onlyColumns (Optional) If specified, ONLY these columns will be validated. If left blank, all columns are validated.
56
- */
57
- agGridValidatePaginatedTable<E extends Node = HTMLElement>(
58
- expectedPaginatedTableData: any,
59
- onlyColumns: {}
60
- ): Chainable<JQuery<E>>;
61
-
62
- /**
63
- * Performs an exact validation to verify the data exists within the displayed grid page.
64
- * @param {*} actualTableData The actual page data returned from the getAgGridData() command.
65
- * @param {*} expectedTableData The expected data to exist within the current grid page. Requires all columns and values exactly as shown in the grid, in the same order as shown in the grid.
66
- */
67
- agGridValidateRowsExactOrder<E extends Node = HTMLElement>(
68
- actualTableData: {},
69
- expectedTableData: {}
70
- ): Chainable<JQuery<E>>;
71
-
72
- /**
73
- * Performs a deep include validation to verify the data exists within the displayed grid page
74
- * @param {*} actualTableData The actual page data returned from the getAgGridData() command.
75
- * @param {*} expectedTableData The expected data to exist within the current grid page. Does not need to be in any specific order.
76
- */
77
- agGridValidateRowsSubset<E extends Node = HTMLElement>(
78
- actualTableData: {},
79
- expectedTableData: {}
80
- ): Chainable<JQuery<E>>;
81
-
82
- /**
83
- * Validates the Ag Grid table data is empty.
84
- * @param {*} actualTableData The actual page data returned from the getAgGridData() command.
85
- */
86
- agGridValidateEmptyTable<E extends Node = HTMLElement>(actualTableData: {}): Chainable<JQuery<E>>;
87
-
88
- /**
89
- * Will add or remove a column from ag grid.
90
- * @param columnName The column name to add/remove
91
- * @param doRemove true will remove the column. false will add the column.
92
- */
93
- agGridToggleColumnsSideBar<E extends Node = HTMLElement>(
94
- columnName: string,
95
- doRemove: boolean
96
- ): Chainable<JQuery<E>>;
97
- }
4
+ interface Chainable<Subject> {
5
+ /**
6
+ * Retrieves the values from the *displayed* page in ag grid and assigns each value to its respective column name.
7
+ * @param options Provide an array of columns you wish to exclude from the table retrieval.
8
+ */
9
+ getAgGridData(options?: getAgGridElementsOptions): Chainable<Array<Record<string, string>>>;
10
+
11
+ /**
12
+ * Retrieves the values from the *displayed* page in ag grid and assigns each value to its respective column name.
13
+ * @param options Provide an array of columns you wish to exclude from the table retrieval.
14
+ */
15
+ getAgGridElements<E extends Node = HTMLElement>(options?: getAgGridElementsOptions): Chainable<JQuery<E>>;
16
+
17
+ /**
18
+ * * Performs sorting operation on the specified column
19
+ * @param {*} subject The get() selector for which ag grid table you wish to retrieve.
20
+ * @param columnName The name of the column you wish to sort
21
+ * @param sortDirection sort enum value
22
+ */
23
+ agGridSortColumn<E extends Node = HTMLElement>(columnName: string, sortDirection: string): Chainable<JQuery<E>>;
24
+
25
+ /**
26
+ * * Performs a filter operation on the specified column and selects only the provided filterValue
27
+ * @param subject The get() selector for which ag grid table you wish to retrieve.
28
+ * @param options Column filter options to filter on
29
+ */
30
+ agGridColumnFilterCheckboxMenu<E extends Node = HTMLElement>(options: agGridColumnFilterOptions<agGridColumnFilterSearchCriteriaOptions>): Chainable<JQuery<E>>;
31
+
32
+ /**
33
+ * * Performs a filter operation on the specified column via the context menu using plain text search
34
+ * @param subject The get() selector for which ag grid table you wish to retrieve.
35
+ * @param options Column filter options to filter on
36
+ */
37
+ agGridColumnFilterTextMenu<E extends Node = HTMLElement>(options: agGridColumnFilterOptions<agGridColumnFilterSearchCriteriaOptionsWithOperator>): Chainable<JQuery<E>>;
38
+
39
+ /**
40
+ * * Performs a filter operation on the specified column via the column's floating filter field using plain text search
41
+ * @param subject The get() selector for which ag grid table you wish to retrieve.
42
+ * @param options Column filter options to filter on
43
+ */
44
+ agGridColumnFilterTextFloating<E extends Node = HTMLElement>(options: agGridColumnFilterOptions<agGridColumnFilterSearchCriteriaOptionsWithMultiFilter>): Chainable<JQuery<E>>;
45
+
46
+ /**
47
+ * * Validates the grid data across its pages. Performs a validation that the data exists on each page, not accounting for order.
48
+ * @param {*} expectedPaginatedTableData Your paginated array to match the grid data.
49
+ * @param {*} onlyColumns If specified, ONLY these columns will be validated. If left blank, all columns are validated.
50
+ */
51
+ agGridValidatePaginatedTable<E extends Node = HTMLElement>(
52
+ expectedPaginatedTableData: any,
53
+ onlyColumns?: string[]
54
+ ): Chainable<JQuery<E>>;
55
+
56
+ /**
57
+ * * Performs an exact validation to verify the data exists within the displayed grid page.
58
+ * @param {*} actualTableData The actual page data returned from the getAgGridData() command.
59
+ * @param {*} expectedTableData The expected data to exist within the current grid page. Requires all columns and values exactly as shown in the grid, in the same order as shown in the grid.
60
+ */
61
+ agGridValidateRowsExactOrder<E extends Node = HTMLElement>(
62
+ actualTableData: {},
63
+ expectedTableData: {}
64
+ ): Chainable<JQuery<E>>;
65
+
66
+ /**
67
+ * * Performs a deep include validation to verify the data exists within the displayed grid page
68
+ * @param {*} actualTableData The actual page data returned from the getAgGridData() command.
69
+ * @param {*} expectedTableData The expected data to exist within the current grid page. Does not need to be in any specific order.
70
+ */
71
+ agGridValidateRowsSubset<E extends Node = HTMLElement>(
72
+ actualTableData: {},
73
+ expectedTableData: {}
74
+ ): Chainable<JQuery<E>>;
75
+
76
+ /**
77
+ * * Validates the Ag Grid table data is empty.
78
+ * @param {*} actualTableData The actual page data returned from the getAgGridData() command.
79
+ */
80
+ agGridValidateEmptyTable<E extends Node = HTMLElement>(actualTableData: {}): Chainable<JQuery<E>>;
81
+
82
+ /**
83
+ * * Will add or remove a column from ag grid.
84
+ * @param columnName The column name to add/remove
85
+ * @param doRemove true will remove the column. false will add the column.
86
+ */
87
+ agGridToggleColumnsSideBar<E extends Node = HTMLElement>(
88
+ columnName: string,
89
+ doRemove: boolean
90
+ ): Chainable<JQuery<E>>;
91
+ }
98
92
  }
93
+
94
+ interface agGridColumnFilterOptions<TSearchCriteria> {
95
+ searchCriteria: TSearchCriteria,
96
+ /** True if "Apply" button is used, false if filters by text input automatically. */
97
+ hasApplyButton?: boolean,
98
+ selectAllLocaleText?: string,
99
+ noMenuTabs?: boolean,
100
+ }
101
+
102
+
103
+ interface getAgGridElementsOptions {
104
+ /** Define columns to select from */
105
+ onlyColumns?: string[],
106
+ /** If true, return headers & rows values as arrays instead of mapping as objects */
107
+ valuesArray?: boolean
108
+ }
109
+
110
+ interface agGridColumnFilterSearchCriteriaOptions {
111
+ /** Name of the column to filter */
112
+ columnName: string,
113
+ /** Value to input into the filter textbox */
114
+ filterValue: string
115
+ }
116
+
117
+ interface agGridColumnFilterSearchCriteriaOptionsWithOperator extends agGridColumnFilterSearchCriteriaOptions {
118
+ /** Use if using a search operator (i.e. Less Than, Equals, etc...use filterOperator.enum values) */
119
+ operator?: string
120
+ }
121
+
122
+ interface agGridColumnFilterSearchCriteriaOptionsWithMultiFilter extends agGridColumnFilterSearchCriteriaOptionsWithOperator {
123
+ /** Use if floating filter is multiselect checkboxes vs free form input */
124
+ isMultiFilter?: boolean
125
+ }
package/src/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /// <reference types="cypress" />
2
2
 
3
- import {getAgGridData, getAgGridElements, sortColumnBy} from "./agGrid/agGridInteractions"
3
+ import {agGridWaitForAnimation, getAgGridData, getAgGridElements, sortColumnBy} from "./agGrid/agGridInteractions"
4
4
  import {validateTablePages, validateTableExactOrder, validateEmptyTable, validateTableRowSubset} from "./agGrid/agGridValidations"
5
5
  import {filterByCheckboxColumnMenu, filterBySearchTextColumnFloatingFilter, filterBySearchTextColumnMenu, toggleColumnFromSideBar, pinColumn} from "./agGrid/agGridInteractions";
6
6
 
@@ -17,4 +17,6 @@ Cypress.Commands.add('agGridValidateRowsSubset', {prevSubject: 'optional'}, vali
17
17
  Cypress.Commands.add('agGridValidateEmptyTable', {prevSubject: 'optional'}, validateEmptyTable)
18
18
 
19
19
  Cypress.Commands.add('agGridToggleColumnsSideBar', {prevSubject: true}, toggleColumnFromSideBar)
20
- Cypress.Commands.add('agGridPinColumn', {prevSubject: true}, pinColumn)
20
+ Cypress.Commands.add('agGridPinColumn', {prevSubject: true}, pinColumn)
21
+
22
+ Cypress.Commands.add('agGridWaitForAnimation', { prevSubject: 'element' }, agGridWaitForAnimation);