Skip to content
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

[Backport 2.x] Fix flaky cypress tests #2296

Merged
merged 1 commit into from
Dec 17, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,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 205 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 @@ -279,8 +279,8 @@
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 282 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 283 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 Down Expand Up @@ -360,7 +360,7 @@
cy.get('.euiTab[id="availability-panel"]').click();

cy.get('[data-test-subj="comboBoxInput"]').click();
cy.get('[data-test-subj="comboBoxOptionsList "] button span').contains('Time series').click({ force: true });

Check warning on line 363 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.focused().type('{enter}');

cy.get('[data-test-subj="addAvailabilityButton"]').click();
Expand Down Expand Up @@ -398,7 +398,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').contains('Time series').click({ force: true });

Check warning on line 401 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="addAvailabilityButton"]').click();
cy.get('[data-test-subj="euiColorPickerAnchor"]').click();
cy.get('[aria-label="Select #9170B8 as the color"]').click();
Expand Down Expand Up @@ -433,13 +433,13 @@


it('Changes availability visualization', () => {
cy.intercept('PUT', `**/api/observability/application`).as('selectUpdate');
cy.intercept('GET', `**/api/observability/operational_panels/panels/**`).as('loadingPanels')
cy.get('[data-test-subj="app-analytics-configTab"]').click();
cy.get('select').select(visOneName);
cy.intercept('PUT', `**/api/observability/application`).as('selectUpdate');
cy.wait('@selectUpdate');

moveToHomePage();
cy.intercept('GET', `**/api/observability/operational_panels/panels/**`).as('loadingPanels')
cy.wait('@loadingPanels');
cy.reload();
cy.get('[data-test-subj="AvailableAvailabilityBadge"][style="background-color: rgb(84, 179, 153); color: rgb(0, 0, 0);"]').should('contain', 'Available');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,10 @@
cy.get('button[id="main-content-vis"]').contains('Visualizations').click();
cy.get('[data-test-subj="eventExplorer__saveManagementPopover"]').click();
cy.get('[data-test-subj="comboBoxToggleListButton"]').eq(2).click();
cy.get('[data-test-subj="eventExplorer__querySaveName"]')

Check warning on line 202 in .cypress/integration/event_analytics_test/event_analytics.spec.js

View workflow job for this annotation

GitHub Actions / Lint

Do not use force on click and type calls
.focus()
.type(SAVE_QUERY2, { force: true });
cy.get('[data-test-subj="eventExplorer__querySaveConfirm"]').click({ force: true });

Check warning on line 205 in .cypress/integration/event_analytics_test/event_analytics.spec.js

View workflow job for this annotation

GitHub Actions / Lint

Do not use force on click and type calls
cy.get('.euiToastHeader__title').contains('successfully').should('exist');
landOnEventHome();
cy.get('.euiFieldSearch').type(SAVE_QUERY2);
Expand All @@ -222,12 +222,12 @@
.contains('Visualizations')
.click();
cy.get('[data-test-subj="eventExplorer__saveManagementPopover"]').click();
cy.get('[data-test-subj="eventExplorer__querySaveName"]')

Check warning on line 225 in .cypress/integration/event_analytics_test/event_analytics.spec.js

View workflow job for this annotation

GitHub Actions / Lint

Do not use force on click and type calls
.focus()
.type(SAVE_QUERY3, { force: true });
cy.get('[data-test-subj="eventExplorer__querySaveComboBox"]').type(TESTING_PANEL);
cy.get(`input[value="${TESTING_PANEL}"]`).click();
cy.get('[data-test-subj="eventExplorer__querySaveConfirm"]').click({ force: true });

Check warning on line 230 in .cypress/integration/event_analytics_test/event_analytics.spec.js

View workflow job for this annotation

GitHub Actions / Lint

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

Expand Down Expand Up @@ -282,7 +282,7 @@
cy.get('[data-test-subj="searchAutocompleteTextArea"]').type(TEST_QUERIES[2].query);
cy.get('[data-test-subj="superDatePickerApplyTimeButton"]').click();
cy.get('.tab-title').contains('Events').click();
cy.get('[data-test-subj="eventExplorer__overrideDefaultTimestamp"]').click({ force: true });

Check warning on line 285 in .cypress/integration/event_analytics_test/event_analytics.spec.js

View workflow job for this annotation

GitHub Actions / Lint

Do not use force on click and type calls

cy.get('[data-attr-field="utc_time"] [data-test-subj="eventFields__default-timestamp-mark"')
.contains('Default Timestamp')
Expand Down Expand Up @@ -479,6 +479,7 @@
});

it('Visualize vertical bar chart', () => {
cy.get('[data-test-subj="globalLoadingIndicator"]').should('not.exist');
cy.get('[data-test-subj="comboBoxInput"]').eq(1).click();
cy.get('[data-test-subj="comboBoxOptionsList "] span').contains(VIS_TYPE_VBAR).click();
cy.get('[data-test-subj="vizConfigSection-series"]')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ describe('Testing traces tree view', () => {
cy.get("[data-test-subj='indexPattern-switch-link']").click();
cy.get("[data-test-subj='data_prepper-mode']").click();
setTimeFilter();
cy.get('[data-test-subj="globalLoadingIndicator"]').should('not.exist');
cy.contains('02feb3a4f611abd81f2a53244d1278ae').click();
cy.get('h1.overview-content').contains('02feb3a4f611abd81f2a53244d1278ae').should('exist');
});
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 @@ -136,6 +136,7 @@ export const moveToEditPage = () => {

export const changeTimeTo24 = (timeUnit) => {
cy.get('[data-test-subj="superDatePickerToggleQuickMenuButton"]').trigger('mouseover').click({ force: true });
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();
Expand Down
Loading