-
Notifications
You must be signed in to change notification settings - Fork 334
Expand file tree
/
Copy pathworkload-dashboard.spec.ts
More file actions
55 lines (42 loc) · 1.87 KB
/
workload-dashboard.spec.ts
File metadata and controls
55 lines (42 loc) · 1.87 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
import WorkloadDashboardPagePo from '@/cypress/e2e/po/pages/explorer/workloads/workload-dashboard.po';
const workloadDashboard = new WorkloadDashboardPagePo('local');
describe('Workload Dashboard', { testIsolation: 'off', tags: ['@explorer2', '@adminUser'] }, () => {
before(() => {
cy.login();
cy.updateNamespaceFilter('local', 'none', '{"local":[]}');
WorkloadDashboardPagePo.navTo();
workloadDashboard.waitForPage();
});
it('should display the title', () => {
workloadDashboard.title().should('contain.text', 'Workloads Overview');
});
it('should display a namespace subtitle with workload count', () => {
workloadDashboard.subtitle().should('be.visible');
workloadDashboard.subtitle().invoke('text').should('match', /\(\d+\)/);
});
it('should display the By State section with state cards', () => {
workloadDashboard.byStateSection().should('be.visible');
workloadDashboard.stateCards().should('have.length.gte', 1);
});
it('should display the By Type section with type cards', () => {
workloadDashboard.byTypeSection().should('be.visible');
workloadDashboard.byTypeCards().should('have.length.gte', 1);
});
it('should navigate to the resource list when clicking a By Type card', () => {
WorkloadDashboardPagePo.navTo();
workloadDashboard.waitForPage();
workloadDashboard.byTypeCards().first().click();
cy.url().should('match', /\/c\/local\/explorer\/(apps\.|batch\.)?[a-z]+/);
});
it('should show empty state when namespace filter matches no workloads', () => {
workloadDashboard.interceptSummariesAsEmpty();
WorkloadDashboardPagePo.navTo();
workloadDashboard.waitForPage();
workloadDashboard.waitForEmptySummaries();
workloadDashboard.emptyState().should('be.visible');
});
after(() => {
cy.login();
cy.updateNamespaceFilter('local', 'none', '{"local":["all://user"]}');
});
});