Repository: appsmithorg/appsmith
File: app/client/cypress/e2e/Regression/ClientSide/Widgets/Input/Inputv2_spec.js (JavaScript)

Code before:
        ".t--property-control-datatype",
        "Single-line text",
      );
      cy.get(".t--property-control-required label")
        .last()
        .click({ force: true });
      // Set onSubmit action, storing value
      cy.get(".t--property-control-onsubmit").find(".t--js-toggle").click();
      cy.updateCodeInput(
        ".t--property-control-onsubmit",
        "{{storeValue('textPayloadOnSubmit',Input1.text)}}",
      );
      // Bind to stored value above
      cy.openPropertyPane("textwidget");
      cy.updateCodeInput(
        ".t--property-control-text",
        "{{appsmith.store.textPayloadOnSubmit}}",
      );
      agHelper.AssertAutoSave();

      cy.closePropertyPane();
      cy.get(widgetInput).clear();
      cy.wait(300);
      // Input text and hit enter key
      cy.get(widgetInput).type("test{enter}", {
        delay: 300,
      });
      // Assert if the Text widget contains the whole value, test
      cy.get(".t--widget-textwidget").should("have.text", "test");
    });

    it("9. changing default text should change text", () => {
      cy.openPropertyPane("textwidget");
      cy.updateCodeInput(
        ".t--property-control-text",
        `{{Input1.text}}:{{Input1.value}}:{{Input1.isValid}}`,
      );
      cy.openPropertyPane(widgetName);
      cy.updateCodeInput(".t--property-control-defaultvalue", `test`);
      // wait for evaluations
      cy.wait(300);
      cy.get(`.t--widget-${widgetName} input`).should("contain.value", "test");
      cy.get(".t--widget-textwidget").should("contain", "test:test:true");

      cy.updateCodeInput(".t--property-control-defaultvalue", `anotherText`);
      // wait for evaluations
      cy.wait(300);
      cy.get(`.t--widget-${widgetName} input`).should(
        "contain.value",
        "anotherText",
      );

Review comment (suggestion):
@ankitakinger Can we add a comment here for why delay of 300ms is added here? We can also take it out in constant file similar to what was done in this [PR](https://github.com/appsmithorg/appsmith/pull/40239), so that if in future, the value 300 changes in the code, it will be updated for cypress as well

Code after:
      cy.selectDropdownValue(
        ".t--property-control-datatype",
        "Single-line text",
      );
      cy.get(".t--property-control-required label")
        .last()
        .click({ force: true });
      // Set onSubmit action, storing value
      cy.get(".t--property-control-onsubmit").find(".t--js-toggle").click();
      cy.updateCodeInput(
        ".t--property-control-onsubmit",
        "{{storeValue('textPayloadOnSubmit',Input1.text)}}",
      );
      // Bind to stored value above
      cy.openPropertyPane("textwidget");
      cy.updateCodeInput(
        ".t--property-control-text",
        "{{appsmith.store.textPayloadOnSubmit}}",
      );
      agHelper.AssertAutoSave();

      cy.closePropertyPane();
      cy.get(widgetInput).clear();
      cy.wait(300);
      // Input text and hit enter key
      cy.get(widgetInput).type("test{enter}", {
        delay: DEBOUNCE_WAIT_TIME_ON_INPUT_CHANGE,
      });
      // Assert if the Text widget contains the whole value, test
      cy.get(".t--widget-textwidget").should("have.text", "test");
    });

    it("9. changing default text should change text", () => {
      cy.openPropertyPane("textwidget");
      cy.updateCodeInput(
        ".t--property-control-text",
        `{{Input1.text}}:{{Input1.value}}:{{Input1.isValid}}`,
      );
      cy.openPropertyPane(widgetName);
      cy.updateCodeInput(".t--property-control-defaultvalue", `test`);
      // wait for evaluations
      cy.wait(300);
      cy.get(`.t--widget-${widgetName} input`).should("contain.value", "test");
      cy.get(".t--widget-textwidget").should("contain", "test:test:true");

      cy.updateCodeInput(".t--property-control-defaultvalue", `anotherText`);
      // wait for evaluations
      cy.wait(300);
      cy.get(`.t--widget-${widgetName} input`).should(
        "contain.value",
        "anotherText",