Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion client/src/components/buttons/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ interface ButtonWithMenuV2Props {
children?: React.ReactNode;
className?: string;
color?: string;
dataCy?: string;
default: React.ReactNode;
direction?: "up" | "down" | "start" | "end";
disabled?: boolean;
Expand All @@ -139,6 +140,7 @@ export function SplitButtonWithMenu({
children,
className,
color,
dataCy,
default: defaultButton,
direction,
disabled,
Expand Down Expand Up @@ -168,7 +170,7 @@ export function SplitButtonWithMenu({
className={cx("border-start-0", "dropdown-toggle-split")}
data-bs-toggle="dropdown"
color={color ?? "primary"}
data-cy="button-with-menu-dropdown"
data-cy={dataCy ?? "button-with-menu-dropdown"}
disabled={isDisabledDropdownToggle ?? disabled}
/>
<DropdownMenu end>{children}</DropdownMenu>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@ export default function ProjectInformation({
title="Namespace:"
>
<p className="mb-0">
<Link to={namespaceUrl}>{namespaceName}</Link>
<Link data-cy="project-namespace-link" to={namespaceUrl}>
{namespaceName}
</Link>
</p>
</ProjectInformationBox>
<ProjectInformationBox icon={<Eye className="bi" />} title="Visibility:">
Expand Down
1 change: 1 addition & 0 deletions client/src/features/dashboardV2/DashboardV2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ function UserDashboard() {
<Link
to={userPageUrl}
className={cx("link-primary", "stretched-link")}
data-cy="user-namespace-link"
>
@{userInfo.username ?? "unknown"}
</Link>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,7 @@ function DataConnectorActionsInner({
) : (
<ButtonWithMenuV2
color="outline-primary"
dataCy="data-connector-menu-dropdown"
default={
<Button
color="outline-primary"
Expand Down
2 changes: 1 addition & 1 deletion client/src/features/session/components/SessionsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ export function SessionRowResourceRequests({
) : null;

return (
<div>
<div data-cy="session-view-resource-class-description">
{resourceClassName && (
<span key="name">
<span className="text-nowrap">{resourceClassName}</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export default function DeleteSessionLauncherModal({
size="lg"
toggle={toggle}
>
<ModalHeader className="text-danger" tag="h2" toggle={toggle}>
<ModalHeader className="text-danger" data-cy="delete-session-launcher-title" tag="h2" toggle={toggle}>
Delete session launcher
</ModalHeader>
<ModalBody>
Expand Down Expand Up @@ -107,6 +107,7 @@ export default function DeleteSessionLauncherModal({
</Button>
<Button
color="danger"
data-cy="delete-session-launcher-button"
disabled={result.isLoading}
onClick={onDelete}
type="button"
Expand Down
4 changes: 2 additions & 2 deletions client/src/features/sessionsV2/SessionImageModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,10 @@ export default function SessionImageModal({
isOpen={isOpen}
size="lg"
>
<ModalHeader tag="h2">Session image not accessible</ModalHeader>
<ModalHeader tag="h2" data-cy="session-image-not-accessible-header">Session image not accessible</ModalHeader>
<ModalBody>{content}</ModalBody>
<ModalFooter>
<Button color="outline-danger" onClick={onCancel}>
<Button color="outline-danger" onClick={onCancel} data-cy="session-image-not-accessible-cancel-button">
<XLg className={cx("bi", "me-1")} />
Cancel
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ function CustomImageEnvironmentValues({
)}
</div>
<EnvironmentRowWithLabel
dataCy="session-view-session-environment-image"
label="Container image"
value={environment?.container_image || ""}
/>
Expand Down Expand Up @@ -470,15 +471,17 @@ function EnvironmentRow({ children }: { children?: ReactNode }) {
function EnvironmentRowWithLabel({
label,
value,
dataCy,
}: {
label: string;
value?: string | number | null;
dataCy?: string;
}) {
return (
<EnvironmentRow>
<div className="d-block">
<label className={cx("text-nowrap", "mb-0", "me-2")}>{label}:</label>
<code>{value ?? "-"}</code>
<code data-cy={dataCy}>{value ?? "-"}</code>
</div>
</EnvironmentRow>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ export function SessionView({
<>
<Button
color="outline-primary"
data-cy="session-view-modify-session-environment-button"
id="modify-session-environment-button"
onClick={toggle}
size="sm"
Expand All @@ -409,7 +410,7 @@ export function SessionView({
)}
<div>
<div className={cx("d-flex", "justify-content-between", "mb-2")}>
<h3 className="my-auto">Default Resource Class</h3>
<h3 className="my-auto" data-cy="session-view-resource-class-heading">Default Resource Class</h3>
{launcher && (
<PermissionsGuard
disabled={null}
Expand All @@ -421,6 +422,7 @@ export function SessionView({
onClick={toggleModifyResources}
size="sm"
tabIndex={0}
data-cy="session-view-resource-class-edit-button"
>
<Pencil className="bi" />
</Button>
Expand Down
1 change: 1 addition & 0 deletions client/src/features/sessionsV2/SessionsV2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ export function SessionV2Actions({
<>
<ButtonWithMenuV2
color="outline-primary"
dataCy="session-launcher-menu-dropdown"
default={defaultAction}
preventPropagation
size="sm"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,15 +168,15 @@ export function ModifyResourcesLauncherModal({
size="lg"
toggle={toggleModal}
>
<ModalHeader tag="h2" toggle={toggleModal}>
<ModalHeader tag="h2" toggle={toggleModal} data-cy="set-resource-class-header">
Set default resource class
</ModalHeader>
<ModalBody>
{result.error && (
<ErrorOrNotAvailableResourcePools title="Error modifying resources" />
)}
{result.isSuccess && (
<SuccessAlert dismissible={false}>
<SuccessAlert dismissible={false} data-cy="set-resource-class-success-alert">
<h3 className={cx("fs-6", "fw-bold")}>
Default resource class updated
</h3>
Expand Down Expand Up @@ -269,7 +269,7 @@ export function ModifyResourcesLauncherModal({
)}
</ModalBody>
<ModalFooter>
<Button color="outline-primary" onClick={toggleModal}>
<Button color="outline-primary" onClick={toggleModal} data-cy="set-resource-class-cancel-button">
<XLg className={cx("bi", "me-1")} />
Cancel
</Button>
Expand All @@ -284,6 +284,7 @@ export function ModifyResourcesLauncherModal({
}
onClick={onSubmit}
type="submit"
data-cy="set-resource-class-submit-button"
>
{result.isLoading ? (
<Loader className="me-1" inline size={16} />
Expand Down
Loading