Skip to content

Commit

Permalink
Fix buggy grouping cypress tests (#106) (#113)
Browse files Browse the repository at this point in the history
(cherry picked from commit f28631d)

Signed-off-by: Siddhant Deshmukh <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 1c38a2b commit 94fd46e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
9 changes: 4 additions & 5 deletions cypress/e2e/4_group_details.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,22 @@
*/

import sampleDocument from '../fixtures/sample_document.json';
import { METRICS } from '../support/constants';

const indexName = 'sample_index';

const clearAll = () => {
cy.deleteIndexByName(indexName);
cy.disableTopQueries(METRICS.LATENCY);
cy.disableTopQueries(METRICS.CPU);
cy.disableTopQueries(METRICS.MEMORY);
cy.disableGrouping();
};

describe('Query Group Details Page', () => {
beforeEach(() => {
clearAll();
cy.wait(5000);
cy.createIndexByName(indexName, sampleDocument);
cy.enableTopQueries(METRICS.LATENCY);
cy.enableGrouping();
// waiting for the query insights to stablize
cy.wait(5000);
cy.searchOnIndex(indexName);
cy.searchOnIndex(indexName);
cy.searchOnIndex(indexName);
Expand All @@ -30,6 +28,7 @@ describe('Query Group Details Page', () => {
cy.navigateToOverview();
cy.get('.euiTableRow').first().find('button').first().trigger('mouseover');
cy.wait(1000);
// Click the first button in the 'group' row
cy.get('.euiTableRow').first().find('button').first().click(); // Navigate to details
cy.wait(1000);
});
Expand Down
6 changes: 4 additions & 2 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,10 @@ Cypress.Commands.add('enableGrouping', () => {
'search.insights.top_queries.latency.window_size': '1m',
'search.insights.top_queries.cpu.window_size': '1m',
'search.insights.top_queries.memory.window_size': '1m',
'search.insights.top_queries.exporter.type': 'none',
},
},
failOnStatusCode: false,
failOnStatusCode: true,
});
});

Expand All @@ -131,9 +132,10 @@ Cypress.Commands.add('disableGrouping', () => {
'search.insights.top_queries.cpu.enabled': false,
'search.insights.top_queries.memory.enabled': false,
'search.insights.top_queries.group_by': 'none',
'search.insights.top_queries.exporter.type': 'none',
},
},
failOnStatusCode: false,
failOnStatusCode: true,
});
});

Expand Down

0 comments on commit 94fd46e

Please sign in to comment.