diff --git a/frontend/packages/console-shared/src/components/dashboard/utilization-card/TopConsumerPopover.tsx b/frontend/packages/console-shared/src/components/dashboard/utilization-card/TopConsumerPopover.tsx index 888e47eae21..09726c78e78 100644 --- a/frontend/packages/console-shared/src/components/dashboard/utilization-card/TopConsumerPopover.tsx +++ b/frontend/packages/console-shared/src/components/dashboard/utilization-card/TopConsumerPopover.tsx @@ -3,7 +3,7 @@ import * as React from 'react'; import { Button, Popover, PopoverPosition } from '@patternfly/react-core'; import { useTranslation } from 'react-i18next'; import { Link } from 'react-router-dom-v5-compat'; -import { useActivePerspective, LIMIT_STATE, Humanize } from '@console/dynamic-plugin-sdk'; +import { LIMIT_STATE, Humanize } from '@console/dynamic-plugin-sdk'; import { getPrometheusQueryResponse } from '@console/internal/actions/dashboards'; import { withDashboardResources, @@ -15,8 +15,7 @@ import { resourcePathFromModel } from '@console/internal/components/utils'; import { ConsoleSelect } from '@console/internal/components/utils/console-select'; import { useK8sWatchResource } from '@console/internal/components/utils/k8s-watch-hook'; import { K8sKind, referenceForModel, K8sResourceCommon } from '@console/internal/module/k8s'; -import { getName, getNamespace, useFlag } from '../../..'; -import { FLAGS } from '../../../constants'; +import { getName, getNamespace } from '../../..'; import { RedExclamationCircleIcon, YellowExclamationTriangleIcon } from '../../status'; import Status from '../status-card/StatusPopup'; @@ -131,9 +130,6 @@ export const PopoverBody = withDashboardResources { const { t } = useTranslation(); const [currentConsumer, setCurrentConsumer] = React.useState(consumers[0]); - const [activePerspective, setActivePerspective] = useActivePerspective(); - const canAccessMonitoring = - useFlag(FLAGS.CAN_GET_NS) && !!window.SERVER_FLAGS.prometheusBaseURL; const { query, model, metric, fieldSelector } = currentConsumer; const k8sResource = React.useMemo( () => (isOpen ? getResourceToWatch(model, namespace, fieldSelector) : null), @@ -176,8 +172,9 @@ export const PopoverBody = withDashboardResources { const params = new URLSearchParams(); params.set('query0', currentConsumer.query); + params.set('namespace', namespace); return params; - }, [currentConsumer.query]); + }, [currentConsumer.query, namespace]); const dropdownItems = React.useMemo( () => @@ -195,10 +192,7 @@ export const PopoverBody = withDashboardResources - { - if (monitoringURL.startsWith('/dev-monitoring') && activePerspective !== 'dev') { - setActivePerspective('dev'); - } - }} - > - {t('console-shared~View more')} - + {t('console-shared~View more')} ); } diff --git a/frontend/packages/dev-console/integration-tests/features/monitoring/changing-context-monitoring-dashboard.feature b/frontend/packages/dev-console/integration-tests/features/monitoring/changing-context-monitoring-dashboard.feature deleted file mode 100644 index 4138ee4dac4..00000000000 --- a/frontend/packages/dev-console/integration-tests/features/monitoring/changing-context-monitoring-dashboard.feature +++ /dev/null @@ -1,36 +0,0 @@ -@monitoring @dev-console @odc-3698 -Feature: Changing context in Observe Dashboard - As a user, I should be able to change the filter in the Observe Dashboard - - - Background: - Given user is at developer perspective - And user has created or selected namespace "aut-observe" - And user has created workload "nodejs-ex-git" with resource type "Deployment" - - - @regression - Scenario: Charts display in observe dashboards for specific workload: M-01-TC01 - Given user is at the Topology page - When user selects the workload "nodejs-ex-git" to open the topology sidebar - And user navigates to observe dashboards from toplogy sidebar - Then user is able to see the workload "nodejs-ex-git" in workloads dropdown - And user will see "CPU Usage" chart - And user will see "CPU Quota" chart - And user will see "Memory Usage" chart - And user will see "Memory Quota" chart - And user will see "Current Network Usage" chart - And user will see "Bandwidth" charts - And user will see "Rate of Packets" charts - And user will see "Rate of Packets Dropped" charts - - - @regression - Scenario: Restore the selected workload on refresh: M-01-TC02 - Given user is at the Observe dashboard - When user clicks on Dashboard dropdown - And user selects "Kubernetes / Compute Resources / Workload" option from the dropdown - And user clicks on Workload dropdown - And user selects "nodejs-ex-git" option from the dropdown - And user refreshes the page - Then user is still able to see the same workload "nodejs-ex-git" diff --git a/frontend/packages/dev-console/integration-tests/features/monitoring/dashboard-display.feature b/frontend/packages/dev-console/integration-tests/features/monitoring/dashboard-display.feature deleted file mode 100644 index 4960ca5019c..00000000000 --- a/frontend/packages/dev-console/integration-tests/features/monitoring/dashboard-display.feature +++ /dev/null @@ -1,169 +0,0 @@ -@monitoring @dev-console @broken-test -Feature: Observe Page - As a user, I should be able to perform actions related to observe a project and deployments inside it - - - Background: - Given user is at developer perspective - And user has created or selected namespace "aut-observe-1" - - - @smoke - Scenario: Observe Page: M-02-TC01 - Given user is at Add page - When user navigates to Observe page - Then user will see Dashboard, Metrics, Alerts, Events tabs - - - @regression @odc-3698 - Scenario: Dashboard tab on the Observe page with Kubernetes / Compute Resources / Namespace (Workloads) option selected: M-02-TC02 - Given user has created workload "parks-test" with resource type "Deployment" - And user is on Observe page - When user clicks on "Dashboard" tab - And user clicks on Dashboard dropdown - And user selects "Kubernetes / Compute Resources / Namespace (Workloads)" option from the dropdown - And user clicks on Type dropdown - And user selects "deployment" option from the dropdown - Then user will see "CPU Usage" chart - And user will see "CPU Quota" chart - And user will see "Memory Usage" chart - And user will see "Memory Quota" chart - And user will see "Current Network Usage" chart - And user will see "Bandwidth" charts - And user will see "Rate of Packets" charts - And user will see "Rate of Packets Dropped" charts - - - @regression @odc-3698 - Scenario: Dashboard tab on the Observe page with Kubernetes / Compute Resources / Namespace (Pods) option selected: M-02-TC03 - Given user is on Observe page - When user clicks on "Dashboard" tab - And user clicks on Dashboard dropdown - And user selects "Kubernetes / Compute Resources / Namespace (Pods)" option from the dropdown - Then user will see "CPU Utilisation (from requests)" chart - And user will see "CPU Utilisation (from limits)" chart - And user will see "Memory Utilisation (from requests)" chart - And user will see "Memory Utilisation (from limits)" chart - And user will see "CPU Usage" chart - And user will see "CPU Quota" chart - And user will see "Memory Usage (w/o-cache)" chart - And user will see "Memory Quota" chart - And user will see "Current Network Usage" chart - And user will see "Bandwidth" charts - And user will see "Rate of Packets" charts - And user will see "Rate of Packets Dropped" charts - And user will see "Storage IO" charts - And user will see "Storage IO - Distribution" charts - - - @regression @odc-3698 - Scenario: Dashboard tab on the Observe page with Kubernetes / Compute Resources / Workload option selected: M-02-TC04 - Given user has created workload "parks-test-1" with resource type "Deployment" - And user is on Observe page - When user clicks on "Dashboard" tab - And user clicks on Dashboard dropdown - And user selects "Kubernetes / Compute Resources / Workload" option from the dropdown - And user clicks on Workload dropdown - And user selects "parks-test" option from the dropdown - And user clicks on Type dropdown - And user selects "deployment" option from the dropdown - Then user will see "CPU Usage" chart - And user will see "CPU Quota" chart - And user will see "Memory Usage" chart - And user will see "Memory Quota" chart - And user will see "Current Network Usage" chart - And user will see "Bandwidth" charts - And user will see "Average Container Bandwidth by Pod" charts - And user will see "Rate of Packets" charts - And user will see "Rate of Packets Dropped" charts - - - @regression @odc-3698 - Scenario: Dashboard tab on the Observe page with Kubernetes / Compute Resources / Pod option selected: M-02-TC05 - Given user has created workload "parks-test-2" with resource type "Deployment" - And user is on Observe page - When user clicks on "Dashboard" tab - And user clicks on Dashboard dropdown - And user selects "Kubernetes / Compute Resources / Pod" option from the dropdown - And user clicks on Pod dropdown - # Pod name is dynamic so select first option - And user selects the first option from the dropdown - Then user will see "CPU Usage" chart - And user will see "CPU Throttling" chart - And user will see "CPU Quota" chart - And user will see "Memory Usage (WSS)" chart - And user will see "Memory Quota" chart - And user will see "Bandwidth" charts - And user will see "Rate of Packets" charts - And user will see "Rate of Packets Dropped" charts - And user will see "Storage IO - Distribution(Pod - Read & Writes)" charts - - - # https://bugzilla.redhat.com/show_bug.cgi?id=2026865 - @regression @broken-test - Scenario: Inspect chart directs to Metrics tab: M-02-TC06 - Given user is on Observe page - When user clicks on "Dashboard" tab - And user clicks on Dashboard dropdown - And user selects "Kubernetes / Compute Resources / Namespace (Pods)" option from the dropdown - And user clicks on Inspect on "CPU Usage" chart - Then user will see Metrics tab in Observe page - And "CPU Usage" option selected by default - - - @smoke - Scenario: Events tab on the Observe Page: M-02-TC07 - Given user is on Observe page - When user clicks on "Events" tab - Then user will see events related to all resources and all types - - - @regression @odc-3698 - Scenario: Events for Multiple Resources: M-02-TC08 - Given user has workloads of all resource types - And user is on Observe page - When user clicks on "Events" tab - And user clicks on Resources dropdown - And user selects "Service" - And user selects "Deployment" - And user selects "DeploymentConfig" - Then user will see events for Service, Deployment and DeploymentConfig type resources - - - @regression @to-do - Scenario Outline: Event types on observe page: M-02-TC09 - Given user has workloads of all resource types - And user is on Observe page - When user clicks on "Events" tab - And user clicks on Types dropdown - And user selects "" from Types dropdown - Then user will see "" types of events - - Examples: - | Type | - | Normal | - | Warning | - - - @regression @odc-3698 - Scenario: Filter Events by name or message: M-02-TC10 - Given user has workloads of all resource types - And user is on Observe page - When user clicks on "Events" tab - And user enters "Scaled Up" in the Filter field - Then user will see events having Scaled Up message - - - @smoke - Scenario: Alerts tab on observe page: M-02-TC11 - Given user is on Observe page - When user clicks on "Alerts" tab - Then user is able to see Name, Severity, Alert State and Notifications - - - @regression @odc-6359 - Scenario: Knative items present in dashboard: M-02-TC12 - Given user is on Observe page - When user clicks on "Dashboard" tab - And user clicks on Dashboard dropdown - Then user can see "Knative Serving - Revision CPU and Memory Usage" and "Knative Serving - Revision Queue Proxy Metrics" option diff --git a/frontend/packages/dev-console/integration-tests/features/monitoring/monitoring-alerts.feature b/frontend/packages/dev-console/integration-tests/features/monitoring/monitoring-alerts.feature deleted file mode 100644 index 2c0b1ba59c4..00000000000 --- a/frontend/packages/dev-console/integration-tests/features/monitoring/monitoring-alerts.feature +++ /dev/null @@ -1,155 +0,0 @@ -@monitoring @dev-console @broken-test -Feature: Filter for Alert state and Severity - User should be able to filter out alerts as per Alert State and Severity - - - Background: - Given user is at developer perspective - And user is at Add page - And user has created or selected namespace "aut-observe-alerts" - # To configure the alerts on cluster - need to execute below yaml files from monitoring YAMLs test data - # cluster-monitoring-config.yaml, workload-monitoring-config.yaml, prometheous-example.yaml - And user is at Observe page - - - @smoke - Scenario: Filters dropdown on the Alerts page: M-03-TC01 - Given user is on the Alerts tab - When user clicks on the Filter dropdown - Then user is able to see Firing, Pending, Silenced and Not Firing filters under Alert State type - And user is able to see Critical, Warning, Info and None filters under Severity type - And user is able to see filters as unchecked - - - @regression @manual - Scenario Outline: Ability to show only "" Alerts on the Alerts tab: M-03-TC02 - Given user is on the Alerts tab - When user selects the "" option under Alert State type - Then user will see the only "" alerts if there are any - - Examples: - | alert_state | - | Firing | - | Pending | - | Silenced | - | Not Firing | - - - @regression @manual - Scenario Outline: Ability to show only "" Alerts on the Alerts tab: M-03-TC03 - Given user is on the Alerts tab - When user selects the "" option under Severity type - Then user will see the only "" alerts if there are any - - Examples: - | severity | - | Critical | - | Warning | - | Info | - | None | - - - @regression @manual - Scenario Outline: Ability to hide only "" Alerts on the Alerts tab: M-03-TC04 - Given user is on the Alerts tab - When user selects the "" option under Alert State type - Then user will not see the "" alerts - - Examples: - | alert_state | - | Firing | - | Pending | - | Silenced | - | Not Firing | - - - @regression @manual - Scenario Outline: Ability to hide only "" Alerts on the Alerts tab: M-03-TC05 - Given user is on the Alerts tab - When user selects the "" option under Severity type - Then user will not see the "" alerts - - Examples: - | severity | - | Critical | - | Warning | - | Info | - | None | - - - @regression @to-do - Scenario: Alert details page: M-03-TC06 - Given user is on Alerts tab - When user clicks on the name of the alert - Then user will see Alert details page - And user will see alert Metrics - And user will see Name, Severity, Labels, Source, State, Alerting rule - - - @regression @to-do - Scenario: Time range on Metrics in Alert details page: M-03-TC07 - Given user is on Alert details page - When user selects "1 hour" on Time range dropdown - Then user will see alert activity for past one hour - - - @regression @to-do - Scenario: Reset Zoom on Metrics in Alert details page: M-03-TC08 - Given user is on Alert details page - When user selects "1 hour" on Time range dropdown - And user clicks on Reset zoom - Then user will see Time range changed to 30 minutes - - - @regression @to-do - Scenario: Navigating to Metrics tab from Alert details page: M-03-TC09 - Given user is on Alert details page - When user clicks on View in Metrics - Then user will be taken to Metrics tab in Observe - - - @regression @to-do - Scenario: Silence alert from Alert details page: M-03-TC10 - Given user is on Alert details page - When user clicks on Silence alert button - And user update the details and click on Silence - Then user will be taken to Silence details page with silence state Active - - - @regression @to-do - Scenario: Alert Rule details page: M-03-TC11 - Given user is on Alerts tab - When user clicks on the kebab menu on the alert - And user clicks on View Alerting Rule - Then user will see Alerting rule details page - And user will see Alert metrics in Active alerts section - And user will see Name, Severity, Labels, Source, For, Expression, Description - - - @regression @to-do - Scenario: Time range on Metrics in Alert rule details page: M-03-TC12 - Given user is on Alert rule details page - When user selects "1 hour" on Time range dropdown - Then user will see alert activity for past one hour - - - @regression @to-do - Scenario: Reset Zoom on Metrics in Alert rule details page: M-03-TC13 - Given user is on Alert rule details page - When user selects "1 hour" on Time range dropdown - And user clicks on Reset zoom - Then user will see Time range changed to 30 minutes - - - @regression @to-do - Scenario: Navigating to Metrics tab from Alert rule details page: M-03-TC14 - Given user is on Alert rule details page - When user clicks on View in Metrics - Then user will be taken to Metrics tab in Observe page - - - @regression @to-do - Scenario: Navigating to Alert details page from Alert rule details page: M-03-TC15 - Given user is on Alert rule details page - When user clicks on name on alert under description - Then user will be taken to Alert details page diff --git a/frontend/packages/dev-console/integration-tests/features/monitoring/topology-sidebar-actions.feature b/frontend/packages/dev-console/integration-tests/features/monitoring/topology-sidebar-actions.feature deleted file mode 100644 index e547d6c2a42..00000000000 --- a/frontend/packages/dev-console/integration-tests/features/monitoring/topology-sidebar-actions.feature +++ /dev/null @@ -1,54 +0,0 @@ -@monitoring @dev-console @broken-test -Feature: Observe tab on the topology Sidebar - As a user, I should be able to see Observe tab on the sidebar of topology page and add Health Checks - - - Background: - Given user is at developer perspective - And user is at Add page - And user has created or selected namespace "aut-observe-sidebar" - - - @smoke @odc-3698 - Scenario Outline: Navigating to Observe page from topology page Sidebar for "" workload : M-04-TC01 - Given user has created workload "" with resource type "" - And user is at Topology page - When user clicks on the workload "" to open the sidebar - And user clicks on Observe tab - And user clicks on View dashboard link - Then page redirected to the Dashboard tab of Observe page - And user will see the "Kubernetes / Compute Resources / Workload" selected in the Dashboard dropdown - And user will see "" option selected in the Workload dropdown - And user will see "" option selected in the Type dropdown - - Examples: - | workload | resourceType | - | parks-test-d | deployment | - - - @smoke @odc-3698 - Scenario: Observe tab on the Sidebar for Helm Release: M-04-TC02 - Given helm release "nodejs" is present in topology page - When user clicks on the deployment of workload "nodejs" to open the sidebar - And user clicks on Observe tab - And user clicks on View dashboard link - Then page redirected to the Observe page - - - @regression - Scenario: Observe tab on the Sidebar for Knative Service: M-04-TC03 - Given user has installed OpenShift Serverless Operator - And user is at Add page - And workload "parks-test-kn" with resource type "Knative Service" is present in topology page - And user is at the Topology page - When user clicks on the knative service "parks-test-kn" to open the sidebar - Then user wont see Observe tab - - - @regression @odc-3698 - Scenario: Navigating to Observe Metrics from the workload Sidebar: M-04-TC04 - Given workload "nodejs-ex-1" with resource type "Deployment" is present in topology page - When user clicks on the workload "nodejs-ex-1" to open the sidebar - And user clicks on Observe tab - And user clicks on Memory usage chart - Then page redirected to the Observe Metrics page for the chart \ No newline at end of file diff --git a/frontend/packages/dev-console/integration-tests/features/monitoring/topology-sidebar-alert-details.feature b/frontend/packages/dev-console/integration-tests/features/monitoring/topology-sidebar-alert-details.feature deleted file mode 100644 index e929c9e482c..00000000000 --- a/frontend/packages/dev-console/integration-tests/features/monitoring/topology-sidebar-alert-details.feature +++ /dev/null @@ -1,93 +0,0 @@ -@monitoring @dev-console -Feature: Alert Icon on Topology for Workloads in sidebar and Alerts tab on Observe page - User should be aware of alerts related to workloads and should see alerts in the sidebar - - - Background: - Given user is at developer perspective - And user has created or selected namespace "aut-observe-topology" - - - @regression @manual - Scenario: Alerts tab on the Observe page: M-05-TC01 - Given user is at the Topology page - When user opens Observe page - Then user will see the Alerts tab - - - @regression @manual - Scenario: Observe Firing Alerts Decorator on the workload: M-05-TC02 - Given user is at Topology page - And user has a node with firing alerts - Then user will see the Observe Alerts Decorator on the upper left quadrant of that workload - - - @regression @manual - Scenario: Click on Firing Alerts Decorator on Topology workloads to see associated alerts in both graph and list view: M-05-TC03 - Given user is at Topology page - And user has a node with firing alerts - When user clicks on the observe alert decorator on the node - Then sidebar for that node will get opened - And user will see that Observe tab is selected by default - And user will see an alerts section having the associated alerts listed in the order of severity - - - @regression @to-do - Scenario: Redirect to Alert Details page on click of alert: M-05-TC04 - Given user is at the Topology page - And user has a node with firing alerts - When user clicks on node to open the sidebar - And user clicks on an alert in the Alert section under Observe Tab - Then user will be redirected to Alerts details page - - - @regression @to-do - Scenario: Associated Metrics on selection of Alerts in Alerts tab: M-05-TC05 - Given user is on the Observe page - When user opens the Alerts tab - And user clicks on the alert under alert rules - And user clicks on the View Metrics button on the alert details page - Then user will be redirected to Metrics tab - And user will see that associated metrics has been opened - - - @regression @to-do - Scenario: Notification Column on the Alerts table: M-05-TC06 - Given user is on the Observe page - When user opens the Alerts tab - Then user will see the Notification column - - - @regression @to-do - Scenario: Alerting rule details page: M-05-TC07 - Given user is on the Alerts tab - When user clicks on the kebab menu to view alerting rule - Then user will be redirected to the Alert Rule Details page - - - @regression @to-do - Scenario: Notification Silence button: M-05-TC08 - Given user is on the Alerts tab - When user clicks on the Notification Silence button - Then user will see a Silence for dropdown - And user will see silence for 30 minutes item - And user will see silence for 1 hour item - And user will see silence for 2 hours item - And user will see silence for 1 day item - - - @regression @manual - Scenario: Display expire time of Notification Silence: M-05-TC09 - Given user is on the Alerts tab - When user clicks on the Notification Silence button - And user will silence the notification for 30 minutes - Then user will see the expire time of silence - And user will not see the severity icon at the beginning of the row of rule - - - @regression @to-do - Scenario: Switch on the Notification: M-05-TC10 - Given user is on the Alerts tab - When user clicks on the Notification Silence button - And user clicks on the Notification Silence button again - Then user will see that Notifications are on again diff --git a/frontend/packages/dev-console/integration-tests/features/monitoring/workload-metrics-display.feature b/frontend/packages/dev-console/integration-tests/features/monitoring/workload-metrics-display.feature deleted file mode 100644 index 5fb946d62ca..00000000000 --- a/frontend/packages/dev-console/integration-tests/features/monitoring/workload-metrics-display.feature +++ /dev/null @@ -1,141 +0,0 @@ -@monitoring @dev-console @broken-test -Feature: Metrics Tab on Observe Page - As a user, I should be able to run queries to check the usage - - Background: - Given user is at developer perspective - And user has created or selected namespace "aut-observe-m" - And user has opened application "dancer-ex-git" in topology page - And user is on Observe page - - - @smoke - Scenario: CPU Usage Query on Metrics tab: M-06-TC01 - Given user is on Metrics tab - When user selects "CPU usage" Query from Select Query dropdown - Then user will see the CPU Usage on Metrics tab - And user will see the pods list - And user will see the value of CPU used by each pod - - - @smoke - Scenario: Memory Usage Query on Metrics tab: M-06-TC02 - Given user is on Metrics tab - When user selects "Memory usage" Query from Select Query dropdown - Then user will see the Memory Usage on Metrics tab - And user will see the pods list - And user will see the value of Memory used by each pod - - - @smoke - Scenario: Filesystem Usage Query on Metrics tab: M-06-TC03 - Given user is on Metrics tab - When user selects "Filesystem usage" Query from Select Query dropdown - Then user will see the Filesystem Usage on Metrics tab - And user will see namespace name "test-monitoring" - And user will see the pods list - And user will see the value of Filesystem used by each pod - - - @smoke - Scenario: Receive Bandwidth Query on Metrics tab: M-06-TC04 - Given user is on Metrics tab - When user selects "Receive bandwidth" Query from Select Query dropdown - Then user will see the Received Bandwidth on Metrics tab - And user will see the pods list - And user will see the value of Received Bandwidth by each pod - - - @smoke - Scenario: Transmit Bandwidth Query on Metrics tab: M-06-TC05 - Given user is on Metrics tab - When user selects "Transmit bandwidth" Query from Select Query dropdown - Then user will see the Transmitted Bandwidth on Metrics tab - And user will see the pods list - And user will see the value of Transmitted Bandwidth by each pod - - - @smoke - Scenario: Rate of Received Packets Query on Metrics tab: M-06-TC06 - Given user is on Metrics tab - When user selects "Rate of received packets" Query from Select Query dropdown - Then user will see the Received Packets on Metrics tab - And user will see the pods list - And user will see the value of Received Packets by each pod - - - @smoke - Scenario: Rate of Transmitted Packets Query on Metrics tab: M-06-TC07 - Given user is on Metrics tab - When user selects "Rate of transmitted packets" Query from Select Query dropdown - Then user will see the Transmitted Packets on Metrics tab - And user will see the pods list - And user will see the value of Transmitted Packets by each pod - - - @smoke - Scenario: Rate of Received Packets Dropped Query on Metrics tab: M-06-TC08 - Given user is on Metrics tab - When user selects "Rate of received packets dropped" Query from Select Query dropdown - Then user will see the Received Packets Dropped on Metrics tab - And user will see the pods list - And user will see the value of Received Packets Dropped by each pod - - - @smoke - Scenario: Rate of Transmitted Packets Dropped Query on Metrics tab: M-06-TC09 - Given user is on Metrics tab - When user selects "Rate of transmitted packets dropped" Query from Select Query dropdown - Then user will see the Transmitted Packets Dropped on Metrics tab - And user will see the pods list - And user will see the value of Transmitted Packets Dropped by each pod - - -#Custom Query: "sum(container_memory_working_set_bytes{ namespace="openshift-monitoring", container!="POD", container!=""}) by (pod)" - @smoke - Scenario Outline: Custom Query on Metrics tab: M-06-TC10 - Given user is on Metrics tab - When user selects "Custom query" Query from Select Query dropdown - And user enters the custom query "" - Then user will see the output of the custom query - And user will see the pods list - And user will see the value of given custom query by each pod - - Examples: - | query | - | sum(container_memory_working_set_bytes{ namespace="openshift-monitoring", container!="POD", container!=""}) by (pod) | - - - @regression - Scenario: Show PromQL button on Metrics tab: M-06-TC11 - Given user is on Metrics tab - When user selects "CPU usage" Query from Select Query dropdown - And user clicks on Show PromQL button - Then user will see the query ran to see CPU Usage - And user will see Hide PromQL button - - - @regression - Scenario: Hide PromQL button on Metrics tab: M-06-TC12 - Given user is on Metrics tab - When user selects "CPU usage" Query from Select Query dropdown - And user clicks on Show PromQL button - And user clicks on Hide PromQL button - Then user wont see the query - - - @manual - Scenario: Time range dropdown: M-06-TC13 - Given user is on Metrics tab - When user selects "CPU usage" Query from Select Query dropdown - And user selects "1 hour" on Time range dropdown - Then user will see CPU Usage for past one hour - - - @manual - Scenario: Reset Zoom button: M-06-TC14 - Given user is on Metrics tab - When user selects "CPU usage" Query from Select Query dropdown - And user selects "1 hour" on Time range dropdowne - And user clicks on Reset Zoom button - Then user will see Time range changed to 30 minutes diff --git a/frontend/packages/dev-console/integration-tests/support/pageObjects/monitoring-po.ts b/frontend/packages/dev-console/integration-tests/support/pageObjects/monitoring-po.ts index 6bfc506b1f4..e198d475dc2 100644 --- a/frontend/packages/dev-console/integration-tests/support/pageObjects/monitoring-po.ts +++ b/frontend/packages/dev-console/integration-tests/support/pageObjects/monitoring-po.ts @@ -1,57 +1,12 @@ export const monitoringPO = { tabs: { - dashboard: '[data-test-id="horizontal-link-Dashboards"]', - metrics: '[data-test-id="horizontal-link-Metrics"]', - alerts: '[data-test-id="horizontal-link-Alerts"]', events: '[data-test-id="horizontal-link-Events"]', }, timeRange: '', refreshInterval: '', - dashboardTab: { - dashboardDropdown: '[data-test="dashboard-dropdown"]', - workloadsDropdown: '[data-test="workload-dropdown"]', - dashboardFilter: '[aria-label="Options menu"]', - workloadsFilter: '[#odc-monitoring-dashboard-workload-filter]', - typeDropdown: '[data-test="type-dropdown"]', - podDropdown: '[data-test="pod-dropdown"]', - dashboard: '[data-test-id="dashboard"]', - sections: { - cpuUsage: '[data-test-id="panel-cpu-usage"]', - memoryUsage: '[data-test-id="panel-memory-usage"]', - receiveBandwidth: '[data-test="receive-bandwidth-chart"]', - transmitBandwidth: '[data-test="transmit-bandwidth-chart"]', - rateOfReceivedPackets: '[data-test="rate-of-received-packets-chart"]', - rateOfTransmittedPackets: '[data-test="rate-of-transmitted-packets-chart"]', - rateOfReceivedPacketsDropped: '[data-test="rate-of-received-packets-dropped-chart"]', - rateOfTransmittedPacketsDropped: '[data-test="rate-of-transmitted-packets-dropped-chart"]', - }, - }, - metricsTab: { - selectQuery: '.odc-metrics-query-input button[type="button"]', - queryExpression: 'textarea[placeholder="Expression (press Shift+Enter for newlines)"]', - cpuGraph: '.graph-wrapper--query-browser', - podsList: 'table[aria-label="query results table"]', - showPromQL: '', - hidePromQL: '', - emptyQueryMessage: '', - resetZoom: '', - }, eventsTab: { resources: '', selectedResource: '.form-group ul li span', types: '[data-test="console-select-menu-toggle"]', }, - alertsTab: { - filter: '[data-test-id="filter-dropdown-toggle"] button', - search: 'input[data-test-id="item-filter"]', - table: '[role="grid"]', - alertsTable: { - columns: { - name: '[data-label="Name"]', - severity: '[data-label="Severity"]', - alertState: '[data-label="Alert state"]', - notifications: '[data-label="Notifications"]', - }, - }, - }, }; diff --git a/frontend/packages/dev-console/integration-tests/support/pages/monitoring/monitoring-page.ts b/frontend/packages/dev-console/integration-tests/support/pages/monitoring/monitoring-page.ts index 8ac5b4044f1..8facc4b43a4 100644 --- a/frontend/packages/dev-console/integration-tests/support/pages/monitoring/monitoring-page.ts +++ b/frontend/packages/dev-console/integration-tests/support/pages/monitoring/monitoring-page.ts @@ -8,47 +8,6 @@ export const detailsPage = { }; export const monitoringPage = { - dashboard: { - selectWorkload: (workloadName: string = 'All Workloads') => { - cy.get(monitoringPO.dashboardTab.workloadsFilter).click(); - cy.byTestID('console-select-search-input').type(workloadName); - cy.get(`[id="${workloadName}-link"]`).click(); - }, - selectDashboard: (dashboardName: string) => { - cy.get(monitoringPO.dashboardTab.dashboardDropdown).click(); - cy.get('input[type="search"]').type(dashboardName); - cy.get('button.monitoring-dashboards__dashboard_dropdown_item').first().click(); - }, - verifySection: () => cy.get(monitoringPO.dashboardTab.dashboard).should('exist'), - verifyCpuUsageGraph: () => cy.get(monitoringPO.dashboardTab.sections.cpuUsage).should('exist'), - verifyMemoryUsageGraph: () => - cy.get(monitoringPO.dashboardTab.sections.memoryUsage).should('exist'), - verifyReceiveBandwidthGraph: () => - cy.get(monitoringPO.dashboardTab.sections.receiveBandwidth).should('exist'), - verifyTransmitBandwidthGraph: () => - cy.get(monitoringPO.dashboardTab.sections.transmitBandwidth).should('exist'), - verifyRateOfReceivedPacketsGraph: () => - cy.get(monitoringPO.dashboardTab.sections.rateOfReceivedPackets).should('exist'), - verifyRateOfTransmittedPacketsGraph: () => - cy.get(monitoringPO.dashboardTab.sections.rateOfTransmittedPackets).should('exist'), - verifyRateOfReceivedPacketsDroppedGraph: () => - cy.get(monitoringPO.dashboardTab.sections.rateOfReceivedPacketsDropped).should('exist'), - verifyRateOfTransmittedPacketsDroppedGraph: () => - cy.get(monitoringPO.dashboardTab.sections.rateOfTransmittedPacketsDropped).should('exist'), - }, - metrics: { - enterQuery: (query: string) => { - cy.get(monitoringPO.metricsTab.queryExpression).type(query); - }, - selectQuery: (queryValue: string) => { - cy.selectValueFromAutoCompleteDropDown(monitoringPO.metricsTab.selectQuery, queryValue); - }, - verifyGraph: () => { - cy.get(monitoringPO.metricsTab.cpuGraph).should('be.visible'); - }, - verifyResetZoom: () => cy.byButtonText('Reset Zoom').should('be.visible'), - clickResetZoom: () => cy.byButtonText('Reset Zoom').click(), - }, events: { selectResources: (resourceName: string) => { cy.selectValueFromAutoCompleteDropDown(monitoringPO.eventsTab.resources, resourceName); @@ -61,16 +20,6 @@ export const monitoringPage = { }, selectTab: (tabName: monitoringTabs | string) => { switch (tabName) { - case 'Dashboard': - case monitoringTabs.Dashboard: - detailsPage.selectTab(monitoringPO.tabs.dashboard); - cy.url().should('include', 'dev-monitoring/ns/'); - break; - case 'Metrics': - case monitoringTabs.Metrics: - detailsPage.selectTab(monitoringPO.tabs.metrics); - cy.url().should('include', 'metrics'); - break; case 'Events': case monitoringTabs.Events: detailsPage.selectTab(monitoringPO.tabs.events); diff --git a/frontend/packages/dev-console/integration-tests/support/step-definitions/monitoring/changing-context-dashboard.ts b/frontend/packages/dev-console/integration-tests/support/step-definitions/monitoring/changing-context-dashboard.ts deleted file mode 100644 index 48044d5b20b..00000000000 --- a/frontend/packages/dev-console/integration-tests/support/step-definitions/monitoring/changing-context-dashboard.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { Then, When } from 'cypress-cucumber-preprocessor/steps'; -import { monitoringPO, topologyPO } from '../../pageObjects'; -import { topologyPage, topologySidePane } from '../../pages'; - -When('user selects the workload {string} to open the topology sidebar', (workloadName: string) => { - topologyPage.clickOnNode(workloadName); -}); - -When('user navigates to observe dashboards from toplogy sidebar', () => { - topologySidePane.selectTab('Observe'); - cy.get(topologyPO.sidePane.monitoringTab.viewMonitoringDashBoardsLink).click({ force: true }); -}); - -Then('user is able to see the workload {string} in workloads dropdown', (workloadName: string) => { - cy.get(monitoringPO.dashboardTab.workloadsDropdown).should('contain.text', workloadName); -}); - -Then('user is still able to see the same workload {string}', (workloadName: string) => { - cy.get(monitoringPO.dashboardTab.workloadsDropdown).should('contain.text', workloadName); -}); diff --git a/frontend/packages/dev-console/integration-tests/support/step-definitions/monitoring/dashboard-display.ts b/frontend/packages/dev-console/integration-tests/support/step-definitions/monitoring/dashboard-display.ts deleted file mode 100644 index 43e12d11250..00000000000 --- a/frontend/packages/dev-console/integration-tests/support/step-definitions/monitoring/dashboard-display.ts +++ /dev/null @@ -1,280 +0,0 @@ -import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps'; -import { resourceTypes } from '../../constants'; -import { devNavigationMenu } from '../../constants/global'; -import { monitoringPO } from '../../pageObjects/monitoring-po'; -import { - monitoringPage, - topologyPage, - navigateTo, - createGitWorkloadIfNotExistsOnTopologyPage, - gitPage, -} from '../../pages'; - -Given('user opened the url of the workload {string} in topology page', (workloadName: string) => { - topologyPage.clickWorkloadUrl(workloadName); -}); - -Given('user has workloads of all resource types', () => { - const name = 'observe-nodejs'; - const app = 'observe-nodejs-app'; - const url = 'https://github.com/sclorg/nodejs-ex'; - createGitWorkloadIfNotExistsOnTopologyPage(url, `${name}-d`, resourceTypes.Deployment, app); - createGitWorkloadIfNotExistsOnTopologyPage( - url, - `${name}-dc`, - resourceTypes.DeploymentConfig, - app, - ); -}); - -When('user navigates to Monitoring page', () => { - navigateTo(devNavigationMenu.Observe); -}); - -When('user selects the workload {string} from the dropdown', (workloadName: string) => { - monitoringPage.dashboard.selectWorkload(workloadName); -}); - -When('user clicks on Resources dropdown', () => { - cy.get('[aria-label="Options menu"] div span').click({ force: true }); -}); - -When('user selects {string} in Resource type section', (resourceType: string) => { - gitPage.selectResource(resourceType); -}); - -When('user selects Service', () => { - // TODO: implement step -}); - -When('user selects Deployment', () => { - // TODO: implement step -}); - -When('user selects DeploymentConfig', () => { - // TODO: implement step -}); - -When('user clicks on Types dropdown', () => { - cy.get('[data-test="type-dropdown"]').click(); -}); - -When('user selects {string} from Types dropdown', (typeName: string) => { - cy.contains('[data-test="console-select-item"]', typeName).click(); -}); - -When('user enters {string} in the Filter field', (filterCriteria: string) => { - cy.byLegacyTestID('item-filter').clear().type(filterCriteria); -}); - -Then('user will see Dashboard, Metrics, Alerts, Events tabs', () => { - cy.get(monitoringPO.tabs.dashboard).should('be.visible'); - cy.get(monitoringPO.tabs.metrics).should('be.visible'); - cy.get(monitoringPO.tabs.alerts).should('be.visible'); - cy.get(monitoringPO.tabs.events).should('be.visible'); -}); - -Then('user will see the dropdown selected with All Workloads by default', () => { - cy.get(monitoringPO.dashboardTab.workloadsFilter).should('contain.text', 'All Workloads'); -}); - -Then('user will see the CPU Usage on Metrics tab', () => { - cy.get(monitoringPO.dashboardTab.sections.cpuUsage).scrollIntoView().should('be.visible'); -}); - -Then('user will see the Memory Usage on Metrics tab', () => { - cy.get(monitoringPO.dashboardTab.sections.memoryUsage).scrollIntoView().should('be.visible'); -}); - -Then('user will see Receive Bandwidth on Metrics tab', () => { - cy.get(monitoringPO.dashboardTab.sections.receiveBandwidth).scrollIntoView().should('be.visible'); -}); - -Then('user will see Transmit Bandwidth on Metrics tab', () => { - cy.get(monitoringPO.dashboardTab.sections.transmitBandwidth) - .scrollIntoView() - .should('be.visible'); -}); - -Then('user will see the Rate of Received Packets on Metrics tab', () => { - cy.get(monitoringPO.dashboardTab.sections.rateOfReceivedPackets) - .scrollIntoView() - .should('be.visible'); -}); - -Then('user will see the Rate of Transmitted Packets on Metrics tab', () => { - cy.get(monitoringPO.dashboardTab.sections.rateOfTransmittedPackets) - .scrollIntoView() - .should('be.visible'); -}); - -Then('user will see the Rate of Received Packets Dropped on Metrics tab', () => { - cy.get(monitoringPO.dashboardTab.sections.rateOfReceivedPacketsDropped) - .scrollIntoView() - .should('be.visible'); -}); - -Then('user will see the Rate of Transmitted Packets Dropped on Metrics tab', () => { - cy.get(monitoringPO.dashboardTab.sections.rateOfTransmittedPacketsDropped) - .scrollIntoView() - .should('be.visible'); -}); - -Then('user will see events related to all resources and all types', () => { - cy.get(monitoringPO.eventsTab.types).should('contain.text', 'All types'); -}); - -Then('user will see events for Service, Deployment and DeploymentConfig type resources', () => { - cy.get('.co-m-loader').should('not.exist'); - cy.get('.co-sysevent').each((element) => { - cy.wrap(element) - .find('.sr-only') - .first() - .invoke('text') - .should('be.oneOf', ['Service', 'Deployment', 'DeploymentConfig']); - }); -}); - -Then('user will see {string} types of events', (type: string) => { - // TODO: implement step - cy.log(type); -}); - -Then('user will see events having Scaled Up message', () => { - cy.contains('.co-sysevent', 'Scaled up').should('have.length.at.least', 1); -}); - -Then('user is able to see Name, Severity, Alert State and Notifications', () => { - cy.get(monitoringPO.alertsTab.table).should('be.visible'); - cy.get(monitoringPO.alertsTab.alertsTable.columns.name).should('be.visible'); - cy.get(monitoringPO.alertsTab.alertsTable.columns.severity).should('be.visible'); - cy.get(monitoringPO.alertsTab.alertsTable.columns.notifications).should('be.visible'); - cy.get(monitoringPO.alertsTab.alertsTable.columns.alertState).should('be.visible'); -}); - -Then('user will see the CPU Usage on Dashboard tab', () => { - cy.get(monitoringPO.dashboardTab.sections.cpuUsage).scrollIntoView().should('be.visible'); -}); - -Then('user will see the Memory Usage on Dashboard tab', () => { - cy.get(monitoringPO.dashboardTab.sections.memoryUsage).scrollIntoView().should('be.visible'); -}); - -Then('user will see Receive Bandwidth on Dashboard tab', () => { - cy.get(monitoringPO.dashboardTab.sections.receiveBandwidth).scrollIntoView().should('be.visible'); -}); - -Then('user will see Transmit Bandwidth on Dashboard tab', () => { - cy.get(monitoringPO.dashboardTab.sections.transmitBandwidth) - .scrollIntoView() - .should('be.visible'); -}); - -Then('user will see the Rate of Received Packets on Dashboard tab', () => { - cy.get(monitoringPO.dashboardTab.sections.rateOfReceivedPackets) - .scrollIntoView() - .should('be.visible'); -}); - -Then('user will see the Rate of Transmitted Packets on Dashboard tab', () => { - cy.get(monitoringPO.dashboardTab.sections.rateOfTransmittedPackets) - .scrollIntoView() - .should('be.visible'); -}); - -Then('user will see the Rate of Received Packets Dropped on Dashboard tab', () => { - cy.get(monitoringPO.dashboardTab.sections.rateOfReceivedPacketsDropped) - .scrollIntoView() - .should('be.visible'); -}); - -Then('user will see the Rate of Transmitted Packets Dropped on Dashboard tab', () => { - cy.get(monitoringPO.dashboardTab.sections.rateOfTransmittedPacketsDropped) - .scrollIntoView() - .should('be.visible'); -}); - -Given('user is on Observe page', () => { - navigateTo(devNavigationMenu.Observe); -}); - -When('user clicks on Dashboard tab', () => { - cy.get(monitoringPO.tabs.dashboard).should('be.visible').click(); -}); - -When('user clicks on Dashboard dropdown', () => { - cy.get(monitoringPO.dashboardTab.dashboardFilter).should('be.visible').click(); -}); - -When('user can see {string} and {string} option', (option1: string, option2: string) => { - // Uncommented after story ODC-6340 is implemented - // cy.get('.pf-v6-c-select__menu') - // .should('contain', option1) - // .and('contain', option2); - cy.log(option1, option2); // to avoid lint issues -}); - -function chartTitleToTestId(chartTitle: string): string { - return chartTitle.toLowerCase().replace(/\s+/g, '-'); -} - -Then('user will see {string} chart', (chartTitle: string) => { - cy.get(`[data-test="${chartTitle.toLowerCase().replace(/\s+/g, '-')}-chart"]`) - .scrollIntoView() - .should('be.visible') - // also wait for the chart to load - .find('.co-m-loader') - .should('not.exist'); -}); - -Then('user will see {string} charts', (chartsGroup: string) => { - cy.get( - `[data-test-id="panel-${chartsGroup - .toLowerCase() - .replace(/\)/, '') - .replace(/[^\w\s]/g, ' ') - .replace(/\s+/g, '-')}"]`, - ) - .scrollIntoView() - .should('be.visible') - .find('.co-m-loader') - .should('not.exist'); -}); - -When('user clicks on Workload dropdown', () => { - cy.get(monitoringPO.dashboardTab.workloadsDropdown).click(); -}); - -When('user clicks on Dashboard dropdown', () => { - cy.get(monitoringPO.dashboardTab.dashboardDropdown).click(); -}); - -When('user clicks on Type dropdown', () => { - cy.get(monitoringPO.dashboardTab.typeDropdown).click(); -}); - -When('user clicks on Pod dropdown', () => { - cy.get(monitoringPO.dashboardTab.podDropdown).click(); -}); - -When('user selects {string} option from the dropdown', (workloadName: string) => { - cy.contains('[data-test="console-select-item"]', workloadName).click(); -}); - -When('user selects the first option from the dropdown', () => { - cy.get('[id*="select-option"]').first().click(); -}); - -When('user clicks on Inspect on {string} chart', (chartTitle: string) => { - cy.get(`[data-test="${chartTitleToTestId(chartTitle)}-chart"]`) - .find(`.co-dashboard-card__link`) - .click(); -}); - -Then('user will see Metrics tab in Observe page', () => { - cy.get('.pf-v6-c-tabs__item.pf-m-current').find(monitoringPO.tabs.metrics).should('be.visible'); -}); - -Then('{string} option selected by default', (metric) => { - cy.get(monitoringPO.metricsTab.selectQuery).should('contain.text', metric); -}); diff --git a/frontend/packages/dev-console/integration-tests/support/step-definitions/monitoring/filter-the-alerts.ts b/frontend/packages/dev-console/integration-tests/support/step-definitions/monitoring/filter-the-alerts.ts deleted file mode 100644 index 7bc64ea8f24..00000000000 --- a/frontend/packages/dev-console/integration-tests/support/step-definitions/monitoring/filter-the-alerts.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps'; -import { monitoringTabs } from '../../constants'; -import { monitoringPage } from '../../pages'; - -Given('user is on the Alerts tab', () => { - monitoringPage.selectTab(monitoringTabs.Alerts); -}); - -When('user clicks on the Filter dropdown', () => { - monitoringPage.alerts.clickFilter(); -}); - -Then( - 'user is able to see Firing, Pending, Silenced and Not Firing filters under Alert State type', - () => { - cy.get('ul section h1').should('contain.text', 'Alert State'); - cy.get('#firing').should('be.visible'); - cy.get('#pending').should('be.visible'); - cy.get('#silenced').should('be.visible'); - cy.get('#not-firing').should('be.visible'); - }, -); - -Then('user is able to see Critical, Warning, Info and None filters under Severity type', () => { - cy.get('ul section h1').should('contain.text', 'Severity'); - cy.get('#critical').should('be.visible'); - cy.get('#warning').should('be.visible'); - cy.get('#info').should('be.visible'); - cy.get('#none').should('be.visible'); -}); - -Then('user is able to see filters as unchecked', () => { - cy.get('#firing-checkbox').should('not.be.checked'); - cy.get('#pending-checkbox').should('not.be.checked'); - cy.get('#silenced-checkbox').should('not.be.checked'); - cy.get('#not-firing-checkbox').should('not.be.checked'); - cy.get('#critical-checkbox').should('not.be.checked'); - cy.get('#warning-checkbox').should('not.be.checked'); - cy.get('#info-checkbox').should('not.be.checked'); - cy.get('#none-checkbox').should('not.be.checked'); -}); - -When('user selects the {string} option under Alert State type', (alertStateType: string) => { - cy.get(`#${alertStateType}-checkbox`).click(); -}); - -When('user selects the {string} option under Severity type', (severityType: string) => { - cy.get(`#${severityType}-checkbox`).click(); -}); - -Then('user will see the only {string} alerts if there are any', (filterType: string) => { - cy.log(filterType); - // manual step -}); - -Then('user will not see the {string} alerts', (filterType: string) => { - cy.log(filterType); - // manual step -}); diff --git a/frontend/packages/dev-console/integration-tests/support/step-definitions/monitoring/metrics-display-for-workload.ts b/frontend/packages/dev-console/integration-tests/support/step-definitions/monitoring/metrics-display-for-workload.ts deleted file mode 100644 index 153ce6be3fc..00000000000 --- a/frontend/packages/dev-console/integration-tests/support/step-definitions/monitoring/metrics-display-for-workload.ts +++ /dev/null @@ -1,127 +0,0 @@ -import { When, Then } from 'cypress-cucumber-preprocessor/steps'; -import { monitoringPO } from '../../pageObjects'; -import { monitoringPage } from '../../pages'; - -When('user selects {string} Query from Select Query dropdown', (queryName: string) => { - monitoringPage.metrics.selectQuery(queryName); -}); - -When('user enters the custom query {string}', (query: string) => { - monitoringPage.metrics.enterQuery(query); -}); - -When('user clicks on Show PromQL button', () => { - cy.get(monitoringPO.metricsTab.showPromQL).click(); -}); - -When('user clicks on Hide PromQL button', () => { - cy.get(monitoringPO.metricsTab.hidePromQL).click(); -}); - -Then('user is able to see Show PromQL button', () => { - cy.get(monitoringPO.metricsTab.showPromQL).should('be.visible'); -}); - -Then('user is able to see message {string}', (message: string) => { - cy.get(monitoringPO.metricsTab.emptyQueryMessage).should('contain.text', message); -}); - -When('user selects {string} on Time range dropdown', (time: string) => { - cy.get(monitoringPO.timeRange).click(); - cy.byButtonText(time).click(); -}); - -When('user clicks on Reset Zoom button', () => { - cy.get(monitoringPO.metricsTab.resetZoom).click(); -}); - -Then('user will see the pods list', () => { - cy.get(monitoringPO.metricsTab.podsList).should('be.visible'); -}); - -Then('user will see the value of CPU used by each pod', () => { - // TODO: implement step -}); - -Then('user will see the value of Memory used by each pod', () => { - // TODO: implement step -}); - -Then('user will see the Filesystem Usage', () => { - // TODO: implement step -}); - -Then('user will see the Received Bandwidth', () => { - // TODO: implement step -}); - -Then('user will see the Transmitted Bandwidth', () => { - // TODO: implement step -}); - -Then('user will see the Received Packets', () => { - // TODO: implement step -}); - -Then('user will see namespace name {string}', (namespace: string) => { - // TODO: implement step - cy.log(namespace); -}); - -Then('user will see the Transmitted Packets', () => {}); - -Then('user will see the value of Filesystem used by each pod', () => { - // TODO: implement step -}); - -Then('user will see the value of Received Bandwidth by each pod', () => { - // TODO: implement step -}); - -Then('user will see the value of Transmitted Bandwidth by each pod', () => { - // TODO: implement step -}); - -Then('user will see the value of Received Packets by each pod', () => { - // TODO: implement step -}); - -Then('user will see the value of Transmitted Packets by each pod', () => { - // TODO: implement step -}); - -Then('user will see the value of Received Packets Dropped by each pod', () => { - // TODO: implement step -}); - -Then('user will see the value of Transmitted Packets Dropped by each pod', () => { - // TODO: implement step -}); - -Then('user will see the output of the custom query', () => { - monitoringPage.metrics.verifyGraph(); -}); - -Then('user will see the value of given custom query by each pod', () => { - // TODO: implement step -}); - -Then('user will see the query ran to see CPU Usage', () => { - // TODO: implement step -}); - -Then('user will see Hide PromQL button', () => { - // TODO: implement step -}); - -Then('user wont see the query', () => { - // TODO: implement step -}); - -Then('user will see CPU Usage for past one hour', () => { - // TODO: implement step -}); - -Then('user will see Time range changed to 30 minutes', () => { - // TODO: implement step -}); diff --git a/frontend/packages/dev-console/integration-tests/support/step-definitions/monitoring/topology-sidebar-actions.ts b/frontend/packages/dev-console/integration-tests/support/step-definitions/monitoring/topology-sidebar-actions.ts index 30a30035e9d..770a97d26c3 100644 --- a/frontend/packages/dev-console/integration-tests/support/step-definitions/monitoring/topology-sidebar-actions.ts +++ b/frontend/packages/dev-console/integration-tests/support/step-definitions/monitoring/topology-sidebar-actions.ts @@ -1,12 +1,10 @@ import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps'; -import { detailsPage } from '@console/cypress-integration-tests/views/details-page'; -import { pageTitle, sideBarTabs, nodeActions } from '../../constants'; -import { monitoringPO, topologyPO, addHealthChecksPO } from '../../pageObjects'; +import { nodeActions } from '../../constants'; +import { addHealthChecksPO } from '../../pageObjects'; import { addHealthChecksPage, createGitWorkloadIfNotExistsOnTopologyPage, createHelmChartFromAddPage, - monitoringPage, topologyPage, topologySidePane, } from '../../pages'; @@ -36,27 +34,10 @@ Given( }, ); -When('user clicks on Observe tab', () => { - topologySidePane.selectTab(sideBarTabs.Observe); -}); - -When('user clicks on Memory usage chart', () => { - cy.get('[data-test="memory-usage"]').contains('a', 'Inspect').click(); -}); - -Then('page redirected to the Observe Metrics page for the chart', () => { - detailsPage.titleShouldContain('Observe'); - cy.get('.pf-v6-c-tabs__item.pf-m-current').find(monitoringPO.tabs.metrics).should('be.visible'); -}); - When('user selects {string} from Context Menu', (menuOption: string) => { topologyPage.selectContextMenuAction(menuOption); }); -When('user clicks on View dashboard link', () => { - cy.get(topologyPO.sidePane.monitoringTab.viewMonitoringDashBoardsLink).click({ force: true }); -}); - When('user selects {string} from topology sidebar Actions dropdown', (menuOption: string) => { topologySidePane.selectNodeAction(menuOption); }); @@ -74,31 +55,6 @@ When( }, ); -Then('user wont see Observe tab', () => { - topologySidePane.verifyTabNotVisible(sideBarTabs.Observe); -}); - -Then('page redirected to the Observe page', () => { - detailsPage.titleShouldContain('Observe'); -}); - -Then('page redirected to the Dashboard tab of Observe page', () => { - detailsPage.titleShouldContain('Observe'); - cy.get('.pf-v6-c-tabs__item.pf-m-current').find(monitoringPO.tabs.dashboard).should('be.visible'); -}); - -Then('user will see the {string} selected in the Dashboard dropdown', (dashboardName: string) => { - cy.get(monitoringPO.dashboardTab.dashboardDropdown).should('contain.text', dashboardName); -}); - -Then('user will see {string} option selected in the Workload dropdown', (workloadName: string) => { - cy.get(monitoringPO.dashboardTab.workloadsDropdown).should('contain.text', workloadName); -}); - -Then('user will see {string} option selected in the Type dropdown', (resourceType: string) => { - cy.get(monitoringPO.dashboardTab.typeDropdown).should('contain.text', resourceType); -}); - When( 'user clicks on the knative service {string} to open the sidebar', (knativeWorkloadName: string) => { @@ -106,10 +62,6 @@ When( }, ); -Then('page redirected to the Monitoring page', () => { - detailsPage.titleShouldContain('Monitoring'); -}); - Given('user is on the topology sidebar of the helm release {string}', (helmReleaseName: string) => { createHelmChartFromAddPage(helmReleaseName); }); @@ -177,35 +129,6 @@ When('user starts a new build', () => { topologyPage.startBuild(); }); -Then('user will be taken to Dashboard tab on the Monitoring page', () => { - detailsPage.titleShouldContain(pageTitle.Observe); -}); - -Then('user wont see Monitoring tab', () => { - topologySidePane.verify(); - cy.get(topologyPO.sidePane.tabName).contains(sideBarTabs.Observe).should('not.be.visible'); -}); - -Then('user will see View dashboard link', () => { - cy.get(topologyPO.sidePane.monitoringTab.viewMonitoringDashBoardsLink).should('be.visible'); -}); - -Then('user will see CPU Usage Metrics', () => { - monitoringPage.dashboard.verifyCpuUsageGraph(); -}); - -Then('user will see Memory Usage Metrics', () => { - monitoringPage.dashboard.verifyMemoryUsageGraph(); -}); - -Then('user will see Receive Bandwidth Metrics', () => { - monitoringPage.dashboard.verifyReceiveBandwidthGraph(); -}); - -Then('user will see All Events dropdown', () => { - cy.get(monitoringPO.dashboardTab.workloadsFilter).should('be.visible'); -}); - Then('user will see Health Checks advanced option', () => { // TODO: implement step }); diff --git a/frontend/packages/dev-console/src/components/monitoring/dashboard/MonitoringDashboardGraph.tsx b/frontend/packages/dev-console/src/components/monitoring/dashboard/MonitoringDashboardGraph.tsx index f7a843f3b84..7f0c7ec54c5 100644 --- a/frontend/packages/dev-console/src/components/monitoring/dashboard/MonitoringDashboardGraph.tsx +++ b/frontend/packages/dev-console/src/components/monitoring/dashboard/MonitoringDashboardGraph.tsx @@ -23,11 +23,9 @@ const PrometheusGraphLink = ({ query, namespace, ariaChartLinkLabel }) => { } const params = new URLSearchParams(); queries.forEach((q, index) => params.set(`query${index}`, q)); + params.set('namespace', namespace); return ( - + {t('devconsole~Inspect')} ); diff --git a/frontend/packages/dev-console/src/components/monitoring/overview/MonitoringOverview.tsx b/frontend/packages/dev-console/src/components/monitoring/overview/MonitoringOverview.tsx index 44c941ce5d4..82361db18bc 100644 --- a/frontend/packages/dev-console/src/components/monitoring/overview/MonitoringOverview.tsx +++ b/frontend/packages/dev-console/src/components/monitoring/overview/MonitoringOverview.tsx @@ -128,12 +128,16 @@ const MonitoringOverview: React.FC = (props) => { ) : ( <>
+ {/* query params: + namespace - used within dashboard logic + openshift-project - used for namespace dropdown for console + */} {t('devconsole~View dashboards')} diff --git a/frontend/packages/dev-console/src/components/monitoring/overview/MonitoringOverviewAlerts.tsx b/frontend/packages/dev-console/src/components/monitoring/overview/MonitoringOverviewAlerts.tsx index a628f2bed5e..78d03d923b2 100644 --- a/frontend/packages/dev-console/src/components/monitoring/overview/MonitoringOverviewAlerts.tsx +++ b/frontend/packages/dev-console/src/components/monitoring/overview/MonitoringOverviewAlerts.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import { Alert } from '@patternfly/react-core'; import * as _ from 'lodash'; import { Link } from 'react-router-dom-v5-compat'; -import { Alert as AlertType, useActivePerspective } from '@console/dynamic-plugin-sdk'; +import { Alert as AlertType } from '@console/dynamic-plugin-sdk'; import { labelsToParams } from '@console/internal/components/monitoring/utils'; import { fromNow } from '@console/internal/components/utils/datetime'; import { sortMonitoringAlerts } from '@console/shared'; @@ -14,7 +14,6 @@ interface MonitoringOverviewAlertsProps { } const MonitoringOverviewAlerts: React.FC = ({ alerts }) => { - const [activePerspective, setActivePerspective] = useActivePerspective(); const sortedAlerts = sortMonitoringAlerts(alerts); return ( @@ -23,26 +22,15 @@ const MonitoringOverviewAlerts: React.FC = ({ ale const { activeAt, annotations: { message }, - labels: { severity, alertname, namespace }, + labels: { severity, alertname }, rule: { name, id }, } = alert; - const alertDetailsPageLink = - activePerspective === 'admin' - ? `/monitoring/alerts/${id}?${labelsToParams(alert.labels)}` - : `/dev-monitoring/ns/${namespace}/alerts/${id}?${labelsToParams(alert.labels)}`; + const alertDetailsPageLink = `/monitoring/alerts/${id}?${labelsToParams(alert.labels)}`; return ( {name}} - onClick={() => { - if ( - alertDetailsPageLink.startsWith('/dev-monitoring') && - activePerspective !== 'dev' - ) { - setActivePerspective('dev'); - } - }} key={`${alertname}-${id}`} > {message} diff --git a/frontend/public/components/graphs/__tests__/prometheus-graph.spec.tsx b/frontend/public/components/graphs/__tests__/prometheus-graph.spec.tsx index 28aff36bbc2..636c817bc80 100644 --- a/frontend/public/components/graphs/__tests__/prometheus-graph.spec.tsx +++ b/frontend/public/components/graphs/__tests__/prometheus-graph.spec.tsx @@ -64,7 +64,6 @@ describe('PrometheusGraphLink', () => { }); it('should not render a link when query is empty', () => { - store.dispatch(setFlag(FLAGS.CAN_GET_NS, false)); useActivePerspectiveMock.mockReturnValue(['dev', () => {}]); renderWithProviders( @@ -82,33 +81,18 @@ describe('PrometheusGraphLink', () => { const testScenarios = [ { perspective: 'admin', - canGetNS: false, - expectedUrl: '/dev-monitoring/ns/default/metrics?query0=test', - description: 'admin perspective with CAN_GET_NS=false', - }, - { - perspective: 'admin', - canGetNS: true, - expectedUrl: '/monitoring/query-browser?query0=test', - description: 'admin perspective with CAN_GET_NS=true', - }, - { - perspective: 'dev', - canGetNS: false, - expectedUrl: '/dev-monitoring/ns/default/metrics?query0=test', - description: 'dev perspective with CAN_GET_NS=false', + expectedUrl: '/monitoring/query-browser?query0=test&namespace=default', + description: 'admin perspective graph link', }, { perspective: 'dev', - canGetNS: true, - expectedUrl: '/dev-monitoring/ns/default/metrics?query0=test', - description: 'dev perspective with CAN_GET_NS=true', + expectedUrl: '/monitoring/query-browser?query0=test&namespace=default', + description: 'dev perspective graph link', }, ]; - testScenarios.forEach(({ perspective, canGetNS, expectedUrl, description }) => { + testScenarios.forEach(({ perspective, expectedUrl, description }) => { it(`should generate correct URL for ${description}`, () => { - store.dispatch(setFlag(FLAGS.CAN_GET_NS, canGetNS)); useActivePerspectiveMock.mockReturnValue([perspective, () => {}]); renderWithProviders( diff --git a/frontend/public/components/graphs/prometheus-graph.tsx b/frontend/public/components/graphs/prometheus-graph.tsx index 882bc9e2c26..2e1c88da081 100644 --- a/frontend/public/components/graphs/prometheus-graph.tsx +++ b/frontend/public/components/graphs/prometheus-graph.tsx @@ -5,7 +5,6 @@ import { connect } from 'react-redux'; import { Link } from 'react-router-dom-v5-compat'; import { Title } from '@patternfly/react-core'; -import { useActivePerspective } from '@console/dynamic-plugin-sdk'; import { FLAGS } from '@console/shared'; import { featureReducerName } from '../../reducers/features'; import { getActiveNamespace } from '../../reducers/ui'; @@ -18,13 +17,11 @@ const mapStateToProps = (state: RootState) => ({ }); const PrometheusGraphLink_: React.FC = ({ - canAccessMonitoring, children, query, namespace, ariaChartLinkLabel, }) => { - const [activePerspective, setActivePerspective] = useActivePerspective(); const queries = _.compact(_.castArray(query)); if (!queries.length) { return <>{children}; @@ -32,22 +29,15 @@ const PrometheusGraphLink_: React.FC = ({ const params = new URLSearchParams(); queries.forEach((q, index) => params.set(`query${index}`, q)); + params.set('namespace', namespace); - const url = - canAccessMonitoring && activePerspective === 'admin' - ? `/monitoring/query-browser?${params.toString()}` - : `/dev-monitoring/ns/${namespace}/metrics?${params.toString()}`; + const url = `/monitoring/query-browser?${params.toString()}`; return ( { - if (url.startsWith('/dev-monitoring/') && activePerspective !== 'dev') { - setActivePerspective('dev'); - } - }} > {children} @@ -69,7 +59,6 @@ export const PrometheusGraph: React.FC = React.forwardRef( ); type PrometheusGraphLinkProps = { - canAccessMonitoring: boolean; query: string | string[]; namespace?: string; ariaChartLinkLabel?: string;