-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: new test cases framework functions and Action selector #37566
Conversation
WalkthroughThe changes in this pull request encompass updates across multiple files, primarily enhancing the functionality and test coverage of various components within the application. Key modifications include the introduction of new methods and properties in the Changes
Suggested reviewers
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (3)
👮 Files not reviewed due to content moderation or server errors (2)
🧰 Additional context used📓 Path-based instructions (3)app/client/cypress/support/Pages/PropertyPane.ts (1)Pattern
app/client/cypress/e2e/Regression/ClientSide/Widgets/Radio/Radio2_spec.ts (1)Pattern
app/client/cypress/e2e/Regression/ClientSide/Widgets/Sliders/CategorySlider_spec.ts (1)Pattern
📓 Learnings (1)app/client/cypress/e2e/Regression/ClientSide/Widgets/Radio/Radio2_spec.ts (1)
🔇 Additional comments (3)app/client/cypress/support/Pages/PropertyPane.ts (3)
The method properly handles JS mode toggling with index support, making it more flexible for multiple toggles.
Make the selector more flexible and parameterized. The hardcoded "Button1" in the selector makes it less reusable. -_buttonWidget = "[data-widgetname-cy='Button1']";
+_buttonWidgetSelector = (name: string) => `[data-widgetname-cy='${name}']`;
Remove duplicate selector method. This method is redundant with -_getActionCardSelector = (type: string) =>
- `[data-testid='action-card-Show ${type}']`; Use the existing
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
/ci-test-limit-count run_count=15 |
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/11913100291. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🧹 Outside diff range and nitpick comments (1)
app/client/cypress/limited-tests.txt (1)
Line range hint
1-6
: Consider adding a version control commentSince this file controls CI test execution, consider adding a comment with the last modification date and the reason for changes to help track test suite evolution.
# To run only limited tests - give the spec names in below format: +# Last updated: November 2024 - Replaced template tests with action execution tests cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_NavigateToFunctions_spec.ts # For running all specs - uncomment below: #cypress/e2e/**/**/*
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (2)
app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_NavigateToFunctions_spec.ts
(1 hunks)app/client/cypress/limited-tests.txt
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_NavigateToFunctions_spec.ts (1)
Pattern app/client/cypress/**/**.*
: Review the following e2e test code written using the Cypress test library. Ensure that:
- Follow best practices for Cypress code and e2e automation.
- Avoid using cy.wait in code.
- Avoid using cy.pause in code.
- Avoid using agHelper.sleep().
- Use locator variables for locators and do not use plain strings.
- Use data-* attributes for selectors.
- Avoid Xpaths, Attributes and CSS path.
- Avoid selectors like .btn.submit or button[type=submit].
- Perform logins via API with LoginFromAPI.
- Perform logout via API with LogOutviaAPI.
- Perform signup via API with SignupFromAPI.
- Avoid using it.only.
- Avoid using after and aftereach in test cases.
- Use multiple assertions for expect statements.
- Avoid using strings for assertions.
- Do not use duplicate filenames even with different paths.
- Avoid using agHelper.Sleep, this.Sleep in any file in code.
app/client/cypress/limited-tests.txt (1)
Pattern app/client/cypress/**/**.*
: Review the following e2e test code written using the Cypress test library. Ensure that:
- Follow best practices for Cypress code and e2e automation.
- Avoid using cy.wait in code.
- Avoid using cy.pause in code.
- Avoid using agHelper.sleep().
- Use locator variables for locators and do not use plain strings.
- Use data-* attributes for selectors.
- Avoid Xpaths, Attributes and CSS path.
- Avoid selectors like .btn.submit or button[type=submit].
- Perform logins via API with LoginFromAPI.
- Perform logout via API with LogOutviaAPI.
- Perform signup via API with SignupFromAPI.
- Avoid using it.only.
- Avoid using after and aftereach in test cases.
- Use multiple assertions for expect statements.
- Avoid using strings for assertions.
- Do not use duplicate filenames even with different paths.
- Avoid using agHelper.Sleep, this.Sleep in any file in code.
🔇 Additional comments (1)
app/client/cypress/limited-tests.txt (1)
2-2
: Verify the new test file exists and follows best practices
Let's ensure the new test file exists and follows our Cypress coding guidelines.
✅ Verification successful
Test file verified and follows best practices
The new test file exists and follows Cypress best practices:
- Uses page object model with proper imports
- No prohibited practices like
cy.wait
orit.only
- Uses proper test organization with
describe
andit
blocks - Implements proper navigation testing with URL assertions
- Uses data-driven selectors instead of brittle selectors
The old test file Fork_Template_spec.js
is not referenced anywhere else in the codebase.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Check if the new test file exists and verify its contents
if [ -f "app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_NavigateToFunctions_spec.ts" ]; then
echo "File exists. Checking contents..."
# Check for prohibited practices
rg -i "cy\.wait|cy\.pause|agHelper\.sleep|it\.only|after\(|afterEach\(" "app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_NavigateToFunctions_spec.ts"
# Check for proper selector usage
rg "\.btn\.|button\[|xpath\=|\.submit" "app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_NavigateToFunctions_spec.ts"
else
echo "ERROR: Test file not found!"
fi
# Check if the old test file is still referenced elsewhere
rg "Fork_Template_spec\.js" --type txt --type typescript --type javascript
Length of output: 750
Script:
#!/bin/bash
# Check if the new test file exists
if [ -f "app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_NavigateToFunctions_spec.ts" ]; then
echo "File exists. Checking contents..."
# Check for prohibited practices with fixed regex
rg -i "cy\.wait|cy\.pause|agHelper\.sleep|it\.only|after\(|afterEach\(" "app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_NavigateToFunctions_spec.ts"
# Check for proper selector usage with fixed regex
rg "\.btn|button\[|xpath=|\.submit" "app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_NavigateToFunctions_spec.ts"
# Show file contents for manual inspection
cat "app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_NavigateToFunctions_spec.ts"
else
echo "ERROR: Test file not found!"
fi
# Search for old test file references with individual file types
rg "Fork_Template_spec\.js" --type js
rg "Fork_Template_spec\.js" --type ts
rg "Fork_Template_spec\.js" -g "*.txt"
Length of output: 10601
...cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_NavigateToFunctions_spec.ts
Outdated
Show resolved
Hide resolved
...cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_NavigateToFunctions_spec.ts
Outdated
Show resolved
Hide resolved
...cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_NavigateToFunctions_spec.ts
Outdated
Show resolved
Hide resolved
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/11913100291.
|
/ci-test-limit-count run_count=15 |
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/11928726909. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (2)
app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_NavigateToFunctions_spec.ts
(1 hunks)app/client/cypress/support/Pages/PropertyPane.ts
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_NavigateToFunctions_spec.ts
🧰 Additional context used
📓 Path-based instructions (1)
app/client/cypress/support/Pages/PropertyPane.ts (1)
Pattern app/client/cypress/**/**.*
: Review the following e2e test code written using the Cypress test library. Ensure that:
- Follow best practices for Cypress code and e2e automation.
- Avoid using cy.wait in code.
- Avoid using cy.pause in code.
- Avoid using agHelper.sleep().
- Use locator variables for locators and do not use plain strings.
- Use data-* attributes for selectors.
- Avoid Xpaths, Attributes and CSS path.
- Avoid selectors like .btn.submit or button[type=submit].
- Perform logins via API with LoginFromAPI.
- Perform logout via API with LogOutviaAPI.
- Perform signup via API with SignupFromAPI.
- Avoid using it.only.
- Avoid using after and aftereach in test cases.
- Use multiple assertions for expect statements.
- Avoid using strings for assertions.
- Do not use duplicate filenames even with different paths.
- Avoid using agHelper.Sleep, this.Sleep in any file in code.
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/11928726909.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Outside diff range and nitpick comments (3)
app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_ShowAlertFunctions_spec.ts (3)
24-24
: Remove or clarify the TODO commentThe comment "Please check requirement for this test case" should either be removed or replaced with actual requirements documentation.
25-62
: Optimize test execution flowConsider the following improvements:
- The deploy-test-navigate back pattern is repeated, consider extracting it into a helper function
- Replace element visibility checks with more specific assertions
- deployMode.DeployApp(); - agHelper.AssertElementVisibility(appSettings.locators._header); - agHelper.ClickButton("Submit"); - agHelper.AssertElementVisibility(locators._toastMsg); - deployMode.NavigateBacktoEditor(); + // Extract to helper + function testInDeployMode(assertion: () => void) { + deployMode.DeployApp(); + assertion(); + deployMode.NavigateBacktoEditor(); + }
120-125
: Strengthen toast message assertionsConsider adding more robust assertions for toast messages:
- Check for message presence and content in a single assertion
- Add timeout configurations for toast visibility
// Add helper function function assertToast(message: string, type: string) { cy.get(commonlocators.tostifyIcon) .should('be.visible') .and('have.attr', 'type', type) .parent() .should('contain.text', message); }Also applies to: 184-189, 248-253, 312-317
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (2)
app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_ShowAlertFunctions_spec.ts
(1 hunks)app/client/cypress/locators/commonlocators.json
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_ShowAlertFunctions_spec.ts (1)
Pattern app/client/cypress/**/**.*
: Review the following e2e test code written using the Cypress test library. Ensure that:
- Follow best practices for Cypress code and e2e automation.
- Avoid using cy.wait in code.
- Avoid using cy.pause in code.
- Avoid using agHelper.sleep().
- Use locator variables for locators and do not use plain strings.
- Use data-* attributes for selectors.
- Avoid Xpaths, Attributes and CSS path.
- Avoid selectors like .btn.submit or button[type=submit].
- Perform logins via API with LoginFromAPI.
- Perform logout via API with LogOutviaAPI.
- Perform signup via API with SignupFromAPI.
- Avoid using it.only.
- Avoid using after and aftereach in test cases.
- Use multiple assertions for expect statements.
- Avoid using strings for assertions.
- Do not use duplicate filenames even with different paths.
- Avoid using agHelper.Sleep, this.Sleep in any file in code.
app/client/cypress/locators/commonlocators.json (1)
Pattern app/client/cypress/**/**.*
: Review the following e2e test code written using the Cypress test library. Ensure that:
- Follow best practices for Cypress code and e2e automation.
- Avoid using cy.wait in code.
- Avoid using cy.pause in code.
- Avoid using agHelper.sleep().
- Use locator variables for locators and do not use plain strings.
- Use data-* attributes for selectors.
- Avoid Xpaths, Attributes and CSS path.
- Avoid selectors like .btn.submit or button[type=submit].
- Perform logins via API with LoginFromAPI.
- Perform logout via API with LogOutviaAPI.
- Perform signup via API with SignupFromAPI.
- Avoid using it.only.
- Avoid using after and aftereach in test cases.
- Use multiple assertions for expect statements.
- Avoid using strings for assertions.
- Do not use duplicate filenames even with different paths.
- Avoid using agHelper.Sleep, this.Sleep in any file in code.
🔇 Additional comments (1)
app/client/cypress/locators/commonlocators.json (1)
245-245
: LGTM!
The locator follows the established pattern using data-* attributes.
/ci-test-limit-count run_count=10 |
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/11947275309. |
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/11947275309.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 5
🧹 Outside diff range and nitpick comments (4)
app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_ShowCloseModalFunctions_spec.ts (3)
25-62
: Consider replacing page refresh with a more deterministic approachThe test uses
agHelper.RefreshPage()
which might introduce unnecessary waiting. Consider using Cypress's built-in mechanisms to wait for specific conditions instead of refreshing the page.- agHelper.RefreshPage(); + // Wait for specific condition instead + agHelper.WaitUntilAllToastsDisappear(); + agHelper.WaitUntilEleAppear(locators._modalWrapper);
71-108
: Consider extracting repeated deployment validation into a helper functionThe deployment and validation steps are duplicated. Consider extracting them into a reusable helper function.
// Suggested helper function: const validateInDeployedMode = (action: () => void) => { deployMode.DeployApp(); agHelper.AssertElementVisibility(appSettings.locators._header); action(); deployMode.NavigateBacktoEditor(); };
1-163
: Overall: Good test coverage with room for improvementThe tests thoroughly cover modal functionality scenarios. However, there are several areas for improvement:
- Avoid direct Cypress commands in favor of helper methods
- Reduce code duplication in deployment and JS object creation
- Consider more deterministic waiting strategies
The test structure and assertions are solid, but implementing the suggested refactors would improve maintainability.
app/client/cypress/support/Objects/CommonLocators.ts (1)
345-345
: LGTM with a suggestion for the modal button locator.The modal button locator uses data-testid which is good, but consider making it more specific by using a dedicated data-testid for the button itself.
- _modalButtonText = "[data-testid='modal-wrapper'] .bp3-button"; + _modalButtonText = "[data-testid='modal-button']";
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (5)
app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_NavigateToFunctions_spec.ts
(1 hunks)app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_ShowAlertFunctions_spec.ts
(1 hunks)app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_ShowCloseModalFunctions_spec.ts
(1 hunks)app/client/cypress/support/Objects/CommonLocators.ts
(1 hunks)app/client/cypress/support/Pages/ApiPage.ts
(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_NavigateToFunctions_spec.ts
🧰 Additional context used
📓 Path-based instructions (4)
app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_ShowAlertFunctions_spec.ts (1)
Pattern app/client/cypress/**/**.*
: Review the following e2e test code written using the Cypress test library. Ensure that:
- Follow best practices for Cypress code and e2e automation.
- Avoid using cy.wait in code.
- Avoid using cy.pause in code.
- Avoid using agHelper.sleep().
- Use locator variables for locators and do not use plain strings.
- Use data-* attributes for selectors.
- Avoid Xpaths, Attributes and CSS path.
- Avoid selectors like .btn.submit or button[type=submit].
- Perform logins via API with LoginFromAPI.
- Perform logout via API with LogOutviaAPI.
- Perform signup via API with SignupFromAPI.
- Avoid using it.only.
- Avoid using after and aftereach in test cases.
- Use multiple assertions for expect statements.
- Avoid using strings for assertions.
- Do not use duplicate filenames even with different paths.
- Avoid using agHelper.Sleep, this.Sleep in any file in code.
app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_ShowCloseModalFunctions_spec.ts (1)
Pattern app/client/cypress/**/**.*
: Review the following e2e test code written using the Cypress test library. Ensure that:
- Follow best practices for Cypress code and e2e automation.
- Avoid using cy.wait in code.
- Avoid using cy.pause in code.
- Avoid using agHelper.sleep().
- Use locator variables for locators and do not use plain strings.
- Use data-* attributes for selectors.
- Avoid Xpaths, Attributes and CSS path.
- Avoid selectors like .btn.submit or button[type=submit].
- Perform logins via API with LoginFromAPI.
- Perform logout via API with LogOutviaAPI.
- Perform signup via API with SignupFromAPI.
- Avoid using it.only.
- Avoid using after and aftereach in test cases.
- Use multiple assertions for expect statements.
- Avoid using strings for assertions.
- Do not use duplicate filenames even with different paths.
- Avoid using agHelper.Sleep, this.Sleep in any file in code.
app/client/cypress/support/Objects/CommonLocators.ts (1)
Pattern app/client/cypress/**/**.*
: Review the following e2e test code written using the Cypress test library. Ensure that:
- Follow best practices for Cypress code and e2e automation.
- Avoid using cy.wait in code.
- Avoid using cy.pause in code.
- Avoid using agHelper.sleep().
- Use locator variables for locators and do not use plain strings.
- Use data-* attributes for selectors.
- Avoid Xpaths, Attributes and CSS path.
- Avoid selectors like .btn.submit or button[type=submit].
- Perform logins via API with LoginFromAPI.
- Perform logout via API with LogOutviaAPI.
- Perform signup via API with SignupFromAPI.
- Avoid using it.only.
- Avoid using after and aftereach in test cases.
- Use multiple assertions for expect statements.
- Avoid using strings for assertions.
- Do not use duplicate filenames even with different paths.
- Avoid using agHelper.Sleep, this.Sleep in any file in code.
app/client/cypress/support/Pages/ApiPage.ts (1)
Pattern app/client/cypress/**/**.*
: Review the following e2e test code written using the Cypress test library. Ensure that:
- Follow best practices for Cypress code and e2e automation.
- Avoid using cy.wait in code.
- Avoid using cy.pause in code.
- Avoid using agHelper.sleep().
- Use locator variables for locators and do not use plain strings.
- Use data-* attributes for selectors.
- Avoid Xpaths, Attributes and CSS path.
- Avoid selectors like .btn.submit or button[type=submit].
- Perform logins via API with LoginFromAPI.
- Perform logout via API with LogOutviaAPI.
- Perform signup via API with SignupFromAPI.
- Avoid using it.only.
- Avoid using after and aftereach in test cases.
- Use multiple assertions for expect statements.
- Avoid using strings for assertions.
- Do not use duplicate filenames even with different paths.
- Avoid using agHelper.Sleep, this.Sleep in any file in code.
🔇 Additional comments (5)
app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_ShowCloseModalFunctions_spec.ts (1)
1-24
: LGTM: Clean imports and minimal setup
The imports are well-organized and the setup is appropriately scoped.
app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_ShowAlertFunctions_spec.ts (3)
1-23
: LGTM! Clean setup with proper imports.
The test setup is minimal and focused on the required functionality.
24-24
: Please clarify the test case requirements.
The comment suggests uncertainty about the test requirements. This should be resolved before proceeding.
Would you like me to help create a GitHub issue to track the requirements clarification?
64-107
: Consider previous parameterization suggestion.
This test case could benefit from the parameterization approach suggested in the previous review.
app/client/cypress/support/Pages/ApiPage.ts (1)
99-100
: LGTM!
The selector is well-defined and follows the pattern used in other similar properties in the class.
...ess/e2e/Regression/ClientSide/ActionExecution/ActionSelector_ShowCloseModalFunctions_spec.ts
Outdated
Show resolved
Hide resolved
...ess/e2e/Regression/ClientSide/ActionExecution/ActionSelector_ShowCloseModalFunctions_spec.ts
Outdated
Show resolved
Hide resolved
.../cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_ShowAlertFunctions_spec.ts
Outdated
Show resolved
Hide resolved
/ci-test-limit-count run_count=10 |
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/12016743468. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 8
🧹 Outside diff range and nitpick comments (6)
app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ClearStore_spec.ts (1)
82-86
: Refactor to reduce code duplicationMultiple test cases have similar setup and teardown code. Abstract common code into helper functions to improve maintainability.
Also applies to: 115-137, 150-155, 180-187, 212-238, 264-287, 312-316
app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_LocalStoreValueFunctions_spec.ts (1)
39-39
: Avoid using strings in assertionsIn several assertions, you're using string literals directly, such as in
agHelper.AssertText(locators._textInside, "text", "true")
. As per the coding guidelines, avoid using strings for assertions. Consider using variables or constants instead.Also applies to: 46-46, 69-69, 74-74, 92-92, 140-140, 190-190, 196-196, 220-220, 224-224, 253-253, 260-260, 266-266, 267-267, 290-290, 291-291, 296-296, 297-297
app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_LocalRemoveValueFunctions_spec.ts (4)
36-36
: Avoid hardcoded strings in assertionsReplace hardcoded expected values in assertions with constants or variables to enhance maintainability and clarity.
Also applies to: 53-53, 99-99, 106-106, 135-135, 164-164, 227-227, 275-275, 293-293, 365-365, 369-369, 448-448, 506-506, 517-517, 555-555, 562-562, 607-607, 614-614
15-17
: Update test suite description for accuracyThe description mentions "Local store value function," but the tests focus on
removeValue()
. Update the description to reflect the tests accurately.
401-401
: Ensure unique and descriptive test case titlesTest case "5" title is similar to test "4". Provide unique titles for each test to avoid confusion and improve readability.
243-264
: Refactor repeated code for storing valuesThe code for storing values is duplicated in multiple tests. Consider creating helper functions to reduce repetition and improve maintainability.
Also applies to: 403-424
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (6)
app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_LocalRemoveValueFunctions_spec.ts
(1 hunks)app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_LocalStoreValueFunctions_spec.ts
(1 hunks)app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ClearStore_spec.ts
(1 hunks)app/client/cypress/limited-tests.txt
(1 hunks)app/client/cypress/locators/HomePage.js
(2 hunks)app/client/cypress/support/Pages/AggregateHelper.ts
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- app/client/cypress/limited-tests.txt
🧰 Additional context used
📓 Path-based instructions (5)
app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_LocalRemoveValueFunctions_spec.ts (1)
Pattern app/client/cypress/**/**.*
: Review the following e2e test code written using the Cypress test library. Ensure that:
- Follow best practices for Cypress code and e2e automation.
- Avoid using cy.wait in code.
- Avoid using cy.pause in code.
- Avoid using agHelper.sleep().
- Use locator variables for locators and do not use plain strings.
- Use data-* attributes for selectors.
- Avoid Xpaths, Attributes and CSS path.
- Avoid selectors like .btn.submit or button[type=submit].
- Perform logins via API with LoginFromAPI.
- Perform logout via API with LogOutviaAPI.
- Perform signup via API with SignupFromAPI.
- Avoid using it.only.
- Avoid using after and aftereach in test cases.
- Use multiple assertions for expect statements.
- Avoid using strings for assertions.
- Do not use duplicate filenames even with different paths.
- Avoid using agHelper.Sleep, this.Sleep in any file in code.
app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_LocalStoreValueFunctions_spec.ts (1)
Pattern app/client/cypress/**/**.*
: Review the following e2e test code written using the Cypress test library. Ensure that:
- Follow best practices for Cypress code and e2e automation.
- Avoid using cy.wait in code.
- Avoid using cy.pause in code.
- Avoid using agHelper.sleep().
- Use locator variables for locators and do not use plain strings.
- Use data-* attributes for selectors.
- Avoid Xpaths, Attributes and CSS path.
- Avoid selectors like .btn.submit or button[type=submit].
- Perform logins via API with LoginFromAPI.
- Perform logout via API with LogOutviaAPI.
- Perform signup via API with SignupFromAPI.
- Avoid using it.only.
- Avoid using after and aftereach in test cases.
- Use multiple assertions for expect statements.
- Avoid using strings for assertions.
- Do not use duplicate filenames even with different paths.
- Avoid using agHelper.Sleep, this.Sleep in any file in code.
app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ClearStore_spec.ts (1)
Pattern app/client/cypress/**/**.*
: Review the following e2e test code written using the Cypress test library. Ensure that:
- Follow best practices for Cypress code and e2e automation.
- Avoid using cy.wait in code.
- Avoid using cy.pause in code.
- Avoid using agHelper.sleep().
- Use locator variables for locators and do not use plain strings.
- Use data-* attributes for selectors.
- Avoid Xpaths, Attributes and CSS path.
- Avoid selectors like .btn.submit or button[type=submit].
- Perform logins via API with LoginFromAPI.
- Perform logout via API with LogOutviaAPI.
- Perform signup via API with SignupFromAPI.
- Avoid using it.only.
- Avoid using after and aftereach in test cases.
- Use multiple assertions for expect statements.
- Avoid using strings for assertions.
- Do not use duplicate filenames even with different paths.
- Avoid using agHelper.Sleep, this.Sleep in any file in code.
app/client/cypress/locators/HomePage.js (1)
Pattern app/client/cypress/**/**.*
: Review the following e2e test code written using the Cypress test library. Ensure that:
- Follow best practices for Cypress code and e2e automation.
- Avoid using cy.wait in code.
- Avoid using cy.pause in code.
- Avoid using agHelper.sleep().
- Use locator variables for locators and do not use plain strings.
- Use data-* attributes for selectors.
- Avoid Xpaths, Attributes and CSS path.
- Avoid selectors like .btn.submit or button[type=submit].
- Perform logins via API with LoginFromAPI.
- Perform logout via API with LogOutviaAPI.
- Perform signup via API with SignupFromAPI.
- Avoid using it.only.
- Avoid using after and aftereach in test cases.
- Use multiple assertions for expect statements.
- Avoid using strings for assertions.
- Do not use duplicate filenames even with different paths.
- Avoid using agHelper.Sleep, this.Sleep in any file in code.
app/client/cypress/support/Pages/AggregateHelper.ts (1)
Pattern app/client/cypress/**/**.*
: Review the following e2e test code written using the Cypress test library. Ensure that:
- Follow best practices for Cypress code and e2e automation.
- Avoid using cy.wait in code.
- Avoid using cy.pause in code.
- Avoid using agHelper.sleep().
- Use locator variables for locators and do not use plain strings.
- Use data-* attributes for selectors.
- Avoid Xpaths, Attributes and CSS path.
- Avoid selectors like .btn.submit or button[type=submit].
- Perform logins via API with LoginFromAPI.
- Perform logout via API with LogOutviaAPI.
- Perform signup via API with SignupFromAPI.
- Avoid using it.only.
- Avoid using after and aftereach in test cases.
- Use multiple assertions for expect statements.
- Avoid using strings for assertions.
- Do not use duplicate filenames even with different paths.
- Avoid using agHelper.Sleep, this.Sleep in any file in code.
🪛 Biome (1.9.4)
app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ClearStore_spec.ts
[error] 240-240: Don't focus the test.
The 'only' method is often used for debugging or during implementation. It should be removed before deploying to production.
Consider removing 'only' to ensure all tests are executed.
Unsafe fix: Remove focus from test.
(lint/suspicious/noFocusedTests)
🔇 Additional comments (3)
app/client/cypress/locators/HomePage.js (2)
58-59
: LGTM! Proper usage of data-testid
The selector follows the best practices by using data-testid attribute.
107-109
: LGTM! Proper usage of data-testid
These selectors follow best practices by using data-testid attributes.
app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_LocalStoreValueFunctions_spec.ts (1)
15-304
: Overall code looks good
The test cases are well-structured and adhere to Cypress best practices.
cy.window().then((win) => { | ||
const newTab = win.open(win.location.href, "_blank"); | ||
if (newTab) { | ||
cy.wrap(newTab).should(() => { | ||
const isEmpty = Object.keys(newTab.localStorage).length === 0; | ||
expect(isEmpty).to.be.false; | ||
}); | ||
newTab.close(); | ||
} | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Avoid using 'window.open' in Cypress tests
Cypress does not support multiple tabs or window.open
. Consider simulating the behavior within the same tab.
agHelper.GetNClick(propPane._deleteWidget); | ||
}); | ||
|
||
it.only("4. To verify that clearStore() only affects the current tab's storage and does not inadvertently impact session storage across tabs.", function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove 'it.only' to execute all tests
The it.only
method skips other tests. Please remove it to ensure all tests are executed.
Apply this diff to fix the issue:
- it.only("4. To verify that clearStore() only affects the current tab's storage and does not inadvertently impact session storage across tabs.", function () {
+ it("4. To verify that clearStore() only affects the current tab's storage and does not inadvertently impact session storage across tabs.", function () {
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
it.only("4. To verify that clearStore() only affects the current tab's storage and does not inadvertently impact session storage across tabs.", function () { | |
it("4. To verify that clearStore() only affects the current tab's storage and does not inadvertently impact session storage across tabs.", function () { |
🧰 Tools
🪛 Biome (1.9.4)
[error] 240-240: Don't focus the test.
The 'only' method is often used for debugging or during implementation. It should be removed before deploying to production.
Consider removing 'only' to ensure all tests are executed.
Unsafe fix: Remove focus from test.
(lint/suspicious/noFocusedTests)
...s/e2e/Regression/ClientSide/ActionExecution/ActionSelector_LocalRemoveValueFunctions_spec.ts
Outdated
Show resolved
Hide resolved
/ci-test-limit-count run_count=5 |
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/12024187163. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (3)
app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ClearStore_spec.ts (3)
82-86
: Consider extracting cleanup logic into afterEach hookThe widget cleanup logic is repeated across all test cases. Consider moving it to an afterEach hook to follow DRY principles.
+ afterEach(() => { + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + agHelper.GetNClick(propPane._deleteWidget); + EditorNavigation.SelectEntityByName("Button2", EntityType.Widget); + agHelper.GetNClick(propPane._deleteWidget); + });
140-149
: Enhance assertions with specific error messagesThe assertions could be more specific about what is being tested. Consider adding custom error messages to make test failures more descriptive.
- agHelper.AssertContains( + agHelper.AssertContains( JSON.stringify({ persistentVal1: "persistent value 1", persistentVal2: "persistent value 2", sessionVal1: "session value 1", sessionVal2: "session value 2", }), + "Store should contain both persistent and session values before clearing" ); - agHelper.AssertContains(JSON.stringify({})); + agHelper.AssertContains(JSON.stringify({}), "Store should be empty after clearing");
Line range hint
1-316
: Consider implementing shared test utilitiesThe test file has repeated patterns for:
- JS object creation
- Button setup
- Widget cleanup
Consider extracting these into shared test utilities to improve maintainability.
Example utility function:
const setupTestButtons = (jsObjectBody: string, button1Label: string, button2Label: string) => { entityExplorer.DragDropWidgetNVerify("buttonwidget", 100, 100); jsEditor.CreateJSObject(jsObjectBody, { paste: true, completeReplace: true, toRun: false, prettify: false, shouldCreateNewJSObj: true, }); EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); propPane.UpdatePropertyFieldValue("Label", ""); propPane.TypeTextIntoField("Label", button1Label); // ... rest of the setup logic };
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (1)
app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ClearStore_spec.ts
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ClearStore_spec.ts (1)
Pattern app/client/cypress/**/**.*
: Review the following e2e test code written using the Cypress test library. Ensure that:
- Follow best practices for Cypress code and e2e automation.
- Avoid using cy.wait in code.
- Avoid using cy.pause in code.
- Avoid using agHelper.sleep().
- Use locator variables for locators and do not use plain strings.
- Use data-* attributes for selectors.
- Avoid Xpaths, Attributes and CSS path.
- Avoid selectors like .btn.submit or button[type=submit].
- Perform logins via API with LoginFromAPI.
- Perform logout via API with LogOutviaAPI.
- Perform signup via API with SignupFromAPI.
- Avoid using it.only.
- Avoid using after and aftereach in test cases.
- Use multiple assertions for expect statements.
- Avoid using strings for assertions.
- Do not use duplicate filenames even with different paths.
- Avoid using agHelper.Sleep, this.Sleep in any file in code.
🔇 Additional comments (1)
app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ClearStore_spec.ts (1)
160-163
:
Add cleanup for localStorage test data
Test data added to localStorage should be cleaned up after the test to avoid affecting other tests.
+ before(() => {
+ cy.window().then((win) => {
+ win.localStorage.clear();
+ });
+ });
cy.window().then((win) => {
win.localStorage.setItem("unrelatedKey1", "unrelated value 1");
win.localStorage.setItem("unrelatedKey2", "unrelated value 2");
});
+ after(() => {
+ cy.window().then((win) => {
+ win.localStorage.removeItem("unrelatedKey1");
+ win.localStorage.removeItem("unrelatedKey2");
+ });
+ });
Likely invalid or redundant comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (3)
app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ClearStore_spec.ts
(1 hunks)app/client/cypress/support/Pages/AggregateHelper.ts
(1 hunks)app/client/cypress/support/Pages/PropertyPane.ts
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- app/client/cypress/support/Pages/PropertyPane.ts
🧰 Additional context used
📓 Path-based instructions (2)
app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ClearStore_spec.ts (1)
Pattern app/client/cypress/**/**.*
: Review the following e2e test code written using the Cypress test library. Ensure that:
- Follow best practices for Cypress code and e2e automation.
- Avoid using cy.wait in code.
- Avoid using cy.pause in code.
- Avoid using agHelper.sleep().
- Use locator variables for locators and do not use plain strings.
- Use data-* attributes for selectors.
- Avoid Xpaths, Attributes and CSS path.
- Avoid selectors like .btn.submit or button[type=submit].
- Perform logins via API with LoginFromAPI.
- Perform logout via API with LogOutviaAPI.
- Perform signup via API with SignupFromAPI.
- Avoid using it.only.
- Avoid using after and aftereach in test cases.
- Use multiple assertions for expect statements.
- Avoid using strings for assertions.
- Do not use duplicate filenames even with different paths.
- Avoid using agHelper.Sleep, this.Sleep in any file in code.
app/client/cypress/support/Pages/AggregateHelper.ts (1)
Pattern app/client/cypress/**/**.*
: Review the following e2e test code written using the Cypress test library. Ensure that:
- Follow best practices for Cypress code and e2e automation.
- Avoid using cy.wait in code.
- Avoid using cy.pause in code.
- Avoid using agHelper.sleep().
- Use locator variables for locators and do not use plain strings.
- Use data-* attributes for selectors.
- Avoid Xpaths, Attributes and CSS path.
- Avoid selectors like .btn.submit or button[type=submit].
- Perform logins via API with LoginFromAPI.
- Perform logout via API with LogOutviaAPI.
- Perform signup via API with SignupFromAPI.
- Avoid using it.only.
- Avoid using after and aftereach in test cases.
- Use multiple assertions for expect statements.
- Avoid using strings for assertions.
- Do not use duplicate filenames even with different paths.
- Avoid using agHelper.Sleep, this.Sleep in any file in code.
🔇 Additional comments (9)
app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ClearStore_spec.ts (5)
151-154
: Use API calls for test cleanup instead of UI interactions
Similar to the previous test, replace widget deletion via UI with API calls.
160-163
: LGTM! Direct localStorage usage is appropriate here
The direct manipulation of localStorage is justified for testing isolation of clearStore() functionality.
234-237
: Use API calls for test cleanup instead of UI interactions
Replace widget deletion via UI with API calls.
313-316
: Use API calls for test cleanup instead of UI interactions
Replace widget deletion via UI with API calls.
298-307
:
Avoid using window.open() in Cypress tests
Cypress doesn't support multiple browser tabs. Consider simulating the behavior within the same window context.
- cy.window().then((win) => {
- const newTab = win.open(win.location.href, "_blank");
- if (newTab) {
- cy.wrap(newTab).should(() => {
- const isEmpty = Object.keys(newTab.localStorage).length === 0;
- expect(isEmpty).to.be.false;
- });
- newTab.close();
- }
- });
+ // Simulate multi-tab behavior in same window
+ cy.window().then((win) => {
+ const storageSnapshot = { ...win.localStorage };
+ win.localStorage.clear();
+ expect(Object.keys(storageSnapshot).length).to.be.greaterThan(0);
+ Object.assign(win.localStorage, storageSnapshot);
+ });
Likely invalid or redundant comment.
app/client/cypress/support/Pages/AggregateHelper.ts (4)
1969-1980
: Remove console.table from verification methods.
The use of console.table in test verification methods adds unnecessary noise to test output.
public verifyConsoleLogNotContainingError(): void {
cy.get("@error")
.invoke("getCalls")
.then((calls) => {
- console.table(calls);
cy.wrap(calls).each((call) => {
// ... rest of the code
});
});
}
public verifyConsoleLogContainsExpectedMessage(message: string): void {
cy.get("@log")
.invoke("getCalls")
.then((calls) => {
- console.table(calls);
cy.wrap(calls).each((call) => {
// ... rest of the code
});
});
}
Also applies to: 1982-1993
1947-1957
: 🛠️ Refactor suggestion
Consider consolidating with existing RemoveCharsNType method and improve type safety.
Apply this diff to improve the implementation:
- public RemoveChars(selector: string, charCount = 0, index = 0) {
+ public RemoveChars(selector: string, charCount = 0, index = 0): Cypress.Chainable<JQuery<HTMLElement>> {
+ if (charCount < -1) {
+ throw new Error("charCount must be >= -1");
+ }
+
+ const element = this.GetElement(selector).eq(index);
+
if (charCount > 0) {
- this.GetElement(selector)
- .eq(index)
- .focus()
- .type("{backspace}".repeat(charCount), { timeout: 2, force: true })
- .wait(50);
+ return element
+ .focus()
+ .type("{backspace}".repeat(charCount), { timeout: 2, force: true })
+ .wait(500);
} else {
- if (charCount == -1) this.GetElement(selector).eq(index).clear();
+ if (charCount === -1) {
+ return element.clear();
+ }
+ return element;
}
}
1995-2001
: 🛠️ Refactor suggestion
Add error handling for clearConsoleLogs method.
public clearConsoleLogs(): void {
cy.window().then((win) => {
+ if (!win.console) {
+ cy.log('Console object not available');
+ return;
+ }
cy.spy(win.console, "log").as("log");
cy.spy(win.console, "error").as("error");
cy.spy(win.console, "warn").as("warn");
});
}
Likely invalid or redundant comment.
1959-1967
: 🛠️ Refactor suggestion
Add cleanup mechanism for console spies.
The method creates spies but doesn't provide a mechanism to restore them. This could lead to memory leaks in long-running test suites.
+ private consoleSpies: { logSpy: any; errorSpy: any; warnSpy: any } | null = null;
public captureConsoleLogs(): void {
cy.window()
.its("console")
.then((console) => {
- cy.spy(console, "log").as("log");
- cy.spy(console, "error").as("error");
- cy.spy(console, "warn").as("warn");
+ const logSpy = cy.spy(console, "log").as("log");
+ const errorSpy = cy.spy(console, "error").as("error");
+ const warnSpy = cy.spy(console, "warn").as("warn");
+ this.consoleSpies = { logSpy, errorSpy, warnSpy };
});
}
+ public restoreConsoleLogs(): void {
+ if (this.consoleSpies) {
+ Object.values(this.consoleSpies).forEach(spy => spy.restore());
+ this.consoleSpies = null;
+ }
+ }
Likely invalid or redundant comment.
EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); | ||
agHelper.GetNClick(propPane._deleteWidget); | ||
EditorNavigation.SelectEntityByName("Button2", EntityType.Widget); | ||
agHelper.GetNClick(propPane._deleteWidget); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Use API calls for test cleanup instead of UI interactions
Replace widget deletion via UI with API calls for more reliable and faster test execution.
- EditorNavigation.SelectEntityByName("Button1", EntityType.Widget);
- agHelper.GetNClick(propPane._deleteWidget);
- EditorNavigation.SelectEntityByName("Button2", EntityType.Widget);
- agHelper.GetNClick(propPane._deleteWidget);
+ // Use API calls to delete widgets
+ cy.deleteWidget("Button1");
+ cy.deleteWidget("Button2");
Committable suggestion skipped: line range outside the PR's diff.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (1)
app/client/cypress/support/Pages/ApiPage.ts (1)
103-105
: LGTM! Consider simplifying the selector.The property declarations follow good practices with
settingsTriggerLocator
using data-testid. However, therunOnPageLoadJSObject
selector could be simplified for better maintainability.Consider using a data-testid attribute instead of the complex CSS selector:
- private runOnPageLoadJSObject = "input[name^='execute-on-page-load'][type='checkbox']"; + private runOnPageLoadJSObject = "[data-testid='execute-on-page-load-checkbox']";
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (3)
app/client/cypress/locators/commonlocators.json
(1 hunks)app/client/cypress/support/Pages/ApiPage.ts
(2 hunks)app/client/cypress/support/Pages/JSEditor.ts
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- app/client/cypress/support/Pages/JSEditor.ts
- app/client/cypress/locators/commonlocators.json
🧰 Additional context used
📓 Path-based instructions (1)
app/client/cypress/support/Pages/ApiPage.ts (1)
Pattern app/client/cypress/**/**.*
: Review the following e2e test code written using the Cypress test library. Ensure that:
- Follow best practices for Cypress code and e2e automation.
- Avoid using cy.wait in code.
- Avoid using cy.pause in code.
- Avoid using agHelper.sleep().
- Use locator variables for locators and do not use plain strings.
- Use data-* attributes for selectors.
- Avoid Xpaths, Attributes and CSS path.
- Avoid selectors like .btn.submit or button[type=submit].
- Perform logins via API with LoginFromAPI.
- Perform logout via API with LogOutviaAPI.
- Perform signup via API with SignupFromAPI.
- Avoid using it.only.
- Avoid using after and aftereach in test cases.
- Use multiple assertions for expect statements.
- Avoid using strings for assertions.
- Do not use duplicate filenames even with different paths.
- Avoid using agHelper.Sleep, this.Sleep in any file in code.
🔇 Additional comments (1)
app/client/cypress/support/Pages/ApiPage.ts (1)
502-506
: Redundant parameter default and implementation.
public clickSettingIcon(enable: boolean) { | ||
this.agHelper.GetNClick(this.settingsTriggerLocator); | ||
if (enable) this.agHelper.CheckUncheck(this.runOnPageLoadJSObject, true); | ||
else this.agHelper.CheckUncheck(this.runOnPageLoadJSObject, false); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Refactor to remove code duplication.
The toggle logic is duplicated between clickSettingIcon
and ToggleOnPageLoadRunJsObject
. This violates the DRY principle.
Consider refactoring to reuse the existing toggle method:
public clickSettingIcon(enable: boolean) {
this.agHelper.GetNClick(this.settingsTriggerLocator);
- if (enable) this.agHelper.CheckUncheck(this.runOnPageLoadJSObject, true);
- else this.agHelper.CheckUncheck(this.runOnPageLoadJSObject, false);
+ this.ToggleOnPageLoadRunJsObject(enable);
}
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
public clickSettingIcon(enable: boolean) { | |
this.agHelper.GetNClick(this.settingsTriggerLocator); | |
if (enable) this.agHelper.CheckUncheck(this.runOnPageLoadJSObject, true); | |
else this.agHelper.CheckUncheck(this.runOnPageLoadJSObject, false); | |
} | |
public clickSettingIcon(enable: boolean) { | |
this.agHelper.GetNClick(this.settingsTriggerLocator); | |
this.ToggleOnPageLoadRunJsObject(enable); | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm
Description
E2E Test cases for framework function & Action selector.
Fixes Issue URL
Automation
/ok-to-test tags="@tag.All"
🔍 Cypress test results
Tip
🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/12343756587
Commit: 56f7a2e
Cypress dashboard.
Tags:
@tag.All
Spec:
Mon, 16 Dec 2024 03:08:25 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit
New Features
Bug Fixes
Tests