Skip to content

Commit 24a643a

Browse files
committed
mr props test
1 parent d504657 commit 24a643a

7 files changed

Lines changed: 667 additions & 0 deletions

File tree

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Test data for custom properties retention tests
2+
# Tests verify no data loss on related objects during model registry operations
3+
4+
# Registry and database configuration
5+
registryNamePrefix: "test-props-registry"
6+
databaseNamePrefix: "props-db"
7+
projectNamePrefix: "props-deploy-project"
8+
operatorDeploymentName: "model-registry-operator-controller-manager"
9+
10+
# Model configuration
11+
modelNamePrefix: "test-props-model"
12+
modelDescription: "Test model for verifying custom properties retention during operations"
13+
14+
# Model custom properties
15+
modelCustomProperties:
16+
- key: "model-prop-1"
17+
value: "model-value-1"
18+
19+
# Model labels
20+
modelLabels:
21+
- "model-label-1"
22+
- "model-label-2"
23+
24+
# Version configuration
25+
versionName: "v1.0"
26+
versionDescription: "Test version for verifying custom properties retention"
27+
28+
# Version custom properties
29+
versionCustomProperties:
30+
- key: "version-prop-1"
31+
value: "version-value-1"
32+
33+
# Version labels
34+
versionLabels:
35+
- "version-label-1"
36+
- "version-label-2"
37+
38+
# Model format configuration
39+
sourceModelFormat: "onnx"
40+
sourceModelFormatVersion: "1.0"
41+
42+
# Updated values for edit tests
43+
updatedVersionDescription: "Updated description for version - testing properties retention"
44+
updatedModelFormat: "pytorch"
45+
updatedFormatVersion: "2.0"
46+
newVersionLabel: "new-version-label"
47+
newVersionPropertyKey: "new-version-prop"
48+
newVersionPropertyValue: "new-version-value"
49+
50+
# Object storage configuration (for model registration)
51+
objectStorageEndpoint: "http://minio.example.com:9000"
52+
objectStorageBucket: "test-models"
53+
objectStorageRegion: "us-east-1"
54+
objectStoragePath: "models/retain-props-test/v1.0"
55+
56+
# Model format for deployment test
57+
modelFormatForDeployment: "openvino_ir - opset13"
58+
servingRuntimeForDeployment: "OpenVINO Model Server"
59+
modelPathForDeployment: "kserve-openvino-test/openvino-example-model"

packages/cypress/cypress/pages/modelRegistry.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,10 @@ class ModelRegistry {
218218
return cy.findByTestId('breadcrumb-model');
219219
}
220220

221+
findModelVersionBreadcrumbItem() {
222+
return cy.findByTestId('breadcrumb-model-version');
223+
}
224+
221225
findModelVersionsTableKebab() {
222226
return cy.findByTestId('model-versions-table-kebab-action');
223227
}
@@ -250,6 +254,10 @@ class ModelRegistry {
250254
return cy.findByTestId('empty-model-registry-secondary-action', { timeout });
251255
}
252256

