adding data test subject attributes to elements in APM as requested by Unified O11y (#137039)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Boris Kirov 2022-07-25 13:11:38 +02:00 committed by GitHub
parent c932ce04a8
commit 7e7d37dd56
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 18 additions and 2 deletions

View file

@ -33,6 +33,7 @@ export function CreateButton({ onClick }: Props) {
>
<EuiButton
iconType="plusInCircle"
data-test-subj="apmCreateServiceGroupButton"
onClick={() => {
dismissTour();
onClick();

View file

@ -69,6 +69,7 @@ export function AlertingPopoverAndFlyout({
iconType="arrowDown"
iconSide="right"
onClick={() => setPopoverOpen((prevState) => !prevState)}
data-test-subj="apmAlertAndRulesHeaderLink"
>
{alertLabel}
</EuiHeaderLink>
@ -84,6 +85,7 @@ export function AlertingPopoverAndFlyout({
{
name: createThresholdAlertLabel,
panel: CREATE_THRESHOLD_PANEL_ID,
'data-test-subj': 'apmAlertsMenuItemCreateThreshold',
},
...(canReadAnomalies
? [
@ -93,6 +95,7 @@ export function AlertingPopoverAndFlyout({
setAlertType(AlertType.Anomaly);
setPopoverOpen(false);
},
'data-test-subj': 'apmAlertsMenuItemCreateAnomaly',
},
]
: []),
@ -102,6 +105,7 @@ export function AlertingPopoverAndFlyout({
setAlertType(AlertType.ErrorCount);
setPopoverOpen(false);
},
'data-test-subj': 'apmAlertsMenuItemErrorCount',
},
]
: []),
@ -114,6 +118,7 @@ export function AlertingPopoverAndFlyout({
),
href: observability.useRulesLink().href,
icon: 'tableOfContents',
'data-test-subj': 'apmAlertsMenuItemManageRules',
},
]
: []),

View file

@ -82,6 +82,7 @@ export function AnomalyDetectionSetupLink() {
color={color}
href={getLegacyApmHref({ basePath, path: '/settings/anomaly-detection' })}
style={{ whiteSpace: 'nowrap' }}
data-test-subj="apmAnomalyDetectionHeaderLink"
>
{pre}
<span style={{ marginInlineStart: theme.eui.euiSizeS }}>

View file

@ -42,7 +42,11 @@ export function ApmHeaderActionMenu() {
return (
<EuiHeaderLinks gutterSize="xs">
<EuiHeaderLink color="text" href={apmHref('/settings')}>
<EuiHeaderLink
color="text"
href={apmHref('/settings')}
data-test-subj="apmSettingsHeaderLink"
>
{i18n.translate('xpack.apm.settingsLinkLabel', {
defaultMessage: 'Settings',
})}
@ -61,6 +65,7 @@ export function ApmHeaderActionMenu() {
color="primary"
href={kibanaHref('/app/home#/tutorial/apm')}
iconType="indexOpen"
data-test-subj="apmAddDataHeaderLink"
>
{i18n.translate('xpack.apm.addDataButtonLabel', {
defaultMessage: 'Add data',

View file

@ -32,7 +32,11 @@ export function InspectorHeaderLink() {
}
return (
<EuiHeaderLink color="primary" onClick={inspect}>
<EuiHeaderLink
color="primary"
onClick={inspect}
data-test-subj="apmInspectHeaderLink"
>
{i18n.translate('xpack.apm.inspectButtonText', {
defaultMessage: 'Inspect',
})}