-
Notifications
You must be signed in to change notification settings - Fork 4.6k
chore: external merge request from Contributor #36575
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
Closed
rahulbarwal
wants to merge
18
commits into
release
from
external-contri/fix/bug-alert-shows-twice-for-select-widget-26696
Closed
Changes from 9 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
86c083e
fixed the bug alert message is showing twice in select widget and add…
prasad-madine 6bd2959
Merge branch 'release' of https://github.com/PrasadMadine/appsmith in…
prasad-madine ebf1d7d
Fix: updated the description of cypress test for select widget
prasad-madine ef0011c
Merge branch 'release' of https://github.com/PrasadMadine/appsmith in…
prasad-madine c0fde14
Merge branch 'release' of https://github.com/PrasadMadine/appsmith in…
prasad-madine 98d07b2
fix: bug with different approach and added alerts and count of alert …
prasad-madine ad953b3
fix: Addressed the review comments
prasad-madine f8da8fc
fix: addressed the comments suggested by coderabbit ai
prasad-madine 8edc030
Merge remote-tracking branch 'contributor-fork/fix/bug-alert-shows-tw…
rahulbarwal b7d1357
fix: Added unit test cases
prasad-madine a328709
fix: Addressed the comments
prasad-madine 75bccc1
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
rahulbarwal dd90fe5
Merge branch 'fix/bug-alert-shows-twice-for-select-widget-26696' of h…
rahulbarwal 0519280
Fix: linting errors
prasad-madine be1147e
Merge branch 'fix/bug-alert-shows-twice-for-select-widget-26696' of h…
rahulbarwal bbc672b
fix: rename the test file and linting errors
prasad-madine c3338ff
Merge branch 'fix/bug-alert-shows-twice-for-select-widget-26696' of h…
rahulbarwal 7540edf
Merge branches 'release' and 'release' of https://github.com/appsmith…
rahulbarwal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
53 changes: 53 additions & 0 deletions
53
app/client/cypress/e2e/Regression/ClientSide/Widgets/Select/Select4_spec.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| import { | ||
| agHelper, | ||
| draggableWidgets, | ||
| deployMode, | ||
| entityExplorer, | ||
| locators, | ||
| propPane, | ||
| } from "../../../../../support/Objects/ObjectsCore"; | ||
|
|
||
| // Issue link: https://github.com/appsmithorg/appsmith/issues/26696 | ||
| describe( | ||
| "Select widget tests validating OnDropdownClose events are rendering show alert only once", | ||
| { tags: ["@tag.Widget", "@tag.Select"] }, | ||
| function () { | ||
| before(() => { | ||
| entityExplorer.DragDropWidgetNVerify(draggableWidgets.SELECT); | ||
| }); | ||
|
|
||
| it("Validate OnDropdownClose events are rendering show alert only once", () => { | ||
| propPane.EnterJSContext( | ||
| "onDropdownClose", | ||
| "{{showAlert('Dropdown closed!','success')}}", | ||
| true, | ||
| ); | ||
| propPane.ToggleJSMode("onDropdownClose", false); | ||
| propPane.EnterJSContext( | ||
| "onDropdownOpen", | ||
| "{{showAlert('Dropdown opened!','success')}}", | ||
| true, | ||
| ); | ||
| propPane.ToggleJSMode("onDropdownOpen", false); | ||
| propPane.EnterJSContext( | ||
| "onOptionChange", | ||
| "{{showAlert('Option changed!','success')}}", | ||
| true, | ||
| ); | ||
| propPane.ToggleJSMode("onOptionChange", false); | ||
| deployMode.DeployApp(locators._widgetInDeployed(draggableWidgets.SELECT)); | ||
| agHelper.GetNClick(locators._widgetInDeployed(draggableWidgets.SELECT)); | ||
| agHelper.ValidateToastMessage("Dropdown opened!"); | ||
| agHelper.AssertElementVisibility( | ||
| locators._selectOptionValue("Red"), | ||
| true, | ||
| ); | ||
| agHelper.GetNClick(locators._selectOptionValue("Red")); | ||
| agHelper.ValidateToastMessage("Option changed!"); | ||
| agHelper.ValidateToastMessage("Dropdown closed!"); | ||
| cy.get("#ToastId12 > .Toastify__toast-body") | ||
| .contains("Dropdown closed!") | ||
| .should("have.length", 1); | ||
| }); | ||
| }, | ||
| ); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Good effort on the test case, but let's make some improvements!
Your test case does a great job of covering the main functionality of the Select widget. However, there are a few areas where we can make it even better:
Instead of using
cy.get('#ToastId12'), let's use a more robust selector. Remember, we want to avoid direct element selection and use data attributes instead.We should use locator variables for all our selectors to make the test more maintainable.
The toast ID (#ToastId12) might change, making our test brittle. Let's find a more stable way to assert the toast message.
Here's how we can improve it:
Remember, class, using data attributes and locator variables makes our tests more robust and easier to maintain. Keep up the good work!