Merge branch 'release' of https://github.com/appsmithorg/appsmith into release
This commit is contained in:
commit
c3703edba4
|
|
@ -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}}");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
@ -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}}");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
@ -65,5 +65,9 @@
|
||||||
"saveStatusSuccess": ".t--save-status-success",
|
"saveStatusSuccess": ".t--save-status-success",
|
||||||
"saveStatusError": ".t--save-status-error",
|
"saveStatusError": ".t--save-status-error",
|
||||||
"tableNextPage": ".t--table-widget-next-page",
|
"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"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -68,6 +68,7 @@ const ToastComponent = (props: Props) => {
|
||||||
<ToastMessage>{props.message}</ToastMessage>
|
<ToastMessage>{props.message}</ToastMessage>
|
||||||
{props.action && (
|
{props.action && (
|
||||||
<ToastAction
|
<ToastAction
|
||||||
|
className="t--toast-action"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
dispatch(props.action?.dispatchableAction);
|
dispatch(props.action?.dispatchableAction);
|
||||||
props.closeToast && props.closeToast();
|
props.closeToast && props.closeToast();
|
||||||
|
|
|
||||||
|
|
@ -125,6 +125,7 @@ const PropertyPaneTitle = memo((props: PropertyPaneTitleProps) => {
|
||||||
hoverOpenDelay={200}
|
hoverOpenDelay={200}
|
||||||
>
|
>
|
||||||
<CopyIcon
|
<CopyIcon
|
||||||
|
className="t--copy-widget"
|
||||||
width={14}
|
width={14}
|
||||||
height={14}
|
height={14}
|
||||||
color={theme.colors.paneSectionLabel}
|
color={theme.colors.paneSectionLabel}
|
||||||
|
|
@ -137,6 +138,7 @@ const PropertyPaneTitle = memo((props: PropertyPaneTitleProps) => {
|
||||||
hoverOpenDelay={200}
|
hoverOpenDelay={200}
|
||||||
>
|
>
|
||||||
<DeleteIcon
|
<DeleteIcon
|
||||||
|
className="t--delete-widget"
|
||||||
width={16}
|
width={16}
|
||||||
height={16}
|
height={16}
|
||||||
color={theme.colors.paneSectionLabel}
|
color={theme.colors.paneSectionLabel}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user