Skip to content

Commit 68e7788

Browse files
Merge pull request #659 from etmurasaki/ou-1086
OU-1086: monitoring tests reflecting namespace level
2 parents 2fd214b + 7b78ce6 commit 68e7788

27 files changed

+204
-226
lines changed

web/cypress/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ npm run test-cypress-smoke
277277

278278
**Run regression tests (all non-smoke tests):**
279279
```bash
280-
npx cypress run --env grepTags="-@smoke -@flaky -@demo"
280+
npx cypress run --env grepTags="--@smoke --@flaky --@demo"
281281
```
282282

283283
**Run component-specific tests:**
@@ -314,7 +314,7 @@ npx cypress run --env grepTags="@smoke+@incidents"
314314

315315
**Complex filtering:**
316316
```bash
317-
npx cypress run --env grepTags="@incidents -@slow -@flaky"
317+
npx cypress run --env grepTags="@incidents --@slow --@flaky"
318318
```
319319

320320
---

web/cypress/e2e/monitoring/00.bvt_admin.cy.ts

Lines changed: 3 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { nav } from '../../views/nav';
22
import { alerts } from '../../fixtures/monitoring/alert';
33
import { guidedTour } from '../../views/tour';
44
import { runBVTMonitoringTests } from '../../support/monitoring/00.bvt_monitoring.cy';
5-
import { runBVTMonitoringTestsNamespace } from '../../support/monitoring/00.bvt_monitoring_namespace.cy';
65
import { commonPages } from '../../views/common';
76
import { overviewPage } from '../../views/overview-page';
87
// Set constants for the operators that need to be installed for tests.
@@ -21,11 +20,13 @@ describe('BVT: Monitoring', { tags: ['@smoke', '@monitoring'] }, () => {
2120
cy.visit('/');
2221
guidedTour.close();
2322
cy.validateLogin();
23+
nav.sidenav.clickNavLink(['Observe', 'Metrics']);
24+
commonPages.titleShouldHaveText('Metrics');
25+
cy.changeNamespace("All Projects");
2426
alerts.getWatchdogAlert();
2527
nav.sidenav.clickNavLink(['Observe', 'Alerting']);
2628
commonPages.titleShouldHaveText('Alerting');
2729
alerts.getWatchdogAlert();
28-
cy.changeNamespace("All Projects");
2930
});
3031

