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

* allow setting multiple feature toggles in  run-suite
pull/104831/head
Scott Lepper 3 weeks ago committed by GitHub
parent fd4afdbd2c
commit ca2ae82e80
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 21
      e2e/cypress/support/e2e.js

@ -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');
}
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 (Cypress.env('kubernetesDashboards')) {
cy.logToConsole('enabling kubernetes dashboards API in localstorage');
cy.setLocalStorage('grafana.featureToggles', 'kubernetesDashboards=true');
if (toggles.length > 0) {
cy.logToConsole('setting feature toggles in localstorage');
cy.setLocalStorage('grafana.featureToggles', toggles.join(','));
}
});

Loading…
Cancel
Save