Skip to content

Commit

Permalink
test: fix JsObjectMutation flaky test (#32936)
Browse files Browse the repository at this point in the history
RCA:


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit


- **Tests**
- Updated the test specification file and focused test execution on a
specific test case.
- Added a new assertion to verify the presence of a specific element in
the DOM.
- Added a new declaration to the `CommonLocators` class for improved
test reliability.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
NandanAnantharamu committed Apr 26, 2024
1 parent 9e214c2 commit a96f9cc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { getWidgetSelector } from "../../../../locators/WidgetLocators";
import { locators } from "../../../../support/Objects/ObjectsCore";
import * as _ from "../../../../support/Objects/ObjectsCore";
import EditorNavigation, {
EntityType,
} from "../../../../support/Pages/EditorNavigation";
const commonlocators = require("../../../../locators/commonlocators.json");

describe("JSObject testing", { tags: ["@tag.JS"] }, () => {
before(() => {
Expand Down Expand Up @@ -128,6 +130,7 @@ describe("JSObject testing", { tags: ["@tag.JS"] }, () => {
toRun: false,
shouldCreateNewJSObj: true,
});
_.agHelper.GetNAssertContains(locators._selectionItem, "getData");
_.jsEditor.SelectFunctionDropdown("myFun1");
_.jsEditor.RunJSObj();
EditorNavigation.SelectEntityByName("Text2", EntityType.Widget);
Expand Down
1 change: 1 addition & 0 deletions app/client/cypress/support/Objects/CommonLocators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,4 +329,5 @@ export class CommonLocators {
_exitFullScreen = ".application-demo-new-dashboard-control-exit-fullscreen";
_menuItem = ".bp3-menu-item";
_slashCommandHintText = ".slash-command-hint-text";
_selectionItem = ".rc-select-selection-item";
}

0 comments on commit a96f9cc

Please sign in to comment.