Skip to content

Application Analytics - Flaky cypress fix #2402

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .cypress/integration/app_analytics_test/app_analytics.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@
cy.get('[data-test-subj="searchAutocompleteTextArea"]').click();
cy.focused().type(' source = ');
cy.focused().type('{enter}');
cy.get('[data-test-subj="createAndSetButton"]').click({ force: true });

Check warning on line 224 in .cypress/integration/app_analytics_test/app_analytics.spec.js

View workflow job for this annotation

GitHub Actions / Lint

Do not use force on click and type calls
cy.get('.euiTableRow').should('have.length.lessThan', 1);
cy.get('[data-test-subj="applicationTitle"]').should('contain', nameThree);
cy.get('.euiBreadcrumb[href="#/"]').click();
Expand Down Expand Up @@ -303,13 +303,14 @@

it('Opens service detail flyout when Service Name is clicked', () => {
cy.get('[data-test-subj="app-analytics-serviceTab"]').click();
cy.get('[data-test-subj="globalLoadingIndicator"]').should('not.exist');
cy.get('*[data-test-subj^="service-link"]').eq(0).click();
cy.get('[data-test-subj="serviceDetailFlyoutTitle"]').should('be.visible');
cy.get('[data-test-subj="Number of connected servicesDescriptionList"]').should('contain', '3');
cy.get('[data-text="Errors"]').eq(1).click(); // Selecting errors tab within flyout
cy.get('.ytitle').contains('Error rate').should('exist');
cy.get('[data-test-subj="dataGridRowCell"]').eq(0).click({ force: true }); // absolutely doesn't click no matter what unless theres a double click

Check warning on line 312 in .cypress/integration/app_analytics_test/app_analytics.spec.js

View workflow job for this annotation

GitHub Actions / Lint

Do not use force on click and type calls
cy.get('button[data-test-subj="spanId-link"]').eq(0).click({ force: true });

Check warning on line 313 in .cypress/integration/app_analytics_test/app_analytics.spec.js

View workflow job for this annotation

GitHub Actions / Lint

Do not use force on click and type calls
cy.get('[data-test-subj="spanDetailFlyout"]').contains('Span detail').should('be.visible');
cy.get('[data-test-subj="ServiceDescriptionList"]').should('contain', 'authentication');
cy.get('[data-test-subj="euiFlyoutCloseButton"]').click();
Expand All @@ -319,6 +320,7 @@

it('Opens trace detail flyout when Trace ID is clicked', () => {
cy.get('[data-test-subj="app-analytics-traceTab"]').click();
cy.get('[data-test-subj="globalLoadingIndicator"]').should('not.exist');
cy.get('[title="03f9c770db5ee2f1caac0afc36db49ba"]').click();
cy.get('[data-test-subj="traceDetailFlyoutTitle"]').should('be.visible');
cy.get('[data-test-subj="traceDetailFlyout"]').within(($flyout) => {
Expand All @@ -339,6 +341,7 @@

it('Opens span detail flyout when Span ID is clicked', () => {
cy.get('[data-test-subj="app-analytics-traceTab"]').click();
cy.get('[data-test-subj="globalLoadingIndicator"]').should('not.exist');
cy.get('input[type="search"]').click().type(`5ff3516909562c60`);
cy.get('[data-test-subj="globalLoadingIndicator"]').should('not.exist');
cy.get('[data-test-subj="dataGridRowCell"]').contains('5ff3516909562c60').click();
Expand Down Expand Up @@ -397,7 +400,7 @@
cy.get('.euiTab[id="availability-panel"]').click();

cy.get('[data-test-subj="comboBoxInput"]').click();
cy.get('[data-test-subj="comboBoxOptionsList "] button span')

Check warning on line 403 in .cypress/integration/app_analytics_test/app_analytics.spec.js

View workflow job for this annotation

GitHub Actions / Lint

Do not use force on click and type calls
.contains('Time series')
.click({ force: true });
cy.focused().type('{enter}');
Expand Down Expand Up @@ -432,6 +435,7 @@
changeTimeTo24('months');
cy.get('[data-test-subj="app-analytics-logTab"]').click();
cy.get('[data-test-subj="superDatePickerApplyTimeButton"]').click();
cy.get('[data-test-subj="globalLoadingIndicator"]').should('not.exist');
cy.get('[id="explorerPlotComponent"]', { timeout: timeoutDelay }).should('exist');
cy.get('[data-test-subj="searchAutocompleteTextArea"]').focus();
cy.get('[data-test-subj="searchAutocompleteTextArea"]').type(' ' + query_two, {
Expand All @@ -441,7 +445,7 @@
cy.get('[data-test-subj="main-content-visTab"]').click();
cy.get('.euiTab[id="availability-panel"]').click();
cy.get('[data-test-subj="comboBoxInput"]').click();
cy.get('[data-test-subj="comboBoxOptionsList "] button span')

Check warning on line 448 in .cypress/integration/app_analytics_test/app_analytics.spec.js

View workflow job for this annotation

GitHub Actions / Lint

Do not use force on click and type calls
.contains('Time series')
.click({ force: true });
cy.get('[data-test-subj="addAvailabilityButton"]').click();
Expand Down
1 change: 1 addition & 0 deletions .cypress/utils/app_constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
cy.visit(`${Cypress.env('opensearchDashboards')}/app/home#/tutorial_directory`);

// Load sample flights data
cy.get(`button[data-test-subj="addSampleDataSetflights"]`).click({

Check warning on line 34 in .cypress/utils/app_constants.js

View workflow job for this annotation

GitHub Actions / Lint

Do not use force on click and type calls
force: true,
});
// Load sample logs data
cy.get(`button[data-test-subj="addSampleDataSetlogs"]`).click({

Check warning on line 38 in .cypress/utils/app_constants.js

View workflow job for this annotation

GitHub Actions / Lint

Do not use force on click and type calls
force: true,
});

Expand Down Expand Up @@ -135,15 +135,16 @@
};

export const changeTimeTo24 = (timeUnit) => {
cy.get('[data-test-subj="superDatePickerToggleQuickMenuButton"]').trigger('mouseover').click({ force: true });

Check warning on line 138 in .cypress/utils/app_constants.js

View workflow job for this annotation

GitHub Actions / Lint

Do not use force on click and type calls
cy.get('[aria-label="Time value"]').type('{selectall}24');
cy.get('[aria-label="Time unit"]').select(timeUnit);
cy.get('.euiButton').contains('Apply').click();
cy.get('[data-test-subj="superDatePickerApplyTimeButton"]').click();
cy.get('[data-test-subj="globalLoadingIndicator"]').should('not.exist');
};

export const expectMessageOnHover = (button, message) => {
cy.get(`[data-test-subj="${button}"]`).click({ force: true });

Check warning on line 147 in .cypress/utils/app_constants.js

View workflow job for this annotation

GitHub Actions / Lint

Do not use force on click and type calls
cy.get('.euiToolTipPopover').contains(message).should('exist');
};

Expand Down
Loading