From d9f1e1e1edbfa23e69330419a6073b44bf960d91 Mon Sep 17 00:00:00 2001 From: OlegIvaniv Date: Mon, 3 Apr 2023 09:49:55 +0200 Subject: [PATCH] test(editor): Fix failing licensing related e2e specs (no-changelog) (#5884) test(editor): Fix failing licensing related specs --- cypress/e2e/10-settings-log-streaming.cy.ts | 2 +- packages/cli/src/api/e2e.api.ts | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/cypress/e2e/10-settings-log-streaming.cy.ts b/cypress/e2e/10-settings-log-streaming.cy.ts index e67f47045d..0126667a69 100644 --- a/cypress/e2e/10-settings-log-streaming.cy.ts +++ b/cypress/e2e/10-settings-log-streaming.cy.ts @@ -26,7 +26,7 @@ describe('Log Streaming Settings', () => { }); it('should show the licensed view when the feature is enabled', () => { - cy.enableFeature('logStreaming'); + cy.enableFeature('feat:logStreaming'); cy.visit('/settings/log-streaming'); settingsLogStreamingPage.getters.getActionBoxLicensed().should('be.visible'); settingsLogStreamingPage.getters.getAddFirstDestinationButton().should('be.visible'); diff --git a/packages/cli/src/api/e2e.api.ts b/packages/cli/src/api/e2e.api.ts index fb9097da61..249bd769ba 100644 --- a/packages/cli/src/api/e2e.api.ts +++ b/packages/cli/src/api/e2e.api.ts @@ -15,6 +15,7 @@ import { hashPassword } from '@/UserManagement/UserManagementHelper'; import { eventBus } from '@/eventbus/MessageEventBus/MessageEventBus'; import Container from 'typedi'; import { License } from '../License'; +import { LICENSE_FEATURES } from '@/constants'; if (process.env.E2E_TESTS !== 'true') { console.error('E2E endpoints only allowed during E2E tests'); @@ -22,11 +23,11 @@ if (process.env.E2E_TESTS !== 'true') { } const enabledFeatures = { - sharing: true, //default to true here instead of setting it in config/index.ts for e2e - ldap: false, - saml: false, - logStreaming: false, - advancedExecutionFilters: false, + [LICENSE_FEATURES.SHARING]: true, //default to true here instead of setting it in config/index.ts for e2e + [LICENSE_FEATURES.LDAP]: false, + [LICENSE_FEATURES.SAML]: false, + [LICENSE_FEATURES.LOG_STREAMING]: false, + [LICENSE_FEATURES.ADVANCED_EXECUTION_FILTERS]: false, }; type Feature = keyof typeof enabledFeatures; @@ -93,7 +94,7 @@ const setupUserManagement = async () => { }; const resetLogStreaming = async () => { - enabledFeatures.logStreaming = false; + enabledFeatures[LICENSE_FEATURES.LOG_STREAMING] = false; for (const id in eventBus.destinations) { await eventBus.removeDestination(id); }