diff --git a/frontend/src/__tests__/integration/pages/modelServing/ServingRuntimeList.spec.ts b/frontend/src/__tests__/integration/pages/modelServing/ServingRuntimeList.spec.ts index e20c0e1a3a..f4118146d1 100644 --- a/frontend/src/__tests__/integration/pages/modelServing/ServingRuntimeList.spec.ts +++ b/frontend/src/__tests__/integration/pages/modelServing/ServingRuntimeList.spec.ts @@ -164,6 +164,38 @@ test('Add ModelMesh model server', async ({ page }) => { await expect(page.getByRole('menuitem', { name: 'New OVMS Server Invalid' })).toBeHidden(); await expect(page.getByRole('button', { name: 'Add', exact: true })).toBeEnabled(); + //test Add model server tooltips + const expectedContent = [ + { + ariaLabel: 'Model server replicas info', + content: + 'Consider network traffic and failover scenarios when specifying the number of model server replicas.', + }, + { + ariaLabel: 'Model server size info', + content: + 'Select a server size that will accommodate your largest model. See the product documentation for more information.', + }, + { + ariaLabel: 'Accelerator info', + content: + 'Ensure that appropriate tolerations are in place before adding an accelerator to your model server.', + }, + ]; + + for (const item of expectedContent) { + const iconPopover = await page.getByRole('button', { name: item.ariaLabel, exact: true }); + if (await iconPopover.isVisible()) { + await iconPopover.click(); + const popoverContent = await page.locator('div.pf-c-popover__content').textContent(); + expect(popoverContent).toContain(item.content); + + const closeButton = await page.locator('div.pf-c-popover__content>button'); + if (closeButton) { + closeButton.click(); + } + } + } // test the if the alert is visible when route is external while token is not set await expect(page.locator('#alt-form-checkbox-route')).not.toBeChecked(); await expect(page.locator('#alt-form-checkbox-auth')).not.toBeChecked(); diff --git a/frontend/src/pages/modelServing/screens/projects/ServingRuntimeModal/ManageServingRuntimeModal.tsx b/frontend/src/pages/modelServing/screens/projects/ServingRuntimeModal/ManageServingRuntimeModal.tsx index b6b9be7982..d6c443904a 100644 --- a/frontend/src/pages/modelServing/screens/projects/ServingRuntimeModal/ManageServingRuntimeModal.tsx +++ b/frontend/src/pages/modelServing/screens/projects/ServingRuntimeModal/ManageServingRuntimeModal.tsx @@ -180,7 +180,12 @@ const ManageServingRuntimeModal: React.FC = ({ /> - + = ({ servingRuntimeSelected={servingRuntimeSelected} acceleratorState={acceleratorState} setAcceleratorState={setAcceleratorState} + infoContent="Select a server size that will accommodate your largest model. See the product documentation for more information." /> {!allowCreate && ( diff --git a/frontend/src/pages/modelServing/screens/projects/ServingRuntimeModal/ServingRuntimeReplicaSection.tsx b/frontend/src/pages/modelServing/screens/projects/ServingRuntimeModal/ServingRuntimeReplicaSection.tsx index f3b41b1fbe..35ddb18f26 100644 --- a/frontend/src/pages/modelServing/screens/projects/ServingRuntimeModal/ServingRuntimeReplicaSection.tsx +++ b/frontend/src/pages/modelServing/screens/projects/ServingRuntimeModal/ServingRuntimeReplicaSection.tsx @@ -1,5 +1,6 @@ import * as React from 'react'; -import { FormGroup, FormSection, NumberInput } from '@patternfly/react-core'; +import { FormGroup, FormSection, NumberInput, Popover, Icon } from '@patternfly/react-core'; +import { OutlinedQuestionCircleIcon } from '@patternfly/react-icons'; import { UpdateObjectAtPropAndValue } from '~/pages/projects/types'; import { CreatingServingRuntimeObject } from '~/pages/modelServing/screens/types'; import { isHTMLInputElement, normalizeBetween } from '~/utilities/utils'; @@ -7,11 +8,13 @@ import { isHTMLInputElement, normalizeBetween } from '~/utilities/utils'; type ServingRuntimeReplicaSectionProps = { data: CreatingServingRuntimeObject; setData: UpdateObjectAtPropAndValue; + infoContent?: string; }; const ServingRuntimeReplicaSection: React.FC = ({ data, setData, + infoContent, }) => { const MIN_SIZE = 0; @@ -21,7 +24,18 @@ const ServingRuntimeReplicaSection: React.FC return ( - + {infoContent}}> + + + + + ) : undefined + } + > ; + infoContent?: string; }; const ServingRuntimeSizeSection: React.FC = ({ @@ -35,6 +39,7 @@ const ServingRuntimeSizeSection: React.FC = ({ servingRuntimeSelected, acceleratorState, setAcceleratorState, + infoContent, }) => { const [sizeDropdownOpen, setSizeDropdownOpen] = React.useState(false); const [supportedAccelerators, setSupportedAccelerators] = React.useState(); @@ -72,7 +77,18 @@ const ServingRuntimeSizeSection: React.FC = ({ return ( - + {infoContent}}> + + + + + ) : undefined + } + >