-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bdb92ab
commit 8eea2be
Showing
26 changed files
with
2,027 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
/playwright-report/ | ||
/playwright/.cache/ | ||
/storybook-static/ | ||
/public-cypress | ||
|
||
# production | ||
/public | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81 changes: 81 additions & 0 deletions
81
frontend/src/__tests__/cypress/cypress/e2e/clusterSettings/ClusterSettings.cy.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
import { mockClusterSettings } from '~/__mocks__/mockClusterSettings'; | ||
import { mockDashboardConfig } from '~/__mocks__/mockDashboardConfig'; | ||
import { mockDscStatus } from '~/__mocks__/mockDscStatus'; | ||
import { mockStatus } from '~/__mocks__/mockStatus'; | ||
import { | ||
clusterSettings, | ||
cullerSettings, | ||
modelServingSettings, | ||
notebookTolerationSettings, | ||
pvcSizeSettings, | ||
telemetrySettings, | ||
} from '~/__tests__/cypress/cypress/pages/clusterSettings'; | ||
import { be } from '~/__tests__/cypress/cypress/utils/should'; | ||
import { StackComponent } from '~/concepts/areas/types'; | ||
|
||
it('Cluster Settings', () => { | ||
cy.intercept( | ||
'/api/dsc/status', | ||
mockDscStatus({ | ||
installedComponents: { [StackComponent.K_SERVE]: true, [StackComponent.MODEL_MESH]: true }, | ||
}), | ||
); | ||
cy.intercept('/api/status', mockStatus()); | ||
cy.intercept('/api/config', mockDashboardConfig({})); | ||
cy.intercept('/api/cluster-settings', mockClusterSettings({})); | ||
|
||
clusterSettings.visit(); | ||
|
||
// check serving platform field | ||
modelServingSettings.findSinglePlatformCheckbox().should('be.checked'); | ||
modelServingSettings.findMultiPlatformCheckbox().should('be.checked'); | ||
modelServingSettings.findSubmitButton().should('be.disabled'); | ||
modelServingSettings.findMultiPlatformCheckbox().uncheck(); | ||
modelServingSettings.findAlert().should(be.info); | ||
modelServingSettings.findSubmitButton().should('be.enabled'); | ||
modelServingSettings.findSinglePlatformCheckbox().uncheck(); | ||
modelServingSettings.findAlert().should(be.warning); | ||
modelServingSettings.findMultiPlatformCheckbox().check(); | ||
modelServingSettings.findAlert().should(be.info); | ||
modelServingSettings.findSinglePlatformCheckbox().check(); | ||
modelServingSettings.findAlert().should('not.exist'); | ||
modelServingSettings.findSubmitButton().should('be.disabled'); | ||
|
||
// check PVC size field | ||
pvcSizeSettings.findInput().clear(); | ||
pvcSizeSettings.findInput().type('10'); | ||
pvcSizeSettings.findSubmitButton().should('be.enabled'); | ||
pvcSizeSettings.findInput().clear(); | ||
pvcSizeSettings.findSubmitButton().should('be.disabled'); | ||
pvcSizeSettings.findHint().should(be.error); | ||
pvcSizeSettings.findRestoreDefaultsButton().click(); | ||
pvcSizeSettings.findHint().should(be.indeterminate); | ||
|
||
// // check culler field | ||
cullerSettings.findLimitedOption().click(); | ||
cullerSettings.findSubmitButton().should('be.enabled'); | ||
cullerSettings.findHoursInput().clear(); | ||
cullerSettings.findSubmitButton().should('be.disabled'); | ||
cullerSettings.findHint().should(be.error); | ||
cullerSettings.findMinutesInput().type('20'); | ||
cullerSettings.findSubmitButton().should('be.enabled'); | ||
cullerSettings.findHint().should(be.indeterminate); | ||
cullerSettings.findUnlimitedOption().click(); | ||
cullerSettings.findSubmitButton().should('be.disabled'); | ||
|
||
// check user tracking field | ||
telemetrySettings.findEnabledCheckbox().click(); | ||
telemetrySettings.findSubmitButton().should('be.enabled'); | ||
telemetrySettings.findEnabledCheckbox().click(); | ||
telemetrySettings.findSubmitButton().should('be.disabled'); | ||
|
||
// check notebook toleration field | ||
notebookTolerationSettings.findKeyError().should('not.exist'); | ||
notebookTolerationSettings.findKeyInput().clear(); | ||
notebookTolerationSettings.findKeyError().should('exist'); | ||
notebookTolerationSettings.findSubmitButton().should('be.disabled'); | ||
notebookTolerationSettings.findKeyInput().type('NotebooksOnlyChange'); | ||
notebookTolerationSettings.findKeyError().should('not.exist'); | ||
notebookTolerationSettings.findEnabledCheckbox().click(); | ||
notebookTolerationSettings.findSubmitButton().should('be.enabled'); | ||
}); |
52 changes: 52 additions & 0 deletions
52
frontend/src/__tests__/cypress/cypress/e2e/customServingRuntimes/CustomServingRuntimes.cy.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import { mockDashboardConfig } from '~/__mocks__/mockDashboardConfig'; | ||
import { mockK8sResourceList } from '~/__mocks__/mockK8sResourceList'; | ||
import { mockProjectK8sResource } from '~/__mocks__/mockProjectK8sResource'; | ||
import { mockServingRuntimeTemplateK8sResource } from '~/__mocks__/mockServingRuntimeTemplateK8sResource'; | ||
import { mockStatus } from '~/__mocks__/mockStatus'; | ||
import { servingRuntimes } from '~/__tests__/cypress/cypress/pages/servingRuntimes'; | ||
import { ServingRuntimePlatform } from '~/types'; | ||
|
||
it('Custom serving runtimes', () => { | ||
cy.intercept('/api/status', mockStatus()); | ||
cy.intercept('/api/config', mockDashboardConfig({})); | ||
cy.intercept('/api/dashboardConfig/opendatahub/odh-dashboard-config', mockDashboardConfig({})); | ||
cy.intercept( | ||
{ pathname: '/api/templates/opendatahub' }, | ||
mockK8sResourceList([ | ||
mockServingRuntimeTemplateK8sResource({ | ||
name: 'template-1', | ||
displayName: 'Multi Platform', | ||
platforms: [ServingRuntimePlatform.SINGLE, ServingRuntimePlatform.MULTI], | ||
}), | ||
mockServingRuntimeTemplateK8sResource({ | ||
name: 'template-2', | ||
displayName: 'Caikit', | ||
platforms: [ServingRuntimePlatform.SINGLE], | ||
}), | ||
mockServingRuntimeTemplateK8sResource({ | ||
name: 'template-3', | ||
displayName: 'OVMS', | ||
platforms: [ServingRuntimePlatform.MULTI], | ||
}), | ||
mockServingRuntimeTemplateK8sResource({ | ||
name: 'template-4', | ||
displayName: 'Serving Runtime with No Annotations', | ||
}), | ||
]), | ||
); | ||
cy.intercept( | ||
'/api/k8s/apis/project.openshift.io/v1/projects', | ||
mockK8sResourceList([mockProjectK8sResource({})]), | ||
); | ||
|
||
servingRuntimes.visit(); | ||
|
||
// check the platform setting labels in the header | ||
servingRuntimes.shouldBeSingleModel(true).shouldBeMultiModel(true); | ||
|
||
// check the platform labels in the table row | ||
servingRuntimes.getRowById('template-1').shouldBeSingleModel(true).shouldBeMultiModel(true); | ||
servingRuntimes.getRowById('template-2').shouldBeSingleModel(true).shouldBeMultiModel(false); | ||
servingRuntimes.getRowById('template-3').shouldBeSingleModel(false).shouldBeMultiModel(true); | ||
servingRuntimes.getRowById('template-4').shouldBeSingleModel(false).shouldBeMultiModel(true); | ||
}); |
Oops, something went wrong.