cypress-ag-grid 2.0.1 → 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.
@@ -1,59 +1,59 @@
1
- import { filterOperator } from "../../src/agGrid/filterOperator.enum";
2
-
3
- const agGridSelector = "#myGrid2";
4
-
5
- describe("ag-grid get elements scenario", () => {
6
- beforeEach(() => {
7
- cy.visit("../app/index.html");
8
- cy.get(".ag-cell", { timeout: 10000 }).should("be.visible");
9
- });
10
-
11
- it("able to update grid cell value", () => {
12
- // filter to only show the porsche
13
- cy.get(agGridSelector).agGridColumnFilterTextFloating({
14
- searchCriteria: {
15
- columnName: "Make",
16
- filterValue: "Porsche",
17
- operator: filterOperator.equals,
18
- },
19
- hasApplyButton: true,
20
- });
21
-
22
- // expected values before changing the price
23
- const expectedTableBeforeEditing = [
24
- { Year: "2020", Make: "Porsche", Model: "Boxter", Price: "72000" },
25
- { Year: "2020", Make: "Porsche", Model: "Boxter", Price: "99000" },
26
- ];
27
-
28
- // verify values before editing
29
- cy.get(agGridSelector)
30
- .getAgGridData()
31
- .then((tableData) => {
32
- cy.agGridValidateRowsSubset(tableData, expectedTableBeforeEditing);
33
- });
34
-
35
- // edit the porsche boxter from 72000 to 66000
36
- cy.get(agGridSelector)
37
- .getAgGridElements()
38
- .then((tableElements) => {
39
- const porscheRow = tableElements.find(
40
- (row) => row.Price.innerText === "72000"
41
- );
42
- const priceCell = porscheRow.Price;
43
- cy.wrap(priceCell).dblclick().type("66000{enter}");
44
- });
45
-
46
- // expected values after changing the price
47
- const expectedTableAfterEditing = [
48
- { Year: "2020", Make: "Porsche", Model: "Boxter", Price: "66000" },
49
- { Year: "2020", Make: "Porsche", Model: "Boxter", Price: "99000" },
50
- ];
51
-
52
- // verify values before editing
53
- cy.get(agGridSelector)
54
- .getAgGridData()
55
- .then((tableData) => {
56
- cy.agGridValidateRowsSubset(tableData, expectedTableAfterEditing);
57
- });
58
- });
59
- });
1
+ import { filterOperator } from "../../src/agGrid/filterOperator.enum";
2
+
3
+ const agGridSelector = "#myGrid2";
4
+
5
+ describe("ag-grid get elements scenario", () => {
6
+ beforeEach(() => {
7
+ cy.visit("../app/index.html");
8
+ cy.get(".ag-cell", { timeout: 10000 }).should("be.visible");
9
+ });
10
+
11
+ it("able to update grid cell value", () => {
12
+ // filter to only show the porsche
13
+ cy.get(agGridSelector).agGridColumnFilterTextFloating({
14
+ searchCriteria: {
15
+ columnName: "Make",
16
+ filterValue: "Porsche",
17
+ operator: filterOperator.equals,
18
+ },
19
+ hasApplyButton: true,
20
+ });
21
+
22
+ // expected values before changing the price
23
+ const expectedTableBeforeEditing = [
24
+ { Year: "2020", Make: "Porsche", Model: "Boxter", Price: "72000" },
25
+ { Year: "2020", Make: "Porsche", Model: "Boxter", Price: "99000" },
26
+ ];
27
+
28
+ // verify values before editing
29
+ cy.get(agGridSelector)
30
+ .getAgGridData()
31
+ .then((tableData) => {
32
+ cy.agGridValidateRowsSubset(tableData, expectedTableBeforeEditing);
33
+ });
34
+
35
+ // edit the porsche boxter from 72000 to 66000
36
+ cy.get(agGridSelector)
37
+ .getAgGridElements()
38
+ .then((tableElements) => {
39
+ const porscheRow = tableElements.find(
40
+ (row) => row.Price.innerText === "72000"
41
+ );
42
+ const priceCell = porscheRow.Price;
43
+ cy.wrap(priceCell).dblclick().type("66000{enter}");
44
+ });
45
+
46
+ // expected values after changing the price
47
+ const expectedTableAfterEditing = [
48
+ { Year: "2020", Make: "Porsche", Model: "Boxter", Price: "66000" },
49
+ { Year: "2020", Make: "Porsche", Model: "Boxter", Price: "99000" },
50
+ ];
51
+
52
+ // verify values before editing
53
+ cy.get(agGridSelector)
54
+ .getAgGridData()
55
+ .then((tableData) => {
56
+ cy.agGridValidateRowsSubset(tableData, expectedTableAfterEditing);
57
+ });
58
+ });
59
+ });
@@ -1,21 +1,21 @@
1
- [
2
- { "Year": "2020", "Make": "Toyota", "Model": "Celica", "Price": "35000" },
3
- { "Year": "2020", "Make": "Ford", "Model": "Mondeo", "Price": "32000" },
4
- { "Year": "2020", "Make": "Porsche", "Model": "Boxter", "Price": "72000" },
5
- { "Year": "2020", "Make": "BMW", "Model": "3-series", "Price": "45000" },
6
- { "Year": "2020", "Make": "Mercedes", "Model": "GLC300", "Price": "53000" },
7
- { "Year": "2020", "Make": "Honda", "Model": "Civic", "Price": "22000" },
8
- { "Year": "2020", "Make": "Honda", "Model": "Accord", "Price": "32000" },
9
- { "Year": "2020", "Make": "Ford", "Model": "Taurus", "Price": "19000" },
10
- { "Year": "2020", "Make": "Hyundai", "Model": "Elantra", "Price": "22000" },
11
- { "Year": "2020", "Make": "Toyota", "Model": "Celica", "Price": "5000" },
12
- { "Year": "2020", "Make": "Ford", "Model": "Mondeo", "Price": "25000" },
13
- { "Year": "2020", "Make": "Porsche", "Model": "Boxter", "Price": "99000" },
14
- { "Year": "2020", "Make": "BMW", "Model": "3-series", "Price": "32000" },
15
- { "Year": "2020", "Make": "Mercedes", "Model": "GLC300", "Price": "35000" },
16
- { "Year": "2011", "Make": "Honda", "Model": "Civic", "Price": "9000" },
17
- { "Year": "2020", "Make": "Honda", "Model": "Accord", "Price": "34000" },
18
- { "Year": "1990", "Make": "Ford", "Model": "Taurus", "Price": "900" },
19
- { "Year": "2020", "Make": "Hyundai", "Model": "Elantra", "Price": "3000" },
20
- { "Year": "2020", "Make": "BMW", "Model": "2002", "Price": "88001" }
21
- ]
1
+ [
2
+ { "Year": "2020", "Make": "Toyota", "Model": "Celica", "Price": "35000" },
3
+ { "Year": "2020", "Make": "Ford", "Model": "Mondeo", "Price": "32000" },
4
+ { "Year": "2020", "Make": "Porsche", "Model": "Boxter", "Price": "72000" },
5
+ { "Year": "2020", "Make": "BMW", "Model": "3-series", "Price": "45000" },
6
+ { "Year": "2020", "Make": "Mercedes", "Model": "GLC300", "Price": "53000" },
7
+ { "Year": "2020", "Make": "Honda", "Model": "Civic", "Price": "22000" },
8
+ { "Year": "2020", "Make": "Honda", "Model": "Accord", "Price": "32000" },
9
+ { "Year": "2020", "Make": "Ford", "Model": "Taurus", "Price": "19000" },
10
+ { "Year": "2020", "Make": "Hyundai", "Model": "Elantra", "Price": "22000" },
11
+ { "Year": "2020", "Make": "Toyota", "Model": "Celica", "Price": "5000" },
12
+ { "Year": "2020", "Make": "Ford", "Model": "Mondeo", "Price": "25000" },
13
+ { "Year": "2020", "Make": "Porsche", "Model": "Boxter", "Price": "99000" },
14
+ { "Year": "2020", "Make": "BMW", "Model": "3-series", "Price": "32000" },
15
+ { "Year": "2020", "Make": "Mercedes", "Model": "GLC300", "Price": "35000" },
16
+ { "Year": "2011", "Make": "Honda", "Model": "Civic", "Price": "9000" },
17
+ { "Year": "2020", "Make": "Honda", "Model": "Accord", "Price": "34000" },
18
+ { "Year": "1990", "Make": "Ford", "Model": "Taurus", "Price": "900" },
19
+ { "Year": "2020", "Make": "Hyundai", "Model": "Elantra", "Price": "3000" },
20
+ { "Year": "2020", "Make": "BMW", "Model": "2002", "Price": "88001" }
21
+ ]
@@ -1,22 +1,22 @@
1
- /// <reference types="cypress" />
2
- // ***********************************************************
3
- // This example plugins/index.js can be used to load plugins
4
- //
5
- // You can change the location of this file or turn off loading
6
- // the plugins file with the 'pluginsFile' configuration option.
7
- //
8
- // You can read more here:
9
- // https://on.cypress.io/plugins-guide
10
- // ***********************************************************
11
-
12
- // This function is called when a project is opened or re-opened (e.g. due to
13
- // the project's config changing)
14
-
15
- /**
16
- * @type {Cypress.PluginConfig}
17
- */
18
- // eslint-disable-next-line no-unused-vars
19
- module.exports = (on, config) => {
20
- // `on` is used to hook into various events Cypress emits
21
- // `config` is the resolved Cypress config
22
- }
1
+ /// <reference types="cypress" />
2
+ // ***********************************************************
3
+ // This example plugins/index.js can be used to load plugins
4
+ //
5
+ // You can change the location of this file or turn off loading
6
+ // the plugins file with the 'pluginsFile' configuration option.
7
+ //
8
+ // You can read more here:
9
+ // https://on.cypress.io/plugins-guide
10
+ // ***********************************************************
11
+
12
+ // This function is called when a project is opened or re-opened (e.g. due to
13
+ // the project's config changing)
14
+
15
+ /**
16
+ * @type {Cypress.PluginConfig}
17
+ */
18
+ // eslint-disable-next-line no-unused-vars
19
+ module.exports = (on, config) => {
20
+ // `on` is used to hook into various events Cypress emits
21
+ // `config` is the resolved Cypress config
22
+ }
@@ -1,25 +1,25 @@
1
- // ***********************************************
2
- // This example commands.js shows you how to
3
- // create various custom commands and overwrite
4
- // existing commands.
5
- //
6
- // For more comprehensive examples of custom
7
- // commands please read more here:
8
- // https://on.cypress.io/custom-commands
9
- // ***********************************************
10
- //
11
- //
12
- // -- This is a parent command --
13
- // Cypress.Commands.add('login', (email, password) => { ... })
14
- //
15
- //
16
- // -- This is a child command --
17
- // Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
18
- //
19
- //
20
- // -- This is a dual command --
21
- // Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
22
- //
23
- //
24
- // -- This will overwrite an existing command --
25
- // Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
1
+ // ***********************************************
2
+ // This example commands.js shows you how to
3
+ // create various custom commands and overwrite
4
+ // existing commands.
5
+ //
6
+ // For more comprehensive examples of custom
7
+ // commands please read more here:
8
+ // https://on.cypress.io/custom-commands
9
+ // ***********************************************
10
+ //
11
+ //
12
+ // -- This is a parent command --
13
+ // Cypress.Commands.add('login', (email, password) => { ... })
14
+ //
15
+ //
16
+ // -- This is a child command --
17
+ // Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
18
+ //
19
+ //
20
+ // -- This is a dual command --
21
+ // Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
22
+ //
23
+ //
24
+ // -- This will overwrite an existing command --
25
+ // Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
@@ -1,21 +1,21 @@
1
- // ***********************************************************
2
- // This example support/index.js is processed and
3
- // loaded automatically before your test files.
4
- //
5
- // This is a great place to put global configuration and
6
- // behavior that modifies Cypress.
7
- //
8
- // You can change the location of this file or turn off
9
- // automatically serving support files with the
10
- // 'supportFile' configuration option.
11
- //
12
- // You can read more here:
13
- // https://on.cypress.io/configuration
14
- // ***********************************************************
15
-
16
- // Import commands.js using ES2015 syntax:
17
- import './commands'
18
- import '../../src/index'
19
-
20
- // Alternatively you can use CommonJS syntax:
21
- // require('./commands')
1
+ // ***********************************************************
2
+ // This example support/index.js is processed and
3
+ // loaded automatically before your test files.
4
+ //
5
+ // This is a great place to put global configuration and
6
+ // behavior that modifies Cypress.
7
+ //
8
+ // You can change the location of this file or turn off
9
+ // automatically serving support files with the
10
+ // 'supportFile' configuration option.
11
+ //
12
+ // You can read more here:
13
+ // https://on.cypress.io/configuration
14
+ // ***********************************************************
15
+
16
+ // Import commands.js using ES2015 syntax:
17
+ import './commands'
18
+ import '../../src/index'
19
+
20
+ // Alternatively you can use CommonJS syntax:
21
+ // require('./commands')
package/package.json CHANGED
@@ -1,29 +1,29 @@
1
- {
2
- "name": "cypress-ag-grid",
3
- "version": "2.0.1",
4
- "description": "Cypress plugin to interact with ag grid",
5
- "main": "src/index.js",
6
- "repository": {
7
- "type": "git",
8
- "url": "git+https://github.com/kpmck/cypress-ag-grid.git"
9
- },
10
- "keywords": [
11
- "aggrid",
12
- "ag-grid",
13
- "cypress",
14
- "cypress-io",
15
- "e2e testing",
16
- "cypress table",
17
- "cypress ag grid",
18
- "cypress aggrid"
19
- ],
20
- "scripts": {
21
- "test": "npx cypress run --headless --spec cypress/integration/ag-grid-spec.js",
22
- "test:watch": "npx cypress open"
23
- },
24
- "author": "Kerry McKeever <kerry@kerrymckeever.com>",
25
- "license": "MIT",
26
- "devDependencies": {
27
- "cypress": "^10.1.0"
28
- }
29
- }
1
+ {
2
+ "name": "cypress-ag-grid",
3
+ "version": "2.0.2",
4
+ "description": "Cypress plugin to interact with ag grid",
5
+ "main": "src/index.js",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/kpmck/cypress-ag-grid.git"
9
+ },
10
+ "keywords": [
11
+ "aggrid",
12
+ "ag-grid",
13
+ "cypress",
14
+ "cypress-io",
15
+ "e2e testing",
16
+ "cypress table",
17
+ "cypress ag grid",
18
+ "cypress aggrid"
19
+ ],
20
+ "scripts": {
21
+ "test": "npx cypress run --headless --spec cypress/integration/ag-grid-spec.js",
22
+ "test:watch": "npx cypress open"
23
+ },
24
+ "author": "Kerry McKeever <kerry@kerrymckeever.com>",
25
+ "license": "MIT",
26
+ "devDependencies": {
27
+ "cypress": "^10.1.0"
28
+ }
29
+ }