Skip to content

Commit

Permalink
Fix flaky cypress tests (#2293) (#2296)
Browse files Browse the repository at this point in the history
* change time value to 24 when setting time



* move intercepts earlier



* wait for query to load before visualizing data



* wait for table to load before clicking trace



---------




(cherry picked from commit 6f67c50)

Signed-off-by: Ritvi Bhatt <[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>
Co-authored-by: Ritvi Bhatt <[email protected]>
Co-authored-by: Adam Tackett <[email protected]>
  • Loading branch information
4 people authored Dec 17, 2024
1 parent fab522a commit 09ec8a3
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .cypress/integration/app_analytics_test/app_analytics.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -433,13 +433,13 @@ describe('Viewing application', () => {


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 @@ -479,6 +479,7 @@ describe('Visualizing data', () => {
});

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

0 comments on commit 09ec8a3

Please sign in to comment.