2023-04-12 07:24:54 +00:00
|
|
|
import { commonSelectors, commonWidgetSelector } from "Selectors/common";
|
|
|
|
|
import { buttonText } from "Texts/button";
|
2023-04-10 05:47:25 +00:00
|
|
|
import { fake } from "Fixtures/fake";
|
|
|
|
|
import { commonWidgetText } from "Texts/common";
|
2023-04-12 07:24:54 +00:00
|
|
|
|
|
|
|
|
import { verifyControlComponentAction } from "Support/utils/button";
|
|
|
|
|
import {
|
|
|
|
|
launchModal,
|
|
|
|
|
closeModal,
|
|
|
|
|
launchButton,
|
|
|
|
|
verifySize,
|
|
|
|
|
addAndVerifyColor,
|
|
|
|
|
typeOnFx,
|
|
|
|
|
} from "Support/utils/modal";
|
2023-04-10 05:47:25 +00:00
|
|
|
|
|
|
|
|
import {
|
|
|
|
|
openAccordion,
|
|
|
|
|
verifyAndModifyParameter,
|
|
|
|
|
openEditorSidebar,
|
|
|
|
|
verifyAndModifyToggleFx,
|
2023-04-12 07:24:54 +00:00
|
|
|
addDefaultEventHandler,
|
|
|
|
|
addAndVerifyTooltip,
|
|
|
|
|
verifyComponentFromInspector,
|
|
|
|
|
verifyAndModifyStylePickerFx,
|
|
|
|
|
verifyWidgetColorCss,
|
|
|
|
|
selectColourFromColourPicker,
|
|
|
|
|
fillBoxShadowParams,
|
2023-04-10 05:47:25 +00:00
|
|
|
verifyBoxShadowCss,
|
|
|
|
|
verifyLayout,
|
|
|
|
|
verifyTooltip,
|
|
|
|
|
editAndVerifyWidgetName,
|
|
|
|
|
verifyPropertiesGeneralAccordion,
|
|
|
|
|
verifyStylesGeneralAccordion,
|
|
|
|
|
} from "Support/utils/commonWidget";
|
2023-05-10 13:06:42 +00:00
|
|
|
import {
|
|
|
|
|
selectCSA,
|
|
|
|
|
selectEvent,
|
|
|
|
|
addSupportCSAData,
|
|
|
|
|
} from "Support/utils/events";
|
2023-04-10 05:47:25 +00:00
|
|
|
|
|
|
|
|
describe("Modal", () => {
|
|
|
|
|
beforeEach(() => {
|
2023-09-04 04:05:12 +00:00
|
|
|
cy.apiLogin();
|
2024-02-20 15:58:38 +00:00
|
|
|
cy.apiCreateApp(`${fake.companyName}-Modal-App`);
|
2023-09-04 04:05:12 +00:00
|
|
|
cy.openApp();
|
2023-04-10 05:47:25 +00:00
|
|
|
cy.dragAndDropWidget("Modal");
|
|
|
|
|
});
|
2023-09-04 04:05:12 +00:00
|
|
|
afterEach(() => {
|
|
|
|
|
cy.apiDeleteApp();
|
|
|
|
|
});
|
2023-04-10 05:47:25 +00:00
|
|
|
|
2023-04-12 07:24:54 +00:00
|
|
|
it("should verify the properties of the modal component", () => {
|
2023-04-10 05:47:25 +00:00
|
|
|
const data = {};
|
|
|
|
|
data.appName = `${fake.companyName}-App`;
|
2023-04-12 07:24:54 +00:00
|
|
|
data.alertMessage = fake.randomSentence;
|
2023-04-10 05:47:25 +00:00
|
|
|
data.widgetName = fake.widgetName;
|
2023-04-12 07:24:54 +00:00
|
|
|
data.customTitle = fake.randomSentence;
|
2023-04-10 05:47:25 +00:00
|
|
|
data.tooltipText = fake.randomSentence;
|
2023-04-12 07:24:54 +00:00
|
|
|
data.buttonText = fake.companyName;
|
2023-04-10 05:47:25 +00:00
|
|
|
|
2023-04-12 07:24:54 +00:00
|
|
|
launchModal("modal1");
|
|
|
|
|
cy.get('[data-cy="modal-title"]').verifyVisibleElement(
|
|
|
|
|
"have.text",
|
|
|
|
|
"This title can be changed"
|
|
|
|
|
);
|
|
|
|
|
cy.get('[data-cy="modal-body"]').should("be.visible");
|
|
|
|
|
cy.get('[data-cy="modal-close-button"]').click();
|
|
|
|
|
cy.notVisible('[data-cy="modal-title"]');
|
2023-04-10 05:47:25 +00:00
|
|
|
|
2024-02-20 15:58:38 +00:00
|
|
|
openEditorSidebar("modal1", ["Options", "Properties", "Devices"]);
|
2023-04-12 07:24:54 +00:00
|
|
|
editAndVerifyWidgetName(data.widgetName, [
|
|
|
|
|
"Options",
|
2023-04-10 05:47:25 +00:00
|
|
|
"Properties",
|
2024-02-20 15:58:38 +00:00
|
|
|
"Devices",
|
2023-04-10 05:47:25 +00:00
|
|
|
]);
|
2023-04-12 07:24:54 +00:00
|
|
|
verifyComponentFromInspector(data.widgetName);
|
|
|
|
|
|
|
|
|
|
openAccordion(commonWidgetText.accordionProperties);
|
|
|
|
|
verifyAndModifyParameter("Title", data.customTitle);
|
|
|
|
|
launchModal(data.widgetName);
|
|
|
|
|
cy.get('[data-cy="modal-title"]').verifyVisibleElement(
|
|
|
|
|
"have.text",
|
|
|
|
|
data.customTitle
|
2023-04-10 05:47:25 +00:00
|
|
|
);
|
2023-04-12 07:24:54 +00:00
|
|
|
cy.get('[data-cy="modal-close-button"]').click();
|
|
|
|
|
|
|
|
|
|
verifyAndModifyToggleFx(
|
|
|
|
|
buttonText.loadingState,
|
|
|
|
|
commonWidgetText.codeMirrorLabelFalse
|
|
|
|
|
);
|
|
|
|
|
launchModal(data.widgetName);
|
|
|
|
|
cy.get(".spinner-border").should("be.visible");
|
2023-04-10 05:47:25 +00:00
|
|
|
|
2023-04-12 07:24:54 +00:00
|
|
|
cy.get(
|
|
|
|
|
commonWidgetSelector.parameterTogglebutton(buttonText.loadingState)
|
|
|
|
|
).click();
|
|
|
|
|
cy.notVisible(".spinner-border");
|
2023-04-10 05:47:25 +00:00
|
|
|
|
2023-04-12 07:24:54 +00:00
|
|
|
verifyAndModifyToggleFx(
|
|
|
|
|
"Hide title bar",
|
|
|
|
|
commonWidgetText.codeMirrorLabelFalse
|
|
|
|
|
);
|
|
|
|
|
cy.notVisible('[data-cy="modal-title"]');
|
|
|
|
|
cy.get('[data-cy="hide-title-bar-toggle-button"]').click();
|
|
|
|
|
cy.get('[data-cy="modal-title"]').verifyVisibleElement(
|
|
|
|
|
"have.text",
|
|
|
|
|
data.customTitle
|
|
|
|
|
);
|
2023-04-10 05:47:25 +00:00
|
|
|
|
2023-04-12 07:24:54 +00:00
|
|
|
cy.realPress("Escape");
|
|
|
|
|
cy.notVisible('[data-cy="modal-title"]');
|
|
|
|
|
|
|
|
|
|
verifyAndModifyToggleFx(
|
2023-04-24 11:03:27 +00:00
|
|
|
"Close on escape key",
|
2023-04-12 07:24:54 +00:00
|
|
|
commonWidgetText.codeMirrorLabelTrue
|
|
|
|
|
);
|
|
|
|
|
launchModal(data.widgetName);
|
|
|
|
|
|
|
|
|
|
cy.realPress("Escape");
|
2023-04-27 02:31:37 +00:00
|
|
|
cy.get('[data-cy="modal-title"]').verifyVisibleElement(
|
|
|
|
|
"have.text",
|
|
|
|
|
data.customTitle
|
|
|
|
|
);
|
|
|
|
|
|
2023-04-24 11:03:27 +00:00
|
|
|
closeModal(data.widgetName);
|
|
|
|
|
launchModal(data.widgetName);
|
2023-04-12 07:24:54 +00:00
|
|
|
|
|
|
|
|
verifySize("Medium");
|
|
|
|
|
verifySize("Large");
|
|
|
|
|
verifySize("Small");
|
2023-04-10 05:47:25 +00:00
|
|
|
|
|
|
|
|
verifyAndModifyToggleFx(
|
2023-04-12 07:24:54 +00:00
|
|
|
"Use default trigger button",
|
|
|
|
|
commonWidgetText.codeMirrorLabelTrue
|
|
|
|
|
);
|
|
|
|
|
cy.get('[data-cy="modal-close-button"]').click();
|
|
|
|
|
cy.notVisible(launchButton(data.widgetName));
|
|
|
|
|
|
|
|
|
|
cy.get('[data-cy="use-default-trigger-button-toggle-button"]').click();
|
|
|
|
|
|
|
|
|
|
cy.get(
|
|
|
|
|
'[data-cy="trigger-button-label-input-field"]'
|
|
|
|
|
).clearAndTypeOnCodeMirror(data.buttonText);
|
|
|
|
|
cy.forceClickOnCanvas();
|
|
|
|
|
cy.get(launchButton(data.widgetName))
|
|
|
|
|
.verifyVisibleElement("have.text", data.buttonText)
|
|
|
|
|
.click();
|
|
|
|
|
|
|
|
|
|
openAccordion(commonWidgetText.accordionEvents);
|
|
|
|
|
selectEvent("On open", "Show Alert");
|
|
|
|
|
cy.get('[data-cy="modal-close-button"]').click();
|
|
|
|
|
launchModal(data.widgetName);
|
|
|
|
|
cy.verifyToastMessage(commonSelectors.toastMessage, "Hello world!");
|
|
|
|
|
cy.get('[data-cy="modal-close-button"]').click();
|
|
|
|
|
|
|
|
|
|
verifyLayout(data.widgetName);
|
|
|
|
|
|
|
|
|
|
cy.get(commonWidgetSelector.changeLayoutToDesktopButton).click();
|
|
|
|
|
cy.get(
|
|
|
|
|
commonWidgetSelector.parameterTogglebutton(
|
|
|
|
|
commonWidgetText.parameterShowOnDesktop
|
|
|
|
|
)
|
|
|
|
|
).click();
|
|
|
|
|
|
|
|
|
|
cy.get(commonWidgetSelector.widgetDocumentationLink).should(
|
|
|
|
|
"have.text",
|
2023-09-12 07:34:44 +00:00
|
|
|
"Read documentation for Modal"
|
2023-04-12 07:24:54 +00:00
|
|
|
);
|
2023-04-10 05:47:25 +00:00
|
|
|
});
|
2023-04-12 07:24:54 +00:00
|
|
|
|
|
|
|
|
it("should verify the styles of the modal widget", () => {
|
2023-04-10 05:47:25 +00:00
|
|
|
const data = {};
|
|
|
|
|
data.appName = `${fake.companyName}-App`;
|
|
|
|
|
data.boxShadowColor = fake.randomRgba;
|
2023-04-12 07:24:54 +00:00
|
|
|
data.colourHex = fake.randomRgbaHex;
|
2023-04-10 05:47:25 +00:00
|
|
|
data.boxShadowParam = fake.boxShadowParam;
|
2023-04-12 07:24:54 +00:00
|
|
|
data.backgroundColor = fake.randomRgba;
|
2023-04-10 05:47:25 +00:00
|
|
|
|
2023-04-12 07:24:54 +00:00
|
|
|
launchModal("modal1");
|
2023-04-10 05:47:25 +00:00
|
|
|
cy.get(commonWidgetSelector.buttonStylesEditorSideBar).click();
|
|
|
|
|
|
2023-04-12 07:24:54 +00:00
|
|
|
addAndVerifyColor(
|
|
|
|
|
"Header background color",
|
|
|
|
|
"#ffffffff",
|
|
|
|
|
data.backgroundColor,
|
|
|
|
|
"[data-cy='modal-header']"
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
data.backgroundColor = fake.randomRgba;
|
|
|
|
|
addAndVerifyColor(
|
|
|
|
|
"Header title color",
|
|
|
|
|
"#000000",
|
|
|
|
|
data.backgroundColor,
|
|
|
|
|
"[data-cy='modal-header']",
|
|
|
|
|
"color"
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
data.backgroundColor = fake.randomRgba;
|
|
|
|
|
addAndVerifyColor(
|
|
|
|
|
"Body background color",
|
|
|
|
|
"#ffffffff",
|
|
|
|
|
data.backgroundColor,
|
|
|
|
|
"[data-cy='modal-body']"
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
data.backgroundColor = fake.randomRgba;
|
|
|
|
|
addAndVerifyColor(
|
|
|
|
|
"Trigger button background color",
|
|
|
|
|
"#4D72FA",
|
|
|
|
|
data.backgroundColor,
|
|
|
|
|
launchButton("modal1"),
|
|
|
|
|
"background-color"
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
data.backgroundColor = fake.randomRgba;
|
|
|
|
|
addAndVerifyColor(
|
|
|
|
|
"Trigger button text color",
|
|
|
|
|
"#ffffffff",
|
|
|
|
|
data.backgroundColor,
|
|
|
|
|
launchButton("modal1"),
|
|
|
|
|
"color"
|
|
|
|
|
);
|
|
|
|
|
cy.get("[data-cy='modal-header']").realClick();
|
|
|
|
|
|
2023-04-10 05:47:25 +00:00
|
|
|
verifyAndModifyToggleFx(
|
|
|
|
|
commonWidgetText.parameterVisibility,
|
|
|
|
|
commonWidgetText.codeMirrorLabelTrue
|
|
|
|
|
);
|
2023-04-12 07:24:54 +00:00
|
|
|
cy.get('[data-cy="modal-close-button"]').click();
|
2024-02-20 15:58:38 +00:00
|
|
|
cy.get(commonWidgetSelector.draggableWidget("modal1"))
|
|
|
|
|
.find("button")
|
|
|
|
|
.should("not.be.visible");
|
2023-04-12 07:24:54 +00:00
|
|
|
cy.get(commonWidgetSelector.parameterTogglebutton("Visibility")).click();
|
2023-04-10 05:47:25 +00:00
|
|
|
|
|
|
|
|
verifyAndModifyToggleFx(
|
|
|
|
|
commonWidgetText.parameterDisable,
|
|
|
|
|
commonWidgetText.codeMirrorLabelFalse
|
|
|
|
|
);
|
|
|
|
|
cy.waitForAutoSave();
|
2023-04-12 07:24:54 +00:00
|
|
|
cy.get(launchButton("modal1")).should("have.attr", "disabled");
|
2023-04-10 05:47:25 +00:00
|
|
|
|
2023-04-12 07:24:54 +00:00
|
|
|
cy.get(commonWidgetSelector.parameterTogglebutton("Disable")).click();
|
|
|
|
|
launchModal("modal1");
|
|
|
|
|
cy.get('[data-cy="modal-title"]').verifyVisibleElement(
|
|
|
|
|
"have.text",
|
|
|
|
|
"This title can be changed"
|
2023-04-10 05:47:25 +00:00
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it("should verify the app preview", () => {
|
|
|
|
|
const data = {};
|
|
|
|
|
data.appName = `${fake.companyName}-App`;
|
2023-04-12 07:24:54 +00:00
|
|
|
data.bgColor = fake.randomRgba;
|
|
|
|
|
data.titleColor = fake.randomRgba;
|
|
|
|
|
data.bodyColor = fake.randomRgba;
|
|
|
|
|
data.buttonColor = fake.randomRgba;
|
|
|
|
|
data.buttonTextColor = fake.randomRgba;
|
|
|
|
|
data.customTitle = fake.randomSentence;
|
|
|
|
|
|
2023-09-12 07:34:44 +00:00
|
|
|
cy.forceClickOnCanvas();
|
2023-04-12 07:24:54 +00:00
|
|
|
cy.dragAndDropWidget(commonWidgetText.toggleSwitch, 600, 50);
|
2023-09-12 07:34:44 +00:00
|
|
|
cy.forceClickOnCanvas();
|
2023-04-12 07:24:54 +00:00
|
|
|
cy.dragAndDropWidget(commonWidgetText.toggleSwitch, 600, 100);
|
2023-09-12 07:34:44 +00:00
|
|
|
cy.forceClickOnCanvas();
|
2023-04-12 07:24:54 +00:00
|
|
|
cy.dragAndDropWidget(commonWidgetText.toggleSwitch, 600, 150);
|
2023-09-12 07:34:44 +00:00
|
|
|
cy.forceClickOnCanvas();
|
2023-04-12 07:24:54 +00:00
|
|
|
cy.dragAndDropWidget(commonWidgetText.toggleSwitch, 600, 200);
|
2023-09-12 07:34:44 +00:00
|
|
|
cy.forceClickOnCanvas();
|
2023-04-12 07:24:54 +00:00
|
|
|
cy.dragAndDropWidget(commonWidgetText.toggleSwitch, 600, 250);
|
2023-09-12 07:34:44 +00:00
|
|
|
cy.forceClickOnCanvas();
|
2023-04-10 05:47:25 +00:00
|
|
|
|
2023-04-12 07:24:54 +00:00
|
|
|
launchModal("modal1");
|
|
|
|
|
verifyAndModifyParameter("Title", data.customTitle);
|
|
|
|
|
cy.get(commonWidgetSelector.buttonStylesEditorSideBar).click();
|
2023-04-10 05:47:25 +00:00
|
|
|
|
2023-04-12 07:24:54 +00:00
|
|
|
addAndVerifyColor(
|
|
|
|
|
"Header background color",
|
|
|
|
|
"#ffffffff",
|
|
|
|
|
data.bgColor,
|
|
|
|
|
"[data-cy='modal-header']"
|
2023-04-10 05:47:25 +00:00
|
|
|
);
|
|
|
|
|
|
2023-04-12 07:24:54 +00:00
|
|
|
addAndVerifyColor(
|
|
|
|
|
"Header title color",
|
|
|
|
|
"#000000",
|
|
|
|
|
data.titleColor,
|
|
|
|
|
"[data-cy='modal-header']",
|
|
|
|
|
"color"
|
2023-04-10 05:47:25 +00:00
|
|
|
);
|
|
|
|
|
|
2023-04-12 07:24:54 +00:00
|
|
|
addAndVerifyColor(
|
|
|
|
|
"Body background color",
|
|
|
|
|
"#ffffffff",
|
|
|
|
|
data.bodyColor,
|
|
|
|
|
"[data-cy='modal-body']"
|
2023-04-10 05:47:25 +00:00
|
|
|
);
|
|
|
|
|
|
2023-04-12 07:24:54 +00:00
|
|
|
addAndVerifyColor(
|
|
|
|
|
"Trigger button background color",
|
|
|
|
|
"#4D72FA",
|
|
|
|
|
data.buttonColor,
|
|
|
|
|
launchButton("modal1"),
|
|
|
|
|
"background-color"
|
|
|
|
|
);
|
2023-04-10 05:47:25 +00:00
|
|
|
|
2023-04-12 07:24:54 +00:00
|
|
|
addAndVerifyColor(
|
|
|
|
|
"Trigger button text color",
|
|
|
|
|
"#ffffffff",
|
|
|
|
|
data.buttonTextColor,
|
|
|
|
|
launchButton("modal1"),
|
|
|
|
|
"color"
|
|
|
|
|
);
|
2023-04-10 05:47:25 +00:00
|
|
|
|
2023-04-27 02:31:37 +00:00
|
|
|
closeModal("modal1");
|
|
|
|
|
launchModal("modal1");
|
2023-04-12 07:24:54 +00:00
|
|
|
typeOnFx(
|
|
|
|
|
commonWidgetText.parameterVisibility,
|
|
|
|
|
"{{components.toggleswitch1.value"
|
2023-04-10 05:47:25 +00:00
|
|
|
);
|
2023-04-12 07:24:54 +00:00
|
|
|
cy.get("[data-cy='modal-header']").realClick();
|
2023-05-03 06:21:56 +00:00
|
|
|
cy.get(commonWidgetSelector.buttonStylesEditorSideBar).click();
|
|
|
|
|
|
2023-04-12 07:24:54 +00:00
|
|
|
typeOnFx(
|
|
|
|
|
commonWidgetText.parameterDisable,
|
|
|
|
|
"{{components.toggleswitch2.value"
|
2023-04-10 05:47:25 +00:00
|
|
|
);
|
2023-09-12 07:34:44 +00:00
|
|
|
cy.get("#inspector-tab-properties").click();
|
2023-04-10 05:47:25 +00:00
|
|
|
|
2023-12-07 12:26:00 +00:00
|
|
|
typeOnFx("Loading state", "{{components.toggleswitch3.value");
|
2023-04-12 07:24:54 +00:00
|
|
|
cy.get("[data-cy='modal-header']").realClick();
|
2023-04-10 05:47:25 +00:00
|
|
|
|
2023-04-12 07:24:54 +00:00
|
|
|
typeOnFx("Hide title bar", "{{components.toggleswitch4.value");
|
|
|
|
|
cy.get("[data-cy='modal-header']").realClick();
|
2023-04-10 05:47:25 +00:00
|
|
|
|
2023-04-12 07:24:54 +00:00
|
|
|
typeOnFx("Hide close button", "{{components.toggleswitch5.value");
|
|
|
|
|
cy.get("[data-cy='modal-header']").realClick();
|
|
|
|
|
cy.waitForAutoSave();
|
|
|
|
|
cy.openInCurrentTab(commonWidgetSelector.previewButton);
|
|
|
|
|
cy.wait(2000);
|
|
|
|
|
|
|
|
|
|
cy.notVisible(launchButton("modal1"));
|
|
|
|
|
cy.get(commonWidgetSelector.draggableWidget("toggleswitch1"))
|
|
|
|
|
.find(".form-check-input")
|
|
|
|
|
.click();
|
|
|
|
|
cy.get(launchButton("modal1")).should("be.visible");
|
|
|
|
|
|
|
|
|
|
cy.get(commonWidgetSelector.draggableWidget("toggleswitch2"))
|
|
|
|
|
.find(".form-check-input")
|
|
|
|
|
.click();
|
|
|
|
|
cy.get(launchButton("modal1")).should("have.attr", "disabled");
|
|
|
|
|
cy.get(commonWidgetSelector.draggableWidget("toggleswitch2"))
|
|
|
|
|
.find(".form-check-input")
|
|
|
|
|
.click();
|
|
|
|
|
cy.get(commonWidgetSelector.draggableWidget("toggleswitch3"))
|
|
|
|
|
.find(".form-check-input")
|
|
|
|
|
.click();
|
|
|
|
|
launchModal("modal1");
|
|
|
|
|
cy.get(".spinner-border").should("be.visible");
|
|
|
|
|
cy.realPress("Escape");
|
|
|
|
|
|
|
|
|
|
cy.get(commonWidgetSelector.draggableWidget("toggleswitch3"))
|
|
|
|
|
.find(".form-check-input")
|
|
|
|
|
.click();
|
|
|
|
|
|
|
|
|
|
cy.get(commonWidgetSelector.draggableWidget("toggleswitch4"))
|
|
|
|
|
.find(".form-check-input")
|
|
|
|
|
.click();
|
|
|
|
|
launchModal("modal1");
|
|
|
|
|
cy.notVisible('[data-cy="modal-title"]');
|
|
|
|
|
cy.realPress("Escape");
|
|
|
|
|
|
|
|
|
|
cy.get(commonWidgetSelector.draggableWidget("toggleswitch4"))
|
|
|
|
|
.find(".form-check-input")
|
|
|
|
|
.click();
|
|
|
|
|
launchModal("modal1");
|
|
|
|
|
verifyWidgetColorCss(
|
|
|
|
|
"[data-cy='modal-header']",
|
|
|
|
|
"background-color",
|
|
|
|
|
data.bgColor,
|
|
|
|
|
true
|
2023-04-10 05:47:25 +00:00
|
|
|
);
|
2023-04-12 07:24:54 +00:00
|
|
|
verifyWidgetColorCss(
|
|
|
|
|
"[data-cy='modal-header']",
|
|
|
|
|
"color",
|
|
|
|
|
data.titleColor,
|
|
|
|
|
true
|
2023-04-10 05:47:25 +00:00
|
|
|
);
|
2023-04-12 07:24:54 +00:00
|
|
|
verifyWidgetColorCss(
|
|
|
|
|
"[data-cy='modal-body']",
|
|
|
|
|
"background-color",
|
|
|
|
|
data.bodyColor,
|
|
|
|
|
true
|
2023-04-10 05:47:25 +00:00
|
|
|
);
|
|
|
|
|
|
2023-04-12 07:24:54 +00:00
|
|
|
cy.realPress("Escape");
|
|
|
|
|
verifyWidgetColorCss(
|
|
|
|
|
launchButton("modal1"),
|
|
|
|
|
"color",
|
|
|
|
|
data.buttonTextColor,
|
|
|
|
|
true
|
2023-04-10 05:47:25 +00:00
|
|
|
);
|
2023-04-12 07:24:54 +00:00
|
|
|
verifyWidgetColorCss(
|
|
|
|
|
launchButton("modal1"),
|
|
|
|
|
"background-color",
|
|
|
|
|
data.buttonColor,
|
|
|
|
|
true
|
|
|
|
|
);
|
|
|
|
|
launchModal("modal1");
|
2023-04-10 05:47:25 +00:00
|
|
|
|
2023-04-12 07:24:54 +00:00
|
|
|
cy.get('[data-cy="modal-title"]').verifyVisibleElement(
|
|
|
|
|
"have.text",
|
|
|
|
|
data.customTitle
|
|
|
|
|
);
|
|
|
|
|
cy.realPress("Escape");
|
|
|
|
|
cy.get(commonWidgetSelector.draggableWidget("toggleswitch5"))
|
|
|
|
|
.find(".form-check-input")
|
|
|
|
|
.click();
|
|
|
|
|
launchModal("modal1");
|
2023-07-05 07:28:09 +00:00
|
|
|
cy.wait(1000);
|
2023-04-12 07:24:54 +00:00
|
|
|
cy.notVisible('[data-cy="modal-close-button"]');
|
2023-04-10 05:47:25 +00:00
|
|
|
});
|
2023-05-10 13:06:42 +00:00
|
|
|
|
|
|
|
|
it("should verify csa", () => {
|
|
|
|
|
cy.get('[data-cy="real-canvas"]').click("topRight", { force: true });
|
|
|
|
|
cy.dragAndDropWidget(buttonText.defaultWidgetText, 500, 200);
|
|
|
|
|
selectEvent("On click", "Control Component");
|
|
|
|
|
selectCSA("modal1", "open");
|
|
|
|
|
|
|
|
|
|
cy.get(commonWidgetSelector.draggableWidget("button1")).click();
|
|
|
|
|
cy.get('[data-cy="modal-title"]').verifyVisibleElement(
|
|
|
|
|
"have.text",
|
|
|
|
|
"This title can be changed"
|
|
|
|
|
);
|
|
|
|
|
|
2023-09-12 07:34:44 +00:00
|
|
|
cy.forceClickOnCanvas();
|
2023-05-10 13:06:42 +00:00
|
|
|
cy.dragAndDropWidget("Button", 500, 300, "Button", "[id*=canvas]:eq(2)");
|
|
|
|
|
selectEvent("On click", "Control Component");
|
|
|
|
|
selectCSA("modal1", "close");
|
|
|
|
|
// cy.realPress("Escape");
|
|
|
|
|
cy.get(commonWidgetSelector.draggableWidget("button2")).click();
|
|
|
|
|
cy.notVisible('[data-cy="modal-close-button"]');
|
|
|
|
|
});
|
2023-04-10 05:47:25 +00:00
|
|
|
});
|