Merge branch 'release' of https://github.com/appsmithorg/appsmith into release

This commit is contained in:
Automated Github Action 2020-09-21 06:07:35 +00:00
commit c3703edba4
5 changed files with 128 additions and 1 deletions

View File

@ -0,0 +1,65 @@
const testdata = require("../../../fixtures/testdata.json");
const apiwidget = require("../../../locators/apiWidgetslocator.json");
const explorer = require("../../../locators/explorerlocators.json");
const commonlocators = require("../../../locators/commonlocators.json");
const formWidgetsPage = require("../../../locators/FormWidgets.json");
const publish = require("../../../locators/publishWidgetspage.json");
const pageid = "MyPage";
describe("Test Suite to validate copy/delete/undo functionalites", function() {
it("Drag and drop form widget and validate copy widget via toast message", function() {
cy.log("Login Successful");
cy.get(explorer.addWidget).click();
cy.get(commonlocators.entityExplorersearch).should("be.visible");
cy.get(commonlocators.entityExplorersearch)
.clear()
.type("form");
cy.dragAndDropToCanvas("formwidget");
cy.widgetText(
"FormTest",
formWidgetsPage.formWidget,
formWidgetsPage.formInner,
);
cy.get(commonlocators.copyWidget).click();
cy.wait(500);
cy.get(commonlocators.toastBody)
.first()
.contains("Copied");
cy.get(commonlocators.editPropCrossButton).click();
cy.get(explorer.closeWidgets).click();
});
it("Delete Widget from sidebar and Undo action validation", function() {
cy.GlobalSearchEntity("FormTest");
cy.get(apiwidget.propertyList).then(function($lis) {
expect($lis).to.have.length(2);
expect($lis.eq(0)).to.contain("{{FormTest.isVisible}}");
expect($lis.eq(1)).to.contain("{{FormTest.data}}");
});
cy.DeleteWidgetFromSideBar();
cy.wait(500);
cy.get(apiwidget.propertyList).should("not.be.visible");
/*
To be enabled once widget delete click works
cy.get('.t--delete-widget')
.trigger("mouseover")
.click({ force: true });
*/
cy.get(commonlocators.toastAction).should("be.visible");
cy.get(commonlocators.toastAction)
.contains("UNDO")
.click({ force: true });
cy.wait("@updateLayout").should(
"have.nested.property",
"response.body.responseMeta.status",
200,
);
cy.wait(500);
cy.get(apiwidget.propertyList).then(function($lis) {
expect($lis).to.have.length(2);
expect($lis.eq(0)).to.contain("{{FormTest.isVisible}}");
expect($lis.eq(1)).to.contain("{{FormTest.data}}");
});
});
});

View File

@ -0,0 +1,55 @@
const testdata = require("../../../fixtures/testdata.json");
const apiwidget = require("../../../locators/apiWidgetslocator.json");
const explorer = require("../../../locators/explorerlocators.json");
const commonlocators = require("../../../locators/commonlocators.json");
const formWidgetsPage = require("../../../locators/FormWidgets.json");
const publish = require("../../../locators/publishWidgetspage.json");
const widgetsPage = require("../../../locators/Widgets.json");
const pageid = "MyPage";
describe("Test Suite to validate copy/delete/undo functionalites", function() {
it("Drag and drop form widget and validate copy widget via toast message", function() {
cy.log("Login Successful");
cy.get(explorer.addWidget).click();
cy.get(commonlocators.entityExplorersearch).should("be.visible");
cy.get(commonlocators.entityExplorersearch)
.clear()
.type("form");
cy.dragAndDropToCanvas("formwidget");
cy.widgetText(
"FormTest",
formWidgetsPage.formWidget,
formWidgetsPage.formInner,
);
cy.get("body").click();
cy.get("body").type("{meta}c");
cy.wait(500);
cy.get(commonlocators.toastBody)
.first()
.contains("Copied");
cy.get("body").type("{meta}v", { force: true });
cy.wait("@updateLayout").should(
"have.nested.property",
"response.body.responseMeta.status",
200,
);
cy.get("body").type("{del}", { force: true });
cy.wait("@updateLayout").should(
"have.nested.property",
"response.body.responseMeta.status",
200,
);
cy.get(commonlocators.toastAction).should("be.visible");
cy.get(commonlocators.toastAction)
.contains("UNDO")
.click({ force: true });
cy.get(explorer.closeWidgets).click();
cy.GlobalSearchEntity("Form1");
cy.get(apiwidget.propertyList).then(function($lis) {
expect($lis).to.have.length(2);
expect($lis.eq(0)).to.contain("{{Form1.isVisible}}");
expect($lis.eq(1)).to.contain("{{Form1.data}}");
});
});
});

View File

@ -65,5 +65,9 @@
"saveStatusSuccess": ".t--save-status-success",
"saveStatusError": ".t--save-status-error",
"tableNextPage": ".t--table-widget-next-page",
"tablePrevPage": ".t--table-widget-prev-page"
"tablePrevPage": ".t--table-widget-prev-page",
"copyWidget": ".t--copy-widget",
"deleteWidget": ".t--delete-widget",
"toastAction": ".t--toast-action",
"toastBody":".Toastify__toast-body"
}

View File

@ -68,6 +68,7 @@ const ToastComponent = (props: Props) => {
<ToastMessage>{props.message}</ToastMessage>
{props.action && (
<ToastAction
className="t--toast-action"
onClick={() => {
dispatch(props.action?.dispatchableAction);
props.closeToast && props.closeToast();

View File

@ -125,6 +125,7 @@ const PropertyPaneTitle = memo((props: PropertyPaneTitleProps) => {
hoverOpenDelay={200}
>
<CopyIcon
className="t--copy-widget"
width={14}
height={14}
color={theme.colors.paneSectionLabel}
@ -137,6 +138,7 @@ const PropertyPaneTitle = memo((props: PropertyPaneTitleProps) => {
hoverOpenDelay={200}
>
<DeleteIcon
className="t--delete-widget"
width={16}
height={16}
color={theme.colors.paneSectionLabel}