Skip to content

Commit 9b7f23b

Browse files
authored
E2e test for new deployment wizard (opendatahub-io#5236)
* update tests as per new deployment wizard * Update deployment steps in tests * Update modelserving tests based on the new wizard * Update singleModelCreation test based on new wizard * Updated all the tests * remove url from visitWIthLogin * Update modelserving tag for the test * add verify model is available before inference call * resolved failing tests * address review comments * added condition to single serving model select if exisits * update Modelserving tag to ModelServing * lint issues * update modelservingToleration test with latest model wizard changes * Unquarantine passing tests * resolve code review comments * Uncomment cypresss step * Quarantine model serving tests with authentication * remove automation tag
1 parent edbb4b3 commit 9b7f23b

File tree

10 files changed

+245
-131
lines changed

10 files changed

+245
-131
lines changed

frontend/src/__tests__/cypress/cypress/fixtures/e2e/dataScienceProjects/testDeployKserveRaw.yaml

Lines changed: 0 additions & 6 deletions
This file was deleted.

frontend/src/__tests__/cypress/cypress/fixtures/e2e/hardwareProfiles/testModelServingTolerations.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ modelServingTolerationsTestNamespace: 'dsp-model-tolerations-test'
33
resourceYamlPath: "resources/hardwareProfile/model_tolerations.yaml"
44
hardwareProfileName: "cypress-hardware-profile-model"
55
tolerationValue: "PreferNoSchedule"
6-
hardwareProfileDeploymentSize: "cypress-hardware-profile-model CPU: Request = 2 Cores; Limit = 2 Cores; Memory: Request = 4 GiB; Limit = 4 GiB"
6+
hardwareProfileDeploymentSize: "cypress-hardware-profile-model Compatible CPU: Request = 2 Cores; Limit = 2 Cores; Memory: Request = 4 GiB; Limit = 4 GiB"
77
modelName: "cypress-toleration-single-model"
88
modelFilePath: "flan-t5-small/flan-t5-small-caikit"

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,14 @@ class ModelServingGlobal {
8080
return cy.findByTestId('kserve-select-button');
8181
}
8282

83+
selectSingleServingModelButtonIfExists() {
84+
cy.get('body').then(($body) => {
85+
if ($body.find('[data-testid="kserve-select-button"]').length > 0) {
86+
this.findSingleServingModelButton().click();
87+
}
88+
});
89+
}
90+
8391
findMultiModelButton() {
8492
return cy.findByTestId('model-mesh-select-button');
8593
}

frontend/src/__tests__/cypress/cypress/tests/e2e/dataScienceProjects/models/testDeployOCIModel.cy.ts

Lines changed: 40 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import {
88
connectionsPage,
99
} from '#~/__tests__/cypress/cypress/pages/connections';
1010
import {
11-
inferenceServiceModal,
1211
modelServingGlobal,
1312
modelServingSection,
13+
modelServingWizard,
1414
} from '#~/__tests__/cypress/cypress/pages/modelServing';
1515
import { checkInferenceServiceState } from '#~/__tests__/cypress/cypress/utils/oc_commands/modelServing';
1616
import type { DeployOCIModelData } from '#~/__tests__/cypress/cypress/types';
@@ -44,7 +44,7 @@ const updateSecretDetailsFile = (
4444
};
4545

4646
describe(
47-
'[Automation Bug: RHOAIENG-32898] A user can create an OCI connection and deploy a model with it',
47+
'A user can create an OCI connection and deploy a model with it',
4848
{ testIsolation: false },
4949
() => {
5050
let testData: DeployOCIModelData;
@@ -80,14 +80,7 @@ describe(
8080
it(
8181
'Verify User Can Create an OCI Connection in DS Connections Page And Deploy the Model',
8282
{
83-
tags: [
84-
'@Smoke',
85-
'@SmokeSet3',
86-
'@Dashboard',
87-
'@Modelserving',
88-
'@NonConcurrent',
89-
'@Maintain',
90-
],
83+
tags: ['@Smoke', '@SmokeSet3', '@Dashboard', '@ModelServing', '@NonConcurrent'],
9184
},
9285
() => {
9386
cy.step(`Navigate to DS Project ${projectName}`);
@@ -101,33 +94,56 @@ describe(
10194
connectionsPage.findCreateConnectionButton().click();
10295
addConnectionModal.findConnectionTypeDropdown().click();
10396
addConnectionModal.findOciConnectionType().click();
104-
addConnectionModal.findConnectionNameInput().type(connectionName);
105-
addConnectionModal.findConnectionDescriptionInput().type('OCI Connection');
97+
addConnectionModal.findConnectionNameInput().clear().type(connectionName);
98+
addConnectionModal.findConnectionDescriptionInput().clear().type('OCI Connection');
10699
addConnectionModal.findOciAccessType().click();
107100
addConnectionModal.findOciPullSecretOption().click();
108101
addConnectionModal.findOciAccessType().click();
109102
addConnectionModal.uploadSecretDetails(secretDetailsFile);
110-
addConnectionModal.findOciRegistryHost().type(ociRegistryHost);
103+
addConnectionModal.findOciRegistryHost().clear().type(ociRegistryHost);
111104
addConnectionModal.findCreateButton().click();
112105

113106
cy.step('Deploy OCI Connection with KServe');
114107
projectDetails.findSectionTab('model-server').click();
115-
modelServingGlobal.findSingleServingModelButton().click();
108+
// If we have only one serving model platform, then it is selected by default.
109+
// So we don't need to click the button.
110+
modelServingGlobal.selectSingleServingModelButtonIfExists();
116111
modelServingGlobal.findDeployModelButton().click();
117-
inferenceServiceModal.findModelNameInput().type(modelDeploymentName);
118-
inferenceServiceModal.findServingRuntimeTemplateSearchSelector().click();
119-
inferenceServiceModal.findGlobalScopedTemplateOption('OpenVINO Model Server').click();
120-
inferenceServiceModal.findModelFrameworkSelect().click();
121-
inferenceServiceModal.findOpenVinoOnnx().click();
122-
inferenceServiceModal.findOCIModelURI().type(modelDeploymentURI);
123-
inferenceServiceModal.findSubmitButton().focus().click();
112+
// Step 1: Model Source
113+
modelServingWizard.findModelLocationSelectOption('Existing connection').click();
114+
modelServingWizard.findOCIModelURI().clear().type(modelDeploymentURI);
115+
modelServingWizard.findModelTypeSelectOption('Predictive model').click();
116+
modelServingWizard.findNextButton().click();
117+
// Step 2: Model Deployment
118+
modelServingWizard.findModelDeploymentNameInput().clear().type(modelDeploymentName);
119+
modelServingWizard.findModelFormatSelectOption('openvino_ir - opset13').click();
120+
// Only interact with serving runtime template selector if it's not disabled
121+
// (it may be disabled when only one option is available)
122+
modelServingWizard.findServingRuntimeTemplateSearchSelector().then(($selector) => {
123+
if (!$selector.is(':disabled')) {
124+
cy.wrap($selector).click();
125+
modelServingWizard
126+
.findGlobalScopedTemplateOption('OpenVINO Model Server')
127+
.should('exist')
128+
.click();
129+
}
130+
});
131+
modelServingWizard.findNextButton().click();
132+
// Step 3: Advanced Options
133+
modelServingWizard.findSubmitButton().click();
134+
modelServingSection.findModelServerDeployedName(modelDeploymentName);
124135
//Verify the model created and is running
125136
cy.step('Verify that the Model is running');
126137
// For KServe Raw deployments, we only need to check Ready condition
127138
// LatestDeploymentReady is specific to Serverless deployments
128-
checkInferenceServiceState(modelDeploymentName, projectName, {
129-
checkReady: true,
130-
});
139+
checkInferenceServiceState(
140+
modelDeploymentName,
141+
projectName,
142+
{
143+
checkReady: true,
144+
},
145+
'RawDeployment',
146+
);
131147
modelServingSection.findModelMetricsLink(modelDeploymentName);
132148
},
133149
);

frontend/src/__tests__/cypress/cypress/tests/e2e/dataScienceProjects/models/testModelPvcDeployment.cy.ts

Lines changed: 34 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {
2-
inferenceServiceModal,
32
modelServingGlobal,
3+
modelServingSection,
4+
modelServingWizard,
45
} from '#~/__tests__/cypress/cypress/pages/modelServing';
56
import { AWS_BUCKETS } from '#~/__tests__/cypress/cypress/utils/s3Buckets';
67
import {
@@ -39,7 +40,7 @@ const awsBucketRegion = AWS_BUCKETS.BUCKET_1.REGION;
3940
const podName = 'pvc-loader-pod';
4041
const uuid = generateTestUUID();
4142

42-
describe('[Automation Bug: RHOAIENG-32898] Verify a model can be deployed from a PVC', () => {
43+
describe('Verify a model can be deployed from a PVC', () => {
4344
retryableBefore(() => {
4445
Cypress.on('uncaught:exception', (err) => {
4546
if (err.message.includes('Error: secrets "ds-pipeline-config" already exists')) {
@@ -69,9 +70,9 @@ describe('[Automation Bug: RHOAIENG-32898] Verify a model can be deployed from a
6970
});
7071
it(
7172
'should deploy a model from a PVC',
72-
{ tags: ['@Smoke', '@SmokeSet3', '@Dashboard', '@Modelserving', '@Maintain'] },
73+
{ tags: ['@Smoke', '@SmokeSet3', '@Dashboard', '@ModelServing'] },
7374
() => {
74-
cy.step('log into application with ${HTPASSWD_CLUSTER_ADMIN_USER.USERNAME}');
75+
cy.step(`log into application with ${HTPASSWD_CLUSTER_ADMIN_USER.USERNAME}`);
7576
cy.visitWithLogin('/', HTPASSWD_CLUSTER_ADMIN_USER);
7677

7778
// Navigate to the project
@@ -87,11 +88,11 @@ describe('[Automation Bug: RHOAIENG-32898] Verify a model can be deployed from a
8788

8889
// Enter cluster storage details
8990
cy.step('Enter cluster storage details');
90-
addClusterStorageModal.findNameInput().type(pvStorageName);
91+
addClusterStorageModal.findNameInput().clear().type(pvStorageName);
9192

9293
addClusterStorageModal.findModelStorageRadio().click();
93-
addClusterStorageModal.findModelPathInput().type(modelFilePath);
94-
addClusterStorageModal.findModelNameInput().type(modelName);
94+
addClusterStorageModal.findModelPathInput().clear().type(modelFilePath);
95+
addClusterStorageModal.findModelNameInput().clear().type(modelName);
9596

9697
addClusterStorageModal.findSubmitButton().click({ force: true });
9798

@@ -127,18 +128,34 @@ describe('[Automation Bug: RHOAIENG-32898] Verify a model can be deployed from a
127128
// Deploy the model
128129
cy.step('Deploy the model');
129130
projectDetails.findSectionTab('model-server').click();
130-
modelServingGlobal.findSingleServingModelButton().click();
131+
// If we have only one serving model platform, then it is selected by default.
132+
// So we don't need to click the button.
133+
modelServingGlobal.selectSingleServingModelButtonIfExists();
131134
modelServingGlobal.findDeployModelButton().click();
132-
inferenceServiceModal.findModelNameInput().type(modelName);
133-
inferenceServiceModal.findServingRuntimeTemplateSearchSelector().click();
134-
inferenceServiceModal.findGlobalScopedTemplateOption('OpenVINO Model Server').click();
135-
inferenceServiceModal.findModelFrameworkSelect().click();
136-
inferenceServiceModal.findOpenVinoIROpSet13().click();
135+
// Step 1: Model Source
136+
modelServingWizard.findModelLocationSelectOption('Cluster storage').click();
137137
// There's only one PVC so it's automatically selected
138-
inferenceServiceModal.findExistingPVCConnectionOption().click();
139-
inferenceServiceModal.findSubmitButton().should('be.enabled').click();
140-
inferenceServiceModal.shouldBeOpen(false);
141-
138+
modelServingWizard.findPVCSelectValue().should('have.value', pvStorageName);
139+
modelServingWizard.findModelTypeSelectOption('Predictive model').click();
140+
modelServingWizard.findNextButton().click();
141+
// Step 2: Model Deployment
142+
modelServingWizard.findModelDeploymentNameInput().clear().type(modelName);
143+
modelServingWizard.findModelFormatSelectOption('openvino_ir - opset13').click();
144+
// Only interact with serving runtime template selector if it's not disabled
145+
// (it may be disabled when only one option is available)
146+
modelServingWizard.findServingRuntimeTemplateSearchSelector().then(($selector) => {
147+
if (!$selector.is(':disabled')) {
148+
cy.wrap($selector).click();
149+
modelServingWizard
150+
.findGlobalScopedTemplateOption('OpenVINO Model Server')
151+
.should('exist')
152+
.click();
153+
}
154+
});
155+
modelServingWizard.findNextButton().click();
156+
//Step 3: Advanced Options
157+
modelServingWizard.findSubmitButton().click();
158+
modelServingSection.findModelServerDeployedName(testData.singleModelName);
142159
//Verify the model created and is running
143160
cy.step('Verify that the Model is running');
144161
// For KServe Raw deployments, we only need to check Ready condition

frontend/src/__tests__/cypress/cypress/tests/e2e/dataScienceProjects/models/testModelStopStart.cy.ts

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import {
22
modelServingGlobal,
33
modelServingSection,
4-
inferenceServiceModal,
5-
} from '#~/__tests__/cypress/cypress/pages/modelServing.ts';
4+
modelServingWizard,
5+
} from '#~/__tests__/cypress/cypress/pages/modelServing';
66
import { projectDetails, projectListPage } from '#~/__tests__/cypress/cypress/pages/projects';
77
import type { DataScienceProjectData } from '#~/__tests__/cypress/cypress/types';
88
import { loadDSPFixture } from '#~/__tests__/cypress/cypress/utils/dataLoader';
@@ -19,12 +19,12 @@ import { MODEL_STATUS_TIMEOUT } from '#~/__tests__/cypress/cypress/support/timeo
1919

2020
let testData: DataScienceProjectData;
2121
let projectName: string;
22-
let modelName: string;
2322
let modelFilePath: string;
23+
let modelName: string;
2424
const awsBucket = 'BUCKET_1' as const;
2525
const uuid = generateTestUUID();
2626

27-
describe('[Automation Bug: RHOAIENG-32898] A model can be stopped and started', () => {
27+
describe('A model can be stopped and started', () => {
2828
retryableBefore(() => {
2929
cy.log('Loading test data');
3030
return loadDSPFixture('e2e/dataScienceProjects/testModelStopStart.yaml').then(
@@ -57,7 +57,7 @@ describe('[Automation Bug: RHOAIENG-32898] A model can be stopped and started',
5757
it(
5858
'Verify that a model can be stopped and started',
5959
{
60-
tags: ['@Smoke', '@SmokeSet3', '@Dashboard', '@Modelserving', '@NonConcurrent', '@Maintain'],
60+
tags: ['@Smoke', '@SmokeSet3', '@Dashboard', '@ModelServing', '@NonConcurrent'],
6161
},
6262
() => {
6363
cy.log('Model Name:', modelName);
@@ -73,19 +73,35 @@ describe('[Automation Bug: RHOAIENG-32898] A model can be stopped and started',
7373
// Navigate to Model Serving section and Deploy a Model
7474
cy.step('Navigate to Model Serving and deploy a Model');
7575
projectDetails.findSectionTab('model-server').click();
76-
modelServingGlobal.findSingleServingModelButton().click();
77-
modelServingGlobal.findDeployModelButton().click();
76+
// If we have only one serving model platform, then it is selected by default.
77+
// So we don't need to click the button.
78+
modelServingGlobal.selectSingleServingModelButtonIfExists();
7879

7980
// Deploy a Model
8081
cy.step('Deploy a Model');
81-
inferenceServiceModal.findModelNameInput().type(testData.singleModelName);
82-
inferenceServiceModal.findServingRuntimeTemplateSearchSelector().click();
83-
inferenceServiceModal.findGlobalScopedTemplateOption('OpenVINO Model Server').click();
84-
inferenceServiceModal.findModelFrameworkSelect().click();
85-
inferenceServiceModal.findOpenVinoIROpSet13().click();
86-
inferenceServiceModal.findLocationPathInput().type(modelFilePath);
87-
inferenceServiceModal.findSubmitButton().click();
88-
inferenceServiceModal.shouldBeOpen(false);
82+
modelServingGlobal.findDeployModelButton().click();
83+
// Step 1: Model Source
84+
modelServingWizard.findModelLocationSelectOption('Existing connection').click();
85+
modelServingWizard.findLocationPathInput().clear().type(modelFilePath);
86+
modelServingWizard.findModelTypeSelectOption('Predictive model').click();
87+
modelServingWizard.findNextButton().click();
88+
// Step 2: Model Deployment
89+
modelServingWizard.findModelDeploymentNameInput().clear().type(modelName);
90+
modelServingWizard.findModelFormatSelectOption('openvino_ir - opset13').click();
91+
// Only interact with serving runtime template selector if it's not disabled
92+
// (it may be disabled when only one option is available)
93+
modelServingWizard.findServingRuntimeTemplateSearchSelector().then(($selector) => {
94+
if (!$selector.is(':disabled')) {
95+
cy.wrap($selector).click();
96+
modelServingWizard
97+
.findGlobalScopedTemplateOption('OpenVINO Model Server')
98+
.should('exist')
99+
.click();
100+
}
101+
});
102+
modelServingWizard.findNextButton().click();
103+
//Step 3: Advanced Options
104+
modelServingWizard.findSubmitButton().click();
89105
modelServingSection.findModelServerDeployedName(testData.singleModelName);
90106
const kServeRow = modelServingSection.getKServeRow(testData.singleModelName);
91107

frontend/src/__tests__/cypress/cypress/tests/e2e/dataScienceProjects/models/testModelTokenAuth.cy.ts

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { projectListPage, projectDetails } from '#~/__tests__/cypress/cypress/pages/projects';
22
import {
33
modelServingGlobal,
4-
inferenceServiceModal,
54
modelServingSection,
65
kserveModalEdit,
6+
modelServingWizard,
77
} from '#~/__tests__/cypress/cypress/pages/modelServing';
88
import type { DataScienceProjectData } from '#~/__tests__/cypress/cypress/types';
99
import { loadDSPFixture } from '#~/__tests__/cypress/cypress/utils/dataLoader';
@@ -71,29 +71,43 @@ describe('[Automation Bug: RHOAIENG-32898] A model can be deployed with token au
7171
// Navigate to Model Serving tab and Deploy a model
7272
cy.step('Navigate to Model Serving and click to Deploy a model');
7373
projectDetails.findSectionTab('model-server').click();
74-
modelServingGlobal.findSingleServingModelButton().click();
74+
// If we have only one serving model platform, then it is selected by default.
75+
// So we don't need to click the button.
76+
modelServingGlobal.selectSingleServingModelButtonIfExists();
7577
modelServingGlobal.findDeployModelButton().click();
7678

7779
// Launch a model
7880
cy.step('Launch a Single Serving Model using Openvino');
79-
inferenceServiceModal.findModelNameInput().type(testData.singleModelName);
80-
inferenceServiceModal.findServingRuntimeTemplateSearchSelector().click();
81-
inferenceServiceModal.findGlobalScopedTemplateOption('OpenVINO Model Server').click();
82-
inferenceServiceModal.findModelFrameworkSelect().click();
83-
inferenceServiceModal.findOpenVinoIROpSet13().click();
84-
81+
// Step 1: Model Source
82+
modelServingWizard.findModelLocationSelectOption('Existing connection').click();
83+
modelServingWizard.findLocationPathInput().clear().type(modelFilePath);
84+
modelServingWizard.findModelTypeSelectOption('Predictive model').click();
85+
modelServingWizard.findNextButton().click();
86+
// Step 2: Model Deployment
87+
modelServingWizard.findModelDeploymentNameInput().clear().type(modelName);
88+
modelServingWizard.findModelFormatSelectOption('openvino_ir - opset13').click();
89+
// Only interact with serving runtime template selector if it's not disabled
90+
// (it may be disabled when only one option is available)
91+
modelServingWizard.findServingRuntimeTemplateSearchSelector().then(($selector) => {
92+
if (!$selector.is(':disabled')) {
93+
cy.wrap($selector).click();
94+
modelServingWizard
95+
.findGlobalScopedTemplateOption('OpenVINO Model Server')
96+
.should('exist')
97+
.click();
98+
}
99+
});
100+
modelServingWizard.findNextButton().click();
101+
//Step 3: Advanced Options
85102
// Enable Model access through an external route
86103
cy.step('Enable Model access through an external route');
87-
inferenceServiceModal.findDeployedModelRouteCheckbox().click();
88-
inferenceServiceModal.findDeployedModelRouteCheckbox().should('be.checked');
89-
inferenceServiceModal.findServiceAccountIndex(0).clear();
90-
inferenceServiceModal.findServiceAccountIndex(0).type('secret');
91-
inferenceServiceModal.findAddServiceAccountButton().click();
92-
inferenceServiceModal.findServiceAccountIndex(1).clear();
93-
inferenceServiceModal.findServiceAccountIndex(1).type('secret2');
94-
inferenceServiceModal.findLocationPathInput().type(modelFilePath);
95-
inferenceServiceModal.findSubmitButton().click();
96-
inferenceServiceModal.shouldBeOpen(false);
104+
modelServingWizard.findExternalRouteCheckbox().click();
105+
modelServingWizard.findTokenAuthenticationCheckbox().should('be.checked');
106+
modelServingWizard.findServiceAccountByIndex(0).clear().type('secret');
107+
modelServingWizard.findAddServiceAccountButton().click();
108+
modelServingWizard.findServiceAccountByIndex(1).clear().type('secret2');
109+
modelServingWizard.findSubmitButton().click();
110+
modelServingSection.findModelServerDeployedName(testData.singleModelName);
97111

98112
// Verify the model created
99113
cy.step('Verify that the Model is running');

0 commit comments

Comments
 (0)