Skip to content

Commit

Permalink
Updated Cypress tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ashley-o0o committed Oct 18, 2024
1 parent e32a974 commit 549ceb5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 17 deletions.
4 changes: 2 additions & 2 deletions frontend/src/__tests__/cypress/cypress/pages/modelServing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ class InferenceServiceRow extends TableRow {
findStatusTooltip() {
return this.find()
.findByTestId('status-tooltip')
.trigger('mouseenter')
.click()
.then(() => {
cy.findByTestId('model-status-tooltip');
});
Expand All @@ -296,7 +296,7 @@ class InferenceServiceRow extends TableRow {
.invoke('text')
.should('contain', msg)
.then(() => {
this.findStatusTooltip().trigger('mouseleave');
this.findStatusTooltip().find('button').click();
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ describe('Serving Runtime List', () => {
.click();
modelServingSection.findInferenceServiceTable().should('exist');
let inferenceServiceRow = modelServingSection.getInferenceServiceRow('OVMS ONNX');
inferenceServiceRow.findStatusTooltip().should('be.visible');
inferenceServiceRow.findStatusTooltip();
inferenceServiceRow.findStatusTooltipValue('Failed to pull model from storage due to error');

// Check status of deployed model which loaded successfully after an error
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { Text, Icon, Popover } from '@patternfly/react-core';
import { Icon, Popover, Button } from '@patternfly/react-core';
import {
CheckCircleIcon,
ExclamationCircleIcon,
Expand Down Expand Up @@ -45,7 +45,6 @@ const InferenceServiceStatus: React.FC<InferenceServiceStatusProps> = ({
isInline
tabIndex={0}
iconSize={iconSize}
style={{ cursor: 'pointer' }}
>
<CheckCircleIcon />
</Icon>
Expand All @@ -60,7 +59,6 @@ const InferenceServiceStatus: React.FC<InferenceServiceStatusProps> = ({
isInline
tabIndex={0}
iconSize={iconSize}
style={{ cursor: 'pointer' }}
>
<ExclamationCircleIcon />
</Icon>
Expand All @@ -82,7 +80,6 @@ const InferenceServiceStatus: React.FC<InferenceServiceStatusProps> = ({
isInline
tabIndex={0}
iconSize={iconSize}
style={{ cursor: 'pointer' }}
>
<OutlinedQuestionCircleIcon />
</Icon>
Expand All @@ -97,26 +94,25 @@ const InferenceServiceStatus: React.FC<InferenceServiceStatusProps> = ({
isInline
tabIndex={0}
iconSize={iconSize}
style={{ cursor: 'pointer' }}
>
<OutlinedQuestionCircleIcon />
</Icon>
);
}
};

const bodyContent = modelStatus?.failedToSchedule
? 'Insufficient resources'
: getInferenceServiceStatusMessage(inferenceService);

return (
<Popover
position="right"
bodyContent={
modelStatus?.failedToSchedule ? (
<Text>Insufficient resources</Text>
) : (
<Text>{getInferenceServiceStatusMessage(inferenceService)}</Text>
)
}
data-testid="model-status-tooltip"
position="top"
bodyContent={bodyContent}
isVisible={bodyContent ? undefined : false}
>
{statusIcon()}
<Button variant="link" isInline icon={statusIcon()} />
</Popover>
);
};
Expand Down

0 comments on commit 549ceb5

Please sign in to comment.