PromucFlow_constructor/app/client/cypress/support/Pages/DebuggerHelper.ts

221 lines
5.9 KiB
TypeScript
Raw Normal View History

import { ObjectsRegistry } from "../Objects/Registry";
export enum PageType {
Canvas,
API,
Query,
JsEditor,
feat: Error Navigation (#21753) ## Description > ``` const isOnCanvas = matchBuilderPath(window.location.pathname); if (isOnCanvas) { dispatch(showDebuggerAction(!showDebugger)); }} ``` The condition check to verify if we are on canvas was removed as we are opening debugger throughout all pages. > Now debugger is accessible from all pages in Appsmith. (Earlier it was not present in Datasources pages.) Fixes #19567 #21935 #21934 #21907 #21223 Media > [Video](https://www.loom.com/share/ff5eebb5e0a74e0bad6ead26050b5833) ## Type of change > Please delete options that are not relevant. - Bug fix (non-breaking change which fixes an issue) - New feature (non-breaking change which adds functionality) ## How Has This Been Tested? - Manual - Jest - 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 - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag ### QA activity: - [ ] Test plan has been approved by relevant developers - [ ] Test plan has been peer reviewed by QA - [ ] Cypress test cases have been added and approved by either SDET or manual QA - [ ] Organized project review call with relevant stakeholders after Round 1/2 of QA - [ ] Added Test Plan Approved label after reveiwing all Cypress test
2023-04-10 12:59:14 +00:00
DataSources,
}
export class DebuggerHelper {
private agHelper = ObjectsRegistry.AggregateHelper;
private commonLocators = ObjectsRegistry.CommonLocators;
// ActionExecutionResizerHeight -> in repo
fix: Open state of bottom bar (#23077) ## Description >**Improved tab handling in DebuggerTabs.tsx and JSResponseView.tsx** Added conditions to prevent unnecessary rendering when selecting RESPONSE_TAB or HEADER_TAB, improving performance. >**Responsive ActionExecutionResizerHeight** Adjusted the height calculation to be 30% of the window height, making it adaptable to different screen sizes. >**Applied tab handling improvements to DataSourceEditor/Debugger** Enhanced the performance of the DataSourceEditor/Debugger component by implementing similar tab handling conditions. #### PR fixes following issue(s) Fixes #22810 #### Type of change - Bug fix (non-breaking change which fixes an issue) > > > ## Testing > #### How Has This Been Tested? > Please describe the tests that you ran to verify your changes. Also list any relevant details for your test configuration. > Delete anything that is not relevant - [x] Manual - [ ] Jest - [x] Cypress > > #### Test Plan > Add Testsmith test cases links that relate to this PR >[testplan](https://docs.google.com/spreadsheets/d/1Pj7iUNsmbDwjBARa1aI5vwieXvyuQd_4-hd9L0gaBpA/edit?usp=sharing) > #### 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 - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] 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/Test-plan-implementation#speedbreaker-features-to-consider-for-every-change) have been covered - [ ] Test plan covers all impacted features and [areas of interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans/_edit#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
2023-05-12 05:47:26 +00:00
private readonly bottomPaneHeight = 330;
// from design system
private readonly TAB_MIN_HEIGHT = 36;
public readonly locators = {
feat: Error Navigation (#21753) ## Description > ``` const isOnCanvas = matchBuilderPath(window.location.pathname); if (isOnCanvas) { dispatch(showDebuggerAction(!showDebugger)); }} ``` The condition check to verify if we are on canvas was removed as we are opening debugger throughout all pages. > Now debugger is accessible from all pages in Appsmith. (Earlier it was not present in Datasources pages.) Fixes #19567 #21935 #21934 #21907 #21223 Media > [Video](https://www.loom.com/share/ff5eebb5e0a74e0bad6ead26050b5833) ## Type of change > Please delete options that are not relevant. - Bug fix (non-breaking change which fixes an issue) - New feature (non-breaking change which adds functionality) ## How Has This Been Tested? - Manual - Jest - 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 - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag ### QA activity: - [ ] Test plan has been approved by relevant developers - [ ] Test plan has been peer reviewed by QA - [ ] Cypress test cases have been added and approved by either SDET or manual QA - [ ] Organized project review call with relevant stakeholders after Round 1/2 of QA - [ ] Added Test Plan Approved label after reveiwing all Cypress test
2023-04-10 12:59:14 +00:00
_debuggerIcon: ".t--debugger",
feat: Error handling phase 1 (#20629) ## Description This PR updates the error logs - Establishing a consistent format for all error messages. - Revising error titles and details for improved understanding. - Compiling internal documentation of all error categories, subcategories, and error descriptions. Updated Error Interface: https://www.notion.so/appsmith/Error-Interface-for-Plugin-Execution-Error-7b3f5323ba4c40bfad281ae717ccf79b PRD: https://www.notion.so/appsmith/PRD-Error-Handling-Framework-4ac9747057fd4105a9d52cb8b42f4452?pvs=4#008e9c79ff3c484abf0250a5416cf052 >TL;DR Fixes # Media > A video or a GIF is preferred. when using Loom, don’t embed because it looks like it’s a GIF. instead, just link to the video ## Type of change - New feature (non-breaking change which adds functionality) ## How Has This Been Tested? - Manual - Jest - Cypress ### Test Plan ### Issues raised during DP testing ## Checklist: ### Dev activity - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes - [x] PR is being merged under a feature flag ### QA activity: - [ ] Test plan has been approved by relevant developers - [ ] Test plan has been peer reviewed by QA - [ ] Cypress test cases have been added and approved by either SDET or manual QA - [ ] Organized project review call with relevant stakeholders after Round 1/2 of QA - [ ] Added Test Plan Approved label after reveiwing all Cypress test --------- Co-authored-by: subrata <subrata@appsmith.com>
2023-02-18 12:55:46 +00:00
_debuggerToggle: "[data-cy=t--debugger-toggle]",
_debuggerDownStreamErrMsg: "[data-cy=t--debugger-downStreamErrorMsg]",
_tabsContainer: ".t--debugger-tabs-container",
_closeButton: ".t--close-debugger",
_logMessage: ".t--debugger-log-message",
_logEntityLink: ".t--debugger-log-entity-link",
_logState: ".t--debugger-log-state",
_errorCount: ".t--debugger-count",
_clearLogs: ".t--debugger-clear-logs",
_logMessageOccurence: ".t--debugger-log-message-occurence",
feat: Error handling phase 1 (#20629) ## Description This PR updates the error logs - Establishing a consistent format for all error messages. - Revising error titles and details for improved understanding. - Compiling internal documentation of all error categories, subcategories, and error descriptions. Updated Error Interface: https://www.notion.so/appsmith/Error-Interface-for-Plugin-Execution-Error-7b3f5323ba4c40bfad281ae717ccf79b PRD: https://www.notion.so/appsmith/PRD-Error-Handling-Framework-4ac9747057fd4105a9d52cb8b42f4452?pvs=4#008e9c79ff3c484abf0250a5416cf052 >TL;DR Fixes # Media > A video or a GIF is preferred. when using Loom, don’t embed because it looks like it’s a GIF. instead, just link to the video ## Type of change - New feature (non-breaking change which adds functionality) ## How Has This Been Tested? - Manual - Jest - Cypress ### Test Plan ### Issues raised during DP testing ## Checklist: ### Dev activity - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes - [x] PR is being merged under a feature flag ### QA activity: - [ ] Test plan has been approved by relevant developers - [ ] Test plan has been peer reviewed by QA - [ ] Cypress test cases have been added and approved by either SDET or manual QA - [ ] Organized project review call with relevant stakeholders after Round 1/2 of QA - [ ] Added Test Plan Approved label after reveiwing all Cypress test --------- Co-authored-by: subrata <subrata@appsmith.com>
2023-02-18 12:55:46 +00:00
_debuggerMessage: "[data-cy=t--debugger-log-message]",
_contextMenuIcon: ".t--debugger-contextual-error-menu ",
_contextMenuItem: ".t--debugger-contextual-menuitem",
_debuggerLabel: "span.debugger-label",
_bottomPaneContainer: {
[PageType.API]: ".t--api-bottom-pane-container",
[PageType.Query]: ".t--query-bottom-pane-container",
[PageType.JsEditor]: ".t--js-editor-bottom-pane-container",
feat: Error Navigation (#21753) ## Description > ``` const isOnCanvas = matchBuilderPath(window.location.pathname); if (isOnCanvas) { dispatch(showDebuggerAction(!showDebugger)); }} ``` The condition check to verify if we are on canvas was removed as we are opening debugger throughout all pages. > Now debugger is accessible from all pages in Appsmith. (Earlier it was not present in Datasources pages.) Fixes #19567 #21935 #21934 #21907 #21223 Media > [Video](https://www.loom.com/share/ff5eebb5e0a74e0bad6ead26050b5833) ## Type of change > Please delete options that are not relevant. - Bug fix (non-breaking change which fixes an issue) - New feature (non-breaking change which adds functionality) ## How Has This Been Tested? - Manual - Jest - 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 - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag ### QA activity: - [ ] Test plan has been approved by relevant developers - [ ] Test plan has been peer reviewed by QA - [ ] Cypress test cases have been added and approved by either SDET or manual QA - [ ] Organized project review call with relevant stakeholders after Round 1/2 of QA - [ ] Added Test Plan Approved label after reveiwing all Cypress test
2023-04-10 12:59:14 +00:00
[PageType.DataSources]: ".t--datasource-bottom-pane-container",
},
_debuggerList: ".debugger-list",
fix: access outer scope variables inside callbacks (#20168) ## Description Any platform function that accepts a callback were unable to access the variables declared in its parent scopes. This was a implementation miss when we originally designed platform functions and again when we turned almost every platform function into a Promise. This PR fixes this limitation along with some other edge cases. - Access outer scope variables inside the callback of run, postMessage, setInterval, getGeoLocation and watchGeolocation functions. - Fixes certain edge cases where functions with callbacks when called inside the then block doesn't get executed. Eg `showAlert.then(() => /* Doesn't execute */ Api1.run(() => {}))` - Changes the implementation of all the platform function in appsmith to maintain the execution metadata (info on from where a function was invoked, event associated with it etc) #### Refactor changes - Added a new folder **_fns_** that would now hold all the platform functions. - Introduced a new ExecutionMetadata singleton class that is now responsible for hold all the meta data related to the current evaluation. - Remove TRIGGER_COLLECTOR array where all callback based platform functions were batched and introduced an Event Emitter based implementation to handle batched fn calls. - All callback based functions now emits event when invoked. These events have handlers attached to the TriggerEmitter object. These handler does the job of batching these invocations and telling the main thread. It also ensures that platform fn calls that gets triggered out the the context of a request/response cycle work. #### Architecture <img width="751" alt="Screenshot 2023-02-07 at 10 04 26" src="https://user-images.githubusercontent.com/32433245/217259200-5eac71bc-f0d3-4d3c-9b69-2a8dc81351bc.png"> Fixes #13156 Fixes #20225 ## Type of change - Bug fix (non-breaking change which fixes an issue) - Refactor ## How Has This Been Tested? - Jest - Cypress - Manual ### Test Plan - [ ] https://github.com/appsmithorg/TestSmith/issues/2181 - [ ] https://github.com/appsmithorg/TestSmith/issues/2182 - [ ] Post message - https://appsmith-git-chore-outer-scope-variable-access-get-appsmith.vercel.app/app/post-msg-app/page1-635fcfba2987b442a739b938/edit - [ ] Apps: https://appsmith-git-chore-outer-scope-variable-access-get-appsmith.vercel.app/app/earworm-1/home-630c9d85b4658d0f257c4987/edit - [ ] https://appsmith-git-chore-outer-scope-variable-access-get-appsmith.vercel.app/app/automation-test-cases/page-1-630c6b90d4ecd573f6bb01e9/edit#0hmn8m90ei ### 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 - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag ### QA activity: - [ ] Test plan has been approved by relevant developers - [ ] Test plan has been peer reviewed by QA - [ ] Cypress test cases have been added and approved by either SDET or manual QA - [ ] Organized project review call with relevant stakeholders after Round 1/2 of QA - [ ] Added Test Plan Approved label after reviewing all Cypress test
2023-02-11 18:33:20 +00:00
_debuggerFilter: ".debugger-search",
feat: Error Navigation (#21753) ## Description > ``` const isOnCanvas = matchBuilderPath(window.location.pathname); if (isOnCanvas) { dispatch(showDebuggerAction(!showDebugger)); }} ``` The condition check to verify if we are on canvas was removed as we are opening debugger throughout all pages. > Now debugger is accessible from all pages in Appsmith. (Earlier it was not present in Datasources pages.) Fixes #19567 #21935 #21934 #21907 #21223 Media > [Video](https://www.loom.com/share/ff5eebb5e0a74e0bad6ead26050b5833) ## Type of change > Please delete options that are not relevant. - Bug fix (non-breaking change which fixes an issue) - New feature (non-breaking change which adds functionality) ## How Has This Been Tested? - Manual - Jest - 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 - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag ### QA activity: - [ ] Test plan has been approved by relevant developers - [ ] Test plan has been peer reviewed by QA - [ ] Cypress test cases have been added and approved by either SDET or manual QA - [ ] Organized project review call with relevant stakeholders after Round 1/2 of QA - [ ] Added Test Plan Approved label after reveiwing all Cypress test
2023-04-10 12:59:14 +00:00
_debuggerSelectedTab: ".react-tabs__tab--selected",
};
ClickDebuggerIcon(
index?: number,
force?: boolean,
waitTimeInterval?: number,
) {
this.agHelper.GetNClick(
this.locators._debuggerIcon,
index,
force,
waitTimeInterval,
);
}
feat: Error handling phase 1 (#20629) ## Description This PR updates the error logs - Establishing a consistent format for all error messages. - Revising error titles and details for improved understanding. - Compiling internal documentation of all error categories, subcategories, and error descriptions. Updated Error Interface: https://www.notion.so/appsmith/Error-Interface-for-Plugin-Execution-Error-7b3f5323ba4c40bfad281ae717ccf79b PRD: https://www.notion.so/appsmith/PRD-Error-Handling-Framework-4ac9747057fd4105a9d52cb8b42f4452?pvs=4#008e9c79ff3c484abf0250a5416cf052 >TL;DR Fixes # Media > A video or a GIF is preferred. when using Loom, don’t embed because it looks like it’s a GIF. instead, just link to the video ## Type of change - New feature (non-breaking change which adds functionality) ## How Has This Been Tested? - Manual - Jest - Cypress ### Test Plan ### Issues raised during DP testing ## Checklist: ### Dev activity - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes - [x] PR is being merged under a feature flag ### QA activity: - [ ] Test plan has been approved by relevant developers - [ ] Test plan has been peer reviewed by QA - [ ] Cypress test cases have been added and approved by either SDET or manual QA - [ ] Organized project review call with relevant stakeholders after Round 1/2 of QA - [ ] Added Test Plan Approved label after reveiwing all Cypress test --------- Co-authored-by: subrata <subrata@appsmith.com>
2023-02-18 12:55:46 +00:00
ClickDebuggerToggle(expand = true, index = 0) {
cy.get(this.locators._debuggerToggle)
.eq(index)
.invoke("attr", "data-isOpen")
.then((arrow) => {
if (expand && arrow == "false")
cy.get(this.locators._debuggerToggle)
.eq(index)
.trigger("click", { multiple: true })
.wait(1000);
else if (!expand && arrow == "true")
cy.get(this.locators._debuggerToggle)
.eq(index)
.trigger("click", { multiple: true })
.wait(1000);
else this.agHelper.Sleep(500);
});
}
ClickResponseTab() {
this.agHelper.GetNClick(this.commonLocators._responseTab);
}
feat: Error Navigation (#21753) ## Description > ``` const isOnCanvas = matchBuilderPath(window.location.pathname); if (isOnCanvas) { dispatch(showDebuggerAction(!showDebugger)); }} ``` The condition check to verify if we are on canvas was removed as we are opening debugger throughout all pages. > Now debugger is accessible from all pages in Appsmith. (Earlier it was not present in Datasources pages.) Fixes #19567 #21935 #21934 #21907 #21223 Media > [Video](https://www.loom.com/share/ff5eebb5e0a74e0bad6ead26050b5833) ## Type of change > Please delete options that are not relevant. - Bug fix (non-breaking change which fixes an issue) - New feature (non-breaking change which adds functionality) ## How Has This Been Tested? - Manual - Jest - 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 - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag ### QA activity: - [ ] Test plan has been approved by relevant developers - [ ] Test plan has been peer reviewed by QA - [ ] Cypress test cases have been added and approved by either SDET or manual QA - [ ] Organized project review call with relevant stakeholders after Round 1/2 of QA - [ ] Added Test Plan Approved label after reveiwing all Cypress test
2023-04-10 12:59:14 +00:00
CloseBottomBar() {
this.agHelper.GetNClick(this.locators._closeButton);
}
AssertOpen(pageType: PageType) {
switch (pageType) {
case PageType.Canvas:
this.agHelper.AssertElementExist(this.locators._tabsContainer);
break;
case PageType.API:
case PageType.JsEditor:
this.agHelper.AssertHeight(
this.locators._bottomPaneContainer[pageType],
this.bottomPaneHeight,
);
break;
case PageType.Query:
feat: Error Navigation (#21753) ## Description > ``` const isOnCanvas = matchBuilderPath(window.location.pathname); if (isOnCanvas) { dispatch(showDebuggerAction(!showDebugger)); }} ``` The condition check to verify if we are on canvas was removed as we are opening debugger throughout all pages. > Now debugger is accessible from all pages in Appsmith. (Earlier it was not present in Datasources pages.) Fixes #19567 #21935 #21934 #21907 #21223 Media > [Video](https://www.loom.com/share/ff5eebb5e0a74e0bad6ead26050b5833) ## Type of change > Please delete options that are not relevant. - Bug fix (non-breaking change which fixes an issue) - New feature (non-breaking change which adds functionality) ## How Has This Been Tested? - Manual - Jest - 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 - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag ### QA activity: - [ ] Test plan has been approved by relevant developers - [ ] Test plan has been peer reviewed by QA - [ ] Cypress test cases have been added and approved by either SDET or manual QA - [ ] Organized project review call with relevant stakeholders after Round 1/2 of QA - [ ] Added Test Plan Approved label after reveiwing all Cypress test
2023-04-10 12:59:14 +00:00
case PageType.DataSources:
this.agHelper.AssertHeight(
this.locators._bottomPaneContainer[pageType],
this.bottomPaneHeight - 1, // -1 to offset error
);
break;
}
}
feat: Error Navigation (#21753) ## Description > ``` const isOnCanvas = matchBuilderPath(window.location.pathname); if (isOnCanvas) { dispatch(showDebuggerAction(!showDebugger)); }} ``` The condition check to verify if we are on canvas was removed as we are opening debugger throughout all pages. > Now debugger is accessible from all pages in Appsmith. (Earlier it was not present in Datasources pages.) Fixes #19567 #21935 #21934 #21907 #21223 Media > [Video](https://www.loom.com/share/ff5eebb5e0a74e0bad6ead26050b5833) ## Type of change > Please delete options that are not relevant. - Bug fix (non-breaking change which fixes an issue) - New feature (non-breaking change which adds functionality) ## How Has This Been Tested? - Manual - Jest - 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 - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag ### QA activity: - [ ] Test plan has been approved by relevant developers - [ ] Test plan has been peer reviewed by QA - [ ] Cypress test cases have been added and approved by either SDET or manual QA - [ ] Organized project review call with relevant stakeholders after Round 1/2 of QA - [ ] Added Test Plan Approved label after reveiwing all Cypress test
2023-04-10 12:59:14 +00:00
AssertClosed() {
this.agHelper.AssertElementAbsence(this.locators._tabsContainer);
}
AssertSelectedTab(text: string) {
this.agHelper.GetNAssertContains(this.locators._debuggerSelectedTab, text);
}
DoesConsoleLogExist(
text: string,
exists = true,
index?: number,
timeout?: number,
) {
this.agHelper.GetNAssertContains(
this.locators._logMessage,
text,
exists ? "exist" : "not.exist",
index,
timeout,
);
}
fix: access outer scope variables inside callbacks (#20168) ## Description Any platform function that accepts a callback were unable to access the variables declared in its parent scopes. This was a implementation miss when we originally designed platform functions and again when we turned almost every platform function into a Promise. This PR fixes this limitation along with some other edge cases. - Access outer scope variables inside the callback of run, postMessage, setInterval, getGeoLocation and watchGeolocation functions. - Fixes certain edge cases where functions with callbacks when called inside the then block doesn't get executed. Eg `showAlert.then(() => /* Doesn't execute */ Api1.run(() => {}))` - Changes the implementation of all the platform function in appsmith to maintain the execution metadata (info on from where a function was invoked, event associated with it etc) #### Refactor changes - Added a new folder **_fns_** that would now hold all the platform functions. - Introduced a new ExecutionMetadata singleton class that is now responsible for hold all the meta data related to the current evaluation. - Remove TRIGGER_COLLECTOR array where all callback based platform functions were batched and introduced an Event Emitter based implementation to handle batched fn calls. - All callback based functions now emits event when invoked. These events have handlers attached to the TriggerEmitter object. These handler does the job of batching these invocations and telling the main thread. It also ensures that platform fn calls that gets triggered out the the context of a request/response cycle work. #### Architecture <img width="751" alt="Screenshot 2023-02-07 at 10 04 26" src="https://user-images.githubusercontent.com/32433245/217259200-5eac71bc-f0d3-4d3c-9b69-2a8dc81351bc.png"> Fixes #13156 Fixes #20225 ## Type of change - Bug fix (non-breaking change which fixes an issue) - Refactor ## How Has This Been Tested? - Jest - Cypress - Manual ### Test Plan - [ ] https://github.com/appsmithorg/TestSmith/issues/2181 - [ ] https://github.com/appsmithorg/TestSmith/issues/2182 - [ ] Post message - https://appsmith-git-chore-outer-scope-variable-access-get-appsmith.vercel.app/app/post-msg-app/page1-635fcfba2987b442a739b938/edit - [ ] Apps: https://appsmith-git-chore-outer-scope-variable-access-get-appsmith.vercel.app/app/earworm-1/home-630c9d85b4658d0f257c4987/edit - [ ] https://appsmith-git-chore-outer-scope-variable-access-get-appsmith.vercel.app/app/automation-test-cases/page-1-630c6b90d4ecd573f6bb01e9/edit#0hmn8m90ei ### 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 - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag ### QA activity: - [ ] Test plan has been approved by relevant developers - [ ] Test plan has been peer reviewed by QA - [ ] Cypress test cases have been added and approved by either SDET or manual QA - [ ] Organized project review call with relevant stakeholders after Round 1/2 of QA - [ ] Added Test Plan Approved label after reviewing all Cypress test
2023-02-11 18:33:20 +00:00
filter(text: string) {
this.agHelper.RemoveCharsNType(this.locators._debuggerFilter, -1, text);
}
LogStateContains(text: string, index?: number) {
this.agHelper.GetNAssertContains(
this.locators._logState,
text,
"exist",
index,
);
}
AssertErrorCount(count: number) {
feat: Error Navigation (#21753) ## Description > ``` const isOnCanvas = matchBuilderPath(window.location.pathname); if (isOnCanvas) { dispatch(showDebuggerAction(!showDebugger)); }} ``` The condition check to verify if we are on canvas was removed as we are opening debugger throughout all pages. > Now debugger is accessible from all pages in Appsmith. (Earlier it was not present in Datasources pages.) Fixes #19567 #21935 #21934 #21907 #21223 Media > [Video](https://www.loom.com/share/ff5eebb5e0a74e0bad6ead26050b5833) ## Type of change > Please delete options that are not relevant. - Bug fix (non-breaking change which fixes an issue) - New feature (non-breaking change which adds functionality) ## How Has This Been Tested? - Manual - Jest - 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 - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag ### QA activity: - [ ] Test plan has been approved by relevant developers - [ ] Test plan has been peer reviewed by QA - [ ] Cypress test cases have been added and approved by either SDET or manual QA - [ ] Organized project review call with relevant stakeholders after Round 1/2 of QA - [ ] Added Test Plan Approved label after reveiwing all Cypress test
2023-04-10 12:59:14 +00:00
this.agHelper.GetNAssertContains(this.locators._errorCount, count);
}
ClearLogs() {
this.agHelper.GetNClick(this.locators._clearLogs);
}
Assert_Consecutive_Console_Log_Count(count: number) {
count > 0
? this.agHelper.GetNAssertContains(
this.locators._logMessageOccurence,
count,
)
: this.agHelper.AssertElementAbsence(this.locators._logMessageOccurence);
}
AssertVisibleErrorMessagesCount(count: number) {
if (count > 0) {
this.agHelper.AssertElementVisible(this.locators._debuggerMessage);
this.agHelper.AssertElementLength(this.locators._debuggerMessage, count);
} else {
this.agHelper.AssertElementAbsence(this.locators._debuggerMessage);
}
}
ClickErrorMessage(index?: number) {
this.agHelper.GetNClick(this.locators._debuggerMessage, index);
}
ClicklogEntityLink(index?: number) {
this.agHelper.GetNClick(this.locators._logEntityLink, index);
}
AssertContextMenuItemVisible() {
this.agHelper.AssertElementVisible(this.locators._contextMenuItem);
}
AssertDebugError(
label: string,
message: string,
shouldOpenDebugger = true,
shouldToggleDebugger = true,
) {
if (shouldOpenDebugger) {
this.ClickDebuggerIcon();
}
this.agHelper.GetNClick(this.commonLocators._errorTab, 0, true, 0);
if (shouldToggleDebugger) {
this.ClickDebuggerToggle();
}
this.agHelper
.GetText(this.locators._debuggerLabel, "text", 0)
.then(($text) => {
expect($text).to.eq(label);
});
if (message) {
this.agHelper
.GetText(this.locators._debuggerDownStreamErrMsg, "text", 0)
.then(($text) => {
expect($text).to.contains(message);
});
}
}
DebuggerListDoesnotContain(text: string) {
this.agHelper.AssertContains(
text,
"not.exist",
this.locators._debuggerList,
);
}
}