Skip to content

Commit a656fc2

Browse files
authored
fix cypress tests after changing the default values (#82)
Signed-off-by: Chenyang Ji <[email protected]>
1 parent 53684b1 commit a656fc2

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

Diff for: cypress/e2e/1_top_queries.cy.js

+3
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ describe('Query Insights Dashboard', () => {
5959
* Validate sorting by the "Timestamp" column works correctly
6060
*/
6161
it('should sort the table by the Timestamp column', () => {
62+
// waiting for the query insights queue to drain
63+
cy.wait(10000);
64+
cy.navigateToOverview();
6265
// Click the Timestamp column header to sort
6366
cy.get('.euiTableHeaderCell').contains('Timestamp').click();
6467
// eslint-disable-next-line jest/valid-expect-in-promise

Diff for: cypress/e2e/3_configurations.cy.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ describe('Query Insights Configurations Page', () => {
9999
it('should allow updating the value of N (count)', () => {
100100
toggleMetricEnabled();
101101
// Locate the input for N
102-
cy.get('input[type="number"]').should('have.attr', 'value', '3'); // Default 3
102+
cy.get('input[type="number"]').should('have.attr', 'value', '10'); // Default 10
103103
// Change the value to 50
104104
cy.get('input[type="number"]').first().clear().type('50').should('have.value', '50');
105105
// Validate invalid input
@@ -114,6 +114,7 @@ describe('Query Insights Configurations Page', () => {
114114
toggleMetricEnabled();
115115
// Validate default values
116116
cy.get('select#timeUnit').should('have.value', 'MINUTES'); // Default unit is "Minute(s)"
117+
cy.get('select#minutes').should('have.value', '5');
117118
// Test valid time unit selection
118119
cy.get('select#timeUnit').select('HOURS').should('have.value', 'HOURS');
119120
cy.get('select#timeUnit').select('MINUTES').should('have.value', 'MINUTES');

Diff for: cypress/e2e/4_group_details.cy.js

+5
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,23 @@
44
*/
55

66
import sampleDocument from '../fixtures/sample_document.json';
7+
import { METRICS } from '../support/constants';
78

89
const indexName = 'sample_index';
910

1011
const clearAll = () => {
1112
cy.deleteIndexByName(indexName);
13+
cy.disableTopQueries(METRICS.LATENCY);
14+
cy.disableTopQueries(METRICS.CPU);
15+
cy.disableTopQueries(METRICS.MEMORY);
1216
cy.disableGrouping();
1317
};
1418

1519
describe('Query Group Details Page', () => {
1620
beforeEach(() => {
1721
clearAll();
1822
cy.createIndexByName(indexName, sampleDocument);
23+
cy.enableTopQueries(METRICS.LATENCY);
1924
cy.enableGrouping();
2025
cy.searchOnIndex(indexName);
2126
cy.searchOnIndex(indexName);

0 commit comments

Comments
 (0)