diff --git a/app/portainer/components/PageHeader/HeaderTitle.html b/app/portainer/components/PageHeader/HeaderTitle.html
index 703646539..cbbb616bf 100644
--- a/app/portainer/components/PageHeader/HeaderTitle.html
+++ b/app/portainer/components/PageHeader/HeaderTitle.html
@@ -4,17 +4,17 @@
-
+
{{ $ctrl.username }}
-
diff --git a/app/react/components/PageHeader/HeaderTitle.tsx b/app/react/components/PageHeader/HeaderTitle.tsx
index 742083b09..076b1acaa 100644
--- a/app/react/components/PageHeader/HeaderTitle.tsx
+++ b/app/react/components/PageHeader/HeaderTitle.tsx
@@ -7,9 +7,10 @@ import {
} from '@reach/menu-button';
import clsx from 'clsx';
import { User, ChevronDown } from 'react-feather';
-import { useSref } from '@uirouter/react';
+import { UISrefProps, useSref } from '@uirouter/react';
import { useUser } from '@/portainer/hooks/useUser';
+import { AutomationTestingProps } from '@/types';
import { useHeaderContext } from './HeaderContainer';
import styles from './HeaderTitle.module.css';
@@ -32,37 +33,59 @@ export function HeaderTitle({ title, children }: PropsWithChildren) {
'pull-right flex items-center gap-1',
styles.menuButton
)}
+ data-cy="userMenu-button"
+ aria-label="User menu toggle"
>
{user && {user.Username}}
-
+
{!window.ddExtension && (
-
+
)}
-
+
);
}
-interface MenuLinkProps {
- to: string;
+interface MenuLinkProps extends AutomationTestingProps, UISrefProps {
label: string;
}
-function MenuLink({ to, label }: MenuLinkProps) {
- const anchorProps = useSref(to);
+function MenuLink({
+ to,
+ label,
+ params,
+ options,
+ 'data-cy': dataCy,
+}: MenuLinkProps) {
+ const anchorProps = useSref(to, params, options);
return (
{label}