Skip to content

Commit

Permalink
Merge branch 'release' of github.com:appsmithorg/appsmith into chore/…
Browse files Browse the repository at this point in the history
…external-contribution-35363
  • Loading branch information
AmanAgarwal041 committed Sep 30, 2024
2 parents 3584608 + 2090919 commit 5f3b581
Show file tree
Hide file tree
Showing 67 changed files with 2,910 additions and 5,184 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/github-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,14 @@ jobs:
run: |
scripts/generate_info_json.sh
# As pg docker image is continuously updated for each scheduled cron on release, we are using the nightly tag while building the latest tag
- name: Place server artifacts-es
run: |
if [[ -f scripts/prepare_server_artifacts.sh ]]; then
scripts/prepare_server_artifacts.sh
PG_TAG=nightly scripts/prepare_server_artifacts.sh
else
echo "No script found to prepare server artifacts"
exit 1
fi
- name: Login to DockerHub
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/test-build-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,12 @@ jobs:
- name: Place server artifacts-es
run: |
run: |
if [[ -f scripts/prepare_server_artifacts.sh ]]; then
scripts/prepare_server_artifacts.sh
else
echo "No script found to prepare server artifacts"
exit 1
fi
- name: Set up Depot CLI
Expand Down Expand Up @@ -439,6 +443,9 @@ jobs:
run: |
if [[ -f scripts/prepare_server_artifacts.sh ]]; then
scripts/prepare_server_artifacts.sh
else
echo "No script found to prepare server artifacts"
exit 1
fi
- name: Set up Depot CLI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,18 @@ import {
dataSources,
deployMode,
draggableWidgets,
entityExplorer,
gitSync,
homePage,
jsEditor,
locators,
propPane,
table,
} from "../../../../../../support/Objects/ObjectsCore";
import EditorNavigation, {
EntityType,
PageLeftPane,
} from "../../../../../../support/Pages/EditorNavigation";
import PageList from "../../../../../../support/Pages/PageList";

