Skip to content

Commit

Permalink
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
Browse files Browse the repository at this point in the history
…o fix/block-onpage-load-actions-collision
  • Loading branch information
rahulbarwal committed Apr 30, 2024
2 parents 77170f9 + 796a4c8 commit 6b2c1c8
Show file tree
Hide file tree
Showing 33 changed files with 246 additions and 156 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ describe(
// Edit datasource, change connection string uri param and click on back button
_.dataSources.EditDatasource();

_.agHelper.UpdateInputValue(_.dataSources._host(), "jargons");
_.agHelper.ClearNType(_.dataSources._host(), "jargons");

// Assert that popup is visible
_.dataSources.cancelDSEditAndAssertModalPopUp(true, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,18 @@ describe(
communityForm.preview.name,
);
//Empty name should disable publish
agHelper.UpdateInputValue(communityForm.inputs.name, "");
agHelper.ClearNType(communityForm.inputs.name, "");
communityTemplates.AssertPublishButtonState(true);
//Update name input, updates preview
const testName = "My first template";
agHelper.UpdateInputValue(communityForm.inputs.name, testName);
agHelper.ClearNType(communityForm.inputs.name, testName);
communityTemplates.AssertInputValueToEqualPreviewValue(
communityForm.inputs.name,
communityForm.preview.name,
);
//Update excerpt input, updates preview
const testExcerpt = "Small description of my template";
agHelper.UpdateInputValue(communityForm.inputs.excerpt, testExcerpt);
agHelper.ClearNType(communityForm.inputs.excerpt, testExcerpt);
communityTemplates.AssertInputValueToEqualPreviewValue(
communityForm.inputs.excerpt,
communityForm.preview.excerpt,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ describe(
dataSources.CreatePlugIn("Mongo");
agHelper.RenameWithInPane("myinvalidds", false);

agHelper.UpdateInputValue(dataSources._host(), "127.0.0.1");
agHelper.UpdateInputValue(dataSources._port, "8000");
agHelper.ClearNType(dataSources._host(), "127.0.0.1");
agHelper.ClearNType(dataSources._port, "8000");

dataSources.SaveDatasource();

Expand All @@ -144,8 +144,8 @@ describe(
dataSources.CreatePlugIn("Mongo");
agHelper.RenameWithInPane(`dummy${I}`, false);

agHelper.UpdateInputValue(dataSources._host(), "127.0.0.1");
agHelper.UpdateInputValue(dataSources._port, "8000");
agHelper.ClearNType(dataSources._host(), "127.0.0.1");
agHelper.ClearNType(dataSources._port, "8000");

dataSources.SaveDatasource();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,22 @@ describe(
agHelper.RenameWithInPane(dataSourceName, false);

dataSources.TestDatasource(false);
agHelper.ValidateToastMessage("Missing endpoint.");
agHelper.ValidateToastMessage("Missing username for authentication.");
agHelper.ValidateToastMessage("Missing hostname.");
agHelper.ClearTextField(dataSources._databaseName);
dataSources.TestDatasource(false);
agHelper.ValidateToastMessage("Missing database name.");
agHelper.WaitUntilAllToastsDisappear();
agHelper.UpdateInputValue(
agHelper.ClearNType(
dataSources._host(),
dataManager.dsValues[dataManager.defaultEnviorment].postgres_host,
);
agHelper.UpdateInputValue(
agHelper.ClearNType(
dataSources._databaseName,
dataManager.dsValues[dataManager.defaultEnviorment]
.postgres_databaseName,
);
agHelper.UpdateInputValue(
agHelper.ClearNType(
dataSources._username,
dataManager.dsValues[dataManager.defaultEnviorment].postgres_username,
);
Expand All @@ -58,7 +58,7 @@ describe(
"Disable",
]);
dataSources.ValidateNSelectDropdown("SSL mode", "Default", "Disable");
agHelper.UpdateInputValue(
agHelper.ClearNType(
dataSources._password,
dataManager.dsValues[dataManager.defaultEnviorment].postgres_password,
);
Expand All @@ -81,23 +81,23 @@ describe(
agHelper.RenameWithInPane(dataSourceName, false);

dataSources.TestDatasource(false);
agHelper.ValidateToastMessage("Missing endpoint and url");
agHelper.ValidateToastMessage("Host value cannot be empty");
agHelper.ValidateToastMessage("Missing username for authentication.");
agHelper.ValidateToastMessage("Missing password for authentication.");
agHelper.ClearTextField(dataSources._databaseName);
dataSources.TestDatasource(false);
agHelper.ValidateToastMessage("Missing database name.");
agHelper.WaitUntilAllToastsDisappear();
agHelper.UpdateInputValue(
agHelper.ClearNType(
dataSources._host(),
dataManager.dsValues[dataManager.defaultEnviorment].mysql_host,
);
agHelper.UpdateInputValue(
agHelper.ClearNType(
dataSources._databaseName,
dataManager.dsValues[dataManager.defaultEnviorment]
.mysql_databaseName,
);
agHelper.UpdateInputValue(
agHelper.ClearNType(
dataSources._username,
dataManager.dsValues[dataManager.defaultEnviorment].mysql_username,
);
Expand All @@ -111,7 +111,7 @@ describe(
"Disabled",
]);
dataSources.ValidateNSelectDropdown("SSL mode", "Default", "Required");
agHelper.UpdateInputValue(
agHelper.ClearNType(
dataSources._password,
dataManager.dsValues[dataManager.defaultEnviorment].mysql_password,
);
Expand All @@ -135,7 +135,9 @@ describe(
agHelper.RenameWithInPane(dataSourceName, false);

dataSources.TestDatasource(false);
agHelper.ValidateToastMessage("Missing endpoint(s)");
agHelper.ValidateToastMessage(
"Connection timed out. Please check if the datasource configuration fields have been filled correctly.",
);
dataSources.ValidateNSelectDropdown(
"Use mongo connection string URI",
"No",
Expand All @@ -145,7 +147,7 @@ describe(
agHelper.ValidateToastMessage(
"'Mongo Connection string URI' field is empty. Please edit the 'Mongo Connection URI' field to provide a connection uri to connect with.",
);
agHelper.UpdateInputValue(
agHelper.ClearNType(
locators._inputFieldByName("Connection string URI") + "//input",
dataManager.mongo_uri(dataManager.defaultEnviorment),
);
Expand All @@ -166,12 +168,14 @@ describe(
"Replica set",
);
dataSources.TestDatasource(false);
agHelper.ValidateToastMessage("Missing endpoint(s)");
agHelper.UpdateInputValue(
agHelper.ValidateToastMessage(
"REPLICA_SET connections should not be given a port. If you are trying to specify all the shards, please add more than one.",
);
agHelper.ClearNType(
dataSources._host(),
dataManager.dsValues[dataManager.defaultEnviorment].mongo_host,
);
agHelper.UpdateInputValue(
agHelper.ClearNType(
dataSources._port,
dataManager.dsValues[
dataManager.defaultEnviorment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe("Validate Oracle DS", { tags: ["@tag.Datasource"] }, () => {
});
});

it("1. Tc #2354, #2204 - Oracle placeholder & mandatory mark verification", () => {
it("1. Tc #2354, #2204 - Oracle placeholder, port default value & mandatory mark verification", () => {
dataSources.NavigateToDSCreateNew();
dataSources.CreatePlugIn("Oracle");
agHelper.GetNAssertContains(locators._dsName, "Untitled datasource");
Expand All @@ -45,6 +45,7 @@ describe("Validate Oracle DS", { tags: ["@tag.Datasource"] }, () => {
"placeholder",
"myapp.abcde.oracle.net",
);
agHelper.AssertAttribute(dataSources._port, "value", "1521");
agHelper.AssertAttribute(
dataSources._databaseName,
"placeholder",
Expand All @@ -54,7 +55,7 @@ describe("Validate Oracle DS", { tags: ["@tag.Datasource"] }, () => {
agHelper.AssertAttribute(dataSources._password, "placeholder", "password");
agHelper.AssertElementLength(dataSources._mandatoryMark, 4); //verifyng all 4 fields are mandatory
agHelper.AssertText(dataSources._host(), "val", "");
agHelper.UpdateInputValue(
agHelper.ClearNType(
dataSources._host(),
dataManager.dsValues[dataManager.environments[1]].oracle_host,
);
Expand All @@ -81,23 +82,23 @@ describe("Validate Oracle DS", { tags: ["@tag.Datasource"] }, () => {
agHelper.ValidateToastMessage("Missing authentication details");
agHelper.WaitUntilAllToastsDisappear();

agHelper.UpdateInputValue(
agHelper.ClearNType(
dataSources._host(),
dataManager.dsValues[dataManager.defaultEnviorment].oracle_host,
);
agHelper.UpdateInputValue(
agHelper.ClearNType(
dataSources._databaseName,
dataManager.dsValues[dataManager.defaultEnviorment].oracle_service,
);
dataSources.TestDatasource(false);
agHelper.ValidateToastMessage("Missing username for authentication");
agHelper.ValidateToastMessage("Missing password for authentication");

agHelper.UpdateInputValue(
agHelper.ClearNType(
dataSources._username,
dataManager.dsValues[dataManager.defaultEnviorment].oracle_username,
);
agHelper.UpdateInputValue(
agHelper.ClearNType(
dataSources._password,
dataManager.dsValues[dataManager.defaultEnviorment].oracle_password,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe("Validate Redis DS", { tags: ["@tag.Datasource"] }, () => {
});
});

it("Create HAST set (Multiple key value pair under single key name) in redis DB, Read, Delete", () => {
it("1. Create HAST set (Multiple key value pair under single key name) in redis DB, Read, Delete", () => {
let hSetReceipe = `HSET recipe:1 name "Vegetable Stir Fry" ingredients "2 cups mixed vegetables (broccoli, carrots, bell peppers, mushrooms, snow peas), 2 cloves garlic, minced" instructions "1. Heat vegetable oil in a large skillet over medium-high heat. 2. Add mixed vegetables and garlic to the skillet and cook for 3-4 minutes. 3. In a small bowl, whisk together soy sauce and cornstarch. 4. Pour the soy sauce mixture over the vegetables and stir until the vegetables are coated. 5. Cook for an additional 1-2 minutes. 6. Serve hot." difficulty "easy"`;
let hGetKeys = "HGET recipe:1 name";
let hMGet = "HMGET recipe:1 difficulty name"; // getting multiple keys
Expand Down Expand Up @@ -90,20 +90,19 @@ describe("Validate Redis DS", { tags: ["@tag.Datasource"] }, () => {
dataSources.EnterQuery(hGetKeys);
dataSources.RunQueryNVerifyResponseViews(); //5 keys, 5 values
dataSources.AssertQueryTableResponse(0, "null");
});

after("Delete the query & datasource", () => {
// Delete the query & datasource
agHelper.ActionContextMenuWithInPane({
action: "Delete",
entityType: entityItems.Query,
});
dataSources.DeleteDatasourceFromWithinDS(dsName);
//commenting below since after query delete, we run into risk of not seeing the datasource in EntityExplorer
// EditorNavigation.SelectEntityByName(dsName, EntityType.Datasource);
// entityExplorer.ActionContextMenuByEntityName({
// entityNameinLeftSidebar: dsName,
// action: "Delete",
// entityType: entityItems.Datasource,
// });
});

it("2. Verify the default port for the datasource", function () {
dataSources.NavigateToDSCreateNew();
dataSources.CreatePlugIn("Redis");

agHelper.AssertAttribute(dataSources._port, "value", "6379");
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe(
dataSources.RunQuery({ toValidateResponse: false });
cy.wait(500);
cy.get("[data-testid=t--query-error]").contains(
"[Missing endpoint., Missing username for authentication.]",
"[Missing username for authentication., Missing hostname.]",
);
agHelper.ActionContextMenuWithInPane({
action: "Delete",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,12 @@ describe(
.then(($dbName) => expect($dbName).to.eq("_system"));
dataSources.SaveDSFromDialog(false);
});

it("5. Verify the default port for the datasource", function () {
dataSources.NavigateToDSCreateNew();
dataSources.CreatePlugIn("ArangoDB");

agHelper.AssertAttribute(dataSources._port, "value", "8529");
});
},
);
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const datasource = require("../../../locators/DatasourcesEditor.json");

import { dataSources } from "../../../support/Objects/ObjectsCore";
import { agHelper, dataSources } from "../../../support/Objects/ObjectsCore";

let elasticSearchName;

Expand Down Expand Up @@ -31,5 +31,12 @@ describe(

dataSources.SaveDSFromDialog(false);
});

it("2. Verify the default port for the datasource", function () {
dataSources.NavigateToDSCreateNew();
dataSources.CreatePlugIn("Elasticsearch");

agHelper.AssertAttribute(dataSources._port, "value", "9200");
});
},
);
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,12 @@ describe(
dataSources.DeleteDatasourceFromWithinDS(dsName);
});
});

it("4. Verify the default port for the datasource", function () {
dataSources.NavigateToDSCreateNew();
dataSources.CreatePlugIn("MongoDB");

agHelper.AssertAttribute(dataSources._port, "value", "27017");
});
},
);
13 changes: 10 additions & 3 deletions app/client/cypress/e2e/Sanity/Datasources/MsSQL_Basic_Spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,15 +259,15 @@ describe(
agHelper.ClearTextField(dataSources._databaseName);
dataSources.TestDatasource(false);
agHelper.WaitUntilAllToastsDisappear();
agHelper.UpdateInputValue(
agHelper.ClearNType(
dataSources._host(),
dataManager.dsValues[dataManager.defaultEnviorment].mssql_host,
);
agHelper.UpdateInputValue(
agHelper.ClearNType(
dataSources._username,
dataManager.dsValues[dataManager.defaultEnviorment].mssql_username,
);
agHelper.UpdateInputValue(
agHelper.ClearNType(
dataSources._password,
dataManager.dsValues[dataManager.defaultEnviorment].mssql_password,
);
Expand Down Expand Up @@ -343,6 +343,13 @@ describe(
table.WaitUntilTableLoad();
});

it("7. Verify the default port for the datasource", function () {
dataSources.NavigateToDSCreateNew();
dataSources.CreatePlugIn("Microsoft SQL Server");

agHelper.AssertAttribute(dataSources._port, "value", "1433");
});

after("Verify Deletion of the datasource", () => {
cy.intercept("DELETE", "/api/v1/datasources/*").as("deleteDatasource"); //Since intercept from before is not working
dataSources.DeleteDatasourceFromWithinDS(dsName, 409); //since CRUD pages are still active
Expand Down
7 changes: 7 additions & 0 deletions app/client/cypress/e2e/Sanity/Datasources/MySQL_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,12 @@ describe(
cy.deleteQueryUsingContext();
cy.deleteDatasource(datasourceName);
});

it("4. Verify the default port for the datasource", function () {
dataSources.NavigateToDSCreateNew();
dataSources.CreatePlugIn("MySQL");

agHelper.AssertAttribute(dataSources._port, "value", "3306");
});
},
);
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,12 @@ describe(
cy.deleteQueryUsingContext();
cy.deleteDatasource(datasourceName);
});

it("4. Verify the default port for the datasource", function () {
dataSources.NavigateToDSCreateNew();
dataSources.CreatePlugIn("PostgreSQL");

agHelper.AssertAttribute(dataSources._port, "value", "5432");
});
},
);
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const datasource = require("../../../locators/DatasourcesEditor.json");
let datasourceName;
import { agHelper, dataSources } from "../../../support/Objects/ObjectsCore";
import { ObjectsRegistry } from "../../../support/Objects/Registry";

describe(
Expand Down Expand Up @@ -49,5 +50,12 @@ describe(
cy.deleteQueryUsingContext();
cy.deleteDatasource(datasourceName);
});

it("4. Verify the default port for the datasource", function () {
dataSources.NavigateToDSCreateNew();
dataSources.CreatePlugIn("Redshift");

agHelper.AssertAttribute(dataSources._port, "value", "5439");
});
},
);

0 comments on commit 6b2c1c8

Please sign in to comment.