From 5b5d5e926d2b5b6d96304cd0ed18e3ed25d55333 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Fri, 25 Oct 2024 13:23:58 -0700 Subject: [PATCH] Update alerting dashboard tests (#1578) (#1604) Signed-off-by: Joanne Wang (cherry picked from commit 884fdb51f16d6e3ec3a56e59e7f89b6ad918ad8d) Co-authored-by: Joanne Wang --- .../bucket_level_monitor_spec.js | 8 ++++---- .../cluster_metrics_monitor_spec.js | 4 ++-- .../composite_level_monitor_spec.js | 3 ++- .../document_level_monitor_spec.js | 12 ++++++------ .../query_level_monitor_spec.js | 12 ++++++------ 5 files changed, 20 insertions(+), 19 deletions(-) diff --git a/cypress/integration/plugins/alerting-dashboards-plugin/bucket_level_monitor_spec.js b/cypress/integration/plugins/alerting-dashboards-plugin/bucket_level_monitor_spec.js index 1c32a04ac..d36d0fbb3 100644 --- a/cypress/integration/plugins/alerting-dashboards-plugin/bucket_level_monitor_spec.js +++ b/cypress/integration/plugins/alerting-dashboards-plugin/bucket_level_monitor_spec.js @@ -326,8 +326,8 @@ describe('Bucket-Level Monitors', () => { // Add a trigger addTriggerToVisualEditorMonitor(SAMPLE_TRIGGER, 0, SAMPLE_ACTION, true); - // Click update button to save monitor changes - cy.get('button').contains('Update').last().click({ force: true }); + // Click save button to save monitor changes + cy.get('button').contains('Save').last().click({ force: true }); // Confirm we can see only one row in the trigger list by checking element cy.contains('This table contains 1 row'); @@ -367,8 +367,8 @@ describe('Bucket-Level Monitors', () => { timeout: ALERTING_PLUGIN_TIMEOUT, }); - // Click the update button - cy.get('button').contains('Update').last().click({ force: true }); + // Click the save button + cy.get('button').contains('Save').last().click({ force: true }); // Confirm we're on the Monitor Details page by searching for the History element cy.contains('History', { timeout: ALERTING_PLUGIN_TIMEOUT }); diff --git a/cypress/integration/plugins/alerting-dashboards-plugin/cluster_metrics_monitor_spec.js b/cypress/integration/plugins/alerting-dashboards-plugin/cluster_metrics_monitor_spec.js index 944df9127..125979012 100644 --- a/cypress/integration/plugins/alerting-dashboards-plugin/cluster_metrics_monitor_spec.js +++ b/cypress/integration/plugins/alerting-dashboards-plugin/cluster_metrics_monitor_spec.js @@ -442,8 +442,8 @@ describe('ClusterMetricsMonitor', () => { 'ctx.results[0].number_of_pending_tasks >= 0' ); - // Click update button to save monitor changes - cy.get('button').contains('Update').last().click({ force: true }); + // Click save button to save monitor changes + cy.get('button').contains('Save').last().click({ force: true }); // Confirm we can see only one row in the trigger list by checking element cy.contains('This table contains 1 row'); diff --git a/cypress/integration/plugins/alerting-dashboards-plugin/composite_level_monitor_spec.js b/cypress/integration/plugins/alerting-dashboards-plugin/composite_level_monitor_spec.js index e06a68ff8..697e1ac5a 100644 --- a/cypress/integration/plugins/alerting-dashboards-plugin/composite_level_monitor_spec.js +++ b/cypress/integration/plugins/alerting-dashboards-plugin/composite_level_monitor_spec.js @@ -169,6 +169,7 @@ describe('CompositeLevelMonitor', () => { it('by visual editor', () => { // Verify edit page + cy.contains('Edit').click({ force: true }); cy.contains('Edit monitor', { timeout: ALERTING_PLUGIN_TIMEOUT }); cy.get('input[name="name"]').type('_edited'); @@ -198,7 +199,7 @@ describe('CompositeLevelMonitor', () => { 'updateMonitorRequest', 'PUT' ); - cy.get('button').contains('Update').click({ force: true }); + cy.get('button').contains('Save').click({ force: true }); // Wait for monitor to be created cy.wait('@updateMonitorRequest').then(() => { diff --git a/cypress/integration/plugins/alerting-dashboards-plugin/document_level_monitor_spec.js b/cypress/integration/plugins/alerting-dashboards-plugin/document_level_monitor_spec.js index 9d4e90f1f..cd3d60803 100644 --- a/cypress/integration/plugins/alerting-dashboards-plugin/document_level_monitor_spec.js +++ b/cypress/integration/plugins/alerting-dashboards-plugin/document_level_monitor_spec.js @@ -432,8 +432,8 @@ describe('DocumentLevelMonitor', () => { // TODO: Test with Notifications plugin - // Click the update button - cy.get('button').contains('Update').last().click({ force: true }); + // Click the save button + cy.get('button').contains('Save').last().click({ force: true }); // Confirm we can see only one row in the trigger list by checking element cy.contains('This table contains 2 rows'); @@ -512,8 +512,8 @@ describe('DocumentLevelMonitor', () => { // TODO: Test with Notifications plugin - // Click the create button - cy.get('button').contains('Update').last().click({ force: true }); + // Click the save button + cy.get('button').contains('Save').last().click({ force: true }); // Confirm we can see only one row in the trigger list by checking element cy.contains('This table contains 1 row'); @@ -569,8 +569,8 @@ describe('DocumentLevelMonitor', () => { timeout: ALERTING_PLUGIN_TIMEOUT, }); - // Click the update button - cy.get('button').contains('Update').last().click({ force: true }); + // Click the save button + cy.get('button').contains('Save').last().click({ force: true }); // Confirm we're on the Monitor Details page by searching for the History element cy.contains('History', { timeout: ALERTING_PLUGIN_TIMEOUT }); diff --git a/cypress/integration/plugins/alerting-dashboards-plugin/query_level_monitor_spec.js b/cypress/integration/plugins/alerting-dashboards-plugin/query_level_monitor_spec.js index f7521728f..9ca152d24 100644 --- a/cypress/integration/plugins/alerting-dashboards-plugin/query_level_monitor_spec.js +++ b/cypress/integration/plugins/alerting-dashboards-plugin/query_level_monitor_spec.js @@ -187,8 +187,8 @@ describe('Query-Level Monitors', () => { .clear() .type(UPDATED_MONITOR, { force: true }); - // Click Update button - cy.get('button').contains('Update').last().click({ force: true }); + // Click save button + cy.get('button').contains('Save').last().click({ force: true }); // Confirm the update process is done and the page loaded cy.contains('Edit monitor'); @@ -234,8 +234,8 @@ describe('Query-Level Monitors', () => { timeout: ALERTING_PLUGIN_TIMEOUT, }); - // Click the update button - cy.get('button').contains('Update').last().click({ force: true }); + // Click the save button + cy.get('button').contains('Save').last().click({ force: true }); // Confirm we're on the Monitor Details page by searching for the History element cy.contains('History', { timeout: ALERTING_PLUGIN_TIMEOUT }); @@ -368,8 +368,8 @@ describe('Query-Level Monitors', () => { ); } - // Click Update button - cy.get('button').contains('Update').last().click({ force: true }); + // Click save button + cy.get('button').contains('Save').last().click({ force: true }); // Confirm we can see the correct number of rows in the trigger list by checking element cy.contains(`This table contains ${triggers.length} rows`, {