Skip to content

Commit 9c7fdb2

Browse files
committed
monitoring stabilization
1 parent 31bbf1e commit 9c7fdb2

20 files changed

Lines changed: 70 additions & 68 deletions

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { nav } from '../../views/nav';
22
import { alerts } from '../../fixtures/monitoring/alert';
3-
import { guidedTour } from '../../views/tour';
43
import { runBVTMonitoringTests } from '../../support/monitoring/00.bvt_monitoring.cy';
54
import { commonPages } from '../../views/common';
65
import { overviewPage } from '../../views/overview-page';
@@ -17,9 +16,6 @@ describe('BVT: Monitoring', { tags: ['@smoke', '@monitoring'] }, () => {
1716
});
1817

1918
beforeEach(() => {
20-
cy.visit('/');
21-
guidedTour.close();
22-
cy.validateLogin();
2319
nav.sidenav.clickNavLink(['Observe', 'Metrics']);
2420
commonPages.titleShouldHaveText('Metrics');
2521
cy.changeNamespace("All Projects");

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import { nav } from '../../views/nav';
22
import { alerts } from '../../fixtures/monitoring/alert';
3-
import { guidedTour } from '../../views/tour';
43
import { runBVTMonitoringTestsNamespace } from '../../support/monitoring/00.bvt_monitoring_namespace.cy';
54
import { commonPages } from '../../views/common';
6-
import { overviewPage } from '../../views/overview-page';
75
// Set constants for the operators that need to be installed for tests.
86
const MP = {
97
namespace: 'openshift-monitoring',
@@ -17,9 +15,6 @@ describe('BVT: Monitoring - Namespaced', { tags: ['@monitoring-dev', '@smoke-dev
1715
});
1816

1917
beforeEach(() => {
20-
cy.visit('/');
21-
guidedTour.close();
22-
cy.validateLogin();
2318
alerts.getWatchdogAlert();
2419
nav.sidenav.clickNavLink(['Observe', 'Alerting']);
2520
commonPages.titleShouldHaveText('Alerting');

web/cypress/e2e/monitoring/regression/01.reg_alerts_admin.cy.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { alerts } from '../../../fixtures/monitoring/alert';
22
import { runAllRegressionAlertsTests } from '../../../support/monitoring/01.reg_alerts.cy';
33
import { commonPages } from '../../../views/common';
44
import { nav } from '../../../views/nav';
5-
import { guidedTour } from '../../../views/tour';
65

76
const MP = {
87
namespace: 'openshift-monitoring',
@@ -17,9 +16,6 @@ describe('Regression: Monitoring - Alerts (Administrator)', { tags: ['@monitorin
1716
});
1817

1918
beforeEach(() => {
20-
cy.visit('/');
21-
guidedTour.close();
22-
cy.validateLogin();
2319
alerts.getWatchdogAlert();
2420
nav.sidenav.clickNavLink(['Observe', 'Metrics']);
2521
commonPages.titleShouldHaveText('Metrics');

web/cypress/e2e/monitoring/regression/01.reg_alerts_dev.cy.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { alerts } from '../../../fixtures/monitoring/alert';
22
import { runAllRegressionAlertsTestsNamespace } from '../../../support/monitoring/04.reg_alerts_namespace.cy';
33
import { commonPages } from '../../../views/common';
44
import { nav } from '../../../views/nav';
5-
import { guidedTour } from '../../../views/tour';
65

76
const MP = {
87
namespace: 'openshift-monitoring',
@@ -16,9 +15,6 @@ describe('Regression: Monitoring - Alerts Namespaced (Administrator)', { tags: [
1615
});
1716

1817
beforeEach(() => {
19-
cy.visit('/');
20-
guidedTour.close();
21-
cy.validateLogin();
2218
alerts.getWatchdogAlert();
2319
nav.sidenav.clickNavLink(['Observe', 'Alerting']);
2420
commonPages.titleShouldHaveText('Alerting');

web/cypress/e2e/monitoring/regression/02.reg_metrics_admin_1.cy.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { runAllRegressionMetricsTests1 } from '../../../support/monitoring/02.re
22
import { runAllRegressionMetricsTestsNamespace1 } from '../../../support/monitoring/05.reg_metrics_namespace_1.cy';
33
import { commonPages } from '../../../views/common';
44
import { nav } from '../../../views/nav';
5-
import { guidedTour } from '../../../views/tour';
65

76
const MP = {
87
namespace: 'openshift-monitoring',
@@ -17,9 +16,6 @@ describe('Regression: Monitoring - Metrics (Administrator)', { tags: ['@monitori
1716
});
1817

1918
beforeEach(() => {
20-
cy.visit('/');
21-
guidedTour.close();
22-
cy.validateLogin();
2319
nav.sidenav.clickNavLink(['Observe', 'Metrics']);
2420
commonPages.titleShouldHaveText('Metrics');
2521
cy.changeNamespace("All Projects");
@@ -40,9 +36,6 @@ describe('Regression: Monitoring - Metrics Namespaced (Administrator)', { tags:
4036
});
4137

4238
beforeEach(() => {
43-
cy.visit('/');
44-
guidedTour.close();
45-
cy.validateLogin();
4639
nav.sidenav.clickNavLink(['Observe', 'Metrics']);
4740
commonPages.titleShouldHaveText('Metrics');
4841
cy.changeNamespace(MP.namespace);

web/cypress/e2e/monitoring/regression/02.reg_metrics_admin_2.cy.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { runAllRegressionMetricsTests2 } from '../../../support/monitoring/02.re
22
import { runAllRegressionMetricsTestsNamespace2 } from '../../../support/monitoring/05.reg_metrics_namespace_2.cy';
33
import { commonPages } from '../../../views/common';
44
import { nav } from '../../../views/nav';
5-
import { guidedTour } from '../../../views/tour';
65

76
const MP = {
87
namespace: 'openshift-monitoring',
@@ -17,9 +16,6 @@ describe('Regression: Monitoring - Metrics (Administrator)', { tags: ['@monitori
1716
});
1817

1918
beforeEach(() => {
20-
cy.visit('/');
21-
guidedTour.close();
22-
cy.validateLogin();
2319
nav.sidenav.clickNavLink(['Observe', 'Metrics']);
2420
commonPages.titleShouldHaveText('Metrics');
2521
cy.changeNamespace("All Projects");
@@ -40,9 +36,6 @@ describe('Regression: Monitoring - Metrics Namespaced (Administrator)', { tags:
4036
});
4137

4238
beforeEach(() => {
43-
cy.visit('/');
44-
guidedTour.close();
45-
cy.validateLogin();
4639
nav.sidenav.clickNavLink(['Observe', 'Metrics']);
4740
commonPages.titleShouldHaveText('Metrics');
4841
cy.changeNamespace(MP.namespace);

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { runAllRegressionLegacyDashboardsTests } from '../../../support/monitori
22
import { runAllRegressionLegacyDashboardsTestsNamespace } from '../../../support/monitoring/06.reg_legacy_dashboards_namespace.cy';
33
import { commonPages } from '../../../views/common';
44
import { nav } from '../../../views/nav';
5-
import { guidedTour } from '../../../views/tour';
65

76
const MP = {
87
namespace: 'openshift-monitoring',
@@ -17,9 +16,6 @@ describe('Regression: Monitoring - Legacy Dashboards (Administrator)', { tags: [
1716
});
1817

1918
beforeEach(() => {
20-
cy.visit('/');
21-
guidedTour.close();
22-
cy.validateLogin();
2319
//when running only this file, beforeBlock changes the namespace to openshift-monitoring
2420
//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
2521
nav.sidenav.clickNavLink(['Observe', 'Metrics']);
@@ -45,9 +41,6 @@ describe('Regression: Monitoring - Legacy Dashboards Namespaced (Administrator)'
4541
});
4642

4743
beforeEach(() => {
48-
cy.visit('/');
49-
guidedTour.close();
50-
cy.validateLogin();
5144
nav.sidenav.clickNavLink(['Observe', 'Dashboards']);
5245
commonPages.titleShouldHaveText('Dashboards');
5346
cy.changeNamespace(MP.namespace);

web/cypress/fixtures/monitoring/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ export enum MetricsPagePredefinedQueries {
9898
export enum MetricsPageQueryInput {
9999
EXPRESSION_PRESS_SHIFT_ENTER_FOR_NEWLINES = 'Expression (press Shift+Enter for newlines)',
100100
INSERT_EXAMPLE_QUERY = 'sort_desc(sum(sum_over_time(ALERTS{alertstate="firing"}[24h])) by (alertname))',
101+
INSERT_EXAMPLE_QUERY_NAMESPACE = 'sort_desc(sum(sum_over_time(ALERTS{alertstate="firing", namespace="openshift-monitoring"}[24h])) by (alertname))',
101102
VECTOR_QUERY='vector(1)',
102103
CPU_USAGE = 'OpenShift_Metrics_QueryTable_sum(node_namespace_pod_container_container_cpu_usage_seconds_total_sum_irate) by (pod).csv',
103104
MEMORY_USAGE = 'OpenShift_Metrics_QueryTable_sum(container_memory_working_set_bytes{container!=__}) by (pod).csv',

web/cypress/support/commands/auth-commands.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,11 @@ declare global {
8181
}
8282

8383
Cypress.Commands.add('validateLogin', () => {
84+
cy.log('validateLogin');
8485
cy.visit('/');
8586
cy.wait(2000);
8687
cy.byTestID("username", {timeout: 120000}).should('be.visible');
88+
cy.wait(10000);
8789
guidedTour.close();
8890
});
8991

@@ -127,6 +129,7 @@ declare global {
127129
}
128130
});
129131
nav.sidenav.switcher.changePerspectiveTo(perspective);
132+
cy.validateLogin();
130133
});
131134

132135
// To avoid influence from upstream login change

web/cypress/support/commands/utility-commands.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ Cypress.Commands.add('waitUntilWithCustomTimeout', (
116116

117117
Cypress.Commands.add('podImage', (pod: string, namespace: string) => {
118118
cy.log('Get pod image');
119+
cy.switchPerspective('Core platform');
120+
cy.wait(5000);
119121
cy.clickNavLink(['Workloads', 'Pods']);
120122
cy.changeNamespace(namespace);
121123
cy.byTestID('page-heading').contains('Pods').should('be.visible');

0 commit comments

Comments
 (0)