-
Notifications
You must be signed in to change notification settings - Fork 334
Expand file tree
/
Copy pathcluster-roles.spec.ts
More file actions
50 lines (40 loc) · 1.9 KB
/
cluster-roles.spec.ts
File metadata and controls
50 lines (40 loc) · 1.9 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
import { ClusterRolesPagePo } from '@/cypress/e2e/po/pages/explorer/cluster-roles.po';
import { clusterRolesNoData, generateClusterRolesDataSmall } from '@/cypress/e2e/blueprints/explorer/rbac/cluster-roles-get';
const clusterRolesPage = new ClusterRolesPagePo();
describe('ClusterRoles', { testIsolation: false, tags: ['@explorer', '@adminUser'] }, () => {
before(() => {
cy.login();
});
describe('List', { tags: ['@noVai', '@adminUser'] }, () => {
it('validate cluster roles table in empty state', () => {
clusterRolesNoData();
clusterRolesPage.goTo();
clusterRolesPage.waitForPage();
cy.wait('@clusterRolesNoData');
const expectedHeaders = ['State', 'Name', 'Created At'];
clusterRolesPage.list().resourceTable().sortableTable().tableHeaderRow()
.get('.table-header-container .content')
.each((el, i) => {
expect(el.text().trim()).to.eq(expectedHeaders[i]);
});
clusterRolesPage.list().resourceTable().sortableTable().checkRowCount(true, 1);
});
it('validate cluster roles table', () => {
generateClusterRolesDataSmall();
clusterRolesPage.goTo();
clusterRolesPage.waitForPage();
cy.wait('@clusterRolesDataSmall');
// check table headers are visible
const expectedHeaders = ['State', 'Name', 'Created At'];
clusterRolesPage.list().resourceTable().sortableTable().tableHeaderRow()
.get('.table-header-container .content')
.each((el, i) => {
expect(el.text().trim()).to.eq(expectedHeaders[i]);
});
clusterRolesPage.list().resourceTable().sortableTable().checkVisible();
clusterRolesPage.list().resourceTable().sortableTable().checkLoadingIndicatorNotVisible();
clusterRolesPage.list().resourceTable().sortableTable().noRowsShouldNotExist();
clusterRolesPage.list().resourceTable().sortableTable().checkRowCount(false, 2);
});
});
});