Skip to content

Commit 09ec8a3

Browse files
opensearch-trigger-bot[bot]github-actions[bot]Ritvi BhattTackAdam
authored
Fix flaky cypress tests (#2293) (#2296)
* 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]>
1 parent fab522a commit 09ec8a3

File tree

4 files changed

+5
-2
lines changed

4 files changed

+5
-2
lines changed

.cypress/integration/app_analytics_test/app_analytics.spec.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -433,13 +433,13 @@ describe('Viewing application', () => {
433433

434434

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

441442
moveToHomePage();
442-
cy.intercept('GET', `**/api/observability/operational_panels/panels/**`).as('loadingPanels')
443443
cy.wait('@loadingPanels');
444444
cy.reload();
445445
cy.get('[data-test-subj="AvailableAvailabilityBadge"][style="background-color: rgb(84, 179, 153); color: rgb(0, 0, 0);"]').should('contain', 'Available');

.cypress/integration/event_analytics_test/event_analytics.spec.js

+1
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,7 @@ describe('Visualizing data', () => {
479479
});
480480

481481
it('Visualize vertical bar chart', () => {
482+
cy.get('[data-test-subj="globalLoadingIndicator"]').should('not.exist');
482483
cy.get('[data-test-subj="comboBoxInput"]').eq(1).click();
483484
cy.get('[data-test-subj="comboBoxOptionsList "] span').contains(VIS_TYPE_VBAR).click();
484485
cy.get('[data-test-subj="vizConfigSection-series"]')

.cypress/integration/trace_analytics_test/trace_analytics_traces.spec.js

+1
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ describe('Testing traces tree view', () => {
164164
cy.get("[data-test-subj='indexPattern-switch-link']").click();
165165
cy.get("[data-test-subj='data_prepper-mode']").click();
166166
setTimeFilter();
167+
cy.get('[data-test-subj="globalLoadingIndicator"]').should('not.exist');
167168
cy.contains('02feb3a4f611abd81f2a53244d1278ae').click();
168169
cy.get('h1.overview-content').contains('02feb3a4f611abd81f2a53244d1278ae').should('exist');
169170
});

.cypress/utils/app_constants.js

+1
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ export const moveToEditPage = () => {
136136

137137
export const changeTimeTo24 = (timeUnit) => {
138138
cy.get('[data-test-subj="superDatePickerToggleQuickMenuButton"]').trigger('mouseover').click({ force: true });
139+
cy.get('[aria-label="Time value"]').type('{selectall}24');
139140
cy.get('[aria-label="Time unit"]').select(timeUnit);
140141
cy.get('.euiButton').contains('Apply').click();
141142
cy.get('[data-test-subj="superDatePickerApplyTimeButton"]').click();

0 commit comments

Comments
 (0)