Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 49 additions & 26 deletions web/cypress/configure-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ print_current_config() {
print_var "CYPRESS_KONFLUX_COO_BUNDLE_IMAGE" "${CYPRESS_KONFLUX_COO_BUNDLE_IMAGE-}"
print_var "CYPRESS_CUSTOM_COO_BUNDLE_IMAGE" "${CYPRESS_CUSTOM_COO_BUNDLE_IMAGE-}"
print_var "CYPRESS_MCP_CONSOLE_IMAGE" "${CYPRESS_MCP_CONSOLE_IMAGE-}"
print_var "CYPRESS_CHA_IMAGE" "${CYPRESS_CHA_IMAGE-}"
print_var "CYPRESS_TIMEZONE" "${CYPRESS_TIMEZONE-}"
print_var "CYPRESS_MOCK_NEW_METRICS" "${CYPRESS_MOCK_NEW_METRICS-}"
print_var "CYPRESS_SESSION" "${CYPRESS_SESSION-}"
Expand All @@ -185,6 +186,7 @@ print_current_config() {
print_var "CYPRESS_KONFLUX_KBV_BUNDLE_IMAGE" "${CYPRESS_KONFLUX_KBV_BUNDLE_IMAGE-}"
print_var "CYPRESS_CUSTOM_KBV_BUNDLE_IMAGE" "${CYPRESS_CUSTOM_KBV_BUNDLE_IMAGE-}"
print_var "CYPRESS_FBC_STAGE_KBV_IMAGE" "${CYPRESS_FBC_STAGE_KBV_IMAGE-}"
print_var "CYPRESS_LOGIN_IDP_DEV_USER" "${CYPRESS_LOGIN_IDP_DEV_USER-}"
}

main() {
Expand Down Expand Up @@ -226,6 +228,7 @@ main() {
local def_konflux_bundle=${CYPRESS_KONFLUX_COO_BUNDLE_IMAGE-}
local def_custom_coo_bundle=${CYPRESS_CUSTOM_COO_BUNDLE_IMAGE-}
local def_mcp_console_image=${CYPRESS_MCP_CONSOLE_IMAGE-}
local def_cha_image=${CYPRESS_CHA_IMAGE-}
local def_timezone=${CYPRESS_TIMEZONE-}
local def_mock_new_metrics=${CYPRESS_MOCK_NEW_METRICS-}
local def_session=${CYPRESS_SESSION-}
Expand All @@ -236,6 +239,7 @@ main() {
local def_konflux_kbv_bundle=${CYPRESS_KONFLUX_KBV_BUNDLE_IMAGE-}
local def_custom_kbv_bundle=${CYPRESS_CUSTOM_KBV_BUNDLE_IMAGE-}
local def_fbc_stage_kbv_image=${CYPRESS_FBC_STAGE_KBV_IMAGE-}
local def_login_idp_dev_user=${CYPRESS_LOGIN_IDP_DEV_USER-}
# Required basics
local base_url
while true; do
Expand Down Expand Up @@ -295,7 +299,11 @@ main() {
# User declined current, try to find kubeconfigs from Downloads
if [[ -d "$HOME/Downloads" ]]; then
local kubeconfig_files
mapfile -t kubeconfig_files < <(ls -t "$HOME/Downloads"/*kubeconfig* 2>/dev/null | head -10)
# Use 'while read' instead of 'mapfile' for bash 3.x compatibility (macOS)
kubeconfig_files=()
while IFS= read -r file; do
kubeconfig_files+=("$file")
done < <(ls -t "$HOME/Downloads"/*kubeconfig* 2>/dev/null | head -10)

if [[ ${#kubeconfig_files[@]} -gt 0 ]]; then
echo ""
Expand Down Expand Up @@ -357,7 +365,11 @@ main() {
# No current kubeconfig set, try to find kubeconfigs from Downloads
if [[ -d "$HOME/Downloads" ]]; then
local kubeconfig_files
mapfile -t kubeconfig_files < <(ls -t "$HOME/Downloads"/*kubeconfig* 2>/dev/null | head -10)
# Use 'while read' instead of 'mapfile' for bash 3.x compatibility (macOS)
kubeconfig_files=()
while IFS= read -r file; do
kubeconfig_files+=("$file")
done < <(ls -t "$HOME/Downloads"/*kubeconfig* 2>/dev/null | head -10)

if [[ ${#kubeconfig_files[@]} -gt 0 ]]; then
echo ""
Expand Down Expand Up @@ -426,6 +438,9 @@ main() {
local mcp_console_image
mcp_console_image=$(ask "Monitoring Console Plugin UI image (CYPRESS_MCP_CONSOLE_IMAGE)" "$def_mcp_console_image")

local cha_image
cha_image=$(ask "Cluster Health Analyzer image (CYPRESS_CHA_IMAGE)" "$def_cha_image")

local timezone
timezone=$(ask "Cluster timezone (CYPRESS_TIMEZONE)" "${def_timezone:-UTC}")

Expand Down Expand Up @@ -468,7 +483,9 @@ main() {
local fbc_stage_kbv_image
fbc_stage_kbv_image=$(ask "KBV FBC image (CYPRESS_FBC_STAGE_KBV_IMAGE)" "$def_fbc_stage_kbv_image")


local login_idp_dev_user
login_idp_dev_user=$(ask "Login identity provider dev user (CYPRESS_LOGIN_IDP_DEV_USER)" "$def_login_idp_dev_user")

# Build export lines with safe quoting
local -a export_lines
export_lines+=("export CYPRESS_BASE_URL='$(printf %s "$base_url" | escape_for_single_quotes)'" )
Expand All @@ -492,6 +509,9 @@ main() {
if [[ -n "$mcp_console_image" ]]; then
export_lines+=("export CYPRESS_MCP_CONSOLE_IMAGE='$(printf %s "$mcp_console_image" | escape_for_single_quotes)'" )
fi
if [[ -n "$cha_image" ]]; then
export_lines+=("export CYPRESS_CHA_IMAGE='$(printf %s "$cha_image" | escape_for_single_quotes)'" )
fi
if [[ -n "$timezone" ]]; then
export_lines+=("export CYPRESS_TIMEZONE='$(printf %s "$timezone" | escape_for_single_quotes)'" )
fi
Expand All @@ -515,7 +535,9 @@ main() {
if [[ -n "$fbc_stage_kbv_image" ]]; then
export_lines+=("export CYPRESS_FBC_STAGE_KBV_IMAGE='$(printf %s "$fbc_stage_kbv_image" | escape_for_single_quotes)'" )
fi

if [[ -n "$login_idp_dev_user" ]]; then
export_lines+=("export CYPRESS_LOGIN_IDP_DEV_USER='$(printf %s "$login_idp_dev_user" | escape_for_single_quotes)'" )
fi
echo ""
if is_sourced; then
# Export directly into current shell
Expand All @@ -534,29 +556,30 @@ main() {

echo ""
echo "Configured values:"
echo " CYPRESS_BASE_URL=$CYPRESS_BASE_URL"
echo " CYPRESS_LOGIN_IDP=${CYPRESS_LOGIN_IDP:-$login_idp}"
echo " CYPRESS_LOGIN_USERS=${CYPRESS_LOGIN_USERS:-$login_users}"
echo " CYPRESS_KUBECONFIG_PATH=${CYPRESS_KUBECONFIG_PATH:-$kubeconfig}"
[[ -n "${CYPRESS_MP_IMAGE-}$mp_image" ]] && echo " CYPRESS_MP_IMAGE=${CYPRESS_MP_IMAGE:-$mp_image}"
[[ -n "${CYPRESS_COO_NAMESPACE-}$coo_namespace" ]] && echo " CYPRESS_COO_NAMESPACE=${CYPRESS_COO_NAMESPACE:-$coo_namespace}"
echo " CYPRESS_SKIP_COO_INSTALL=${CYPRESS_SKIP_COO_INSTALL:-$skip_coo_install}"
echo " CYPRESS_COO_UI_INSTALL=${CYPRESS_COO_UI_INSTALL:-$coo_ui_install}"
[[ -n "${CYPRESS_KONFLUX_COO_BUNDLE_IMAGE-}$konflux_bundle" ]] && echo " CYPRESS_KONFLUX_COO_BUNDLE_IMAGE=${CYPRESS_KONFLUX_COO_BUNDLE_IMAGE:-$konflux_bundle}"
[[ -n "${CYPRESS_CUSTOM_COO_BUNDLE_IMAGE-}$custom_coo_bundle" ]] && echo " CYPRESS_CUSTOM_COO_BUNDLE_IMAGE=${CYPRESS_CUSTOM_COO_BUNDLE_IMAGE:-$custom_coo_bundle}"
[[ -n "${CYPRESS_MCP_CONSOLE_IMAGE-}$mcp_console_image" ]] && echo " CYPRESS_MCP_CONSOLE_IMAGE=${CYPRESS_MCP_CONSOLE_IMAGE:-$mcp_console_image}"
[[ -n "${CYPRESS_TIMEZONE-}$timezone" ]] && echo " CYPRESS_TIMEZONE=${CYPRESS_TIMEZONE:-$timezone}"
echo " CYPRESS_MOCK_NEW_METRICS=${CYPRESS_MOCK_NEW_METRICS:-$mock_new_metrics}"
echo " CYPRESS_SESSION=${CYPRESS_SESSION:-$session}"
echo " CYPRESS_DEBUG=${CYPRESS_DEBUG:-$debug}"
echo " CYPRESS_SKIP_ALL_INSTALL=${CYPRESS_SKIP_ALL_INSTALL:-$skip_all_install}"
echo " CYPRESS_SKIP_KBV_INSTALL=${CYPRESS_SKIP_KBV_INSTALL:-$skip_kbv_install}"
echo " CYPRESS_KBV_UI_INSTALL=${CYPRESS_KBV_UI_INSTALL:-$kbv_ui_install}"
[[ -n "${CYPRESS_KONFLUX_KBV_BUNDLE_IMAGE-}$konflux_kbv_bundle" ]] && echo " CYPRESS_KONFLUX_KBV_BUNDLE_IMAGE=${CYPRESS_KONFLUX_KBV_BUNDLE_IMAGE:-$konflux_kbv_bundle}"
[[ -n "${CYPRESS_CUSTOM_KBV_BUNDLE_IMAGE-}$custom_kbv_bundle" ]] && echo " CYPRESS_CUSTOM_KBV_BUNDLE_IMAGE=${CYPRESS_CUSTOM_KBV_BUNDLE_IMAGE:-$custom_kbv_bundle}"
[[ -n "${CYPRESS_FBC_STAGE_KBV_IMAGE-}$fbc_stage_kbv_image" ]] && echo " CYPRESS_FBC_STAGE_KBV_IMAGE=${CYPRESS_FBC_STAGE_KBV_IMAGE:-$fbc_stage_kbv_image}"
echo " CYPRESS_BASE_URL=$base_url"
echo " CYPRESS_LOGIN_IDP=$login_idp"
echo " CYPRESS_LOGIN_USERS=$login_users"
echo " CYPRESS_LOGIN_IDP_DEV_USER=$login_idp_dev_user"
echo " CYPRESS_KUBECONFIG_PATH=$kubeconfig"
[[ -n "$mp_image" ]] && echo " CYPRESS_MP_IMAGE=$mp_image"
[[ -n "$coo_namespace" ]] && echo " CYPRESS_COO_NAMESPACE=$coo_namespace"
echo " CYPRESS_SKIP_COO_INSTALL=$skip_coo_install"
echo " CYPRESS_COO_UI_INSTALL=$coo_ui_install"
[[ -n "$konflux_bundle" ]] && echo " CYPRESS_KONFLUX_COO_BUNDLE_IMAGE=$konflux_bundle"
[[ -n "$custom_coo_bundle" ]] && echo " CYPRESS_CUSTOM_COO_BUNDLE_IMAGE=$custom_coo_bundle"
[[ -n "$mcp_console_image" ]] && echo " CYPRESS_MCP_CONSOLE_IMAGE=$mcp_console_image"
[[ -n "$cha_image" ]] && echo " CYPRESS_CHA_IMAGE=$cha_image"
[[ -n "$timezone" ]] && echo " CYPRESS_TIMEZONE=$timezone"
echo " CYPRESS_MOCK_NEW_METRICS=$mock_new_metrics"
echo " CYPRESS_SESSION=$session"
echo " CYPRESS_DEBUG=$debug"
echo " CYPRESS_SKIP_ALL_INSTALL=$skip_all_install"
echo " CYPRESS_SKIP_KBV_INSTALL=$skip_kbv_install"
echo " CYPRESS_KBV_UI_INSTALL=$kbv_ui_install"
[[ -n "$konflux_kbv_bundle" ]] && echo " CYPRESS_KONFLUX_KBV_BUNDLE_IMAGE=$konflux_kbv_bundle"
[[ -n "$custom_kbv_bundle" ]] && echo " CYPRESS_CUSTOM_KBV_BUNDLE_IMAGE=$custom_kbv_bundle"
[[ -n "$fbc_stage_kbv_image" ]] && echo " CYPRESS_FBC_STAGE_KBV_IMAGE=$fbc_stage_kbv_image"
}

main "$@"


4 changes: 3 additions & 1 deletion web/cypress/e2e/coo/01.coo_bvt.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ describe('BVT: COO', { tags: ['@smoke', '@coo'] }, () => {

it('1. Admin perspective - Observe Menu', () => {
cy.log('Admin perspective - Observe Menu and verify all submenus');
cy.reload(true);
cy.wait(10000);
nav.sidenav.clickNavLink(['Observe', 'Alerting']);
commonPages.titleShouldHaveText('Alerting');
nav.tabs.switchTab('Silences');
Expand All @@ -45,4 +47,4 @@ describe('BVT: COO', { tags: ['@smoke', '@coo'] }, () => {
* TODO: To be replaced by COO validation such as Dashboards (Perses) scenarios
*/

});
});
5 changes: 2 additions & 3 deletions web/cypress/e2e/coo/01.coo_ivt.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,14 @@ describe('IVT: Monitoring UIPlugin + Virtualization', { tags: ['@smoke', '@coo']
it('1. Virtualization perspective - Observe Menu', () => {
cy.log('Virtualization perspective - Observe Menu and verify all submenus');
cy.switchPerspective('Virtualization');
cy.byAriaLabel('Welcome modal').should('be.visible');
guidedTour.closeKubevirtTour();
troubleshootingPanelPage.signalCorrelationShouldNotBeVisible();
cy.switchPerspective('Administrator');
cy.switchPerspective('Core platform', 'Administrator');

});

/**
* TODO: To be replaced by COO validation such as Dashboards (Perses) scenarios
*/

});
});
18 changes: 9 additions & 9 deletions web/cypress/e2e/coo/02.acm_alerting_ui.cy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// 02.acm_alerting_ui.cy.ts
// E2E test for validating ACM Alerting UI integration with Cluster Observability Operator (COO)
import '../../support/commands/auth-commands';
import { commonPages } from '../../views/common';
import { nav } from '../../views/nav';
import { acmAlertingPage } from '../../views/acm-alerting-page';

