Skip to content

Commit

Permalink
Merge pull request #33916 from appsmithorg/release
Browse files Browse the repository at this point in the history
03/06 Daily Promotion
  • Loading branch information
trishaanand authored Jun 3, 2024
2 parents 5725521 + 5da37f1 commit 9fd3b85
Show file tree
Hide file tree
Showing 281 changed files with 3,541 additions and 3,128 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rts-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ jobs:
# Run the Jest tests only if the workflow has been invoked in a PR
- name: Run the jest tests
if: steps.run_result.outputs.run_result != 'success' && inputs.pr != 0 && inputs.skip-tests != 'true'
if: steps.run_result.outputs.run_result != 'success' && inputs.skip-tests != 'true'
run: yarn run test:unit

- name: Build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scripts/test-tag-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function parseTags({core, context}) {

// "/test" matcher.
const allTags = require(process.env.GITHUB_WORKSPACE + "/app/client/cypress/tags.js").Tag;
const config = body.match(/^\**\/test\s+(.*)\**$/m)?.[1] ?? "";
const config = body.match(/^\**\/test\s+(.+?)\**$/m)?.[1] ?? "";
const concreteTags = [];

if (config.toLowerCase() === "all") {
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/server-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ jobs:
- name: Conditionally start PostgreSQL
run: |
if [[ inputs.is-pg-build == 'true' ]]; then
docker run --name appsmith-pg -p 5432:5432 -d -e POSTGRES_PASSWORD=password postgres:alpine
docker run --name appsmith-pg -p 5432:5432 -d -e POSTGRES_PASSWORD=password postgres:alpine postgres -N 1500
fi
# Retrieve maven dependencies from cache. After a successful run, these dependencies are cached again
Expand Down
18 changes: 15 additions & 3 deletions .github/workflows/test-build-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -264,12 +264,24 @@ jobs:

- name: Return status for ui-matrix
run: |
if [[ "${{ needs.ci-test.result }}" == "success" ]]; then
echo "Integration tests completed successfully!";
if [[ "${{ needs.ci-test.result }}" == "success" && "${{ needs.client-unit-tests.result }}" == "success" && "${{ needs.server-unit-tests.result }}" == "success" ]]; then
echo "Integration, Client unit and Server unit tests completed successfully!";
exit 0;
elif [[ "${{ needs.ci-test.result }}" == "skipped" ]]; then
echo "Integration tests were skipped";
exit 1;
elif [[ "${{ needs.client-unit-tests.result }}" == "skipped" ]]; then
echo "Client unit tests were skipped";
exit 1;
elif [[ "${{ needs.server-unit-tests.result }}" == "skipped" ]]; then
echo "Server unit tests were skipped";
exit 1;
elif [[ "${{ needs.client-unit-tests.result }}" == "failure" ]]; then
echo "Client unit tests have failed";
exit 1;
elif [[ "${{ needs.server-unit-tests.result }}" == "failure" ]]; then
echo "Server unit tests have failed";
exit 1;
else
echo "Integration tests have failed";
exit 1;
Expand Down Expand Up @@ -426,7 +438,7 @@ jobs:
${{ vars.DOCKER_HUB_ORGANIZATION }}/appsmith-${{ vars.EDITION }}:nightly
notify-slack-for-promotion:
needs: ci-test
needs: ci-test-result
runs-on: ubuntu-latest

if: ( failure() && github.ref == 'refs/heads/master' )
Expand Down
9 changes: 7 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,16 @@ ENV APPSMITH_CLOUD_SERVICES_BASE_URL=${APPSMITH_CLOUD_SERVICES_BASE_URL}

ARG APPSMITH_SEGMENT_CE_KEY
ENV APPSMITH_SEGMENT_CE_KEY=${APPSMITH_SEGMENT_CE_KEY}
#Create the plugins directory
RUN mkdir -p ./editor ./rts ./backend/plugins

COPY deploy/docker/fs /

RUN <<END
mkdir -p ./editor ./rts ./backend/plugins

# Ensure all *.sh scripts are executable.
find . -name node_modules -prune -or -type f -name '*.sh' -print -exec chmod +x '{}' ';'
END

#Add the jar to the container
COPY ${JAR_FILE} backend/server.jar
COPY ${PLUGIN_JARS} backend/plugins/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ import {
dataSources,
assertHelper,
} from "../../../support/Objects/ObjectsCore";
import {
createMessage,
IMPORT_APP_SUCCESSFUL,
} from "../../../../src/ce/constants/messages";

describe(
"Import, Export and Fork application and validate data binding",
Expand Down Expand Up @@ -40,7 +36,7 @@ describe(
} else {
cy.get(homePageLocatores.toastMessage).should(
"contain",
createMessage(IMPORT_APP_SUCCESSFUL),
Cypress.env("MESSAGES").IMPORT_APP_SUCCESSFUL(),
);
}
agHelper.GenerateUUID();
Expand Down Expand Up @@ -136,7 +132,7 @@ describe(
} else {
cy.get(homePageLocatores.toastMessage).should(
"contain",
createMessage(IMPORT_APP_SUCCESSFUL),
Cypress.env("MESSAGES").IMPORT_APP_SUCCESSFUL(),
);
}
const importedApp = interception.response.body.data.application;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
anvilLayout,
} from "../../../../support/Objects/ObjectsCore";
import { featureFlagIntercept } from "../../../../support/Objects/FeatureFlags";
import { anvilLocators } from "../../../../support/Pages/Anvil/Locators";

describe(
`${ANVIL_EDITOR_TEST}: Validating multiple widgets in anvil layout mode with App navigation settings`,
Expand All @@ -23,21 +24,36 @@ describe(
agHelper.PressDelete();
});
it("1. Change App navigation settings and valdiate the layout settings", () => {
anvilLayout.DragDropAnvilWidgetNVerify(WIDGET.WDSINPUT, 5, 20, {
skipWidgetSearch: true,
});
anvilLayout.DragDropAnvilWidgetNVerify(WIDGET.WDSINPUT, 5, 20, {
skipWidgetSearch: true,
dropTargetDetails: {
name: "Zone1",
anvilLayout.dnd.DragDropNewAnvilWidgetNVerify(
anvilLocators.WDSINPUT,
5,
20,
{
skipWidgetSearch: true,
},
});
anvilLayout.DragDropAnvilWidgetNVerify(WIDGET.WDSBUTTON, 5, 20, {
skipWidgetSearch: true,
dropTargetDetails: {
name: "Zone1",
);
anvilLayout.dnd.DragDropNewAnvilWidgetNVerify(
anvilLocators.WDSINPUT,
5,
20,
{
skipWidgetSearch: true,
dropTargetDetails: {
name: "Zone1",
},
},
});
);
anvilLayout.dnd.DragDropNewAnvilWidgetNVerify(
anvilLocators.WDSBUTTON,
5,
20,
{
skipWidgetSearch: true,
dropTargetDetails: {
name: "Zone1",
},
},
);
propPane.NavigateToPage("Page1", "onClick");
appSettings.OpenAppSettings();
agHelper.GetNClick(appSettings.locators._navigationSettingsTab);
Expand All @@ -58,10 +74,10 @@ describe(
agHelper.AssertElementExist(appSettings.locators._sideNavbar);
agHelper.GetNClick(locators._canvas);
agHelper.AssertElementExist(
locators._anvilWidgetInCanvas(WIDGET.WDSINPUT),
anvilLocators.anvilWidgetTypeSelector(anvilLocators.WDSINPUT),
);
agHelper.AssertElementExist(
locators._anvilWidgetInCanvas(WIDGET.WDSINPUT),
anvilLocators.anvilWidgetTypeSelector(anvilLocators.WDSINPUT),
1,
);
});
Expand Down
171 changes: 119 additions & 52 deletions app/client/cypress/e2e/Regression/ClientSide/Anvil/AnvilDnD_spec.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
import { MAIN_CONTAINER_WIDGET_ID } from "../../../../../src/constants/WidgetConstants";
import { WIDGET } from "../../../../locators/WidgetLocators";
import {
agHelper,
anvilLayout,
locators,
} from "../../../../support/Objects/ObjectsCore";
import { getAnvilCanvasId } from "../../../../../src/layoutSystems/anvil/viewer/canvas/utils";
import { ANVIL_EDITOR_TEST } from "../../../../support/Constants";
import { agHelper, anvilLayout } from "../../../../support/Objects/ObjectsCore";
import { ANVIL_EDITOR_TEST, modifierKey } from "../../../../support/Constants";
import { featureFlagIntercept } from "../../../../support/Objects/FeatureFlags";
import { anvilLocators } from "../../../../support/Pages/Anvil/Locators";

describe(
`${ANVIL_EDITOR_TEST}: Anvil tests for DnD Module`,
{ tags: ["@tag.Anvil"] },
() => {
beforeEach(() => {
before(() => {
// intercept features call for Anvil + WDS tests
featureFlagIntercept({
release_anvil_enabled: true,
Expand All @@ -22,51 +16,124 @@ describe(
agHelper.SelectAllWidgets();
agHelper.PressDelete();
});
it("1. Drag and Drop widget onto Empty Canvas", () => {
const mainCanvasId = `#${getAnvilCanvasId(MAIN_CONTAINER_WIDGET_ID)}`;
agHelper.AssertElementExist(mainCanvasId).then((mainCanvas) => {
const x = mainCanvas.position().left;
const y = mainCanvas.position().top;
const width = mainCanvas.width() || 0;
const paddingBetweenZoneAndMainCanvas = 35;
// start align
anvilLayout.DragDropAnvilWidgetNVerify(
WIDGET.WDSBUTTON,
x + 10,
y + paddingBetweenZoneAndMainCanvas * 0.5,
{
skipWidgetSearch: true,
},
);
// center align
anvilLayout.DragDropAnvilWidgetNVerify(
WIDGET.WDSBUTTON,
x + (width - 2 * paddingBetweenZoneAndMainCanvas) / 2,
y + paddingBetweenZoneAndMainCanvas * 0.5,
{
skipWidgetSearch: true,
dropTargetDetails: {
name: "Zone1",
},
it("1. Verify dragging and dropping a widget into an empty area to create a new section", () => {
anvilLayout.dnd.DragDropNewAnvilWidgetNVerify(
anvilLocators.WDSBUTTON,
10,
10,
{
skipWidgetSearch: true,
},
);
// section and zone for the widget should be created
agHelper.AssertElementLength(
anvilLocators.anvilWidgetTypeSelector(anvilLocators.ZONE),
1,
);
agHelper.AssertElementLength(
anvilLocators.anvilWidgetTypeSelector(anvilLocators.SECTION),
1,
);
anvilLayout.verifyParentChildRelationship("Zone1", "Button1");
anvilLayout.verifyParentChildRelationship("Section1", "Zone1");
});

it("2. Verify dragging and dropping a widget into an existing section", () => {
agHelper.AssertElementLength(
anvilLocators.anvilWidgetTypeSelector(anvilLocators.ZONE),
1,
);
anvilLayout.dnd.DragDropNewAnvilWidgetNVerify(
anvilLocators.WDSBUTTON,
10,
10,
{
skipWidgetSearch: true,
dropTargetDetails: {
name: "Section1",
},
);
// end align
anvilLayout.DragDropAnvilWidgetNVerify(
WIDGET.WDSBUTTON,
x + (width - 2 * paddingBetweenZoneAndMainCanvas),
y + paddingBetweenZoneAndMainCanvas * 0.5,
{
skipWidgetSearch: true,
dropTargetDetails: {
name: "Zone1",
},
},
);
agHelper.AssertElementLength(
anvilLocators.anvilWidgetTypeSelector(anvilLocators.SECTION),
1,
);
// zone count has to increase
agHelper.AssertElementLength(
anvilLocators.anvilWidgetTypeSelector(anvilLocators.ZONE),
2,
);
anvilLayout.verifyParentChildRelationship("Section1", "Zone2");
});
it("3. Verify dragging and dropping a widget into an existing zone", () => {
anvilLayout.dnd.DragDropNewAnvilWidgetNVerify(
anvilLocators.WDSBUTTON,
10,
10,
{
skipWidgetSearch: true,
dropTargetDetails: {
name: "Zone1",
},
);
agHelper.AssertElementLength(
locators._anvilWidgetInCanvas(WIDGET.WDSBUTTON),
3,
);
},
);
agHelper.AssertElementLength(
anvilLocators.anvilWidgetTypeSelector(anvilLocators.ZONE),
2,
);
anvilLayout.verifyParentChildRelationship("Zone1", "Button3");
});
it("4. Verify moving a widget from one section to another", () => {
anvilLayout.dnd.DragDropNewAnvilWidgetNVerify(
anvilLocators.WDSBUTTON,
50,
360,
{
skipWidgetSearch: true,
},
);
anvilLayout.verifyParentChildRelationship("Section2", "Zone3");
anvilLayout.verifyParentChildRelationship("Zone3", "Button4");
anvilLayout.dnd.MoveAnvilWidget("Button1", 10, 10, {
dropTargetDetails: {
name: "Section2",
},
});
anvilLayout.verifyParentChildRelationship("Zone4", "Button1");
});
it("5. Verify moving a widget from one zone to another within the same section", () => {
anvilLayout.verifyParentChildRelationship("Section2", "Zone4");
anvilLayout.verifyParentChildRelationship("Zone4", "Button1");
anvilLayout.dnd.MoveAnvilWidget("Button1", 10, 10, {
dropTargetDetails: {
name: "Zone3",
},
});
anvilLayout.verifyParentChildRelationship("Zone3", "Button1");
anvilLayout.verifyParentChildRelationship("Section2", "Zone3");
});
it("6. Verify dragging and dropping multiple widgets simultaneously", () => {
agHelper.GetNClick(anvilLocators.anvilWidgetNameSelector("Button1"));
agHelper.GetNClick(
anvilLocators.anvilWidgetNameSelector("Button4"),
0,
false,
500,
true,
);
anvilLayout.dnd.MoveAnvilWidget("Button4", 10, 10, {
dropTargetDetails: {
name: "Zone4",
},
});
anvilLayout.verifyParentChildRelationship("Zone4", "Button4");
anvilLayout.verifyParentChildRelationship("Zone4", "Button1");
});
it("7. Verify undo/redo functionality after drag and drop", () => {
// Undo
cy.get("body").type(`{${modifierKey}+z}`);
anvilLayout.verifyParentChildRelationship("Zone3", "Button4");
anvilLayout.verifyParentChildRelationship("Zone3", "Button1");
});
},
);
Loading

0 comments on commit 9fd3b85

Please sign in to comment.