Skip to content

Commit

Permalink
fix: failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Tooluloope committed Jun 20, 2022
1 parent 2c6054f commit 7ab05c4
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 86 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,37 +31,7 @@ describe("MultiSelect Widget Functionality", function() {
.first()
.should("have.text", "Option 3");
});
it("Selects value with enter in default value", () => {
cy.testJsontext(
"defaultvalue",
'[\n {\n "label": "Option 3",\n "value": "3"\n }\n]',
);
cy.get(formWidgetsPage.multiselectwidgetv2)
.find(".rc-select-selection-item-content")
.first()
.should("have.text", "Option 3");
});
it("Dropdown Functionality To Validate Options", function() {
cy.get(".rc-select-selector").click({ force: true });
cy.dropdownMultiSelectDynamic("Option 2");
});
it("Dropdown Functionality To Unchecked Visible Widget", function() {
cy.togglebarDisable(commonlocators.visibleCheckbox);
cy.PublishtheApp();
cy.get(publish.multiselectwidgetv2 + " " + ".rc-select-selector").should(
"not.exist",
);
cy.get(publish.backToEditor).click();
});
it("Dropdown Functionality To Check Visible Widget", function() {
cy.openPropertyPane("multiselectwidgetv2");
cy.togglebar(commonlocators.visibleCheckbox);
cy.PublishtheApp();
cy.get(publish.multiselectwidgetv2 + " " + ".rc-select-selector").should(
"be.visible",
);
cy.get(publish.backToEditor).click();
});