257+
findModelOverviewTab() {
258+
return cy.findByTestId('model-overview-tab');
259+
}
260+
253261
findModelVersionsTab() {
254262
return cy.findByTestId('model-versions-tab');
255263
}
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
/**
2+
* Page object for Model Version Details page
3+
* Handles interactions with version properties, labels, and metadata editing
4+
*
5+
* On the version details page there are two properties-expandable-section elements:
6+
* one inside the collapsed parent model card and one in the version details card.
7+
* All selectors here use .last() to target the version's section.
8+
*/
9+
10+
class ModelVersionDetails {
11+
findPropertiesExpandableSection() {
12+
return cy.findAllByTestId('properties-expandable-section').last();
13+
}
14+
15+
findPropertiesTable() {
16+
return this.findPropertiesExpandableSection().findByTestId('properties-table');
17+
}
18+
19+
findAddPropertyButton() {
20+
return this.findPropertiesExpandableSection().findByTestId('add-property-button');
21+
}
22+
23+
findPropertyKeyInput() {
24+
return this.findPropertiesExpandableSection().findByTestId('add-property-key-input');
25+
}
26+
27+
findPropertyValueInput() {
28+
return this.findPropertiesExpandableSection().findByTestId('add-property-value-input');
29+
}
30+
31+
findSavePropertyButton() {
32+
return this.findPropertiesExpandableSection().findByTestId('save-edit-button-property');
33+
}
34+
35+
findDiscardPropertyButton() {
36+
return this.findPropertiesExpandableSection().findByTestId('discard-edit-button-property');
37+
}
38+
39+
findPropertiesToggleButton() {
40+
return this.findPropertiesExpandableSection().find('button[aria-expanded]').first();
41+
}
42+
43+
findExpandPropertiesButton() {
44+
return this.findPropertiesExpandableSection().findByTestId('expand-control-button');
45+
}
46+
47+
// Helper to add a custom property
48+
addCustomProperty(key: string, value: string) {
49+
this.findAddPropertyButton().click();
50+
this.findPropertyKeyInput().type(key);
51+
this.findPropertyValueInput().type(value);
52+
this.findSavePropertyButton().click();
53+
}
54+
55+
// Helper to verify custom property exists
56+
shouldHaveCustomProperty(key: string, value: string) {
57+
this.findPropertiesExpandableSection().within(() => {
58+
cy.contains(key).should('be.visible');
59+
cy.contains(value).should('be.visible');
60+
});
61+
return this;
62+
}
63+
64+
// Labels section
65+
findLabel(labelText: string) {
66+
return cy.findByTestId('label').contains(labelText);
67+
}
68+
69+
findLabelGroup() {
70+
return cy.findByTestId('popover-label-group');
71+
}
72+
73+
findModalLabelGroup() {
74+
return cy.findByTestId('modal-label-group');
75+
}
76+
77+
// Helper to verify label exists
78+
shouldHaveLabel(labelText: string) {
79+
cy.contains(labelText).should('be.visible');
80+
return this;
81+
}
82+
}
83+
84+
export const modelVersionDetails = new ModelVersionDetails();
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
/**
2+
* Page object for Registered Model Details page
3+
* Handles interactions with model properties, labels, and metadata editing
4+
*/
5+
6+
class RegisteredModelDetails {
7+
// Properties section
8+
findPropertiesExpandableSection() {
9+
return cy.findByTestId('properties-expandable-section').first();
10+
}
11+
12+
findPropertiesTable() {
13+
return cy.findByTestId('properties-table');
14+
}
15+
16+
findAddPropertyButton() {
17+
return cy.findByTestId('add-property-button');
18+
}
19+
20+
findPropertyKeyInput() {
21+
return cy.findByTestId('add-property-key-input');
22+
}
23+
24+
findPropertyValueInput() {
25+
return cy.findByTestId('add-property-value-input');
26+
}
27+
28+
findSavePropertyButton() {
29+
return cy.findByTestId('save-edit-button-property');
30+
}
31+
32+
findDiscardPropertyButton() {
33+
return cy.findByTestId('discard-edit-button-property');
34+
}
35+
36+
findPropertiesToggleButton() {
37+
return this.findPropertiesExpandableSection().find('button[aria-expanded]').first();
38+
}
39+
40+
ensurePropertiesExpanded() {
41+
this.findPropertiesToggleButton()
42+
.scrollIntoView()
43+
.then(($btn) => {
44+
if ($btn.attr('aria-expanded') === 'false') {
45+
cy.wrap($btn).click();
46+
}
47+
});
48+
this.findPropertiesExpandableSection()
49+
.find('.pf-v6-c-expandable-section__content')
50+
.first()
51+
.should('not.have.css', 'visibility', 'hidden');
52+
}
53+
54+
findExpandPropertiesButton() {
55+
return cy.findByTestId('expand-control-button');
56+
}
57+
58+
// Helper to add a custom property
59+
addCustomProperty(key: string, value: string) {
60+
this.findPropertiesExpandableSection().click();
61+
this.findAddPropertyButton().click();
62+
this.findPropertyKeyInput().type(key);
63+
this.findPropertyValueInput().type(value);
64+
this.findSavePropertyButton().click();
65+
}
66+
67+
// Helper to verify custom property exists
68+
shouldHaveCustomProperty(key: string, value: string) {
69+
this.findPropertiesExpandableSection().within(() => {
70+
cy.contains(key).should('be.visible');
71+
cy.contains(value).should('be.visible');
72+
});
73+
return this;
74+
}
75+
76+
// Labels section
77+
findLabel(labelText: string) {
78+
return cy.findByTestId('label').contains(labelText);
79+
}
80+
81+
findLabelGroup() {
82+
return cy.findByTestId('popover-label-group');
83+
}
84+
85+
findModalLabelGroup() {
86+
return cy.findByTestId('modal-label-group');
87+
}
88+
89+
// Helper to verify label exists
90+
shouldHaveLabel(labelText: string) {
91+
cy.contains(labelText).should('be.visible');
92+
return this;
93+
}
94+
}
95+
96+
export const registeredModelDetails = new RegisteredModelDetails();

0 commit comments

Comments
 (0)