PromucFlow_constructor/app/client/cypress/support/Objects/FeatureFlags.ts

111 lines
3.3 KiB
TypeScript
Raw Normal View History

chore: reverted consolidated api (#30314) ## Description Reverted consolidated api changes and also some CE related changes to make it compatible with EE. #### PR fixes following issue(s) Reverts #29650 & #29939 #### Type of change - Chore (housekeeping or task changes that don't impact user perception) > > > ## Testing #### How Has This Been Tested? - [ ] Manual - [ ] JUnit - [ ] Jest - [x ] Cypress > > #### Test Plan > Add Testsmith test cases links that relate to this PR > > #### Issues raised during DP testing > Link issues raised during DP testing for better visiblity and tracking (copy link from comments dropped on this PR) > > > ## Checklist: #### Dev activity - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag #### QA activity: - [ ] [Speedbreak features](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#speedbreakers-) have been covered - [ ] Test plan covers all impacted features and [areas of interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#areas-of-interest-) - [ ] Test plan has been peer reviewed by project stakeholders and other QA members - [ ] Manually tested functionality on DP - [ ] We had an implementation alignment call with stakeholders post QA Round 2 - [ ] Cypress test cases have been added and approved by SDET/manual QA - [ ] Added `Test Plan Approved` label after Cypress tests were reviewed - [ ] Added `Test Plan Approved` label after JUnit tests were reviewed <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Refactor** - Enhanced the reliability and efficiency of Cypress e2e tests by adjusting wait conditions and assertions. - Simplified network request handling across various test cases. - Updated test logic to align with changes in application data structure and network requests. - **Tests** - Improved test stability for application import/export, Git sync, page load behavior, and widget interactions. - Refined mobile responsiveness tests to accurately validate layout conversions and autofill behaviors. - **Chores** - Removed deprecated feature flags and code related to consolidated page load functionality. - Cleaned up unused parameters and simplified action payloads in Redux actions. - **Documentation** - Updated comments for clarity in test specifications. - **Style** - Adjusted code styling for consistency across test suites. - **Bug Fixes** - Fixed data retrieval logic in tests to ensure correct data extraction from API responses. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-01-16 04:46:48 +00:00
import { LICENSE_FEATURE_FLAGS } from "../Constants";
test: Cypress | Text_With_Different_Size_spec.ts re-write + Flaky fixes (#30445) ## Description - This PR re-writes the entire Text_With_Different_Size_spec.ts spec to fix the master run flakyness and and improves the overall complexity of the test case format - cypress/e2e/Regression/ClientSide/Onboarding/StartFromScratch_spec.ts (agHelper.VisitNAssert improved) - Master runs pass at [Run1](https://github.com/appsmithorg/appsmith-ee/pull/3337#issuecomment-1899183181), [Run2](https://github.com/appsmithorg/appsmith-ee/pull/3337#issuecomment-1899197871) - cypress/e2e/Regression/ClientSide/BugTests/AbortAction_Spec.ts (1st test - replace with TED url) - getConsolidatedDataApi() separated, created new agHelper.CypressReload() - Removed cy.log statements from few places - homePage.LogOutviaAPI() removed static wait - Replaced homePage.LogOutviaAPI(); with homePage.Signout(); in places where its flaky - Split /Onboarding/StartFromScratch_spec.ts to 3 specs to reduce flakyness - Split /ClientSide/PartialImportExport/PartialExport_Widgets_spec.ts with failing test to run the other tests in CI - /Templates/Fork_Template_To_App_spec.ts - Added dynamic check to fix CI flakiness - agHelper.AssertURL(), assertHelper.AssertDocumentReady() improved - jsEditor.NavigateToNewJSEditor() improved - cypress/e2e/Regression/ClientSide/ExplorerTests/JSEditorContextMenu_Spec.ts - jsEditor.ValidateDefaultJSObjProperties improved - cypress/e2e/Regression/ServerSide/OnLoadTests/OnLoadActions_Spec.ts - (3rd case - flaky fix) #### Type of change - Script fix (non-breaking change which fixes an issue) ## Testing #### How Has This Been Tested? - [X] Cypress CI runs ## Checklist: #### QA activity: - [X] Added `Test Plan Approved` label after changes were reviewed <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Summary by CodeRabbit - **Tests** - Enhanced test flexibility by dynamically constructing API URLs. - Improved test setup and flow in onboarding and regression suites. - Added new test spec files for dynamic height, onboarding, bug tests, login failure, and starting from scratch scenarios. - **Refactor** - Updated function calls and parameters across various test files for consistency and efficiency. - Removed redundant code and streamlined test actions. - **Chores** - Updated intercepted HTTP methods and added new utility functions to support test operations. - **Bug Fixes** - Fixed issues related to element visibility assertions in test scripts. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-02-08 11:25:58 +00:00
import { ObjectsRegistry } from "./Registry";
const defaultFlags = {
rollout_remove_feature_walkthrough_enabled: false, // remove this flag from here when it's removed from code
chore: git mod - test fixes (#38357) ## Description - Locator fixes for cy tests - Missing saga for discard and merge - New component for hot keys Fixes https://github.com/appsmithorg/appsmith/issues/37821 Fixes https://github.com/appsmithorg/appsmith/issues/37822 Fixes https://github.com/appsmithorg/appsmith/issues/37824 ## Automation /ok-to-test tags="@tag.Git" ### :mag: Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/12649057943> > Commit: 94c57d0a2398fca8e6cbb4be573586aa98dffbe1 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=12649057943&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.Git` > Spec: > <hr>Tue, 07 Jan 2025 10:42:55 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes - **New Features** - Added repository limit error modal to handle scenarios when repository limits are reached. - Introduced Git hot keys for quick access to Git operations. - Enhanced Git synchronization functionality with new merge and discard change capabilities. - Integrated feature flag handling in test suites for Git-related functionalities. - **Improvements** - Standardized test identifiers across Git-related components. - Refined Git modal interactions and state management. - Updated locator references for more consistent testing. - Improved user feedback with success notifications for branch deletions. - **Bug Fixes** - Resolved issues with branch switching and URL handling. - Improved error handling in Git synchronization processes. - **Testing** - Updated Cypress test suites with new feature flag interceptors. - Enhanced test coverage for Git operations and modal interactions. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-01-07 11:30:42 +00:00
release_git_modularisation_enabled: true,
chore: adding ce files (#41136) ## Description Git Cy test cleanup Doc https://www.notion.so/appsmith/Cypress-Git-Tests-Full-Migration-Plan-Technical-Migration-Document-21cfe271b0e2808e9bbfc52ff3f271d1?source=copy_link Fixes https://github.com/appsmithorg/appsmith/issues/41116 ## Automation /ok-to-test tags="@tag.Git" ### :mag: Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/16609928353> > Commit: c44fe06457377789cee38114e809e7ce842a3870 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=16609928353&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.Git` > Spec: > <hr>Wed, 30 Jul 2025 00:46:28 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Updated test intercepts and network request patterns to use new Git API endpoint structures. * Adjusted feature flag logic to enable a new Git API contracts flag for relevant tests. * Increased wait time for Git import operations to improve test reliability. * Refined and simplified test logic for Git discard, merge, and branch operations. * Added a new locator for pull count in Git sync UI tests. * Removed deprecated or redundant assertions and UI checks in Git-related tests. * Skipped import tests for older app versions due to backend compatibility issues. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-07-31 08:08:56 +00:00
release_git_api_contracts_enabled: true,
};
export const featureFlagIntercept = (
flags: Record<string, boolean> = {},
reload = true,
) => {
getConsolidatedDataApi({ ...flags, ...defaultFlags }, false);
const response = {
responseMeta: {
status: 200,
success: true,
},
data: {
...flags,
...defaultFlags,
},
errorDisplay: "",
};
cy.intercept("GET", "/api/v1/users/features", response);
test: Cypress | Text_With_Different_Size_spec.ts re-write + Flaky fixes (#30445) ## Description - This PR re-writes the entire Text_With_Different_Size_spec.ts spec to fix the master run flakyness and and improves the overall complexity of the test case format - cypress/e2e/Regression/ClientSide/Onboarding/StartFromScratch_spec.ts (agHelper.VisitNAssert improved) - Master runs pass at [Run1](https://github.com/appsmithorg/appsmith-ee/pull/3337#issuecomment-1899183181), [Run2](https://github.com/appsmithorg/appsmith-ee/pull/3337#issuecomment-1899197871) - cypress/e2e/Regression/ClientSide/BugTests/AbortAction_Spec.ts (1st test - replace with TED url) - getConsolidatedDataApi() separated, created new agHelper.CypressReload() - Removed cy.log statements from few places - homePage.LogOutviaAPI() removed static wait - Replaced homePage.LogOutviaAPI(); with homePage.Signout(); in places where its flaky - Split /Onboarding/StartFromScratch_spec.ts to 3 specs to reduce flakyness - Split /ClientSide/PartialImportExport/PartialExport_Widgets_spec.ts with failing test to run the other tests in CI - /Templates/Fork_Template_To_App_spec.ts - Added dynamic check to fix CI flakiness - agHelper.AssertURL(), assertHelper.AssertDocumentReady() improved - jsEditor.NavigateToNewJSEditor() improved - cypress/e2e/Regression/ClientSide/ExplorerTests/JSEditorContextMenu_Spec.ts - jsEditor.ValidateDefaultJSObjProperties improved - cypress/e2e/Regression/ServerSide/OnLoadTests/OnLoadActions_Spec.ts - (3rd case - flaky fix) #### Type of change - Script fix (non-breaking change which fixes an issue) ## Testing #### How Has This Been Tested? - [X] Cypress CI runs ## Checklist: #### QA activity: - [X] Added `Test Plan Approved` label after changes were reviewed <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Summary by CodeRabbit - **Tests** - Enhanced test flexibility by dynamically constructing API URLs. - Improved test setup and flow in onboarding and regression suites. - Added new test spec files for dynamic height, onboarding, bug tests, login failure, and starting from scratch scenarios. - **Refactor** - Updated function calls and parameters across various test files for consistency and efficiency. - Removed redundant code and streamlined test actions. - **Chores** - Updated intercepted HTTP methods and added new utility functions to support test operations. - **Bug Fixes** - Fixed issues related to element visibility assertions in test scripts. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-02-08 11:25:58 +00:00
if (reload) ObjectsRegistry.AggregateHelper.CypressReload();
};
export const getConsolidatedDataApi = (
flags: Record<string, boolean> = {},
reload = true,
) => {
cy.intercept("GET", "/api/v1/consolidated-api/*?*", (req) => {
chore: add etag caching in consolidated api for application view mode (#38873) ## Description - Implement Etag caching for consolidated api in view mode. - Generate Etag for consolidated api in view mode - compare the if none match header with the computed etag and respond with either a 304 or 200 - add span for generate etag fn - Remove prefetching and caching of static assets in service worker ```mermaid sequenceDiagram Client->>Server: Request Consolidated API Server-->>Server: Compute ETag Server-->>Client: Respond with ETag, Cache-Control Client->>Server: Subsequent Request with If-None-Match alt ETag Matches Server-->>Client: 304 Not Modified else ETag Different Server-->>Client: Full Response with New ETag end ``` ## Automation /ok-to-test tags="@tag.All" ### :mag: Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/13046610688> > Commit: c14d58da8a59b3bbfb10c7e308b518d2cd8e3b7d > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=13046610688&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.All` > Spec: > <hr>Thu, 30 Jan 2025 07:14:21 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [x] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added ETag support for consolidated API responses to improve caching efficiency. - Introduced a new route handler for the `/api/v1/consolidated-api/view` endpoint. - **Performance Improvements** - Optimized NGINX configuration for API responses. - Updated tracing endpoint for better monitoring. - **Dependency Updates** - Added Jackson datatype support for Java 8 date and time handling. - **Technical Enhancements** - Improved request handling in ConsolidatedAPIController. - Updated service worker configuration. - Refined feature flag handling in the client. - Enhanced API request headers for consolidated page load functions. - Simplified caching and routing logic in the service worker. - Adjusted service worker caching strategy for production environment. - Updated test specification path for Cypress limited tests. - Modified request handling to remove unnecessary headers in feature flag functions. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-01-30 08:24:34 +00:00
delete req.headers["if-none-match"];
req.reply((res: any) => {
test: Cypress | Text_With_Different_Size_spec.ts re-write + Flaky fixes (#30445) ## Description - This PR re-writes the entire Text_With_Different_Size_spec.ts spec to fix the master run flakyness and and improves the overall complexity of the test case format - cypress/e2e/Regression/ClientSide/Onboarding/StartFromScratch_spec.ts (agHelper.VisitNAssert improved) - Master runs pass at [Run1](https://github.com/appsmithorg/appsmith-ee/pull/3337#issuecomment-1899183181), [Run2](https://github.com/appsmithorg/appsmith-ee/pull/3337#issuecomment-1899197871) - cypress/e2e/Regression/ClientSide/BugTests/AbortAction_Spec.ts (1st test - replace with TED url) - getConsolidatedDataApi() separated, created new agHelper.CypressReload() - Removed cy.log statements from few places - homePage.LogOutviaAPI() removed static wait - Replaced homePage.LogOutviaAPI(); with homePage.Signout(); in places where its flaky - Split /Onboarding/StartFromScratch_spec.ts to 3 specs to reduce flakyness - Split /ClientSide/PartialImportExport/PartialExport_Widgets_spec.ts with failing test to run the other tests in CI - /Templates/Fork_Template_To_App_spec.ts - Added dynamic check to fix CI flakiness - agHelper.AssertURL(), assertHelper.AssertDocumentReady() improved - jsEditor.NavigateToNewJSEditor() improved - cypress/e2e/Regression/ClientSide/ExplorerTests/JSEditorContextMenu_Spec.ts - jsEditor.ValidateDefaultJSObjProperties improved - cypress/e2e/Regression/ServerSide/OnLoadTests/OnLoadActions_Spec.ts - (3rd case - flaky fix) #### Type of change - Script fix (non-breaking change which fixes an issue) ## Testing #### How Has This Been Tested? - [X] Cypress CI runs ## Checklist: #### QA activity: - [X] Added `Test Plan Approved` label after changes were reviewed <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Summary by CodeRabbit - **Tests** - Enhanced test flexibility by dynamically constructing API URLs. - Improved test setup and flow in onboarding and regression suites. - Added new test spec files for dynamic height, onboarding, bug tests, login failure, and starting from scratch scenarios. - **Refactor** - Updated function calls and parameters across various test files for consistency and efficiency. - Removed redundant code and streamlined test actions. - **Chores** - Updated intercepted HTTP methods and added new utility functions to support test operations. - **Bug Fixes** - Fixed issues related to element visibility assertions in test scripts. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-02-08 11:25:58 +00:00
if (
res.statusCode === 200 ||
res.statusCode === 401 ||
res.statusCode === 500
) {
const originalResponse = res?.body;
try {
const updatedResponse = JSON.parse(JSON.stringify(originalResponse));
updatedResponse.data.featureFlags.data = { ...flags };
return res.send(updatedResponse);
} catch (e) {
cy.log(`Featureflags.ts error `, e);
}
}
});
}).as("getConsolidatedData");
test: Cypress | Text_With_Different_Size_spec.ts re-write + Flaky fixes (#30445) ## Description - This PR re-writes the entire Text_With_Different_Size_spec.ts spec to fix the master run flakyness and and improves the overall complexity of the test case format - cypress/e2e/Regression/ClientSide/Onboarding/StartFromScratch_spec.ts (agHelper.VisitNAssert improved) - Master runs pass at [Run1](https://github.com/appsmithorg/appsmith-ee/pull/3337#issuecomment-1899183181), [Run2](https://github.com/appsmithorg/appsmith-ee/pull/3337#issuecomment-1899197871) - cypress/e2e/Regression/ClientSide/BugTests/AbortAction_Spec.ts (1st test - replace with TED url) - getConsolidatedDataApi() separated, created new agHelper.CypressReload() - Removed cy.log statements from few places - homePage.LogOutviaAPI() removed static wait - Replaced homePage.LogOutviaAPI(); with homePage.Signout(); in places where its flaky - Split /Onboarding/StartFromScratch_spec.ts to 3 specs to reduce flakyness - Split /ClientSide/PartialImportExport/PartialExport_Widgets_spec.ts with failing test to run the other tests in CI - /Templates/Fork_Template_To_App_spec.ts - Added dynamic check to fix CI flakiness - agHelper.AssertURL(), assertHelper.AssertDocumentReady() improved - jsEditor.NavigateToNewJSEditor() improved - cypress/e2e/Regression/ClientSide/ExplorerTests/JSEditorContextMenu_Spec.ts - jsEditor.ValidateDefaultJSObjProperties improved - cypress/e2e/Regression/ServerSide/OnLoadTests/OnLoadActions_Spec.ts - (3rd case - flaky fix) #### Type of change - Script fix (non-breaking change which fixes an issue) ## Testing #### How Has This Been Tested? - [X] Cypress CI runs ## Checklist: #### QA activity: - [X] Added `Test Plan Approved` label after changes were reviewed <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Summary by CodeRabbit - **Tests** - Enhanced test flexibility by dynamically constructing API URLs. - Improved test setup and flow in onboarding and regression suites. - Added new test spec files for dynamic height, onboarding, bug tests, login failure, and starting from scratch scenarios. - **Refactor** - Updated function calls and parameters across various test files for consistency and efficiency. - Removed redundant code and streamlined test actions. - **Chores** - Updated intercepted HTTP methods and added new utility functions to support test operations. - **Bug Fixes** - Fixed issues related to element visibility assertions in test scripts. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-02-08 11:25:58 +00:00
if (reload) ObjectsRegistry.AggregateHelper.CypressReload();
};
chore: reverted consolidated api (#30314) ## Description Reverted consolidated api changes and also some CE related changes to make it compatible with EE. #### PR fixes following issue(s) Reverts #29650 & #29939 #### Type of change - Chore (housekeeping or task changes that don't impact user perception) > > > ## Testing #### How Has This Been Tested? - [ ] Manual - [ ] JUnit - [ ] Jest - [x ] Cypress > > #### Test Plan > Add Testsmith test cases links that relate to this PR > > #### Issues raised during DP testing > Link issues raised during DP testing for better visiblity and tracking (copy link from comments dropped on this PR) > > > ## Checklist: #### Dev activity - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag #### QA activity: - [ ] [Speedbreak features](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#speedbreakers-) have been covered - [ ] Test plan covers all impacted features and [areas of interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#areas-of-interest-) - [ ] Test plan has been peer reviewed by project stakeholders and other QA members - [ ] Manually tested functionality on DP - [ ] We had an implementation alignment call with stakeholders post QA Round 2 - [ ] Cypress test cases have been added and approved by SDET/manual QA - [ ] Added `Test Plan Approved` label after Cypress tests were reviewed - [ ] Added `Test Plan Approved` label after JUnit tests were reviewed <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Refactor** - Enhanced the reliability and efficiency of Cypress e2e tests by adjusting wait conditions and assertions. - Simplified network request handling across various test cases. - Updated test logic to align with changes in application data structure and network requests. - **Tests** - Improved test stability for application import/export, Git sync, page load behavior, and widget interactions. - Refined mobile responsiveness tests to accurately validate layout conversions and autofill behaviors. - **Chores** - Removed deprecated feature flags and code related to consolidated page load functionality. - Cleaned up unused parameters and simplified action payloads in Redux actions. - **Documentation** - Updated comments for clarity in test specifications. - **Style** - Adjusted code styling for consistency across test suites. - **Bug Fixes** - Fixed data retrieval logic in tests to ensure correct data extraction from API responses. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-01-16 04:46:48 +00:00
export const featureFlagInterceptForLicenseFlags = () => {
cy.intercept(
{
method: "GET",
url: "/api/v1/users/features",
},
(req) => {
req.reply((res) => {
if (res) {
const originalResponse = res.body;
let modifiedResponse: any = {};
Object.keys(originalResponse.data).forEach((flag) => {
if (LICENSE_FEATURE_FLAGS.includes(flag)) {
modifiedResponse[flag] = originalResponse.data[flag];
}
});
modifiedResponse = {
...modifiedResponse,
release_app_sidebar_enabled: true,
};
res.send({
responseMeta: {
status: 200,
success: true,
},
data: { ...modifiedResponse },
errorDisplay: "",
});
}
});
},
).as("getLicenseFeatures");
test: Cypress | Helpers improved + Flaky fixes (#30735) ## Description - This PR fixes the RenameApplication flakyness in CI with added dynamic check - Also replacing js cy.renameApp to TS helper - Flaky fixes - cypress/e2e/Regression/ClientSide/Workspace/MemberRoles_Spec.ts (entire spec updates for EnableGAC, removed signout from 'it' blocks) - cypress/e2e/Regression/ClientSide/Workspace/ShareAppTests_Spec.ts (7th flaky fixed) - cypress/e2e/Regression/ClientSide/SetProperty/WidgetPropertySetters2_spec.ts (5th test) - cypress/e2e/Regression/ClientSide/Templates/Fork_Template_Existing_app_spec.js (2nd - added validation to match the test description, 1st & 3rd - removed static waits, Added multiple dynamic checks) - cypress/e2e/Regression/ClientSide/OtherUIFeatures/ApplicationURL_spec.js (3rd & 4th flaky tests) - homePage.AssertViewPageLoad() created - homePage.LaunchAppFromAppHover() improved - homePage.Signout() - added dynamic checks - Added more validation to homePage.Signup() method with Dynamic checks - homePage.LeaveWorkspace() removed redundant SelectWorkspace call - admingSettings.EnableGAC() - added dynamic checks - featureFlagIntercept - removed static sleep, reload check improved - agHelper.VisitNAssert() - removed static sleep - homePage.OpenMembersPageForWorkspace() - removed sleep, added dynamic checks #### Type of change - Script fix (non-breaking change which fixes an issue) ## Testing #### How Has This Been Tested? - [X] Cypress CI runs ## Checklist: #### QA activity: - [X] Added `Test Plan Approved` label after Cypress tests were reviewed <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Summary by CodeRabbit - **Refactor** - Enhanced Cypress test commands across multiple test suites for improved efficiency and readability. - Refactored conditional checks and method invocations for better test scenario handling. - **Tests** - Updated testing approaches for application deployment, workspace management, and error handling. - Introduced new assertions for UI visibility and functional behavior in automated tests. - **Chores** - Optimized GitHub Actions workflow by adjusting the matrix count for build processes. - Added new test specs for limited tests in the client-side regression suite. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-02-01 11:12:53 +00:00
cy.intercept("GET", "/api/v1/consolidated-api/*?*", (req) => {
req.reply((res: any) => {
chore: add etag caching in consolidated api for application view mode (#38873) ## Description - Implement Etag caching for consolidated api in view mode. - Generate Etag for consolidated api in view mode - compare the if none match header with the computed etag and respond with either a 304 or 200 - add span for generate etag fn - Remove prefetching and caching of static assets in service worker ```mermaid sequenceDiagram Client->>Server: Request Consolidated API Server-->>Server: Compute ETag Server-->>Client: Respond with ETag, Cache-Control Client->>Server: Subsequent Request with If-None-Match alt ETag Matches Server-->>Client: 304 Not Modified else ETag Different Server-->>Client: Full Response with New ETag end ``` ## Automation /ok-to-test tags="@tag.All" ### :mag: Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/13046610688> > Commit: c14d58da8a59b3bbfb10c7e308b518d2cd8e3b7d > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=13046610688&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.All` > Spec: > <hr>Thu, 30 Jan 2025 07:14:21 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [x] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added ETag support for consolidated API responses to improve caching efficiency. - Introduced a new route handler for the `/api/v1/consolidated-api/view` endpoint. - **Performance Improvements** - Optimized NGINX configuration for API responses. - Updated tracing endpoint for better monitoring. - **Dependency Updates** - Added Jackson datatype support for Java 8 date and time handling. - **Technical Enhancements** - Improved request handling in ConsolidatedAPIController. - Updated service worker configuration. - Refined feature flag handling in the client. - Enhanced API request headers for consolidated page load functions. - Simplified caching and routing logic in the service worker. - Adjusted service worker caching strategy for production environment. - Updated test specification path for Cypress limited tests. - Modified request handling to remove unnecessary headers in feature flag functions. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-01-30 08:24:34 +00:00
delete req.headers["if-none-match"];
if (res.statusCode === 200) {
const originalResponse = res?.body;
const updatedResponse = JSON.parse(JSON.stringify(originalResponse));
updatedResponse.data.featureFlags.data = {};
Object.keys(originalResponse.data.featureFlags.data).forEach((flag) => {
if (LICENSE_FEATURE_FLAGS.includes(flag)) {
updatedResponse.data.featureFlags.data[flag] =
originalResponse.data.featureFlags.data[flag];
}
});
updatedResponse.data.featureFlags.data["release_app_sidebar_enabled"] =
true;
return res.send(updatedResponse);
}
});
}).as("getConsolidatedData");
test: Cypress | Text_With_Different_Size_spec.ts re-write + Flaky fixes (#30445) ## Description - This PR re-writes the entire Text_With_Different_Size_spec.ts spec to fix the master run flakyness and and improves the overall complexity of the test case format - cypress/e2e/Regression/ClientSide/Onboarding/StartFromScratch_spec.ts (agHelper.VisitNAssert improved) - Master runs pass at [Run1](https://github.com/appsmithorg/appsmith-ee/pull/3337#issuecomment-1899183181), [Run2](https://github.com/appsmithorg/appsmith-ee/pull/3337#issuecomment-1899197871) - cypress/e2e/Regression/ClientSide/BugTests/AbortAction_Spec.ts (1st test - replace with TED url) - getConsolidatedDataApi() separated, created new agHelper.CypressReload() - Removed cy.log statements from few places - homePage.LogOutviaAPI() removed static wait - Replaced homePage.LogOutviaAPI(); with homePage.Signout(); in places where its flaky - Split /Onboarding/StartFromScratch_spec.ts to 3 specs to reduce flakyness - Split /ClientSide/PartialImportExport/PartialExport_Widgets_spec.ts with failing test to run the other tests in CI - /Templates/Fork_Template_To_App_spec.ts - Added dynamic check to fix CI flakiness - agHelper.AssertURL(), assertHelper.AssertDocumentReady() improved - jsEditor.NavigateToNewJSEditor() improved - cypress/e2e/Regression/ClientSide/ExplorerTests/JSEditorContextMenu_Spec.ts - jsEditor.ValidateDefaultJSObjProperties improved - cypress/e2e/Regression/ServerSide/OnLoadTests/OnLoadActions_Spec.ts - (3rd case - flaky fix) #### Type of change - Script fix (non-breaking change which fixes an issue) ## Testing #### How Has This Been Tested? - [X] Cypress CI runs ## Checklist: #### QA activity: - [X] Added `Test Plan Approved` label after changes were reviewed <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Summary by CodeRabbit - **Tests** - Enhanced test flexibility by dynamically constructing API URLs. - Improved test setup and flow in onboarding and regression suites. - Added new test spec files for dynamic height, onboarding, bug tests, login failure, and starting from scratch scenarios. - **Refactor** - Updated function calls and parameters across various test files for consistency and efficiency. - Removed redundant code and streamlined test actions. - **Chores** - Updated intercepted HTTP methods and added new utility functions to support test operations. - **Bug Fixes** - Fixed issues related to element visibility assertions in test scripts. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-02-08 11:25:58 +00:00
ObjectsRegistry.AggregateHelper.CypressReload();
chore: reverted consolidated api (#30314) ## Description Reverted consolidated api changes and also some CE related changes to make it compatible with EE. #### PR fixes following issue(s) Reverts #29650 & #29939 #### Type of change - Chore (housekeeping or task changes that don't impact user perception) > > > ## Testing #### How Has This Been Tested? - [ ] Manual - [ ] JUnit - [ ] Jest - [x ] Cypress > > #### Test Plan > Add Testsmith test cases links that relate to this PR > > #### Issues raised during DP testing > Link issues raised during DP testing for better visiblity and tracking (copy link from comments dropped on this PR) > > > ## Checklist: #### Dev activity - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag #### QA activity: - [ ] [Speedbreak features](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#speedbreakers-) have been covered - [ ] Test plan covers all impacted features and [areas of interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#areas-of-interest-) - [ ] Test plan has been peer reviewed by project stakeholders and other QA members - [ ] Manually tested functionality on DP - [ ] We had an implementation alignment call with stakeholders post QA Round 2 - [ ] Cypress test cases have been added and approved by SDET/manual QA - [ ] Added `Test Plan Approved` label after Cypress tests were reviewed - [ ] Added `Test Plan Approved` label after JUnit tests were reviewed <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Refactor** - Enhanced the reliability and efficiency of Cypress e2e tests by adjusting wait conditions and assertions. - Simplified network request handling across various test cases. - Updated test logic to align with changes in application data structure and network requests. - **Tests** - Improved test stability for application import/export, Git sync, page load behavior, and widget interactions. - Refined mobile responsiveness tests to accurately validate layout conversions and autofill behaviors. - **Chores** - Removed deprecated feature flags and code related to consolidated page load functionality. - Cleaned up unused parameters and simplified action payloads in Redux actions. - **Documentation** - Updated comments for clarity in test specifications. - **Style** - Adjusted code styling for consistency across test suites. - **Bug Fixes** - Fixed data retrieval logic in tests to ensure correct data extraction from API responses. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-01-16 04:46:48 +00:00
};