From b836950eb7f8dd614924b70c6fa611a507e51887 Mon Sep 17 00:00:00 2001 From: AWSHurneyt Date: Mon, 29 Jul 2024 17:46:06 -0700 Subject: [PATCH] Fixed alerting cypress tests. Signed-off-by: AWSHurneyt --- .../bucket_level_monitor_spec.js | 5 +++++ .../query_level_monitor_spec.js | 10 ++++++++++ 2 files changed, 15 insertions(+) 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 8e9037841..7bdcd8027 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 @@ -343,6 +343,11 @@ describe('Bucket-Level Monitors', () => { // Click Edit button cy.contains('Edit').click({ force: true }); + // Wait for page to load + // The default admin user for a docker-created domain doesn't have the permissions needed to select clusters. Disabling this check when security is enabled + if (!Cypress.env('SECURITY_ENABLED')) + cy.contains('Select clusters').click({ force: true }); + // Click on the Index field and type in multiple index names to replicate the bug cy.get('#index') .click({ force: true }) 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 52e9c5849..bd4415f54 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 @@ -211,6 +211,11 @@ describe('Query-Level Monitors', () => { force: true, }); + // Wait for page to load + // The default admin user for a docker-created domain doesn't have the permissions needed to select clusters. Disabling this check when security is enabled + if (!Cypress.env('SECURITY_ENABLED')) + cy.contains('Select clusters').click({ force: true }); + // Click on the Index field and type in multiple index names to replicate the bug cy.get('#index') .click({ force: true }) @@ -336,6 +341,11 @@ describe('Query-Level Monitors', () => { // Select visual editor cy.get('[data-test-subj="visualEditorRadioCard"]').click({ force: true }); + // Wait for page to load + // The default admin user for a docker-created domain doesn't have the permissions needed to select clusters. Disabling this check when security is enabled + if (!Cypress.env('SECURITY_ENABLED')) + cy.contains('Select clusters').click({ force: true }); + // Wait for input to load and then type in the index name cy.get('#index').type( `{backspace}${ALERTING_INDEX.SAMPLE_DATA_ECOMMERCE}{enter}`,