From 41f64c1fb8b6d3cef5c25a72b39e44c83f2139f6 Mon Sep 17 00:00:00 2001 From: Arik Fraimovich Date: Tue, 14 Apr 2020 11:07:39 +0300 Subject: [PATCH 1/6] Disable Percy snapshot for Choropleth test --- client/cypress/integration/visualizations/choropleth_spec.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/cypress/integration/visualizations/choropleth_spec.js b/client/cypress/integration/visualizations/choropleth_spec.js index c5faa43290..55ff1d8ba2 100644 --- a/client/cypress/integration/visualizations/choropleth_spec.js +++ b/client/cypress/integration/visualizations/choropleth_spec.js @@ -85,6 +85,7 @@ describe("Choropleth", () => { cy.getByTestId("VisualizationPreview") .find(".map-visualization-container.leaflet-container") .should("exist"); - cy.percySnapshot("Visualizations - Choropleth", { widths: [viewportWidth] }); + // The following has a very high error rate and therefore disabled. + // cy.percySnapshot("Visualizations - Choropleth", { widths: [viewportWidth] }); }); }); From 46255a0f8d4afaff787ccbd1e43455bb12b9d49e Mon Sep 17 00:00:00 2001 From: Arik Fraimovich Date: Tue, 14 Apr 2020 11:26:42 +0300 Subject: [PATCH 2/6] Increase wait. --- client/cypress/integration/visualizations/choropleth_spec.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/client/cypress/integration/visualizations/choropleth_spec.js b/client/cypress/integration/visualizations/choropleth_spec.js index 55ff1d8ba2..a087919555 100644 --- a/client/cypress/integration/visualizations/choropleth_spec.js +++ b/client/cypress/integration/visualizations/choropleth_spec.js @@ -81,11 +81,10 @@ describe("Choropleth", () => { .check({ force: true }); // Wait for proper initialization of visualization - cy.wait(500); // eslint-disable-line cypress/no-unnecessary-waiting + cy.wait(1500); // eslint-disable-line cypress/no-unnecessary-waiting cy.getByTestId("VisualizationPreview") .find(".map-visualization-container.leaflet-container") .should("exist"); - // The following has a very high error rate and therefore disabled. - // cy.percySnapshot("Visualizations - Choropleth", { widths: [viewportWidth] }); + cy.percySnapshot("Visualizations - Choropleth", { widths: [viewportWidth] }); }); }); From 5e978eb3c87bf6eb553267d81a73633361489045 Mon Sep 17 00:00:00 2001 From: Arik Fraimovich Date: Tue, 14 Apr 2020 12:32:59 +0300 Subject: [PATCH 3/6] Diasble Percy snapshot. --- .../cypress/integration/visualizations/choropleth_spec.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/client/cypress/integration/visualizations/choropleth_spec.js b/client/cypress/integration/visualizations/choropleth_spec.js index a087919555..92746f0e8b 100644 --- a/client/cypress/integration/visualizations/choropleth_spec.js +++ b/client/cypress/integration/visualizations/choropleth_spec.js @@ -30,8 +30,6 @@ const SQL = ` `; describe("Choropleth", () => { - const viewportWidth = Cypress.config("viewportWidth"); - beforeEach(() => { cy.login(); createQuery({ query: SQL }).then(({ id }) => { @@ -85,6 +83,9 @@ describe("Choropleth", () => { cy.getByTestId("VisualizationPreview") .find(".map-visualization-container.leaflet-container") .should("exist"); - cy.percySnapshot("Visualizations - Choropleth", { widths: [viewportWidth] }); + + // This is unstable and therefore disabled until a better solution is available. + // const viewportWidth = Cypress.config("viewportWidth"); + // cy.percySnapshot("Visualizations - Choropleth", { widths: [viewportWidth] }); }); }); From 1e5bfcb5d019c8be311b2c3a9d4023dcf072788f Mon Sep 17 00:00:00 2001 From: Arik Fraimovich Date: Tue, 14 Apr 2020 12:33:19 +0300 Subject: [PATCH 4/6] Reduce wait time to original value. --- client/cypress/integration/visualizations/choropleth_spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/cypress/integration/visualizations/choropleth_spec.js b/client/cypress/integration/visualizations/choropleth_spec.js index 92746f0e8b..698950416a 100644 --- a/client/cypress/integration/visualizations/choropleth_spec.js +++ b/client/cypress/integration/visualizations/choropleth_spec.js @@ -79,7 +79,7 @@ describe("Choropleth", () => { .check({ force: true }); // Wait for proper initialization of visualization - cy.wait(1500); // eslint-disable-line cypress/no-unnecessary-waiting + cy.wait(500); // eslint-disable-line cypress/no-unnecessary-waiting cy.getByTestId("VisualizationPreview") .find(".map-visualization-container.leaflet-container") .should("exist"); From 8eb750b995e9a031caa8a469645406d646df4ddf Mon Sep 17 00:00:00 2001 From: "restyled-io[bot]" <32688539+restyled-io[bot]@users.noreply.github.com> Date: Tue, 14 Apr 2020 12:33:42 +0300 Subject: [PATCH 5/6] Restyled by prettier (#4800) Co-authored-by: Restyled.io --- client/cypress/integration/visualizations/choropleth_spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/cypress/integration/visualizations/choropleth_spec.js b/client/cypress/integration/visualizations/choropleth_spec.js index 698950416a..b1329e71aa 100644 --- a/client/cypress/integration/visualizations/choropleth_spec.js +++ b/client/cypress/integration/visualizations/choropleth_spec.js @@ -83,7 +83,7 @@ describe("Choropleth", () => { cy.getByTestId("VisualizationPreview") .find(".map-visualization-container.leaflet-container") .should("exist"); - + // This is unstable and therefore disabled until a better solution is available. // const viewportWidth = Cypress.config("viewportWidth"); // cy.percySnapshot("Visualizations - Choropleth", { widths: [viewportWidth] }); From 9d19c8c711d1bf3df3043ff8051e24027561fe04 Mon Sep 17 00:00:00 2001 From: Arik Fraimovich Date: Tue, 14 Apr 2020 12:45:28 +0300 Subject: [PATCH 6/6] Update choropleth_spec.js --- client/cypress/integration/visualizations/choropleth_spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/cypress/integration/visualizations/choropleth_spec.js b/client/cypress/integration/visualizations/choropleth_spec.js index b1329e71aa..55ffc2b800 100644 --- a/client/cypress/integration/visualizations/choropleth_spec.js +++ b/client/cypress/integration/visualizations/choropleth_spec.js @@ -1,4 +1,4 @@ -/* global cy, Cypress */ +/* global cy */ import { createQuery } from "../../support/redash-api";