Skip to content

Commit

Permalink
add test case for model deployment details loading indicator (#604)
Browse files Browse the repository at this point in the history
Signed-off-by: Lin Wang <wonglam@amazon.com>
  • Loading branch information
wanglam authored Apr 11, 2023
1 parent d82c5f2 commit 59e486a
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
import { MLC_URL } from '../../../utils/constants';
import { MLC_URL, MLC_DASHBOARD_API } from '../../../utils/constants';

if (Cypress.env('ML_COMMONS_DASHBOARDS_ENABLED')) {
describe('MLC Overview page', () => {
Expand Down Expand Up @@ -96,5 +96,35 @@ if (Cypress.env('ML_COMMONS_DASHBOARDS_ENABLED')) {
cy.contains('.euiFlyoutHeader > h3', uploadModelName);
cy.contains('.euiFlyoutBody', uploadedModelId);
});

it('should show empty nodes when deployed model profiling loading', () => {
cy.intercept(
'GET',
MLC_DASHBOARD_API.DEPLOYED_MODEL_PROFILE.replace(
':modelID',
uploadedModelId
),
(req) => {
req.on('response', (res) => {
res.setDelay(3000);
});
}
).as('getDeployedModelProfile');

cy.visit(MLC_URL.OVERVIEW);

cy.get('[aria-label="Search by name or ID"]').type(uploadModelName);

cy.contains(uploadedModelId)
.closest('tr')
.find('[aria-label="view detail"]')
.click();

cy.get('div[role="dialog"] .ml-nodesTableNodeIdCellText', {
timeout: 0,
}).should('not.exist');
cy.wait('@getDeployedModelProfile');
cy.get('div[role="dialog"] .ml-nodesTableNodeIdCellText').should('exist');
});
});
}
6 changes: 6 additions & 0 deletions cypress/utils/plugins/ml-commons-dashboards/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,9 @@ export const MLC_API = {
MODEL_UPLOAD: `${MLC_API_BASE}/models/_upload`,
TASK_BASE: `${MLC_API_BASE}/tasks`,
};

const BASE_MLC_DASHBOARD_API = BASE_PATH + '/api/ml-commons';

export const MLC_DASHBOARD_API = {
DEPLOYED_MODEL_PROFILE: `${BASE_MLC_DASHBOARD_API}/profile/deployed-model/:modelID`,
};

0 comments on commit 59e486a

Please sign in to comment.