From 94992f51135572d60c3f43b1ee6ff6eac85432ab Mon Sep 17 00:00:00 2001 From: Faisal Kanout Date: Wed, 11 May 2022 13:25:07 +0200 Subject: [PATCH] Use and the data test subj for ui triggersAction UI --- .../sections/rules_list/components/rule_status_dropdown.tsx | 2 ++ .../functional/services/observability/alerts/rules_page.ts | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rule_status_dropdown.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rule_status_dropdown.tsx index 40658ae282e16..90a42bd4fe21c 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rule_status_dropdown.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rule_status_dropdown.tsx @@ -292,11 +292,13 @@ const RuleStatusMenu: React.FunctionComponent = ({ name: ENABLED, icon: isEnabled && !isSnoozed ? 'check' : 'empty', onClick: enableRule, + 'data-test-subj': 'statusDropdownEnabledItem', }, { name: DISABLED, icon: !isEnabled ? 'check' : 'empty', onClick: disableRule, + 'data-test-subj': 'statusDropdownDisabledItem', }, { name: snoozeButtonTitle, diff --git a/x-pack/test/functional/services/observability/alerts/rules_page.ts b/x-pack/test/functional/services/observability/alerts/rules_page.ts index d23ab158c6bec..e61ee0d2bcf9a 100644 --- a/x-pack/test/functional/services/observability/alerts/rules_page.ts +++ b/x-pack/test/functional/services/observability/alerts/rules_page.ts @@ -20,10 +20,9 @@ export function ObservabilityAlertsRulesProvider({ getService }: FtrProviderCont return createRuleButton.click(); }; - const clickRuleStatusDropDownMenu = async () => testSubjects.click('statusContextButton'); + const clickRuleStatusDropDownMenu = async () => testSubjects.click('statusDropdown'); - const clickDisableFromDropDownMenu = async () => - find.clickByCssSelector('div.euiContextMenuPanel > div > div > button:nth-child(2)'); + const clickDisableFromDropDownMenu = async () => testSubjects.click('statusDropdownDisabledItem'); return { getManageRulesPageHref,