3132
it(`1. Admin perspective - Observe Menu`, () => {
@@ -81,62 +82,4 @@ describe('BVT: Monitoring', { tags: ['@smoke', '@monitoring'] }, () => {
8182
name: 'Administrator',
8283
});
8384

84-
});
85-
86-
describe('BVT: Monitoring - Namespaced', { tags: ['@smoke', '@monitoring'] }, () => {
87-
88-
before(() => {
89-
cy.beforeBlock(MP);
90-
});
91-
92-
beforeEach(() => {
93-
cy.visit('/');
94-
guidedTour.close();
95-
cy.validateLogin();
96-
alerts.getWatchdogAlert();
97-
nav.sidenav.clickNavLink(['Observe', 'Alerting']);
98-
commonPages.titleShouldHaveText('Alerting');
99-
alerts.getWatchdogAlert();
100-
cy.changeNamespace(MP.namespace);
101-
});
102-
103-
it(`Admin perspective - Observe Menu`, () => {
104-
cy.log(`Admin perspective - Observe Menu and verify all submenus`);
105-
nav.sidenav.clickNavLink(['Administration', 'Cluster Settings']);
106-
commonPages.detailsPage.administration_clusterSettings();
107-
nav.sidenav.clickNavLink(['Observe', 'Alerting']);
108-
commonPages.titleShouldHaveText('Alerting');
109-
nav.tabs.switchTab('Silences');
110-
commonPages.projectDropdownShouldExist();
111-
nav.tabs.switchTab('Alerting rules');
112-
commonPages.projectDropdownShouldExist();
113-
nav.sidenav.clickNavLink(['Observe', 'Metrics']);
114-
commonPages.titleShouldHaveText('Metrics');
115-
commonPages.projectDropdownShouldExist();
116-
nav.sidenav.clickNavLink(['Observe', 'Dashboards']);
117-
commonPages.titleShouldHaveText('Dashboards');
118-
// commonPages.projectDropdownShouldExist();
119-
nav.sidenav.clickNavLink(['Observe', 'Targets']);
120-
commonPages.titleShouldHaveText('Metrics targets');
121-
commonPages.projectDropdownShouldNotExist();
122-
123-
});
124-
125-
it(`Admin perspective - Overview Page > Status - View alerts`, () => {
126-
nav.sidenav.clickNavLink(['Home', 'Overview']);
127-
overviewPage.clickStatusViewAlerts();
128-
commonPages.titleShouldHaveText('Alerting');
129-
});
130-
131-
it(`Admin perspective - Cluster Utilization - Metrics`, () => {
132-
nav.sidenav.clickNavLink(['Home', 'Overview']);
133-
overviewPage.clickClusterUtilizationViewCPU();
134-
commonPages.titleShouldHaveText('Metrics');
135-
});
136-
137-
// Run tests in Administrator perspective
138-
runBVTMonitoringTestsNamespace({
139-
name: 'Administrator',
140-
});
141-
14285
});
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import { nav } from '../../views/nav';
2+
import { alerts } from '../../fixtures/monitoring/alert';
3+
import { guidedTour } from '../../views/tour';
4+
import { runBVTMonitoringTestsNamespace } from '../../support/monitoring/00.bvt_monitoring_namespace.cy';
5+
import { commonPages } from '../../views/common';
6+
import { overviewPage } from '../../views/overview-page';
7+
// Set constants for the operators that need to be installed for tests.
8+
const MP = {
9+
namespace: 'openshift-monitoring',
10+
operatorName: 'Cluster Monitoring Operator',
11+
};
12+
13+
describe('BVT: Monitoring - Namespaced', { tags: ['@monitoring-dev', '@smoke-dev'] }, () => {
14+
15+
before(() => {
16+
cy.beforeBlock(MP);
17+
});
18+
19+
beforeEach(() => {
20+
cy.visit('/');
21+
guidedTour.close();
22+
cy.validateLogin();
23+
alerts.getWatchdogAlert();
24+
nav.sidenav.clickNavLink(['Observe', 'Alerting']);
25+
commonPages.titleShouldHaveText('Alerting');
26+
alerts.getWatchdogAlert();
27+
cy.changeNamespace(MP.namespace);
28+
});
29+
30+
// Run tests in Administrator perspective
31+
runBVTMonitoringTestsNamespace({
32+
name: 'Administrator',
33+
});
34+
35+
});
Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { alerts } from '../../../fixtures/monitoring/alert';
22
import { runAllRegressionAlertsTests } from '../../../support/monitoring/01.reg_alerts.cy';
3-
import { runAllRegressionAlertsTestsNamespace } from '../../../support/monitoring/04.reg_alerts_namespace.cy';
43
import { commonPages } from '../../../views/common';
54
import { nav } from '../../../views/nav';
65
import { guidedTour } from '../../../views/tour';
@@ -22,10 +21,12 @@ describe('Regression: Monitoring - Alerts (Administrator)', { tags: ['@monitorin
2221
guidedTour.close();
2322
cy.validateLogin();
2423
alerts.getWatchdogAlert();
24+
nav.sidenav.clickNavLink(['Observe', 'Metrics']);
25+
commonPages.titleShouldHaveText('Metrics');
26+
cy.changeNamespace("All Projects");
2527
nav.sidenav.clickNavLink(['Observe', 'Alerting']);
2628
commonPages.titleShouldHaveText('Alerting');
2729
alerts.getWatchdogAlert();
28-
cy.changeNamespace("All Projects");
2930
});
3031

3132
// Run tests in Administrator perspective
@@ -35,27 +36,4 @@ describe('Regression: Monitoring - Alerts (Administrator)', { tags: ['@monitorin
3536

3637
});
3738

38-
describe('Regression: Monitoring - Alerts Namespaced (Administrator)', { tags: ['@monitoring', '@alerts'] }, () => {
39-
40-
before(() => {
41-
cy.beforeBlock(MP);
42-
});
43-
44-
beforeEach(() => {
45-
cy.visit('/');
46-
guidedTour.close();
47-
cy.validateLogin();
48-
alerts.getWatchdogAlert();
49-
nav.sidenav.clickNavLink(['Observe', 'Alerting']);
50-
commonPages.titleShouldHaveText('Alerting');
51-
alerts.getWatchdogAlert();
52-
cy.changeNamespace(MP.namespace);
53-
});
54-
55-
// Run tests in Administrator perspective
56-
runAllRegressionAlertsTestsNamespace({
57-
name: 'Administrator',
58-
});
59-
60-
});
6139

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import { alerts } from '../../../fixtures/monitoring/alert';
2+
import { runAllRegressionAlertsTestsNamespace } from '../../../support/monitoring/04.reg_alerts_namespace.cy';
3+
import { commonPages } from '../../../views/common';
4+
import { nav } from '../../../views/nav';
5+
import { guidedTour } from '../../../views/tour';
6+
7+
const MP = {
8+
namespace: 'openshift-monitoring',
9+
operatorName: 'Cluster Monitoring Operator',
10+
};
11+
12+
describe('Regression: Monitoring - Alerts Namespaced (Administrator)', { tags: ['@monitoring-dev', '@alerts-dev'] }, () => {
13+
14+
before(() => {
15+
cy.beforeBlock(MP);
16+
});
17+
18+
beforeEach(() => {
19+
cy.visit('/');
20+
guidedTour.close();
21+
cy.validateLogin();
22+
alerts.getWatchdogAlert();
23+
nav.sidenav.clickNavLink(['Observe', 'Alerting']);
24+
commonPages.titleShouldHaveText('Alerting');
25+
alerts.getWatchdogAlert();
26+
cy.changeNamespace(MP.namespace);
27+
});
28+
29+
// Run tests in Administrator perspective
30+
runAllRegressionAlertsTestsNamespace({
31+
name: 'Administrator',
32+
});
33+
34+
});
35+

web/cypress/e2e/monitoring/regression/03.reg_legacy_dashboards_admin.cy.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,14 @@ describe('Regression: Monitoring - Legacy Dashboards (Administrator)', { tags: [
2020
cy.visit('/');
2121
guidedTour.close();
2222
cy.validateLogin();
23-
//TODO: Begin: To be removed when OU-949 get merged
24-
nav.sidenav.clickNavLink(['Observe', 'Alerting']);
25-
commonPages.titleShouldHaveText('Alerting');
23+
//when running only this file, beforeBlock changes the namespace to openshift-monitoring
24+
//so we need to change it back to All Projects before landing to Dashboards page in order to have API Performance dashboard loaded by default
25+
nav.sidenav.clickNavLink(['Observe', 'Metrics']);
26+
commonPages.titleShouldHaveText('Metrics');
2627
cy.changeNamespace("All Projects");
27-
//TODO: End: To be removed when OU-949 get merged
2828
nav.sidenav.clickNavLink(['Observe', 'Dashboards']);
2929
commonPages.titleShouldHaveText('Dashboards');
30-
//TODO: Uncomment when OU-949 get merged
31-
//cy.changeNamespace("All Projects");
30+
cy.changeNamespace("All Projects");
3231
});
3332

3433
// Run tests in Administrator perspective
@@ -38,7 +37,6 @@ describe('Regression: Monitoring - Legacy Dashboards (Administrator)', { tags: [
3837

3938
});
4039

41-
/* TODO: Uncomment when OU-949 get merged
4240
// Test suite for Administrator perspective
4341
describe('Regression: Monitoring - Legacy Dashboards Namespaced (Administrator)', { tags: ['@monitoring', '@dashboards'] }, () => {
4442

@@ -61,4 +59,3 @@ describe('Regression: Monitoring - Legacy Dashboards Namespaced (Administrator)'
6159
});
6260

6361
});
64-
*/

web/cypress/e2e/virtualization/00.coo_ivt.cy.ts

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -67,37 +67,17 @@ describe('IVT: Monitoring + Virtualization', { tags: ['@smoke', '@virtualization
6767
cy.validateLogin();
6868
cy.switchPerspective('Virtualization');
6969
guidedTour.closeKubevirtTour();
70-
alerts.getWatchdogAlert();
71-
nav.sidenav.clickNavLink(['Observe', 'Alerting']);
72-
commonPages.titleShouldHaveText('Alerting');
70+
nav.sidenav.clickNavLink(['Observe', 'Metrics']);
71+
commonPages.titleShouldHaveText('Metrics');
7372
cy.changeNamespace("All Projects");
7473
alerts.getWatchdogAlert();
75-
});
76-
77-
// Run tests in Administrator perspective
78-
runBVTMonitoringTests({
79-
name: 'Virtualization',
80-
});
81-
82-
});
83-
84-
describe('IVT: Monitoring + Virtualization - Namespaced', { tags: ['@smoke', '@virtualization'] }, () => {
85-
86-
beforeEach(() => {
87-
cy.visit('/');
88-
guidedTour.close();
89-
cy.validateLogin();
90-
cy.switchPerspective('Virtualization');
91-
guidedTour.closeKubevirtTour();
92-
alerts.getWatchdogAlert();
9374
nav.sidenav.clickNavLink(['Observe', 'Alerting']);
9475
commonPages.titleShouldHaveText('Alerting');
95-
cy.changeNamespace(MP.namespace);
9676
alerts.getWatchdogAlert();
9777
});
9878

9979
// Run tests in Administrator perspective
100-
runBVTMonitoringTestsNamespace({
80+
runBVTMonitoringTests({
10181
name: 'Virtualization',
10282
});
10383

web/cypress/e2e/virtualization/01.coo_ivt_alerts.cy.ts

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -65,37 +65,17 @@ describe('Regression: Monitoring - Alerts (Virtualization)', { tags: ['@virtuali
6565
cy.validateLogin();
6666
cy.switchPerspective('Virtualization');
6767
guidedTour.closeKubevirtTour();
68-
alerts.getWatchdogAlert();
69-
nav.sidenav.clickNavLink(['Observe', 'Alerting']);
70-
commonPages.titleShouldHaveText('Alerting');
68+
nav.sidenav.clickNavLink(['Observe', 'Metrics']);
69+
commonPages.titleShouldHaveText('Metrics');
7170
cy.changeNamespace("All Projects");
7271
alerts.getWatchdogAlert();
73-
});
74-
// Run tests in Virtualization perspective
75-
runAllRegressionAlertsTests({
76-
name: 'Virtualization',
77-
});
78-
79-
});
80-
81-
describe('Regression: Monitoring - Alerts Namespaced (Virtualization)', { tags: ['@virtualization', '@alerts'] }, () => {
82-
83-
beforeEach(() => {
84-
cy.visit('/');
85-
cy.validateLogin();
86-
cy.switchPerspective('Virtualization');
87-
guidedTour.closeKubevirtTour();
88-
alerts.getWatchdogAlert();
8972
nav.sidenav.clickNavLink(['Observe', 'Alerting']);
9073
commonPages.titleShouldHaveText('Alerting');
91-
cy.changeNamespace(MP.namespace);
9274
alerts.getWatchdogAlert();
93-
9475
});
9576
// Run tests in Virtualization perspective
96-
runAllRegressionAlertsTestsNamespace({
77+
runAllRegressionAlertsTests({
9778
name: 'Virtualization',
98-
9979
});
10080

10181
});

web/cypress/e2e/virtualization/03.coo_ivt_legacy_dashboards.cy.ts

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,9 @@ describe('Regression: Monitoring - Legacy Dashboards (Virtualization)', { tags:
6464
cy.validateLogin();
6565
cy.switchPerspective('Virtualization');
6666
guidedTour.closeKubevirtTour();
67-
//TODO: Begin: To be removed when OU-949 get merged
68-
nav.sidenav.clickNavLink(['Observe', 'Alerting']);
69-
commonPages.titleShouldHaveText('Alerting');
70-
cy.changeNamespace("All Projects");
71-
//TODO: End: To be removed when OU-949 get merged
7267
nav.sidenav.clickNavLink(['Observe', 'Dashboards']);
7368
commonPages.titleShouldHaveText('Dashboards');
74-
//TODO: Uncomment when OU-949 get merged
75-
// cy.changeNamespace("All Projects");
69+
cy.changeNamespace("All Projects");
7670
});
7771

7872
runAllRegressionLegacyDashboardsTests({
@@ -81,20 +75,18 @@ describe('Regression: Monitoring - Legacy Dashboards (Virtualization)', { tags:
8175

8276
});
8377

84-
/* TODO: Uncomment when OU-949 get merged
85-
// describe('Regression: Monitoring - Legacy Dashboards Namespaced (Virtualization)', () => {
86-
// beforeEach(() => {
87-
// cy.visit('/');
88-
// cy.validateLogin();
89-
// cy.switchPerspective('Virtualization');
90-
// guidedTour.closeKubevirtTour();
91-
// nav.sidenav.clickNavLink(['Observe', 'Dashboards']);
92-
// commonPages.titleShouldHaveText('Dashboards');
93-
// cy.changeNamespace(MP.namespace);
94-
// });
78+
describe('Regression: Monitoring - Legacy Dashboards Namespaced (Virtualization)', { tags: ['@virtualization', '@dashboards'] }, () => {
79+
beforeEach(() => {
80+
cy.visit('/');
81+
cy.validateLogin();
82+
cy.switchPerspective('Virtualization');
83+
guidedTour.closeKubevirtTour();
84+
nav.sidenav.clickNavLink(['Observe', 'Dashboards']);
85+
commonPages.titleShouldHaveText('Dashboards');
86+
cy.changeNamespace(MP.namespace);
87+
});
9588

96-
// runAllRegressionLegacyDashboardsTestsNamespace({
97-
// name: 'Virtualization',
98-
// });
99-
// });
100-
*/
89+
runAllRegressionLegacyDashboardsTestsNamespace({
90+
name: 'Virtualization',
91+
});
92+
});

0 commit comments

Comments
 (0)