From 9d48e8a4446bd726b4d6e79c2a1a126030fd464e Mon Sep 17 00:00:00 2001 From: Shenoy Pratik Date: Tue, 29 Oct 2024 14:59:33 -0700 Subject: [PATCH] [Bug]updated traces and services tests with new refresh button Signed-off-by: Shenoy Pratik Co-authored-by: sumukhswamy --- .../2_trace_analytics_services.spec.js | 7 +++++-- .../3_trace_analytics_traces.spec.js | 10 ++++++++-- .../plugins/observability-dashboards/constants.js | 7 +++++-- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/cypress/integration/plugins/observability-dashboards/2_trace_analytics_services.spec.js b/cypress/integration/plugins/observability-dashboards/2_trace_analytics_services.spec.js index 7ad693834..99c6c5c8e 100644 --- a/cypress/integration/plugins/observability-dashboards/2_trace_analytics_services.spec.js +++ b/cypress/integration/plugins/observability-dashboards/2_trace_analytics_services.spec.js @@ -9,6 +9,7 @@ import { SERVICE_NAME, setTimeFilter, delayTime, + TIMEOUT_DELAY } from '../../../utils/constants'; describe('Testing services table', () => { @@ -26,8 +27,10 @@ describe('Testing services table', () => { .first() .focus() .type(`${SERVICE_NAME}{enter}`); - cy.get('.euiButton__text').contains('Refresh').click(); - cy.contains(' (1)').should('exist'); + cy.get('[data-test-subj="superDatePickerApplyTimeButton"]', { + timeout: TIMEOUT_DELAY, + }).click(); + cy.contains(' (1)').should('exist'); }); it('Opens service flyout', () => { diff --git a/cypress/integration/plugins/observability-dashboards/3_trace_analytics_traces.spec.js b/cypress/integration/plugins/observability-dashboards/3_trace_analytics_traces.spec.js index ed67df8dc..7371f5b71 100644 --- a/cypress/integration/plugins/observability-dashboards/3_trace_analytics_traces.spec.js +++ b/cypress/integration/plugins/observability-dashboards/3_trace_analytics_traces.spec.js @@ -5,7 +5,11 @@ /// -import { setTimeFilter, TRACE_ID } from '../../../utils/constants'; +import { + setTimeFilter, + TRACE_ID, + TIMEOUT_DELAY, +} from '../../../utils/constants'; import customParseFormat from 'dayjs/plugin/customParseFormat'; import dayjs from 'dayjs'; @@ -29,7 +33,9 @@ describe('Testing traces table', () => { it('Searches correctly', () => { cy.get('input[type="search"]').focus().type(`${TRACE_ID}{enter}`); - cy.get('.euiButton__text').contains('Refresh').click(); + cy.get('[data-test-subj="superDatePickerApplyTimeButton"]', { + timeout: TIMEOUT_DELAY, + }).click(); cy.contains(' (1)').should('exist'); cy.get('.euiTableCellContent') .eq(11) diff --git a/cypress/utils/plugins/observability-dashboards/constants.js b/cypress/utils/plugins/observability-dashboards/constants.js index f5fa4c532..380a28790 100644 --- a/cypress/utils/plugins/observability-dashboards/constants.js +++ b/cypress/utils/plugins/observability-dashboards/constants.js @@ -80,7 +80,11 @@ export const setTimeFilter = (setEndTime = false, refresh = true) => { timeout: TIMEOUT_DELAY, }).type('{selectall}' + endTime, { force: true }); } - if (refresh) cy.get('.euiButton__text').contains('Refresh').click(); + if (refresh){ + cy.get('[data-test-subj="superDatePickerApplyTimeButton"]', { + timeout: TIMEOUT_DELAY, + }).click(); + } cy.wait(delayTime); }; @@ -172,7 +176,6 @@ export const querySearch = (query, rangeSelected) => { cy.get('[data-test-subj="superDatePickerApplyTimeButton"]', { timeout: TIMEOUT_DELAY, }) - .contains('Refresh') .click(); };