-
Notifications
You must be signed in to change notification settings - Fork 334
Expand file tree
/
Copy pathpersistent-volumes.spec.ts
More file actions
66 lines (53 loc) · 2.72 KB
/
persistent-volumes.spec.ts
File metadata and controls
66 lines (53 loc) · 2.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import { PersistentVolumesPagePo } from '@/cypress/e2e/po/pages/explorer/persistent-volumes.po';
import { generatePersistentVolumesDataSmall, persistentVolumesNoData } from '@/cypress/e2e/blueprints/explorer/storage/persistent-volumes-get';
const persistentVolumesPagePo = new PersistentVolumesPagePo();
describe('PersistentVolumes', { testIsolation: false, tags: ['@explorer2', '@adminUser'] }, () => {
before(() => {
cy.login();
});
describe('List', { tags: ['@noVai', '@adminUser'] }, () => {
before('set up', () => {
cy.updateNamespaceFilter('local', 'none', '{\"local\":[]}');
});
it('validate persistent volumes table in empty state', () => {
persistentVolumesNoData();
persistentVolumesPagePo.goTo();
persistentVolumesPagePo.waitForPage();
cy.wait('@persistentvolumesNoData');
const expectedHeaders = ['State', 'Name', 'Reclaim Policy', 'Persistent Volume Claim', 'Source', 'Reason', 'Age'];
persistentVolumesPagePo.list().resourceTable().sortableTable().tableHeaderRow()
.get('.table-header-container .content')
.each((el, i) => {
expect(el.text().trim()).to.eq(expectedHeaders[i]);
});
persistentVolumesPagePo.list().resourceTable().sortableTable().checkRowCount(true, 1);
});
it('validate persistent volumes table', () => {
generatePersistentVolumesDataSmall();
persistentVolumesPagePo.goTo();
persistentVolumesPagePo.waitForPage();
cy.wait('@persistentvolumesDataSmall');
// check table headers are visible
const expectedHeaders = ['State', 'Name', 'Reclaim Policy', 'Persistent Volume Claim', 'Source', 'Reason', 'Age'];
persistentVolumesPagePo.list().resourceTable().sortableTable().tableHeaderRow()
.get('.table-header-container .content')
.each((el, i) => {
expect(el.text().trim()).to.eq(expectedHeaders[i]);
});
persistentVolumesPagePo.list().resourceTable().sortableTable().checkVisible();
persistentVolumesPagePo.list().resourceTable().sortableTable().checkLoadingIndicatorNotVisible();
persistentVolumesPagePo.list().resourceTable().sortableTable().noRowsShouldNotExist();
persistentVolumesPagePo.list().resourceTable().sortableTable().checkRowCount(false, 1);
});
it('can open "Edit as YAML"', () => {
persistentVolumesPagePo.goTo();
persistentVolumesPagePo.waitForPage();
persistentVolumesPagePo.clickCreate();
persistentVolumesPagePo.createPersistentVolumesForm().editAsYaml().click();
persistentVolumesPagePo.createPersistentVolumesForm().yamlEditor().checkExists();
});
after('clean up', () => {
cy.updateNamespaceFilter('local', 'none', '{"local":["all://user"]}');
});
});
});