-
Notifications
You must be signed in to change notification settings - Fork 334
Expand file tree
/
Copy pathrole-bindings.spec.ts
More file actions
86 lines (69 loc) · 3.44 KB
/
role-bindings.spec.ts
File metadata and controls
86 lines (69 loc) · 3.44 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
import { RoleBindingsPagePo } from '@/cypress/e2e/po/pages/explorer/role-bindings.po';
import { generateRoleBindingDataSmall, roleBindingNoData } from '@/cypress/e2e/blueprints/explorer/rbac/role-bindings-get';
const roleBindingsPage = new RoleBindingsPagePo();
describe('RoleBindings', { testIsolation: false, tags: ['@explorer', '@adminUser'] }, () => {
before(() => {
cy.login();
});
describe('List', { tags: ['@noVai', '@adminUser'] }, () => {
before('set up', () => {
cy.updateNamespaceFilter('local', 'none', '{\"local\":[]}');
});
it('validate role bindings table in empty state', () => {
roleBindingNoData();
roleBindingsPage.goTo();
roleBindingsPage.waitForPage();
cy.wait('@roleBindingNoData');
const expectedHeaders = ['State', 'Name', 'Namespace', 'Role', 'Users', 'Groups', 'Service Accounts', 'Age'];
roleBindingsPage.list().resourceTable().sortableTable().tableHeaderRow()
.get('.table-header-container .content')
.each((el, i) => {
expect(el.text().trim()).to.eq(expectedHeaders[i]);
});
roleBindingsPage.list().resourceTable().sortableTable().checkRowCount(true, 1);
});
it('flat list: validate role bindings table', () => {
generateRoleBindingDataSmall();
roleBindingsPage.goTo();
roleBindingsPage.waitForPage();
cy.wait('@roleBindingDataSmall');
// check table headers are visible
const expectedHeaders = ['State', 'Name', 'Namespace', 'Role', 'Users', 'Groups', 'Service Accounts', 'Age'];
roleBindingsPage.list().resourceTable().sortableTable().tableHeaderRow()
.get('.table-header-container .content')
.each((el, i) => {
expect(el.text().trim()).to.eq(expectedHeaders[i]);
});
roleBindingsPage.list().resourceTable().sortableTable().checkVisible();
roleBindingsPage.list().resourceTable().sortableTable().checkLoadingIndicatorNotVisible();
roleBindingsPage.list().resourceTable().sortableTable().noRowsShouldNotExist();
roleBindingsPage.list().resourceTable().sortableTable().checkRowCount(false, 3);
});
it('group by namespace: validate role bindings table', () => {
generateRoleBindingDataSmall();
roleBindingsPage.goTo();
roleBindingsPage.waitForPage();
cy.wait('@roleBindingDataSmall');
// group by namespace
roleBindingsPage.list().resourceTable().sortableTable().groupByButtons(1)
.click();
// check table headers are visible
const expectedHeaders = ['State', 'Name', 'Role', 'Users', 'Groups', 'Service Accounts', 'Age'];
roleBindingsPage.list().resourceTable().sortableTable().tableHeaderRow()
.get('.table-header-container .content')
.each((el, i) => {
expect(el.text().trim()).to.eq(expectedHeaders[i]);
});
roleBindingsPage.list().resourceTable().sortableTable().checkVisible();
roleBindingsPage.list().resourceTable().sortableTable().checkLoadingIndicatorNotVisible();
roleBindingsPage.list().resourceTable().sortableTable().noRowsShouldNotExist();
roleBindingsPage.list().resourceTable().sortableTable().groupElementWithName('Namespace: kube-system')
.scrollIntoView()
.should('be.visible');
roleBindingsPage.list().resourceTable().sortableTable().checkRowCount(false, 3);
});
after('clean up', () => {
cy.updateNamespaceFilter('local', 'none', '{"local":["all://user"]}');
});
});
});