Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add cypress integration test support for Ceph plugin
Add test for Subscription flow for OCS Operator
- Loading branch information
Showing
9 changed files
with
83 additions
and
0 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
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
18 changes: 18 additions & 0 deletions
18
frontend/packages/ceph-storage-plugin/integration-tests-cypress/cypress-ceph.json
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,18 @@ | ||
{ | ||
"integrationFolder": "tests", | ||
"screenshotsFolder": "../../../gui_test_screenshots/cypress/screenshots", | ||
"videosFolder": "../../../gui_test_screenshots/cypress/videos", | ||
"video": true, | ||
"reporter": "../../../node_modules/cypress-multi-reporters", | ||
"reporterOptions": { | ||
"configFile": "reporter-config.json" | ||
}, | ||
"supportFile": "../../integration-tests-cypress/support/index.ts", | ||
"pluginsFile": "../../integration-tests-cypress/plugins/index.js", | ||
"fixturesFolder": false, | ||
"defaultCommandTimeout": 30000, | ||
"retries": { | ||
"runMode": 1, | ||
"openMode": 0 | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
frontend/packages/ceph-storage-plugin/integration-tests-cypress/reporter-config.json
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,14 @@ | ||
{ | ||
"reporterEnabled": "mocha-junit-reporter, mochawesome", | ||
"mochaJunitReporterReporterOptions": { | ||
"mochaFile": "../../../gui_test_screenshots/junit_cypress-[hash].xml", | ||
"toConsole": false | ||
}, | ||
"mochawesomeReporterOptions": { | ||
"reportDir": "../../../gui_test_screenshots/", | ||
"reportFilename": "cypress_report_ceph", | ||
"overwrite": false, | ||
"html": false, | ||
"json": true | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
...end/packages/ceph-storage-plugin/integration-tests-cypress/tests/subscribe-to-ocs.spec.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,44 @@ | ||
import { nav } from '../../../integration-tests-cypress/views/nav'; | ||
import { primaryButton } from '../../../integration-tests-cypress/views/form'; | ||
import { installSucess } from '../views/olm'; | ||
|
||
describe('Subscribe to OCS Operator from OperatorHub', () => { | ||
before(() => { | ||
cy.login(); | ||
cy.visit('/'); | ||
nav.sidenav.clickNavLink(['Operators', 'OperatorHub']); | ||
}); | ||
|
||
after(() => { | ||
cy.logout(); | ||
}); | ||
|
||
it('Searches and finds OCS Operator', () => { | ||
cy.byTestID('search-operatorhub').type('Openshift Container Storage'); | ||
cy.byTestID('ocs-operator-redhat-operators-openshift-marketplace').click({ force: true }); | ||
}); | ||
|
||
it('Subscribes to OCS Operator', () => { | ||
cy.byLegacyTestID('operator-install-btn').click({ force: true }); | ||
cy.byTestID('Operator recommended namespace:-radio-input').should('be.checked'); | ||
cy.byTestID('enable-monitoring').click(); | ||
cy.get(primaryButton).click(); | ||
|
||
cy.get(installSucess, { timeout: 180000 }).should('be.visible'); | ||
}); | ||
|
||
it('openshift-storage namespace should be labelled properly', () => { | ||
cy.exec('oc get project openshift-storage -o yaml') | ||
.its('stdout') | ||
.should('contain', 'openshift.io/cluster-monitoring: "true"'); | ||
}); | ||
|
||
// Rook, Noobaa and OCS pod should come up after installation. | ||
it('Test for presence for 3 OCS Operator Pods', () => { | ||
cy.exec('oc get po -n openshift-storage') | ||
.its('stdout') | ||
.should('contain', 'noobaa-operator') | ||
.should('contain', 'ocs-operator') | ||
.should('contain', 'rook-ceph-operator'); | ||
}); | ||
}); |
1 change: 1 addition & 0 deletions
1
frontend/packages/ceph-storage-plugin/integration-tests-cypress/views/olm.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 @@ | ||
export const installSucess = 'svg[fill="#3e8635"]'; |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export const submitButton = 'button[type=submit]'; | ||
export const errorMessage = '.pf-c-alert.pf-m-inline.pf-m-danger'; | ||
export const successMessage = '.pf-c-alert.pf-m-inline.pf-m-success'; | ||
export const primaryButton = '.pf-c-button.pf-m-primary'; |
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
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