Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -218,22 +218,26 @@ describe(
["Form1"],
);
propPane.UpdatePropertyFieldValue("Options", options);
propPane.SelectPlatformFunction("onOptionChange", "Execute a query");
agHelper.GetNClick(`${locators._dropDownValue("Query1")}`, 0, true);
agHelper.GetNClick(locators._callbackAddBtn, 0, true);
agHelper.GetNClick(locators._dropDownValue("Show alert"));
agHelper.TypeText(
propPane._actionSelectorFieldByLabel("Message"),
"Success",
);
agHelper.GetNClick(propPane._actionSelectorPopupClose);
deployMode.DeployApp();
agHelper.WaitUntilEleAppear(
`${locators._widgetInDeployed("singleselecttreewidget")} ${locators._treeSelectSelector}`,
);
agHelper.GetNClick(
`${locators._widgetInDeployed("singleselecttreewidget")} ${locators._treeSelectSelector}`,
propPane.ToggleJSMode("onOptionChange", true);
propPane.UpdatePropertyFieldValue(
"onOptionChange",
"{{Query1.run().then(() => showAlert('Success', ''))}}",
);
deployMode.DeployApp();
const treeSelectInDeploy = `${locators._widgetInDeployed("singleselecttreewidget")} ${locators._treeSelectSelector}`;
agHelper.WaitUntilEleAppear(treeSelectInDeploy);
agHelper.GetNClick(treeSelectInDeploy);
// Verify the dropdown opened; if it didn't (widget remounting during
// page hydration can cause the first click to be swallowed), retry.
cy.get("body").then(($body) => {
if (
$body.find(
".rc-tree-select-dropdown:not(.rc-tree-select-dropdown-hidden)",
).length === 0
Comment on lines +232 to +236
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Use locator-backed selector instead of raw dropdown CSS chain.

Line 235 uses a hardcoded CSS selector inside find(...), which is brittle and against the repo selector rules. Please use a locator variable (preferably backed by data-*) for this retry condition.

♻️ Suggested change in this file
       cy.get("body").then(($body) => {
-        if (
-          $body.find(
-            ".rc-tree-select-dropdown:not(.rc-tree-select-dropdown-hidden)",
-          ).length === 0
-        ) {
+        if ($body.find(locators._treeSelectTitle).length === 0) {
           agHelper.GetNClick(treeSelectInDeploy);
         }
       });

As per coding guidelines: "Use locator variables for locators and do not use plain strings." and "Use data-* attributes for selectors."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@app/client/cypress/e2e/Regression/ClientSide/Widgets/TreeSelect/Tree_Select_2_spec.ts`
around lines 232 - 236, Replace the hardcoded CSS string inside the
cy.get("body").then(...) retry check (currently using
".rc-tree-select-dropdown:not(.rc-tree-select-dropdown-hidden)") with a
locator-backed selector variable (preferably a data-* attribute), e.g., create
or reuse a constant like TREE_SELECT_DROPDOWN and use that in the
$body.find(...) condition; update the test to reference that locator variable
instead of the raw CSS string so the check follows the repo selector rules.

) {
agHelper.GetNClick(treeSelectInDeploy);
}
});
agHelper.AssertElementVisibility(locators._treeSelectTitle);
agHelper.GetNClick(locators._dropDownMultiTreeValue("Green"));
agHelper.ValidateToastMessage("Success");
Expand Down
Loading