From 86599cfb1bc08cfb45d351f32c19c875a70caf83 Mon Sep 17 00:00:00 2001 From: AWSHurneyt Date: Thu, 1 Aug 2024 17:58:46 -0700 Subject: [PATCH] Fixed alerting cypress tests. (#1451) Signed-off-by: AWSHurneyt Co-authored-by: SuZhou-Joe --- .../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}`,