From 8cfd7bbafd863c18e9fb759378470c2d41b802d7 Mon Sep 17 00:00:00 2001 From: Piotr Wysocki <86244209+piwysocki@users.noreply.github.com> Date: Sun, 27 Nov 2022 20:50:52 +0100 Subject: [PATCH] e2e tests - migrate to Cypress v11 --- cypress.config.ts | 29 ++++++++++++++++++ cypress.json | 6 ---- .../bar-chart.spec.ts => e2e/bar-chart.cy.ts} | 0 .../boolean-filter-menu.cy.ts} | 0 .../csv-data-source.cy.ts} | 0 .../fixed-time-filter-menu.cy.ts} | 0 .../grid.spec.ts => e2e/grid.cy.ts} | 0 .../home-page.spec.ts => e2e/home-page.cy.ts} | 0 .../legend.spec.ts => e2e/legend.cy.ts} | 0 .../line-chart.cy.ts} | 0 .../pinboard.spec.ts => e2e/pinboard.cy.ts} | 0 .../relative-time-filter-menu.cy.ts} | 0 .../scatterplot.cy.ts} | 0 .../split-tile.cy.ts} | 0 .../string-split-menu.cy.ts} | 0 .../table.spec.ts => e2e/table.cy.ts} | 0 .../totals.spec.ts => e2e/totals.cy.ts} | 0 cypress/support/{index.js => e2e.js} | 0 package-lock.json | 30 +++++++++---------- package.json | 2 +- 20 files changed, 45 insertions(+), 22 deletions(-) create mode 100644 cypress.config.ts delete mode 100644 cypress.json rename cypress/{integration/bar-chart.spec.ts => e2e/bar-chart.cy.ts} (100%) rename cypress/{integration/boolean-filter-menu.spec.ts => e2e/boolean-filter-menu.cy.ts} (100%) rename cypress/{integration/csv-data-source.spec.ts => e2e/csv-data-source.cy.ts} (100%) rename cypress/{integration/fixed-time-filter-menu.spec.ts => e2e/fixed-time-filter-menu.cy.ts} (100%) rename cypress/{integration/grid.spec.ts => e2e/grid.cy.ts} (100%) rename cypress/{integration/home-page.spec.ts => e2e/home-page.cy.ts} (100%) rename cypress/{integration/legend.spec.ts => e2e/legend.cy.ts} (100%) rename cypress/{integration/line-chart.spec.ts => e2e/line-chart.cy.ts} (100%) rename cypress/{integration/pinboard.spec.ts => e2e/pinboard.cy.ts} (100%) rename cypress/{integration/relative-time-filter-menu.spec.ts => e2e/relative-time-filter-menu.cy.ts} (100%) rename cypress/{integration/scatterplot.spec.ts => e2e/scatterplot.cy.ts} (100%) rename cypress/{integration/split-tile.spec.ts => e2e/split-tile.cy.ts} (100%) rename cypress/{integration/string-split-menu.spec.ts => e2e/string-split-menu.cy.ts} (100%) rename cypress/{integration/table.spec.ts => e2e/table.cy.ts} (100%) rename cypress/{integration/totals.spec.ts => e2e/totals.cy.ts} (100%) rename cypress/support/{index.js => e2e.js} (100%) diff --git a/cypress.config.ts b/cypress.config.ts new file mode 100644 index 000000000..665e6a53e --- /dev/null +++ b/cypress.config.ts @@ -0,0 +1,29 @@ +/* + * Copyright 2017-2022 Allegro.pl + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { defineConfig } from "cypress"; + +export default defineConfig({ + video: false, + viewportWidth: 1280, + viewportHeight: 1024, + e2e: { + // We've imported your old cypress plugins here. + // You may want to clean this up later by importing these. + setupNodeEvents(on, config) { + return require("./cypress/plugins/index.js")(on, config); + } + } +}); diff --git a/cypress.json b/cypress.json deleted file mode 100644 index a6b8f93d9..000000000 --- a/cypress.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "video": false, - "viewportWidth": 1280, - "viewportHeight": 1024 -} - diff --git a/cypress/integration/bar-chart.spec.ts b/cypress/e2e/bar-chart.cy.ts similarity index 100% rename from cypress/integration/bar-chart.spec.ts rename to cypress/e2e/bar-chart.cy.ts diff --git a/cypress/integration/boolean-filter-menu.spec.ts b/cypress/e2e/boolean-filter-menu.cy.ts similarity index 100% rename from cypress/integration/boolean-filter-menu.spec.ts rename to cypress/e2e/boolean-filter-menu.cy.ts diff --git a/cypress/integration/csv-data-source.spec.ts b/cypress/e2e/csv-data-source.cy.ts similarity index 100% rename from cypress/integration/csv-data-source.spec.ts rename to cypress/e2e/csv-data-source.cy.ts diff --git a/cypress/integration/fixed-time-filter-menu.spec.ts b/cypress/e2e/fixed-time-filter-menu.cy.ts similarity index 100% rename from cypress/integration/fixed-time-filter-menu.spec.ts rename to cypress/e2e/fixed-time-filter-menu.cy.ts diff --git a/cypress/integration/grid.spec.ts b/cypress/e2e/grid.cy.ts similarity index 100% rename from cypress/integration/grid.spec.ts rename to cypress/e2e/grid.cy.ts diff --git a/cypress/integration/home-page.spec.ts b/cypress/e2e/home-page.cy.ts similarity index 100% rename from cypress/integration/home-page.spec.ts rename to cypress/e2e/home-page.cy.ts diff --git a/cypress/integration/legend.spec.ts b/cypress/e2e/legend.cy.ts similarity index 100% rename from cypress/integration/legend.spec.ts rename to cypress/e2e/legend.cy.ts diff --git a/cypress/integration/line-chart.spec.ts b/cypress/e2e/line-chart.cy.ts similarity index 100% rename from cypress/integration/line-chart.spec.ts rename to cypress/e2e/line-chart.cy.ts diff --git a/cypress/integration/pinboard.spec.ts b/cypress/e2e/pinboard.cy.ts similarity index 100% rename from cypress/integration/pinboard.spec.ts rename to cypress/e2e/pinboard.cy.ts diff --git a/cypress/integration/relative-time-filter-menu.spec.ts b/cypress/e2e/relative-time-filter-menu.cy.ts similarity index 100% rename from cypress/integration/relative-time-filter-menu.spec.ts rename to cypress/e2e/relative-time-filter-menu.cy.ts diff --git a/cypress/integration/scatterplot.spec.ts b/cypress/e2e/scatterplot.cy.ts similarity index 100% rename from cypress/integration/scatterplot.spec.ts rename to cypress/e2e/scatterplot.cy.ts diff --git a/cypress/integration/split-tile.spec.ts b/cypress/e2e/split-tile.cy.ts similarity index 100% rename from cypress/integration/split-tile.spec.ts rename to cypress/e2e/split-tile.cy.ts diff --git a/cypress/integration/string-split-menu.spec.ts b/cypress/e2e/string-split-menu.cy.ts similarity index 100% rename from cypress/integration/string-split-menu.spec.ts rename to cypress/e2e/string-split-menu.cy.ts diff --git a/cypress/integration/table.spec.ts b/cypress/e2e/table.cy.ts similarity index 100% rename from cypress/integration/table.spec.ts rename to cypress/e2e/table.cy.ts diff --git a/cypress/integration/totals.spec.ts b/cypress/e2e/totals.cy.ts similarity index 100% rename from cypress/integration/totals.spec.ts rename to cypress/e2e/totals.cy.ts diff --git a/cypress/support/index.js b/cypress/support/e2e.js similarity index 100% rename from cypress/support/index.js rename to cypress/support/e2e.js diff --git a/package-lock.json b/package-lock.json index 8965a3a19..e8fb99f37 100644 --- a/package-lock.json +++ b/package-lock.json @@ -102,7 +102,7 @@ "css-loader": "5.2.7", "css-minimizer-webpack-plugin": "1.3.0", "css-modules-require-hook": "4.2.3", - "cypress": "9.7.0", + "cypress": "11.2.0", "enzyme": "3.3.0", "enzyme-adapter-react-16": "1.7.1", "file-loader": "6.2.0", @@ -7663,9 +7663,9 @@ "dev": true }, "node_modules/cypress": { - "version": "9.7.0", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-9.7.0.tgz", - "integrity": "sha512-+1EE1nuuuwIt/N1KXRR2iWHU+OiIt7H28jJDyyI4tiUftId/DrXYEwoDa5+kH2pki1zxnA0r6HrUGHV5eLbF5Q==", + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-11.2.0.tgz", + "integrity": "sha512-u61UGwtu7lpsNWLUma/FKNOsrjcI6wleNmda/TyKHe0dOBcVjbCPlp1N6uwFZ0doXev7f/91YDpU9bqDCFeBLA==", "dev": true, "hasInstallScript": true, "dependencies": { @@ -7688,7 +7688,7 @@ "dayjs": "^1.10.4", "debug": "^4.3.2", "enquirer": "^2.3.6", - "eventemitter2": "^6.4.3", + "eventemitter2": "6.4.7", "execa": "4.1.0", "executable": "^4.1.1", "extract-zip": "2.0.1", @@ -9792,9 +9792,9 @@ } }, "node_modules/eventemitter2": { - "version": "6.4.5", - "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-6.4.5.tgz", - "integrity": "sha512-bXE7Dyc1i6oQElDG0jMRZJrRAn9QR2xyyFGmBdZleNmyQX0FqGYmhZIrIrpPfm/w//LTo4tVQGOGQcGCb5q9uw==", + "version": "6.4.7", + "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-6.4.7.tgz", + "integrity": "sha512-tYUSVOGeQPKt/eC1ABfhHy5Xd96N3oIijJvN3O9+TsC28T5V9yX9oEfEK5faP0EFSNVOG97qtAS68GBrQB2hDg==", "dev": true }, "node_modules/events": { @@ -30675,9 +30675,9 @@ "dev": true }, "cypress": { - "version": "9.7.0", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-9.7.0.tgz", - "integrity": "sha512-+1EE1nuuuwIt/N1KXRR2iWHU+OiIt7H28jJDyyI4tiUftId/DrXYEwoDa5+kH2pki1zxnA0r6HrUGHV5eLbF5Q==", + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-11.2.0.tgz", + "integrity": "sha512-u61UGwtu7lpsNWLUma/FKNOsrjcI6wleNmda/TyKHe0dOBcVjbCPlp1N6uwFZ0doXev7f/91YDpU9bqDCFeBLA==", "dev": true, "requires": { "@cypress/request": "^2.88.10", @@ -30699,7 +30699,7 @@ "dayjs": "^1.10.4", "debug": "^4.3.2", "enquirer": "^2.3.6", - "eventemitter2": "^6.4.3", + "eventemitter2": "6.4.7", "execa": "4.1.0", "executable": "^4.1.1", "extract-zip": "2.0.1", @@ -32331,9 +32331,9 @@ } }, "eventemitter2": { - "version": "6.4.5", - "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-6.4.5.tgz", - "integrity": "sha512-bXE7Dyc1i6oQElDG0jMRZJrRAn9QR2xyyFGmBdZleNmyQX0FqGYmhZIrIrpPfm/w//LTo4tVQGOGQcGCb5q9uw==", + "version": "6.4.7", + "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-6.4.7.tgz", + "integrity": "sha512-tYUSVOGeQPKt/eC1ABfhHy5Xd96N3oIijJvN3O9+TsC28T5V9yX9oEfEK5faP0EFSNVOG97qtAS68GBrQB2hDg==", "dev": true }, "events": { diff --git a/package.json b/package.json index 5e179fb7c..a036bf705 100644 --- a/package.json +++ b/package.json @@ -157,7 +157,7 @@ "css-loader": "5.2.7", "css-minimizer-webpack-plugin": "1.3.0", "css-modules-require-hook": "4.2.3", - "cypress": "9.7.0", + "cypress": "11.2.0", "enzyme": "3.3.0", "enzyme-adapter-react-16": "1.7.1", "file-loader": "6.2.0",