From 3c70bbd1c0c67ecccaa9789c6e70d6c3797e53d6 Mon Sep 17 00:00:00 2001 From: sumukhswamy Date: Tue, 29 Oct 2024 14:21:46 -0700 Subject: [PATCH] updated traces and services tests with new refresh button Signed-off-by: sumukhswamy --- .../2_trace_analytics_services.spec.js | 7 +++++-- .../3_trace_analytics_traces.spec.js | 6 ++++-- .../utils/plugins/observability-dashboards/constants.js | 7 +++++-- 3 files changed, 14 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 845fa7348..a2433f7fb 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,7 @@ /// -import { setTimeFilter, TRACE_ID } from '../../../utils/constants'; +import { setTimeFilter, TRACE_ID, TIMEOUT_DELAY} from '../../../utils/constants'; describe('Testing traces table', () => { beforeEach(() => { @@ -25,7 +25,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.contains('03/25/2021 10:21:22').should('exist'); }); diff --git a/cypress/utils/plugins/observability-dashboards/constants.js b/cypress/utils/plugins/observability-dashboards/constants.js index 99e2b5c90..777c4b6c6 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(); };