diff --git a/packages/grafana-e2e-selectors/src/selectors/components.ts b/packages/grafana-e2e-selectors/src/selectors/components.ts index 7dd6dd3ecb3..a2142e464fb 100644 --- a/packages/grafana-e2e-selectors/src/selectors/components.ts +++ b/packages/grafana-e2e-selectors/src/selectors/components.ts @@ -300,6 +300,15 @@ export const Components = { groupToggle: 'data-testid group-collapse-toggle', toggle: 'data-testid collapse-toggle', expandedContent: 'data-testid expanded-content', + previewButton: 'data-testid alert-rule preview-button', + ruleNameField: 'data-testid alert-rule name-field', + newFolderButton: 'data-testid alert-rule new-folder-button', + newFolderNameField: 'data-testid alert-rule name-folder-name-field', + newFolderNameCreateButton: 'data-testid alert-rule name-folder-name-create-button', + newEvaluationGroupButton: 'data-testid alert-rule new-evaluation-group-button', + newEvaluationGroupName: 'data-testid alert-rule new-evaluation-group-name', + newEvaluationGroupInterval: 'data-testid alert-rule new-evaluation-group-interval', + newEvaluationGroupCreate: 'data-testid alert-rule new-evaluation-group-create-button', }, Alert: { /** diff --git a/public/app/features/alerting/unified/components/rule-editor/AlertRuleNameInput.tsx b/public/app/features/alerting/unified/components/rule-editor/AlertRuleNameInput.tsx index f96d308e08e..ffa4a09b4b1 100644 --- a/public/app/features/alerting/unified/components/rule-editor/AlertRuleNameInput.tsx +++ b/public/app/features/alerting/unified/components/rule-editor/AlertRuleNameInput.tsx @@ -1,6 +1,7 @@ import React from 'react'; import { useFormContext } from 'react-hook-form'; +import { selectors } from '@grafana/e2e-selectors'; import { Field, Input, Text } from '@grafana/ui'; import { RuleFormType, RuleFormValues } from '../../types/rule-form'; @@ -35,6 +36,7 @@ export const AlertRuleNameInput = () => { > New folder @@ -258,6 +260,7 @@ export function FolderAndGroup({ fill="outline" variant="secondary" disabled={!folder} + data-testid={selectors.components.AlertRules.newEvaluationGroupButton} > New evaluation group @@ -309,6 +312,7 @@ function FolderCreationModal({ invalid={error} > Cancel - @@ -388,6 +396,7 @@ function EvaluationGroupCreationModal({ invalid={Boolean(formState.errors.group)} > Cancel - diff --git a/public/app/features/alerting/unified/components/rule-editor/query-and-alert-condition/QueryAndExpressionsStep.tsx b/public/app/features/alerting/unified/components/rule-editor/query-and-alert-condition/QueryAndExpressionsStep.tsx index 9a40a1a3d55..ef70b82adc0 100644 --- a/public/app/features/alerting/unified/components/rule-editor/query-and-alert-condition/QueryAndExpressionsStep.tsx +++ b/public/app/features/alerting/unified/components/rule-editor/query-and-alert-condition/QueryAndExpressionsStep.tsx @@ -497,7 +497,13 @@ export const QueryAndExpressionsStep = ({ editingExistingRule, onDataChange }: P )} {!isPreviewLoading && ( - )}