From 2d78b36647f72319935e78b7228ee656b9efb35d Mon Sep 17 00:00:00 2001 From: Maxim Palenov Date: Tue, 15 Oct 2024 15:18:29 +0200 Subject: [PATCH 1/2] clean up external link text in a general way --- .../security_solution_cypress/cypress/screens/rule_details.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/test/security_solution_cypress/cypress/screens/rule_details.ts b/x-pack/test/security_solution_cypress/cypress/screens/rule_details.ts index e5d6711b7d16e..cdd6177468386 100644 --- a/x-pack/test/security_solution_cypress/cypress/screens/rule_details.ts +++ b/x-pack/test/security_solution_cypress/cypress/screens/rule_details.ts @@ -138,7 +138,7 @@ export const TIMELINE_FIELD = (field: string) => { return `[data-test-subj="formatted-field-${field}"]`; }; -export const removeExternalLinkText = (str: string) => str.replace(/\(external[^)]*\)/g, ''); +export const removeExternalLinkText = (str: string) => str.replace(/\([^)]+\)/g, ''); export const DEFINE_RULE_PANEL_PROGRESS = '[data-test-subj="defineRule"] [data-test-subj="stepPanelProgress"]'; From 916a41bcb7d7556a83bbef2bf47a7a9277aad031 Mon Sep 17 00:00:00 2001 From: Maxim Palenov Date: Wed, 16 Oct 2024 08:39:53 +0200 Subject: [PATCH 2/2] make removeExternalLinkText clearing specific text --- .../security_solution_cypress/cypress/screens/rule_details.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x-pack/test/security_solution_cypress/cypress/screens/rule_details.ts b/x-pack/test/security_solution_cypress/cypress/screens/rule_details.ts index cdd6177468386..f6436249a53c8 100644 --- a/x-pack/test/security_solution_cypress/cypress/screens/rule_details.ts +++ b/x-pack/test/security_solution_cypress/cypress/screens/rule_details.ts @@ -138,7 +138,8 @@ export const TIMELINE_FIELD = (field: string) => { return `[data-test-subj="formatted-field-${field}"]`; }; -export const removeExternalLinkText = (str: string) => str.replace(/\([^)]+\)/g, ''); +export const removeExternalLinkText = (str: string) => + str.replace(/\([^)]*(opens in a new tab or window)[^)]*\)/g, ''); export const DEFINE_RULE_PANEL_PROGRESS = '[data-test-subj="defineRule"] [data-test-subj="stepPanelProgress"]';