Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Ankush Behl <cloudbehl@gmail.com>
- Loading branch information
Showing
6 changed files
with
91 additions
and
6 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
79 changes: 79 additions & 0 deletions
79
frontend/packages/integration-tests-cypress/tests/storage/clone.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,79 @@ | ||
import { testName, checkErrors } from '../../support'; | ||
import { listPage } from '../../views/list-page'; | ||
import { PVC, testerDeployment } from '../../mocks/snapshot'; | ||
import { detailsPage, DetailsPageSelector } from '../../views/details-page'; | ||
import { modal } from '../../views/modal'; | ||
|
||
import { resourceStatusShouldContain } from '../../views/common'; | ||
|
||
const cloneName = `${PVC.metadata.name}-clone`; | ||
const cloneSize = '2'; | ||
|
||
if (Cypress.env('BRIDGE_AWS')) { | ||
describe('Clone Tests', () => { | ||
before(() => { | ||
cy.login(); | ||
cy.createProject(testName); | ||
cy.exec(`echo '${JSON.stringify(PVC)}' | oc apply -n ${testName} -f -`); | ||
cy.exec(`echo '${JSON.stringify(testerDeployment)}' | oc apply -n ${testName} -f -`); | ||
cy.clickNavLink(['Storage', 'Persistent Volume Claims']); | ||
listPage.filter.byName(PVC.metadata.name); | ||
resourceStatusShouldContain('Bound'); | ||
}); | ||
|
||
afterEach(() => { | ||
checkErrors(); | ||
}); | ||
|
||
after(() => { | ||
cy.exec(`echo '${JSON.stringify(testerDeployment)}' | oc delete -n ${testName} -f -`); | ||
cy.exec(`echo '${JSON.stringify(PVC)}' | oc delete -n ${testName} -f -`); | ||
cy.deleteProject(testName); | ||
cy.logout(); | ||
}); | ||
|
||
it('Creates PVC Clone', () => { | ||
listPage.rows.clickKebabAction(PVC.metadata.name, 'Clone PVC'); | ||
modal.shouldBeOpened(); | ||
modal.submitShouldBeEnabled(); | ||
cy.byTestID('input-request-size') | ||
.clear() | ||
.type(cloneSize); | ||
modal.submit(); | ||
modal.shouldBeClosed(); | ||
cy.location('pathname').should( | ||
'include', | ||
`persistentvolumeclaims/${PVC.metadata.name}-clone`, | ||
); | ||
detailsPage.titleShouldContain(`${PVC.metadata.name}-clone`); | ||
cy.exec(`oc get pvc ${PVC.metadata.name}-clone -n ${testName} -o json`) | ||
.its('stdout') | ||
.then((res) => { | ||
const pvc = JSON.parse(res); | ||
cy.get(DetailsPageSelector.name).contains(pvc.metadata.name); | ||
cy.get(DetailsPageSelector.namespace).contains(pvc.metadata.namespace); | ||
cy.byTestID('pvc-requested-capacity').contains(`${cloneSize} GiB`); | ||
}); | ||
}); | ||
|
||
it('Lists Clone', () => { | ||
cy.clickNavLink(['Persistent Volume Claims']); | ||
listPage.rows.shouldBeLoaded(); | ||
listPage.rows.shouldExist(cloneName); | ||
}); | ||
|
||
it('Deletes PVC Clone', () => { | ||
listPage.filter.byName(cloneName); | ||
listPage.rows.clickKebabAction(cloneName, 'Delete Persistent Volume Claim'); | ||
modal.shouldBeOpened(); | ||
modal.submitShouldBeEnabled(); | ||
modal.submit(); | ||
modal.shouldBeClosed(); | ||
listPage.rows.shouldNotExist(cloneName); | ||
}); | ||
}); | ||
} else { | ||
describe('Skipping Clone Tests', () => { | ||
it('No CSI based storage classes are available in this platform', () => {}); | ||
}); | ||
} |
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
2 changes: 0 additions & 2 deletions
2
frontend/packages/integration-tests-cypress/views/storage/snapshot.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
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