Expand All @@ -25,9 +26,11 @@ describe('ACM Alerting UI', { tags: ['@coo', '@alerts'] }, () => {
});

it('Navigate to Fleet Management > local-cluster > Observe > Alerting', () => {
// wait for console page loading completed
cy.visit('/');
cy.get('body', { timeout: 60000 }).should('contain.text', 'Administrator');
// check monitoring-plugin UI is not been affected
nav.sidenav.clickNavLink(['Observe', 'Alerting']);
commonPages.titleShouldHaveText('Alerting')
nav.sidenav.clickNavLink(['Observe', 'Metrics']);
commonPages.titleShouldHaveText('Metrics');
// switch to Fleet Management page
cy.switchPerspective('Fleet Management');
// close pop-up window
Expand All @@ -42,17 +45,14 @@ describe('ACM Alerting UI', { tags: ['@coo', '@alerts'] }, () => {
});
// click side menu -> Observe -> Alerting
nav.sidenav.clickNavLink(['Observe', 'Alerting']);
// Wait for alert tab content to become visible
cy.get('section#alerts-tab-content', { timeout: 60000 })
.should('be.visible');
// confirm Alerting page loading completed
acmAlertingPage.shouldBeLoaded();
// check three test alerts exist
// check test alerts exist
expectedAlerts.forEach((alert) => {
cy.contains('a[data-test-id="alert-resource-link"]', alert, { timeout: 60000 })
cy.contains('a[data-test-id="alert-resource-link"]', alert, { timeout: 120000 })
.should('be.visible');
});
cy.log('Verified all expected alerts are visible on the Alerting page');
cy.log('ACM Alerting UI test completed successfully');
});
});
});
4 changes: 2 additions & 2 deletions web/cypress/e2e/incidents/00.coo_incidents_e2e.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ const MCP = {
};

