From 3a00cf20ee5a149c5e50e37fb1aa344b6ac4cc95 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 (cherry picked from commit 57db1eb9a3e4bd72372963a9ceee8c4a153bc13d) --- .../2_trace_analytics_services.spec.js | 4 +--- .../3_trace_analytics_traces.spec.js | 4 +--- .../plugins/observability-dashboards/6_notebooks.spec.js | 7 +++---- .../utils/plugins/observability-dashboards/constants.js | 7 ++----- 4 files changed, 7 insertions(+), 15 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 80bae211c..57ae03624 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 @@ -27,9 +27,7 @@ describe('Testing services table', () => { .first() .focus() .type(`${SERVICE_NAME}{enter}`); - cy.get('[data-test-subj="superDatePickerApplyTimeButton"]', { - timeout: TIMEOUT_DELAY, - }).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 7c0e0b9ef..ab94cd83a 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 @@ -33,9 +33,7 @@ describe('Testing traces table', () => { it('Searches correctly', () => { cy.get('input[type="search"]').focus().type(`${TRACE_ID}{enter}`); - cy.get('[data-test-subj="superDatePickerApplyTimeButton"]', { - timeout: TIMEOUT_DELAY, - }).click(); + cy.get('[data-test-subj="superDatePickerApplyTimeButton"]').click(); cy.contains(' (1)').should('exist'); cy.get('.euiTableCellContent') .eq(11) 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 fd2af0177..11f866752 100644 --- a/cypress/utils/plugins/observability-dashboards/constants.js +++ b/cypress/utils/plugins/observability-dashboards/constants.js @@ -80,11 +80,8 @@ export const setTimeFilter = (setEndTime = false, refresh = true) => { timeout: TIMEOUT_DELAY, }).type('{selectall}' + endTime, { force: true }); } - if (refresh) { - cy.get('[data-test-subj="superDatePickerApplyTimeButton"]', { - timeout: TIMEOUT_DELAY, - }).click(); - } + if (refresh) + cy.get('[data-test-subj="superDatePickerApplyTimeButton"]').click(); cy.wait(delayTime); };