chore: Stub /features call in tests (#25104)
This change will stub the call to `users/features` to get the feature flags. By default it will return an empty list and rely on the client default flag list to enable/disable features
This commit is contained in:
parent
e6f2dcacde
commit
87b60908a4
|
|
@ -38,6 +38,7 @@ app/client/src/ee/pages/Editor/NavigationSettings/LogoInput.tsx @dhruvikn
|
||||||
# New Developers Pod
|
# New Developers Pod
|
||||||
app/client/src/ce/entities/FeatureFlag.ts @hetunandu
|
app/client/src/ce/entities/FeatureFlag.ts @hetunandu
|
||||||
app/client/src/ee/entities/FeatureFlag.ts @hetunandu
|
app/client/src/ee/entities/FeatureFlag.ts @hetunandu
|
||||||
|
app/server/appsmith-server/src/main/resources/features/init-flags.xml @hetunandu
|
||||||
|
|
||||||
# UI Builders Pod
|
# UI Builders Pod
|
||||||
app/client/generators/* @appsmithorg/ui-builders
|
app/client/generators/* @appsmithorg/ui-builders
|
||||||
|
|
|
||||||
|
|
@ -7,10 +7,6 @@ const queryLocators = require("../../../../locators/QueryEditor.json");
|
||||||
describe("MaintainContext&Focus", function () {
|
describe("MaintainContext&Focus", function () {
|
||||||
before("Import the test application", () => {
|
before("Import the test application", () => {
|
||||||
_.homePage.NavigateToHome();
|
_.homePage.NavigateToHome();
|
||||||
cy.intercept("GET", "/api/v1/users/features", {
|
|
||||||
fixture: "featureFlags.json",
|
|
||||||
}).as("featureFlags");
|
|
||||||
cy.reload();
|
|
||||||
_.homePage.ImportApp("ContextSwitching.json");
|
_.homePage.ImportApp("ContextSwitching.json");
|
||||||
cy.wait("@importNewApplication").then((interception) => {
|
cy.wait("@importNewApplication").then((interception) => {
|
||||||
_.agHelper.Sleep();
|
_.agHelper.Sleep();
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import {
|
||||||
agHelper,
|
agHelper,
|
||||||
appSettings,
|
appSettings,
|
||||||
} from "../../../../support/Objects/ObjectsCore";
|
} from "../../../../support/Objects/ObjectsCore";
|
||||||
|
import { featureFlagIntercept } from "../../../../support/Objects/FeatureFlags";
|
||||||
|
|
||||||
describe("In-app embed settings", () => {
|
describe("In-app embed settings", () => {
|
||||||
function ValidateSyncWithInviteModal(showNavigationBar: "true" | "false") {
|
function ValidateSyncWithInviteModal(showNavigationBar: "true" | "false") {
|
||||||
|
|
@ -72,9 +73,12 @@ describe("In-app embed settings", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it("5. [Feature flag APP_EMBED_VIEW_HIDE_SHARE_SETTINGS_VISIBILITY=false] Changing the show navigation bar setting in the App settings pane should update the embed URL with embed parameter", () => {
|
it("5. [Feature flag APP_EMBED_VIEW_HIDE_SHARE_SETTINGS_VISIBILITY=false] Changing the show navigation bar setting in the App settings pane should update the embed URL with embed parameter", () => {
|
||||||
cy.intercept("GET", "/api/v1/users/features", {
|
featureFlagIntercept(
|
||||||
fixture: "featureFlags.json",
|
{
|
||||||
}).as("featureFlags");
|
APP_EMBED_VIEW_HIDE_SHARE_SETTINGS_VISIBILITY: false,
|
||||||
|
},
|
||||||
|
false,
|
||||||
|
);
|
||||||
agHelper.RefreshPage();
|
agHelper.RefreshPage();
|
||||||
embedSettings.OpenEmbedSettings();
|
embedSettings.OpenEmbedSettings();
|
||||||
embedSettings.TogglePublicAccess(true);
|
embedSettings.TogglePublicAccess(true);
|
||||||
|
|
@ -93,9 +97,10 @@ describe("In-app embed settings", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it("6. [Feature flag APP_EMBED_VIEW_HIDE_SHARE_SETTINGS_VISIBILITY=true] Changing the show navigation bar setting in the App settings pane should update the embed URL with navbar parameter", () => {
|
it("6. [Feature flag APP_EMBED_VIEW_HIDE_SHARE_SETTINGS_VISIBILITY=true] Changing the show navigation bar setting in the App settings pane should update the embed URL with navbar parameter", () => {
|
||||||
cy.intercept("GET", "/api/v1/users/features", {
|
featureFlagIntercept(
|
||||||
fixture: "featureFlagsComplement.json",
|
{ APP_EMBED_VIEW_HIDE_SHARE_SETTINGS_VISIBILITY: true },
|
||||||
}).as("featureFlags");
|
false,
|
||||||
|
);
|
||||||
agHelper.RefreshPage();
|
agHelper.RefreshPage();
|
||||||
|
|
||||||
embedSettings.OpenEmbedSettings();
|
embedSettings.OpenEmbedSettings();
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,6 @@ describe(
|
||||||
"Google Sheets datasource test cases",
|
"Google Sheets datasource test cases",
|
||||||
function () {
|
function () {
|
||||||
it("1. Create Google Sheets datasource", function () {
|
it("1. Create Google Sheets datasource", function () {
|
||||||
cy.intercept("GET", "/api/v1/users/features", {
|
|
||||||
fixture: "featureFlags.json",
|
|
||||||
}).as("featureFlags");
|
|
||||||
dataSources.NavigateToDSCreateNew();
|
dataSources.NavigateToDSCreateNew();
|
||||||
dataSources.CreatePlugIn("Google Sheets");
|
dataSources.CreatePlugIn("Google Sheets");
|
||||||
VerifyFunctionDropdown([
|
VerifyFunctionDropdown([
|
||||||
|
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
{
|
|
||||||
"responseMeta": {
|
|
||||||
"status": 200,
|
|
||||||
"success": true
|
|
||||||
},
|
|
||||||
"data": {
|
|
||||||
"release_datasource_environments_enabled": false,
|
|
||||||
"MULTIPLE_PANES": false,
|
|
||||||
"APP_EMBED_VIEW_HIDE_SHARE_SETTINGS_VISIBILITY": false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
{
|
|
||||||
"responseMeta": {
|
|
||||||
"status": 200,
|
|
||||||
"success": true
|
|
||||||
},
|
|
||||||
"data": {
|
|
||||||
"APP_EMBED_VIEW_HIDE_SHARE_SETTINGS_VISIBILITY": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
17
app/client/cypress/support/Objects/FeatureFlags.ts
Normal file
17
app/client/cypress/support/Objects/FeatureFlags.ts
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
export const featureFlagIntercept = (
|
||||||
|
flags: Record<string, boolean>,
|
||||||
|
reload = true,
|
||||||
|
) => {
|
||||||
|
const response = {
|
||||||
|
responseMeta: {
|
||||||
|
status: 200,
|
||||||
|
success: true,
|
||||||
|
},
|
||||||
|
data: flags,
|
||||||
|
errorDisplay: "",
|
||||||
|
};
|
||||||
|
cy.intercept("GET", "/api/v1/users/features", response);
|
||||||
|
if (reload) {
|
||||||
|
cy.reload();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
@ -31,6 +31,7 @@ const welcomePage = require("../locators/welcomePage.json");
|
||||||
const publishWidgetspage = require("../locators/publishWidgetspage.json");
|
const publishWidgetspage = require("../locators/publishWidgetspage.json");
|
||||||
import { ObjectsRegistry } from "../support/Objects/Registry";
|
import { ObjectsRegistry } from "../support/Objects/Registry";
|
||||||
import RapidMode from "./RapidMode";
|
import RapidMode from "./RapidMode";
|
||||||
|
import { featureFlagIntercept } from "./Objects/FeatureFlags";
|
||||||
|
|
||||||
const propPane = ObjectsRegistry.PropertyPane;
|
const propPane = ObjectsRegistry.PropertyPane;
|
||||||
const agHelper = ObjectsRegistry.AggregateHelper;
|
const agHelper = ObjectsRegistry.AggregateHelper;
|
||||||
|
|
@ -1126,6 +1127,7 @@ Cypress.Commands.add("startServerAndRoutes", () => {
|
||||||
}).as("postTenant");
|
}).as("postTenant");
|
||||||
cy.intercept("PUT", "/api/v1/git/discard/app/*").as("discardChanges");
|
cy.intercept("PUT", "/api/v1/git/discard/app/*").as("discardChanges");
|
||||||
cy.intercept("GET", "/api/v1/libraries/*").as("getLibraries");
|
cy.intercept("GET", "/api/v1/libraries/*").as("getLibraries");
|
||||||
|
featureFlagIntercept({}, false);
|
||||||
});
|
});
|
||||||
|
|
||||||
Cypress.Commands.add("startErrorRoutes", () => {
|
Cypress.Commands.add("startErrorRoutes", () => {
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,6 @@ public enum FeatureFlagEnum {
|
||||||
|
|
||||||
// ------------------- These are actual feature flags meant to be used across the product ----------------------- //
|
// ------------------- These are actual feature flags meant to be used across the product ----------------------- //
|
||||||
release_datasource_environments_enabled,
|
release_datasource_environments_enabled,
|
||||||
MULTIPLE_PANES,
|
|
||||||
APP_NAVIGATION_LOGO_UPLOAD,
|
APP_NAVIGATION_LOGO_UPLOAD,
|
||||||
APP_EMBED_VIEW_HIDE_SHARE_SETTINGS_VISIBILITY,
|
APP_EMBED_VIEW_HIDE_SHARE_SETTINGS_VISIBILITY,
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,11 +3,6 @@
|
||||||
<autocreate>false</autocreate>
|
<autocreate>false</autocreate>
|
||||||
<audit>false</audit>
|
<audit>false</audit>
|
||||||
<features>
|
<features>
|
||||||
<feature uid="MULTIPLE_PANES" enable="true" description="Have multiple panes in the Appsmith IDE">
|
|
||||||
<flipstrategy class="com.appsmith.server.featureflags.strategies.EmailBasedRolloutStrategy">
|
|
||||||
<param name="emails" value="multipanes@appsmith.com,ndx@appsmith.com"/>
|
|
||||||
</flipstrategy>
|
|
||||||
</feature>
|
|
||||||
<feature uid="APP_NAVIGATION_LOGO_UPLOAD" enable="true"
|
<feature uid="APP_NAVIGATION_LOGO_UPLOAD" enable="true"
|
||||||
description="Logo upload feature for app viewer navigation">
|
description="Logo upload feature for app viewer navigation">
|
||||||
<flipstrategy class="com.appsmith.server.featureflags.strategies.EmailBasedRolloutStrategy">
|
<flipstrategy class="com.appsmith.server.featureflags.strategies.EmailBasedRolloutStrategy">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user