From 57db1eb9a3e4bd72372963a9ceee8c4a153bc13d Mon Sep 17 00:00:00 2001 From: ritvibhatt <53196324+ritvibhatt@users.noreply.github.com> Date: Tue, 14 Jan 2025 16:22:29 -0800 Subject: [PATCH] Update observability dashboards tests (#1669) * update observability dashboards tests Signed-off-by: Ritvi Bhatt * fix notebook delete Signed-off-by: Ritvi Bhatt * skip reporting tests Signed-off-by: Ritvi Bhatt * add back reporting tests Signed-off-by: Ritvi Bhatt * skip last reporting tests Signed-off-by: Ritvi Bhatt * move notebook alias earlier Signed-off-by: Ritvi Bhatt * skip last reporting tests Signed-off-by: Ritvi Bhatt * add back reporting tests Signed-off-by: Ritvi Bhatt * stop tests Signed-off-by: Ritvi Bhatt * add back reporting tests Signed-off-by: Ritvi Bhatt * skip reporting tests Signed-off-by: Ritvi Bhatt * add back reporting tests Signed-off-by: Ritvi Bhatt --------- Signed-off-by: Ritvi Bhatt Co-authored-by: Ritvi Bhatt --- .../2_trace_analytics_services.spec.js | 2 +- .../3_trace_analytics_traces.spec.js | 2 +- .../plugins/observability-dashboards/6_notebooks.spec.js | 7 +++---- .../utils/plugins/observability-dashboards/constants.js | 7 +++---- 4 files changed, 8 insertions(+), 10 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..fe30aec90 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 @@ -26,7 +26,7 @@ describe('Testing services table', () => { .first() .focus() .type(`${SERVICE_NAME}{enter}`); - cy.get('.euiButton__text').contains('Refresh').click(); + cy.get('[data-test-subj="superDatePickerApplyTimeButton"]').click(); cy.contains(' (1)').should('exist'); }); 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..9b4459504 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 @@ -25,7 +25,7 @@ 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"]').click(); cy.contains(' (1)').should('exist'); cy.contains('03/25/2021 10:21:22').should('exist'); }); diff --git a/cypress/integration/plugins/observability-dashboards/6_notebooks.spec.js b/cypress/integration/plugins/observability-dashboards/6_notebooks.spec.js index c4f0bd896..99efd8245 100644 --- a/cypress/integration/plugins/observability-dashboards/6_notebooks.spec.js +++ b/cypress/integration/plugins/observability-dashboards/6_notebooks.spec.js @@ -34,7 +34,7 @@ const makeTestNotebook = () => { cy.contains(`Notebook "${notebookName}" successfully created`); - cy.get('h1[data-test-subj="notebookTitle"]') + cy.get('[data-test-subj="notebookTitle"]') .contains(notebookName) .should('exist'); @@ -61,8 +61,7 @@ const deleteNotebook = (notebookName) => { .find('input[type="checkbox"]') .check(); - cy.get('button[data-test-subj="notebookTableActionBtn"]').click(); - cy.get('button[data-test-subj="deleteNotebookBtn"]').click(); + cy.get('[data-test-subj="deleteSelectedNotebooks"]').click(); cy.get('input[data-test-subj="delete-notebook-modal-input"]').focus(); cy.get('input[data-test-subj="delete-notebook-modal-input"]').type('delete'); @@ -110,11 +109,11 @@ describe('Testing notebook actions', () => { describe('Test reporting integration if plugin installed', () => { beforeEach(() => { let notebookName = makeTestNotebook(); + cy.wrap({ name: notebookName }).as('notebook'); cy.get('body').then(($body) => { skipOn($body.find('#reportingActionsButton').length <= 0); }); makePopulatedParagraph(); - cy.wrap({ name: notebookName }).as('notebook'); }); afterEach(() => { diff --git a/cypress/utils/plugins/observability-dashboards/constants.js b/cypress/utils/plugins/observability-dashboards/constants.js index 99e2b5c90..e6c9a2d16 100644 --- a/cypress/utils/plugins/observability-dashboards/constants.js +++ b/cypress/utils/plugins/observability-dashboards/constants.js @@ -80,7 +80,8 @@ 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"]').click(); cy.wait(delayTime); }; @@ -171,9 +172,7 @@ export const querySearch = (query, rangeSelected) => { cy.get(rangeSelected).click(); cy.get('[data-test-subj="superDatePickerApplyTimeButton"]', { timeout: TIMEOUT_DELAY, - }) - .contains('Refresh') - .click(); + }).click(); }; export const landOnEventHome = () => {