Skip to content

Commit

Permalink
updated cypress
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Feb 25, 2025
1 parent b7f5741 commit 2da7477
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions cypress/e2e/1_top_queries.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ describe('Query Insights Dashboard', () => {
cy.contains('No items found');
});


it('should render only individual query-related headers when NONE filter is applied', () => {
cy.wait(1000);
cy.get('.euiFilterButton').contains('Type').click();
Expand Down Expand Up @@ -176,31 +175,33 @@ describe('Query Insights Dashboard', () => {
expect(actualHeaders).to.deep.equal(expectedHeaders);
});
});
it('should render Default query-related headers when NONE and SIMILARITY filter are applied', () => {
cy.wait(1000);
cy.get('.euiFilterButton').contains('Type').click();
cy.get('.euiFilterSelectItem').contains('query').click();
cy.wait(1000);
cy.get('.euiFilterSelectItem').contains('group').click();
cy.wait(1000);
it('should display both query and group data with proper headers', () => {
cy.searchOnIndex(indexName);
cy.wait(60000);
cy.enableGrouping();
cy.searchOnIndex(indexName);
cy.wait(60000);
cy.navigateToOverview();

const expectedHeaders = [
const expectedGroupHeaders = [
'Id',
'Type',
'Query Count',
'Timestamp',
'Avg Latency/ Latency',
'Avg Latency / Latency',
'Avg CPU Time / CPU Time',
'Avg Memory Usage / Memory Usage',
'Indices',
'Search Type',
'Coordinator Node ID',
'Total Shards',
];

cy.get('.euiTableHeaderCell').should(($headers) => {
const actualHeaders = $headers.map((index, el) => Cypress.$(el).text().trim()).get();
expect(actualHeaders).to.deep.equal(expectedHeaders);
// Verify each expected header is present.
expectedGroupHeaders.forEach((header) => {
expect(actualHeaders).to.include(header);
});
});
});

Expand Down

0 comments on commit 2da7477

Please sign in to comment.