mirror of https://github.com/grafana/grafana.git
Alerting: Add data-testids for Fullstory (#94555)
* add data-testids for Fullstory * add more data-testids
This commit is contained in:
parent
0a4e6ff86b
commit
1596acbd3b
|
|
@ -143,6 +143,7 @@ function ManualAndAutomaticRouting({ alertUid }: { alertUid?: string }) {
|
|||
<Stack direction="column" gap={2}>
|
||||
<Stack direction="column">
|
||||
<RadioButtonGroup
|
||||
data-testid={manualRouting ? 'routing-options-contact-point' : 'routing-options-notification-policy'}
|
||||
options={routingOptions}
|
||||
value={manualRouting ? RoutingOptions.ContactPoint : RoutingOptions.NotificationPolicy}
|
||||
onChange={onRoutingOptionChange}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,11 @@ export const RuleEditorSection = ({
|
|||
{switchMode && (
|
||||
<Text variant="bodySmall">
|
||||
<InlineSwitch
|
||||
id="query-and-expressions-advanced-options"
|
||||
data-testid={
|
||||
switchMode.isAdvancedMode
|
||||
? 'query-and-expressions-advanced-options'
|
||||
: 'query-and-expressions-simple-options'
|
||||
}
|
||||
value={switchMode.isAdvancedMode}
|
||||
onChange={(event) => {
|
||||
switchMode.setAdvancedMode(event.currentTarget.checked);
|
||||
|
|
|
|||
|
|
@ -236,6 +236,7 @@ export const AlertRuleForm = ({ existing, prefill }: Props) => {
|
|||
<Stack justifyContent="flex-end" alignItems="center">
|
||||
{existing && (
|
||||
<Button
|
||||
data-testid="save-rule"
|
||||
variant="primary"
|
||||
type="button"
|
||||
size="sm"
|
||||
|
|
@ -247,6 +248,7 @@ export const AlertRuleForm = ({ existing, prefill }: Props) => {
|
|||
</Button>
|
||||
)}
|
||||
<Button
|
||||
data-testid="save-rule-and-exit"
|
||||
variant="primary"
|
||||
type="button"
|
||||
size="sm"
|
||||
|
|
|
|||
|
|
@ -39,7 +39,14 @@ export function LabelsFieldInForm({ onEditClick }: LabelsFieldInFormProps) {
|
|||
) : (
|
||||
<Stack direction="row" gap={2} alignItems="center">
|
||||
<Text>No labels selected</Text>
|
||||
<Button icon="plus" type="button" variant="secondary" onClick={onEditClick} size="sm">
|
||||
<Button
|
||||
icon="plus"
|
||||
type="button"
|
||||
variant="secondary"
|
||||
onClick={onEditClick}
|
||||
size="sm"
|
||||
data-testid="add-labels-button"
|
||||
>
|
||||
Add labels
|
||||
</Button>
|
||||
</Stack>
|
||||
|
|
|
|||
|
|
@ -718,7 +718,7 @@ function TypeSelectorButton({ onClickType }: { onClickType: (type: ExpressionQue
|
|||
|
||||
return (
|
||||
<Dropdown overlay={newMenu}>
|
||||
<Button variant="secondary">
|
||||
<Button variant="secondary" data-testid={'add-expression-button'}>
|
||||
Add expression
|
||||
<Icon name="angle-down" />
|
||||
</Button>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { useFormContext } from 'react-hook-form';
|
|||
|
||||
import { DataSourceInstanceSettings } from '@grafana/data';
|
||||
import { DataSourceJsonData } from '@grafana/schema';
|
||||
import { RadioButtonGroup, Text, Stack } from '@grafana/ui';
|
||||
import { RadioButtonGroup, Stack, Text } from '@grafana/ui';
|
||||
import { contextSrv } from 'app/core/core';
|
||||
import { ExpressionDatasourceUID } from 'app/features/expressions/types';
|
||||
import { AccessControlAction } from 'app/types';
|
||||
|
|
@ -133,6 +133,7 @@ export function SmartAlertTypeDetector({
|
|||
disabledOptions={disabledOptions}
|
||||
value={ruleFormType}
|
||||
onChange={onClickSwitch}
|
||||
data-testid="rule-type-radio-group"
|
||||
/>
|
||||
{/* editing an existing rule, we just show "cannot be changed" */}
|
||||
{editingExistingRule && (
|
||||
|
|
|
|||
Loading…
Reference in New Issue