describe(
"Import and validate older app (app created in older versions of Appsmith) from Gitea",
{ tags: ["@tag.Git", "@tag.Sanity"] },
{ tags: ["@tag.Git", "@tag.Sanity", "@tag.TedMigration"] },
function () {
let appRepoName = "TestMigration",
let appRepoName = "TED-migration-test-1",
appName = "UpgradeAppToLatestVersion",
keyId: any,
workspaceName: any;
Expand All @@ -41,68 +35,21 @@ describe(
dataSources.ReconnectDSbyType("MongoDB");
dataSources.ReconnectDSbyType("MySQL");
dataSources.ReconnectDSbyType("PostgreSQL");
agHelper.Sleep(3000); //for CI to reconnect successfully
homePage.AssertNCloseImport();
});

it("1. Validate merge status + Bug23822", () => {
PageLeftPane.assertPresence("ListingAndReviews");
//Wait for the app to settle
agHelper.Sleep(3000);
homePage.RenameApplication(appName);
PageList.assertPresence("ListingAndReviews");

// this logic will have to be removed after decimal issue with auto-commit is resolved
assertHelper.AssertNetworkResponseData("gitStatus");
agHelper.AssertElementExist(gitSync._bottomBarCommit, 0, 30000);
agHelper.AssertText(gitSync._gitPullCount, "text", "4");
agHelper.GetNClick(gitSync._bottomBarCommit);
agHelper.AssertElementVisibility(gitSync._gitSyncModal);

//This is expected due to Canvas Splitting PR changes in v1.9.24
agHelper.GetNAssertContains(
gitSync._gitStatusChanges,
/[0-9] page(|s) modified/,
);

// Commenting it as part of #28012 - to be added back later
// agHelper.GetNAssertElementText(
// gitSync._gitStatusChanges,
// "Application settings modified",
// "not.contain.text",
// );
agHelper.GetNAssertElementText(
gitSync._gitStatusChanges,
"Theme modified",
"not.contain.text",
);
agHelper.AssertContains(/[0-9] quer(y|ies) modified/, "not.exist");

// Commented out due to #25739 - to be fixed by dev later
// agHelper.GetNAssertElementText(
// gitSync._gitStatusChanges,
// "datasource modified",
// "not.contain.text",
// );

agHelper.AssertContains(/[0-9] JS Object(|s) modified/, "not.exist");

// Commenting it as part of #28012 - to be added back later
// agHelper.AssertContains(/[0-9] librar(y|ies) modified/, "not.exist");

// This assertions is commented out due to issue #https://github.com/appsmithorg/appsmith/issues/28563
// Since we don't want this specific message appearing when we are just migrating the metadata,
// this assertion is not required.
// Slack conversation: https://theappsmith.slack.com/archives/C04HERDNZPA/p1698851532418569

// agHelper.GetNAssertElementText(
// gitSync._gitStatusChanges,
// "Some of the changes above are due to an improved file structure designed to reduce merge conflicts. You can safely commit them to your repository.",
// "contain.text",
// );
agHelper.GetNClick(gitSync._commitButton);
assertHelper.AssertNetworkStatus("@commit", 201);
gitSync.CloseGitSyncModal();
});

it("2. Deploy the app & Validate CRUD pages - Mongo , MySql, Postgres pages", () => {
it("1. Deploy the app & Validate CRUD pages - Mongo , MySql, Postgres pages", () => {
//Mongo CRUD page validation
//Assert table data
cy.latestDeployPreview();
Expand All @@ -112,7 +59,7 @@ describe(
"listingAndReviews Data",
);
agHelper.AssertElementVisibility(locators._widgetByName("data_table"));
table.WaitUntilTableLoad(0, 0, "v2");
table.WaitUntilTableLoad(0, 0);

//Filter & validate table data
table.OpenNFilterTable("_id", "is exactly", "15665837");
Expand All @@ -131,7 +78,7 @@ describe(
"countryFlags Data",
);
agHelper.AssertElementVisibility(locators._widgetByName("data_table"));
table.WaitUntilTableLoad(0, 0, "v2");
table.WaitUntilTableLoad(0, 0);

//Filter & validate table data
table.OpenNFilterTable("Country", "starts with", "Ba");
Expand All @@ -152,7 +99,7 @@ describe(
"public_astronauts Data",
);
agHelper.AssertElementVisibility(locators._widgetByName("data_table"));
table.WaitUntilTableLoad(0, 0, "v2");
table.WaitUntilTableLoad(0, 0);

//Filter & validate table data
table.OpenNFilterTable("id", "is exactly", "196");
Expand All @@ -164,10 +111,8 @@ describe(
//Update table data
deployMode.EnterJSONInputValue("Statusid", "5", 0, true);
deployMode.EnterJSONInputValue("Statusname", "Active", 0, true);
agHelper.Sleep(500);
agHelper.ClickButton("Update");
agHelper.Sleep(2000); //for CI update to be successful
table.WaitUntilTableLoad(0, 0, "v1");
table.WaitUntilTableLoad(0, 0);

//Validate updated values in table
table.ReadTableRowColumnData(0, 3).then(($cellData) => {
Expand All @@ -176,10 +121,9 @@ describe(
table.ReadTableRowColumnData(0, 4).then(($cellData) => {
expect($cellData).to.eq("Active");
});
agHelper.Sleep(500);
});

it("3. Validate widgets & bindings", () => {
it("2. Validate widgets & bindings", () => {
agHelper.GetNClickByContains(locators._deployedPage, "Widgets");
agHelper.AssertElementVisibility(
locators._widgetInDeployed(draggableWidgets.AUDIO),
Expand All @@ -194,22 +138,35 @@ describe(
locators._widgetInDeployed(draggableWidgets.CHART),
);

//Button
agHelper.ClickButton("Alert button");
agHelper.Sleep(500);
agHelper.WaitUntilToastDisappear(
"404 hit : invalidApi failed to execute",
);

//Checkbox group
agHelper.AssertElementVisibility(
locators._widgetInDeployed(draggableWidgets.CHECKBOXGROUP),
);
agHelper.GetNAssertElementText(
agHelper.GetNAssertContains(
locators._widgetInDeployed(draggableWidgets.CHECKBOXGROUP),
"Select AstronautUlf MerboldAndreas MogensenWubbo OckelsThomas ReiterAnil Menon",
"have.text",
"Select Astronaut",
);
agHelper.GetNAssertContains(
locators._widgetInDeployed(draggableWidgets.CHECKBOXGROUP),
"Ulf Merbold",
);
agHelper.GetNAssertContains(
locators._widgetInDeployed(draggableWidgets.CHECKBOXGROUP),
"Andreas Mogensen",
);
agHelper.GetNAssertContains(
locators._widgetInDeployed(draggableWidgets.CHECKBOXGROUP),
"Wubbo Ockels",
);
agHelper.GetNAssertContains(
locators._widgetInDeployed(draggableWidgets.CHECKBOXGROUP),
"Thomas Reiter",
);
agHelper.GetNAssertContains(
locators._widgetInDeployed(draggableWidgets.CHECKBOXGROUP),
"Anil Menon",
);

agHelper
.GetElement(locators._checkboxTypeByOption("Ulf Merbold"))
.should("be.checked");
Expand All @@ -219,10 +176,8 @@ describe(
agHelper
.ScrollIntoView(locators._sliderThumb)
.focus()
.type("{rightArrow}")
.wait(500);
.type("{rightArrow}");

agHelper.Sleep(500);
agHelper.WaitUntilToastDisappear("Category Value Changed!");

//Currency input
Expand Down Expand Up @@ -261,51 +216,6 @@ describe(
agHelper.WaitUntilToastDisappear("Delete customer successful!");
agHelper.ClickButton("Close");
agHelper.AssertElementAbsence(locators._modal);
agHelper.Sleep(2000);
});

it.skip("4. Edit JSObject & Check Updated Data ", () => {
deployMode.NavigateBacktoEditor();
//Edit existing JS object
EditorNavigation.SelectEntityByName("users", EntityType.JSObject);
jsEditor.EditJSObj(`export default {
fun: async () => {
return await invalidApi.run().catch((e) => showAlert("404 hit : " + e.message));
},
myFun1: async () => {
//write code here
const data = JSON.stringify(await usersApi.run())
return data
},
myFun2: async () => {
//use async-await or promises
await this.myFun1()
return showAlert("myFun2 Data")
}
}`);

//Update property field for button
EditorNavigation.SelectEntityByName("Button1", EntityType.Widget);
propPane.EnterJSContext("onClick", `{{users.myFun2()}}`, true, false);

//Drag n drop text widget & bind it to myFun1
entityExplorer.DragDropWidgetNVerify(draggableWidgets.TEXT);
propPane.TypeTextIntoField("Text", `{{users.myFun1.data}}`);
agHelper.ValidateToastMessage(
"[users.myFun1] will be executed automatically on page load",
);

//Commit & push new changes
gitSync.CommitAndPush();
cy.latestDeployPreview();

//Validate new response for button & text widget
agHelper.GetNClickByContains(locators._deployedPage, "Widgets");
agHelper.ClickButton("Submit");
agHelper.ValidateToastMessage("myFun2 Data");
agHelper
.GetText(locators._widgetInDeployed(draggableWidgets.TEXT), "text")
.should("not.be.empty");
});

after(() => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
import ReconnectLocators from "../../../../locators/ReconnectLocators";
import { featureFlagIntercept } from "../../../../support/Objects/FeatureFlags";
import {
agHelper,
gitSync,
homePage,
} from "../../../../support/Objects/ObjectsCore";

let wsName: string;
let repoName: string = "TED-testrepo1";
let repoName: string = "TED-autocommit-test-1";

describe(
"Git Autocommit",
{
tags: [
"@tag.Git",
"@tag.GitAutocommit",
"@tag.excludeForAirgap",
"@tag.Sanity",
"@tag.TedMigration",
],
},
function () {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import {
draggableWidgets,
entityExplorer,
propPane,
agHelper,
} from "../../../../../support/Objects/ObjectsCore";

describe(
"Tests for showAlert message with newline characters in the alert message",
{ tags: ["@tag.Widget", "@tag.Button"] },
() => {
before("Login to the app and navigate to the workspace", function () {
entityExplorer.DragDropWidgetNVerify(draggableWidgets.BUTTON);
});

it("Verify showAlert message renders correctly with newline characters", () => {
propPane.EnterJSContext("onClick", "showAlert(`sai\n\nprabhu`)");
agHelper.ClickButton("Submit");
cy.get(".Toastify", { timeout: 1000 }).should(
"have.text",
"sai\n\nprabhu",
);
});
},
);
Loading

0 comments on commit 5f3b581

Please sign in to comment.