Skip to content

Commit

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

Signed-off-by: Ritvi Bhatt <[email protected]>

* move intercepts earlier

Signed-off-by: Ritvi Bhatt <[email protected]>

* wait for query to load before visualizing data

Signed-off-by: Ritvi Bhatt <[email protected]>

* wait for table to load before clicking trace

Signed-off-by: Ritvi Bhatt <[email protected]>

---------

Signed-off-by: Ritvi Bhatt <[email protected]>
Co-authored-by: Ritvi Bhatt <[email protected]>
Co-authored-by: Adam Tackett <[email protected]>
(cherry picked from commit 6f67c50)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
3 people committed Dec 17, 2024
1 parent 2f8b27f commit 49b3e93
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
@@ -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');
Original file line number Diff line number Diff line change
@@ -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"]')
Original file line number Diff line number Diff line change
@@ -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');
});
1 change: 1 addition & 0 deletions .cypress/utils/app_constants.js
Original file line number Diff line number Diff line change
@@ -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();

0 comments on commit 49b3e93

Please sign in to comment.