Skip to content

Commit 3256ac6

Browse files
committed
added tests
1 parent c003656 commit 3256ac6

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

frontend/src/__tests__/cypress/cypress/pages/modelServing.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,18 @@ class ModelServingRow extends TableRow {
564564
findInternalServicePopover() {
565565
return cy.findByTestId('internal-service-popover');
566566
}
567+
568+
findConfirmStopModal() {
569+
return cy.findByTestId('stop-model-modal');
570+
}
571+
572+
findConfirmStopModalButton() {
573+
return this.findConfirmStopModal().findByTestId('stop-model-button');
574+
}
575+
576+
findConfirmStopModalCheckbox() {
577+
return this.findConfirmStopModal().findByTestId('dont-show-again-checkbox');
578+
}
567579
}
568580

569581
class ModelMeshRow extends ModelServingRow {

frontend/src/__tests__/cypress/cypress/tests/mocked/modelServing/runtime/servingRuntimeList.cy.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1340,6 +1340,10 @@ describe('Serving Runtime List', () => {
13401340
}),
13411341
],
13421342
});
1343+
cy.clearLocalStorage('odh.dashboard.modelServing.stop.modal.preference');
1344+
cy.window().then((win) =>
1345+
win.localStorage.setItem('odh.dashboard.modelServing.stop.modal.preference', 'false'),
1346+
);
13431347
projectDetails.visitSection('test-project', 'model-server');
13441348

13451349
const kserveRow = modelServingSection.getKServeRow('test-model');
@@ -1373,8 +1377,20 @@ describe('Serving Runtime List', () => {
13731377
);
13741378

13751379
kserveRow.findStateActionToggle().should('have.text', 'Stop').click();
1380+
kserveRow.findConfirmStopModal().should('exist');
1381+
kserveRow.findConfirmStopModalCheckbox().should('exist');
1382+
kserveRow.findConfirmStopModalCheckbox().should('not.be.checked');
1383+
kserveRow.findConfirmStopModalCheckbox().click();
1384+
kserveRow.findConfirmStopModalCheckbox().should('be.checked');
1385+
kserveRow.findConfirmStopModalButton().click();
13761386
cy.wait(['@stopModelPatch', '@getStoppedModel']);
13771387
kserveRow.findStateActionToggle().should('have.text', 'Start');
1388+
cy.window().then((win) => {
1389+
const preference = win.localStorage.getItem(
1390+
'odh.dashboard.modelServing.stop.modal.preference',
1391+
);
1392+
expect(preference).to.equal('true');
1393+
});
13781394

13791395
const runningInferenceService = mockInferenceServiceK8sResource({
13801396
name: 'test-model',

0 commit comments

Comments
 (0)