allow setting multiple feature toggles in run-suite (#104821)

* allow setting multiple feature toggles in  run-suite
This commit is contained in:
Scott Lepper
2025-05-01 11:00:04 -04:00
committed by GitHub
parent fd4afdbd2c
commit ca2ae82e80
+17 -4
View File
@@ -45,14 +45,27 @@ Cypress.on('uncaught:exception', (err) => {
// });
//
// TODO: read from toggles_gen.csv?
const featureToggles = ['kubernetesDashboards', 'dashboardNewLayouts'];
beforeEach(() => {
let toggles = [];
if (Cypress.env('DISABLE_SCENES')) {
cy.logToConsole('disabling dashboardScene feature toggle in localstorage');
cy.setLocalStorage('grafana.featureToggles', 'dashboardScene=false');
toggles.push('dashboardScene=false');
}
if (Cypress.env('kubernetesDashboards')) {
cy.logToConsole('enabling kubernetes dashboards API in localstorage');
cy.setLocalStorage('grafana.featureToggles', 'kubernetesDashboards=true');
for (const toggle of featureToggles) {
const toggleValue = Cypress.env(toggle);
if (toggleValue !== undefined) {
cy.logToConsole(`setting ${toggle} to ${toggleValue} in localstorage`);
toggles.push(`${toggle}=${toggleValue}`);
}
}
if (toggles.length > 0) {
cy.logToConsole('setting feature toggles in localstorage');
cy.setLocalStorage('grafana.featureToggles', toggles.join(','));
}
});