it("Dropdown Functionality To Check Allow select all option", function() {
// select all option is not enable
cy.get(formWidgetsPage.multiselectwidgetv2)
Expand Down Expand Up @@ -114,6 +84,37 @@ describe("MultiSelect Widget Functionality", function() {
// Check if isDirty is set to false
cy.get(".t--widget-textwidget").should("contain", "false");
});
it("Selects value with enter in default value", () => {
cy.testJsontext(
"defaultvalue",
'[\n {\n "label": "Option 3",\n "value": "3"\n }\n]',
);
cy.get(formWidgetsPage.multiselectwidgetv2)
.find(".rc-select-selection-item-content")
.first()
.should("have.text", "Option 3");
});
it("Dropdown Functionality To Validate Options", function() {
cy.get(".rc-select-selector").click({ force: true });
cy.dropdownMultiSelectDynamic("Option 2");
});
it("Dropdown Functionality To Unchecked Visible Widget", function() {
cy.togglebarDisable(commonlocators.visibleCheckbox);
cy.PublishtheApp();
cy.get(publish.multiselectwidgetv2 + " " + ".rc-select-selector").should(
"not.exist",
);
cy.get(publish.backToEditor).click();
});
it("Dropdown Functionality To Check Visible Widget", function() {
cy.openPropertyPane("multiselectwidgetv2");
cy.togglebar(commonlocators.visibleCheckbox);
cy.PublishtheApp();
cy.get(publish.multiselectwidgetv2 + " " + ".rc-select-selector").should(
"be.visible",
);
cy.get(publish.backToEditor).click();
});
});
afterEach(() => {
// put your clean up code if any
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,32 @@ describe("MultiSelectTree Widget Functionality", function() {
cy.addDsl(dsl);
});

it("Check isDirty meta property", function() {
cy.get(explorer.addWidget).click();
cy.dragAndDropToCanvas("textwidget", { x: 300, y: 500 });
cy.openPropertyPane("textwidget");
cy.updateCodeInput(
".t--property-control-text",
`{{MultiSelectTree1.isDirty}}`,
);
// Change defaultValue
cy.openPropertyPane("multiselecttreewidget");
cy.testJsontext("defaultvalue", "GREEN\n");
// Check if isDirty is set to false
cy.get(".t--widget-textwidget").should("contain", "false");
// Interact with UI
cy.get(formWidgetsPage.treeSelectInput)
.first()
.click({ force: true });
cy.treeMultiSelectDropdown("Red");
// Check if isDirty is set to true
cy.get(".t--widget-textwidget").should("contain", "true");
// Reset isDirty by changing defaultValue
cy.testJsontext("defaultvalue", "BLUE\n");
// Check if isDirty is set to false
cy.get(".t--widget-textwidget").should("contain", "false");
});

it("Selects value with enter in default value", () => {
cy.openPropertyPane("multiselecttreewidget");
cy.testJsontext("defaultvalue", "RED\n");
Expand Down Expand Up @@ -43,32 +69,6 @@ describe("MultiSelectTree Widget Functionality", function() {
).should("be.visible");
cy.get(publish.backToEditor).click();
});

it("Check isDirty meta property", function() {
cy.get(explorer.addWidget).click();
cy.dragAndDropToCanvas("textwidget", { x: 300, y: 500 });
cy.openPropertyPane("textwidget");
cy.updateCodeInput(
".t--property-control-text",
`{{MultiSelectTree1.isDirty}}`,
);
// Change defaultValue
cy.openPropertyPane("multiselecttreewidget");
cy.testJsontext("defaultvalue", "GREEN\n");
// Check if isDirty is set to false
cy.get(".t--widget-textwidget").should("contain", "false");
// Interact with UI
cy.get(formWidgetsPage.treeSelectInput)
.first()
.click({ force: true });
cy.treeMultiSelectDropdown("Red");
// Check if isDirty is set to true
cy.get(".t--widget-textwidget").should("contain", "true");
// Reset isDirty by changing defaultValue
cy.testJsontext("defaultvalue", "BLUE\n");
// Check if isDirty is set to false
cy.get(".t--widget-textwidget").should("contain", "false");
});
});
afterEach(() => {
// put your clean up code if any
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,34 @@ describe("Single Select Widget Functionality", function() {
before(() => {
cy.addDsl(dsl);
});

it("Check isDirty meta property", function() {
cy.openPropertyPane("textwidget");
cy.updateCodeInput(
".t--property-control-text",
`{{SingleSelectTree1.isDirty}}`,
);
// Change defaultText
cy.openPropertyPane("singleselecttreewidget");
cy.updateCodeInput(".t--property-control-defaultvalue", "GREEN");
// Check if isDirty is reset to false
cy.get(".t--widget-textwidget").should("contain", "false");
// Interact with UI
cy.get(formWidgetsPage.treeSelectInput)
.last()
.click({ force: true });
cy.get(formWidgetsPage.treeSelectFilterInput)
.click()
.type("light");
cy.treeSelectDropdown("Light Blue");
// Check if isDirty is set to true
cy.get(".t--widget-textwidget").should("contain", "true");
// Change defaultText
cy.openPropertyPane("singleselecttreewidget");
cy.updateCodeInput(".t--property-control-defaultvalue", "RED");
// Check if isDirty is reset to false
cy.get(".t--widget-textwidget").should("contain", "false");
});
it("Selects value with enter in default value", () => {
cy.openPropertyPane("singleselecttreewidget");
cy.testJsontext("defaultvalue", "RED\n");
Expand Down Expand Up @@ -41,35 +69,6 @@ describe("Single Select Widget Functionality", function() {
).should("be.visible");
cy.get(publish.backToEditor).click();
});

it("Check isDirty meta property", function() {
cy.openPropertyPane("textwidget");
cy.updateCodeInput(
".t--property-control-text",
`{{SingleSelectTree1.isDirty}}`,
);
// Change defaultText
cy.openPropertyPane("singleselecttreewidget");
cy.updateCodeInput(".t--property-control-defaultvalue", "GREEN");
cy.closePropertyPane();
// Check if isDirty is reset to false
cy.get(".t--widget-textwidget").should("contain", "false");
// Interact with UI
cy.get(formWidgetsPage.treeSelectInput)
.last()
.click({ force: true });
cy.get(formWidgetsPage.treeSelectFilterInput)
.click()
.type("light");
cy.treeSelectDropdown("Light Blue");
// Check if isDirty is set to true
cy.get(".t--widget-textwidget").should("contain", "true");
// Change defaultText
cy.openPropertyPane("singleselecttreewidget");
cy.updateCodeInput(".t--property-control-defaultvalue", "RED");
// Check if isDirty is reset to false
cy.get(".t--widget-textwidget").should("contain", "false");
});
});
afterEach(() => {
// put your clean up code if any
Expand Down

0 comments on commit 7ab05c4

Please sign in to comment.