ToolJet/cypress-tests/cypress/support/utils/basicComponents.js
Srimanitejas123 956f345eb9
Updated private and public app spec (#11602)
* Updated app version spec

* Updated app editor spec

* Updated app editor spec

* Updated app editor spec

* Updated apps spec

* Updated app spec

* changes on app spec

* Updated version spec

* App import and export spec

* Updated apps spec based on review commends

* updated app import and export spec based on review comments

* Updated appEditor and privateAndpublic app spec based on review commends

* Updated version and app import and export spec based on review commends

* fixed selector for query search bar

* Updated private and public app spec based on review comments

* updated private ad public app based on review comments

* Updated version spec

* Updated according to review comment

* Updated based on review comments

* Updated based on review comments

* removed commented lines

* Updated api commands

* Updated app import export spec

* updated app import and export with tj_db

* Updated version spec

* Updated app import and export spec

---------

Co-authored-by: Sri mani Teja s <[email protected]>
Co-authored-by: Ajith KV <[email protected]>
2025-01-07 12:20:36 +05:30

67 lines
1.8 KiB
JavaScript

import { commonWidgetSelector, commonSelectors } from "Selectors/common";
import {
openAccordion,
verifyAndModifyParameter,
openEditorSidebar,
editAndVerifyWidgetName,
} from "Support/utils/commonWidget";
import { resizeQueryPanel } from "Support/utils/dataSource";
export const verifyComponent = (widgetName) => {
cy.get(commonWidgetSelector.draggableWidget(widgetName), {
timeout: 10000,
}).should("be.visible");
};
export const verifyComponentinrightpannel = (widgetName) => {
cy.get(commonWidgetSelector.widgetBox(widgetName), {
timeout: 10000,
}).should("be.visible");
};
export const deleteComponentAndVerify = (widgetName) => {
cy.get(commonWidgetSelector.draggableWidget(widgetName))
.realHover()
.realHover();
cy.get(commonWidgetSelector.draggableWidget(widgetName))
.realHover()
.then(() => {
cy.get(`[data-cy="${widgetName}-delete-button"]`)
.realHover({ position: "topRight" })
.last()
.realClick();
});
cy.verifyToastMessage(
`[class=go3958317564]`,
"Component deleted! (ctrl + Z to undo)"
);
cy.notVisible(commonWidgetSelector.draggableWidget(widgetName));
};
export const verifyComponentWithOutLabel = (
component,
defaultName,
fakeName,
appName,
properties = []
) => {
cy.dragAndDropWidget(component, 300, 300);
cy.get(`[data-cy="draggable-widget-${defaultName}"]`).click({ force: true });
verifyComponent(defaultName);
cy.resizeWidget(defaultName, 650, 600, false);
openEditorSidebar(defaultName);
editAndVerifyWidgetName(fakeName, properties);
cy.forceClickOnCanvas();
cy.waitForAutoSave();
cy.openInCurrentTab(commonWidgetSelector.previewButton);
verifyComponent(fakeName);
cy.go("back");
resizeQueryPanel(0);
deleteComponentAndVerify(fakeName);
};