feat: Internal property to detect changes in form

-- Fix on the wrong widget name in RichTextEditor_spec.js
-- Replace selectors so that Cypress can interact with UI in Select_spec.js
This commit is contained in:
Paul Li 2022-04-01 04:07:22 +08:00
parent c582ad22da
commit 5bb926d6ed
2 changed files with 13 additions and 8 deletions

View File

@ -132,7 +132,7 @@ describe("RichTextEditor Widget Functionality", function() {
cy.openPropertyPane("textwidget");
cy.updateCodeInput(
".t--property-control-text",
`{{RichTextEditor1.isDirty}}`,
`{{RichtextEditor.isDirty}}`,
);
// Change defaultText
cy.openPropertyPane("richtexteditorwidget");

View File

@ -1,24 +1,29 @@
const explorer = require("../../../../locators/explorerlocators.json");
const commonlocators = require("../../../../locators/commonlocators.json");
const formWidgetsPage = require("../../../../locators/FormWidgets.json");
const widgetLocators = require("../../../../locators/Widgets.json");
const widgetName = "selectwidget";
describe("Select widget", () => {
it("1. DragDrop Select/Text widgets", () => {
it("1. Drag and drop Select/Text widgets", () => {
cy.get(explorer.addWidget).click();
cy.dragAndDropToCanvas(widgetName, { x: 300, y: 300 });
cy.get(`.t--widget-${widgetName}`).should("exist");
cy.dragAndDropToCanvas("textwidget", { x: 300, y: 500 });
});
it("2. Check isDirty meta property", () => {
cy.openPropertyPane("textwidget");
cy.updateCodeInput(".t--property-control-text", `{{Select1.isDirty}}`);
// Check if initial value of isDirty is false
cy.get(".t--widget-textwidget").should("contain", "false");
// Interact with UI
cy.get(
`.t--widget-${widgetName} .bp3-popover-target > div > .bp3-button`,
).click();
cy.get(`.bp3-popover-content ul.bp3-menu li`)
.first()
.click();
cy.get(formWidgetsPage.selectWidget)
.find(widgetLocators.dropdownSingleSelect)
.click({ force: true });
cy.get(commonlocators.singleSelectWidgetMenuItem)
.contains("Blue")
.click({ force: true });
// Check if isDirty is set to true
cy.get(".t--widget-textwidget").should("contain", "true");
// Change defaultOptionValue property