-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
fix: Widget property test case fix #38001
Conversation
WalkthroughThe changes in this pull request involve updating the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
🪧 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
|
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 (1)
app/client/cypress/limited-tests.txt
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
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
: Ensure test file migration is complete
The change from JS to TS suggests a migration. Let's verify no remnants of the old test file exist.
✅ Verification successful
Migration verification complete - no issues found
The TypeScript test file exists at the correct location and there is no remnant of a JavaScript version. The file is properly referenced in the limited-tests configuration.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify complete migration from JS to TS
# Check if old JS file still exists
if fd "Fork_Template_spec.js" app/client/cypress/; then
echo "Warning: Old JS test file still exists"
fi
# Check for any references to the old test file in the codebase
rg "Fork_Template_spec\.js" --type ts --type js --type txt
Length of output: 194
Script:
#!/bin/bash
# Let's verify if we're looking at the correct file, since the review comment
# mentions PropertyControl_spec.ts but we searched for Fork_Template_spec.js
# Check for the existence of PropertyControl_spec files
fd "PropertyControl_spec" app/client/cypress/
# Check for any old .js version and current .ts version
rg "PropertyControl_spec\.(js|ts)" --type ts --type js --type txt
# Look for the specific test file mentioned in limited-tests.txt
cat app/client/cypress/limited-tests.txt
Length of output: 546
app/client/cypress/limited-tests.txt
Outdated
@@ -1,5 +1,6 @@ | |||
# To run only limited tests - give the spec names in below format: | |||
cypress/e2e/Regression/ClientSide/Templates/Fork_Template_spec.js | |||
cypress/e2e/Regression/ClientSide/OneClickBinding/PropertyControl_spec.ts |
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.
💡 Codebase verification
Test file needs improvements to follow Cypress best practices
- Remove
cy.wait(500)
and replace with proper assertions or intercepts - Add proper test helper imports for better maintainability
- Test structure follows describe/it pattern correctly
- Good use of assertions with expect statements
🔗 Analysis chain
Verify the new test file structure and existence
Let's ensure the new test file exists and follows the required guidelines.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify the existence and content of the new test file
# Check if the file exists
if ! fd "PropertyControl_spec.ts" app/client/cypress/; then
echo "Error: Test file not found"
exit 1
fi
# Check for prohibited practices in the test file
echo "Checking for prohibited practices..."
# Check for cy.wait usage
rg "cy\.wait" "app/client/cypress/e2e/Regression/ClientSide/OneClickBinding/PropertyControl_spec.ts"
# Check for cy.pause usage
rg "cy\.pause" "app/client/cypress/e2e/Regression/ClientSide/OneClickBinding/PropertyControl_spec.ts"
# Check for agHelper.sleep usage
rg "agHelper\.sleep" "app/client/cypress/e2e/Regression/ClientSide/OneClickBinding/PropertyControl_spec.ts"
# Check for it.only usage
rg "it\.only" "app/client/cypress/e2e/Regression/ClientSide/OneClickBinding/PropertyControl_spec.ts"
# Check for after/afterEach hooks
rg "after(|afterEach" "app/client/cypress/e2e/Regression/ClientSide/OneClickBinding/PropertyControl_spec.ts"
# Check for proper selector usage (looking for potential CSS/XPath selectors)
rg "\$\(|querySelector|xpath=|//" "app/client/cypress/e2e/Regression/ClientSide/OneClickBinding/PropertyControl_spec.ts"
Length of output: 1011
Script:
#!/bin/bash
# Let's check the test file content to understand its structure and patterns
rg -A 2 "describe|it\(" "app/client/cypress/e2e/Regression/ClientSide/OneClickBinding/PropertyControl_spec.ts"
# Check for test helper imports and patterns
rg "^import.*Helper" "app/client/cypress/e2e/Regression/ClientSide/OneClickBinding/PropertyControl_spec.ts"
# Check for proper test assertions
rg "expect|should|assert" "app/client/cypress/e2e/Regression/ClientSide/OneClickBinding/PropertyControl_spec.ts"
Length of output: 1663
/ci-test-limit-count run_count=5 |
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/12194882553. |
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/12194882553.
|
/ci-test-limit-count run_count=20 runId=12194882553 |
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/12197887775. |
/ci-test-limit-count run_count=20 runId=12194882553 |
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/12198020450. |
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 (1)
app/client/cypress/e2e/Regression/ClientSide/Debugger/Widget_property_navigation_spec.ts (1)
167-171
: Consider adding validation pattern assertion.While testing the regex validation, it would be good to assert that the validation actually works with a valid pattern.
_.propPane.OpenTableColumnSettings("id"); _.propPane.TypeTextIntoField("Regex", "{{test}}"); _.debuggerHelper.AssertErrorCount(1); +// Add test with valid regex pattern +_.propPane.TypeTextIntoField("Regex", "^[0-9]+$"); +_.debuggerHelper.AssertErrorCount(0); _.propPane.ToggleSection("validation");
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (1)
app/client/cypress/e2e/Regression/ClientSide/Debugger/Widget_property_navigation_spec.ts
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
app/client/cypress/e2e/Regression/ClientSide/Debugger/Widget_property_navigation_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 (2)
app/client/cypress/e2e/Regression/ClientSide/Debugger/Widget_property_navigation_spec.ts (2)
163-164
: LGTM! Column selection change looks consistent.
The update from 'imdb_id' to 'id' in the column selection follows the changes mentioned in the summary.
167-167
: Verify the column name change impact.
The column name changes from 'imdb_id' to 'id' appear correct, but let's verify there are no remaining references to the old column name.
Also applies to: 175-175
✅ Verification successful
Column name change appears safe to proceed
Based on the codebase analysis:
- Only two references to 'imdb_id' were found in an unrelated test file (Date_column_editing_1_spec.ts)
- The current test file correctly uses 'id' in table column settings and widget interactions
- No conflicting column definitions found in test fixtures or setup
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for any remaining references to 'imdb_id' in test files
rg -g '*.{ts,js}' 'imdb_id' app/client/cypress/
# Search for test data structure to verify column name
rg -g '*.{ts,js}' 'movies.*columns.*id' app/client/cypress/
Length of output: 359
Script:
#!/bin/bash
# Search for table data structure and column definitions in the test file
rg -A 10 -B 10 "OpenTableColumnSettings.*id" app/client/cypress/e2e/Regression/ClientSide/Debugger/Widget_property_navigation_spec.ts
# Search for any table data or mock data setup in the test file
rg "const.*movies.*=" app/client/cypress/e2e/Regression/ClientSide/Debugger/Widget_property_navigation_spec.ts
Length of output: 1240
Script:
#!/bin/bash
# Search for table data setup in the test file's beforeEach or before blocks
rg -A 10 "before(Each)?\s*\(" app/client/cypress/e2e/Regression/ClientSide/Debugger/Widget_property_navigation_spec.ts
# Search for any JSON mock data files that might be used in the test
fd -e json . app/client/cypress/fixtures/ -x rg -l "movies.*id"
Length of output: 366
Script:
#!/bin/bash
# Check the content of the found JSON files for the movies data structure
cat app/client/cypress/fixtures/mongouri_data_spec.json app/client/cypress/fixtures/mongo_PUT_replaceLayoutWithCRUD.json app/client/cypress/fixtures/mongo_GET_selectTableDropdown.json | jq -c '.[] | select(.movies)'
# Search for any table widget setup or configuration in the test file
rg -B 5 -A 5 "Table.*Widget" app/client/cypress/e2e/Regression/ClientSide/Debugger/Widget_property_navigation_spec.ts
Length of output: 682
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/12198020450.
|
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 Fix test case as DB data updated. Fixes # https://app.zenhub.com/workspaces/stability-pod-6690c4814e31602e25cab7fd/issues/gh/appsmithorg/appsmith/38022 ## Automation /ok-to-test tags="@tag.Sanity" ### 🔍 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/12228999115> > Commit: 9eb9d98 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=12228999115&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.Sanity` > Spec: > <hr>Mon, 09 Dec 2024 05:14:24 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 - **Chores** - Updated test specification to focus on a new TypeScript test file. - Streamlined references to column identifiers in widget property navigation tests for consistency. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Description
Fix test case as DB data updated.
Fixes # https://app.zenhub.com/workspaces/stability-pod-6690c4814e31602e25cab7fd/issues/gh/appsmithorg/appsmith/38022
Automation
/ok-to-test tags="@tag.Sanity"
🔍 Cypress test results
Tip
🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/12228999115
Commit: 9eb9d98
Cypress dashboard.
Tags:
@tag.Sanity
Spec:
Mon, 09 Dec 2024 05:14:24 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit