Skip to content

Commit

Permalink
test: Added a new test case for 33601 (appsmithorg#38234)
Browse files Browse the repository at this point in the history
## Description
Automation for Bug: appsmithorg#33601


Fixes #[`Issue Number`
](appsmithorg#38071)

## Automation

/ok-to-test tags="@tag.JS"

### 🔍 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/12396301697>
> Commit: ddb795c
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=12396301697&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.JS`
> Spec:
> <hr>Wed, 18 Dec 2024 16:25:55 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

- **New Features**
- Introduced a new test case to validate the functionality of the
`resetWidget` feature.
- Added a structured JSON file representing an application configuration
with various attributes and actions.

- **Bug Fixes**
- Implemented a test to address Bug 33601 related to the `resetWidget`
function.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
sagar-qa007 authored Dec 19, 2024
1 parent 1d8ef8d commit 87fc819
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 0 deletions.
74 changes: 74 additions & 0 deletions cypress/e2e/Regression/ClientSide/ActionExecution/Bug33601_spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import {
agHelper,
appSettings,
assertHelper,
deployMode,
homePage,
locators,
} from "../../../../support/Objects/ObjectsCore";
import EditorNavigation, {
EntityType,
PageLeftPane,
} from "../../../../support/Pages/EditorNavigation";

describe(
"Bug:33601: resetWidget function causes the next async method to be undefined",
{ tags: ["@tag.JS"] },
() => {
it("1. Bug 33601", () => {
homePage.NavigateToHome();
homePage.ImportApp("resetWidgetBug33601.json");
EditorNavigation.SelectEntityByName("List1", EntityType.Widget);
PageLeftPane.expandCollapseItem("List1");
PageLeftPane.expandCollapseItem("Container1");
EditorNavigation.SelectEntityByName("Input1", EntityType.Widget);

agHelper.EnterInputText("Label", "Widget Input2");
EditorNavigation.SelectEntityByName("Button1", EntityType.Widget);
cy.get(locators._widgetInputSelector("inputwidgetv2"))
.first()
.invoke("attr", "value")
.should("contain", "Widget Input2");
agHelper
.GetAttribute(locators._imgWidgetInsideList, "src")
.then((labelValue) => {
expect(labelValue).not.to.contain("data:image/png;base64");
});

agHelper.ClickButton("Submit");
cy.get(locators._widgetInputSelector("inputwidgetv2"))
.first()
.invoke("attr", "value")
.should("be.empty");
assertHelper.WaitForNetworkCall("@postExecute");
agHelper
.GetAttribute(locators._imgWidgetInsideList, "src")
.then((labelValue) => {
expect(labelValue).to.contain("data:image/png;base64");
});

deployMode.DeployApp();
agHelper.AssertElementVisibility(appSettings.locators._header);
agHelper.EnterInputText("Label", "Widget Input2");
cy.get(locators._widgetInputSelector("inputwidgetv2"))
.first()
.invoke("attr", "value")
.should("contain", "Widget Input2");
agHelper
.GetAttribute(locators._imgWidgetInsideList, "src")
.then((labelValue) => {
expect(labelValue).not.to.contain("data:image/png;base64");
});
agHelper.ClickButton("Submit");
cy.get(locators._widgetInputSelector("inputwidgetv2"))
.first()
.invoke("attr", "value")
.should("be.empty");
agHelper
.GetAttribute(locators._imgWidgetInsideList, "src")
.then((labelValue) => {
expect(labelValue).to.contain("data:image/png;base64");
});
});
},
);
Loading

0 comments on commit 87fc819

Please sign in to comment.