const MP = {
namespace: Cypress.env('COO_NAMESPACE'),
namespace: 'openshift-monitoring',
operatorName: 'Cluster Monitoring Operator',
};

describe('BVT: Incidents - e2e', { tags: ['@smoke', '@slow', '@incidents'] }, () => {
describe('BVT: Incidents - e2e', { tags: ['@smoke', '@slow', '@incidents', '@e2e-real'] }, () => {
let currentAlertName: string;

before(() => {
Expand Down
2 changes: 1 addition & 1 deletion web/cypress/e2e/incidents/01.incidents.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const MCP = {
};

const MP = {
namespace: Cypress.env('COO_NAMESPACE'),
namespace: 'openshift-monitoring',
operatorName: 'Cluster Monitoring Operator',
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const MCP = {
};

const MP = {
namespace: Cypress.env('COO_NAMESPACE'),
namespace: 'openshift-monitoring',
operatorName: 'Cluster Monitoring Operator',
};

Expand Down
4 changes: 2 additions & 2 deletions web/cypress/e2e/incidents/regression/01.reg_filtering.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const MCP = {
};

const MP = {
namespace: Cypress.env('COO_NAMESPACE'),
namespace: 'openshift-monitoring',
operatorName: 'Cluster Monitoring Operator',
};

Expand Down Expand Up @@ -148,4 +148,4 @@ describe('Regression: Incidents Filtering', { tags: ['@incidents'] }, () => {
incidentsPage.clearAllFilters();
});

});
});
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const MCP = {
};

const MP = {
namespace: Cypress.env('COO_NAMESPACE'),
namespace: 'openshift-monitoring',
operatorName: 'Cluster Monitoring Operator',
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const MP = {
operatorName: 'Cluster Monitoring Operator',
};

describe('Regression: Time-Based Alert Resolution (E2E with Firing Alerts)', { tags: ['@incidents', '@slow', '@flaky'] }, () => {
describe('Regression: Time-Based Alert Resolution (E2E with Firing Alerts)', { tags: ['@incidents', '@slow', '@e2e-real'] }, () => {
let currentAlertName: string;

before(() => {
Expand Down Expand Up @@ -301,4 +301,3 @@ describe('Regression: Time-Based Alert Resolution (E2E with Firing Alerts)', { t
});
});


5 changes: 2 additions & 3 deletions web/cypress/e2e/incidents/regression/03.reg_api_calls.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ const MCP = {
};

const MP = {
namespace: Cypress.env('COO_NAMESPACE'),
namespace: 'openshift-monitoring',
operatorName: 'Cluster Monitoring Operator',
};

describe('Regression: Silences Not Applied Correctly', { tags: ['@incidents', '@flaky'] }, () => {
describe('Regression: Silences Not Applied Correctly', { tags: ['@incidents'] }, () => {

before(() => {
cy.beforeBlockCOO(MCP, MP);
Expand Down Expand Up @@ -125,4 +125,3 @@ describe('Regression: Silences Not Applied Correctly', { tags: ['@incidents', '@
});
});


Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ const MCP = {
};

const MP = {
namespace: Cypress.env('COO_NAMESPACE'),
namespace: 'openshift-monitoring',
operatorName: 'Cluster Monitoring Operator',
};

describe('Regression: Redux State Management', { tags: ['@incidents', '@incidents-redux', '@flaky'] }, () => {
describe('Regression: Redux State Management', { tags: ['@incidents', '@incidents-redux'] }, () => {

before(() => {
cy.beforeBlockCOO(MCP, MP);
Expand Down Expand Up @@ -184,4 +184,4 @@ describe('Regression: Redux State Management', { tags: ['@incidents', '@incident
incidentsPage.elements.incidentIdFilterChip().should('be.visible');
cy.log('SUCCESS: Incident reappears when conflicting filter removed');
});
});
});
4 changes: 0 additions & 4 deletions web/cypress/e2e/monitoring/00.bvt_admin.cy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { nav } from '../../views/nav';
import { alerts } from '../../fixtures/monitoring/alert';
import { guidedTour } from '../../views/tour';
import { runBVTMonitoringTests } from '../../support/monitoring/00.bvt_monitoring.cy';
import { commonPages } from '../../views/common';
import { overviewPage } from '../../views/overview-page';
Expand All @@ -17,9 +16,6 @@ describe('BVT: Monitoring', { tags: ['@smoke', '@monitoring'] }, () => {
});

beforeEach(() => {
cy.visit('/');
guidedTour.close();
cy.validateLogin();
nav.sidenav.clickNavLink(['Observe', 'Metrics']);
commonPages.titleShouldHaveText('Metrics');
cy.changeNamespace("All Projects");
Expand Down
5 changes: 0 additions & 5 deletions web/cypress/e2e/monitoring/00.bvt_dev.cy.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { nav } from '../../views/nav';
import { alerts } from '../../fixtures/monitoring/alert';
import { guidedTour } from '../../views/tour';
import { runBVTMonitoringTestsNamespace } from '../../support/monitoring/00.bvt_monitoring_namespace.cy';
import { commonPages } from '../../views/common';
import { overviewPage } from '../../views/overview-page';
// Set constants for the operators that need to be installed for tests.
const MP = {
namespace: 'openshift-monitoring',
Expand All @@ -17,9 +15,6 @@ describe('BVT: Monitoring - Namespaced', { tags: ['@monitoring-dev', '@smoke-dev
});

beforeEach(() => {
cy.visit('/');
guidedTour.close();
cy.validateLogin();
alerts.getWatchdogAlert();
nav.sidenav.clickNavLink(['Observe', 'Alerting']);
commonPages.titleShouldHaveText('Alerting');
Expand Down
Loading