Skip to content

Commit

Permalink
Fix Map spec and Alert Page snapshot flakyness (#4403)
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrieldutra authored Nov 26, 2019
1 parent c70a48d commit 5de291a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
9 changes: 9 additions & 0 deletions client/app/pages/alert/components/Query.less
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,13 @@
.alert-query-schedule {
font-style: italic;
text-transform: lowercase;
}

@media only percy {
// hide query selector arrow in Percy to avoid a flaky snapshot
.alert-query-selector {
.ant-select-arrow-icon {
display: none !important;
}
}
}
6 changes: 3 additions & 3 deletions client/cypress/integration/visualizations/choropleth_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ describe('Choropleth', () => {
cy.clickThrough('Choropleth.EditorTabs.Colors');
cy.clickThrough('Choropleth.Editor.Colors.Min');
cy.fillInputs({ 'ColorPicker.CustomColor': 'yellow{enter}' });
cy.wait(100); // eslint-disable-line cypress/no-unnecessary-waiting
cy.getByTestId('ColorPicker.CustomColor').should('not.be.visible');
cy.clickThrough('Choropleth.Editor.Colors.Max');
cy.fillInputs({ 'ColorPicker.CustomColor': 'red{enter}' });
cy.wait(100); // eslint-disable-line cypress/no-unnecessary-waiting
cy.getByTestId('ColorPicker.CustomColor').should('not.be.visible');
cy.clickThrough('Choropleth.Editor.Colors.Borders');
cy.fillInputs({ 'ColorPicker.CustomColor': 'black{enter}' });
cy.wait(100); // eslint-disable-line cypress/no-unnecessary-waiting
cy.getByTestId('ColorPicker.CustomColor').should('not.be.visible');

cy.clickThrough(`
Choropleth.EditorTabs.Format
Expand Down
12 changes: 7 additions & 5 deletions client/cypress/integration/visualizations/map_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,18 @@ describe('Map (Markers)', () => {
cy.clickThrough('Map.EditorTabs.Groups');
cy.clickThrough('Map.Editor.Groups.Israel.Color');
cy.fillInputs({ 'ColorPicker.CustomColor': 'red{enter}' });
cy.wait(100); // eslint-disable-line cypress/no-unnecessary-waiting
cy.getByTestId('ColorPicker.CustomColor').should('not.be.visible');
cy.clickThrough('Map.Editor.Groups.Ukraine.Color');
cy.fillInputs({ 'ColorPicker.CustomColor': 'green{enter}' });
cy.wait(100); // eslint-disable-line cypress/no-unnecessary-waiting
cy.getByTestId('ColorPicker.CustomColor').should('not.be.visible');
cy.clickThrough('Map.Editor.Groups.Hungary.Color');
cy.fillInputs({ 'ColorPicker.CustomColor': 'blue{enter}' });
cy.getByTestId('ColorPicker.CustomColor').should('not.be.visible');

cy.getByTestId('VisualizationPreview').find('.leaflet-control-zoom-in').click();

// Wait for proper initialization of visualization
cy.wait(500); // eslint-disable-line cypress/no-unnecessary-waiting
cy.wait(1000); // eslint-disable-line cypress/no-unnecessary-waiting
cy.percySnapshot('Visualizations - Map (Markers) with groups', { widths: [viewportWidth] });
});

Expand Down Expand Up @@ -84,14 +85,15 @@ describe('Map (Markers)', () => {

cy.clickThrough('Map.Editor.MarkerBackgroundColor');
cy.fillInputs({ 'ColorPicker.CustomColor': 'red{enter}' });
cy.wait(100); // eslint-disable-line cypress/no-unnecessary-waiting
cy.getByTestId('ColorPicker.CustomColor').should('not.be.visible');
cy.clickThrough('Map.Editor.MarkerBorderColor');
cy.fillInputs({ 'ColorPicker.CustomColor': 'maroon{enter}' });
cy.getByTestId('ColorPicker.CustomColor').should('not.be.visible');

cy.getByTestId('VisualizationPreview').find('.leaflet-control-zoom-in').click();

// Wait for proper initialization of visualization
cy.wait(500); // eslint-disable-line cypress/no-unnecessary-waiting
cy.wait(1000); // eslint-disable-line cypress/no-unnecessary-waiting
cy.percySnapshot('Visualizations - Map (Markers) with custom markers', { widths: [viewportWidth] });
});
});

0 comments on commit 5de291a

Please sign in to comment.