diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/FormWidgets/Button_tooltip_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/FormWidgets/Button_tooltip_spec.js index 7ba007900a..b8ebe31f9b 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/FormWidgets/Button_tooltip_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/FormWidgets/Button_tooltip_spec.js @@ -7,30 +7,51 @@ describe("Button Widget Functionality - Validate tooltip visibility", function() cy.addDsl(dsl); }); - it("Validate show tooltip on button hover", function() { + it("Validate show/hide tooltip feature on normal button", function() { cy.openPropertyPane("buttonwidget"); - // add tooltip + // Add tooltip cy.testJsontext( "tooltip", "Lorem Ipsum is simply dummy text of the printing and typesetting industry", ); + // Hover in cy.get(widgetsPage.buttonWidget).trigger("mouseover"); - // tooltip should show on hover + // Check if a tooltip is displayed cy.get(".bp3-popover2-content").should( "have.text", "Lorem Ipsum is simply dummy text of the printing and typesetting industry", ); + // Hover out + cy.get(widgetsPage.buttonWidget).trigger("mouseout"); + // Check if the tooltip is disappeared + cy.get(".bp3-popover2-content") + .contains( + "Lorem Ipsum is simply dummy text of the printing and typesetting industry", + ) + .should("not.exist"); }); - it("Validate tooltip hidden for disabled button", function() { - // first disable button + it("Validate show/hide tooltip feature for a disabled button", function() { + // Disable the button cy.get(".t--property-control-disabled .bp3-switch").click({ force: true }); cy.validateDisableWidget( widgetsPage.buttonWidget, commonlocators.disabledField, ); - // hover on button and check tooltip should not show + // Hover in cy.get(widgetsPage.buttonWidget).trigger("mouseover"); - cy.get(".bp3-popover2-content").should("not.exist"); + // Check if a tooltip is displayed + cy.get(".bp3-popover2-content").should( + "have.text", + "Lorem Ipsum is simply dummy text of the printing and typesetting industry", + ); + // Hover out + cy.get(widgetsPage.buttonWidget).trigger("mouseout"); + // Check if the tooltip is disappeared + cy.get(".bp3-popover2-content") + .contains( + "Lorem Ipsum is simply dummy text of the printing and typesetting industry", + ) + .should("not.exist"); }); }); diff --git a/app/client/src/widgets/ButtonWidget/component/index.tsx b/app/client/src/widgets/ButtonWidget/component/index.tsx index db33ea45f2..88dbe671ed 100644 --- a/app/client/src/widgets/ButtonWidget/component/index.tsx +++ b/app/client/src/widgets/ButtonWidget/component/index.tsx @@ -469,7 +469,6 @@ function ButtonComponent(props: ButtonComponentProps & RecaptchaProps) { } - disabled={props.isDisabled} hoverOpenDelay={200} interactionKind="hover" portalClassName="btnTooltipContainer"