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

This commit is contained in:
Automated Github Action 2020-08-24 07:05:44 +00:00
commit 2050d455f5
2 changed files with 18 additions and 19 deletions

View File

@ -1,11 +1,6 @@
const commonlocators = require("../../../locators/commonlocators.json");
const dsl = require("../../../fixtures/commondsl.json");
const widgetsPage = require("../../../locators/Widgets.json");
const testdata = require("../../../fixtures/testdata.json");
const pages = require("../../../locators/Pages.json");
const dsl = require("../../../fixtures/displayWidgetDsl.json");
const apiwidget = require("../../../locators/apiWidgetslocator.json");
const explorer = require("../../../locators/explorerlocators.json");
const pageid = "MyPage";
describe("Entity explorer tests related to widgets and validation", function() {
beforeEach(() => {
@ -13,31 +8,26 @@ describe("Entity explorer tests related to widgets and validation", function() {
});
it("Widget edit/delete/copy to clipboard validation", function() {
cy.openPropertyPane("textwidget");
cy.widgetText("Api", widgetsPage.textWidget, widgetsPage.textInputval);
cy.testCodeMirror("/api/users/2");
cy.NavigateToEntityExplorer();
cy.wait(5000);
cy.SearchEntityandOpen("Api");
cy.SearchEntityandOpen("Text1");
cy.get(explorer.collapse)
.last()
.click({ force: true });
cy.get(explorer.property)
.last()
.click({ force: true });
cy.wait(2000);
cy.get(apiwidget.propertyList).then(function($lis) {
expect($lis).to.have.length(2);
expect($lis.eq(0)).to.contain("{{Api.isVisible}}");
expect($lis.eq(1)).to.contain("{{Api.text}}");
expect($lis.eq(0)).to.contain("{{Text1.isVisible}}");
expect($lis.eq(1)).to.contain("{{Text1.text}}");
});
cy.GlobalSearchEntity("Api");
cy.EditApiNameFromExplorer("ApiUpdated");
cy.GlobalSearchEntity("ApiUpdated");
cy.GlobalSearchEntity("Text1");
cy.EditApiNameFromExplorer("TextUpdated");
cy.GlobalSearchEntity("TextUpdated");
cy.get(apiwidget.propertyList).then(function($lis) {
expect($lis).to.have.length(2);
expect($lis.eq(0)).to.contain("{{ApiUpdated.isVisible}}");
expect($lis.eq(1)).to.contain("{{ApiUpdated.text}}");
expect($lis.eq(0)).to.contain("{{TextUpdated.isVisible}}");
expect($lis.eq(1)).to.contain("{{TextUpdated.text}}");
});
cy.DeleteWidgetFromSideBar();
});

View File

@ -14,6 +14,7 @@ import com.appsmith.external.plugins.BasePlugin;
import com.appsmith.external.plugins.PluginExecutor;
import com.mongodb.MongoClient;
import com.mongodb.MongoClientURI;
import com.mongodb.MongoCommandException;
import com.mongodb.MongoTimeoutException;
import com.mongodb.client.ClientSession;
import com.mongodb.client.MongoDatabase;
@ -326,6 +327,14 @@ public class MongoPlugin extends BasePlugin {
log.warn("Timeout connecting to MongoDB from MongoPlugin.", e);
return new DatasourceTestResult("Timed out trying to connect to MongoDB host.");
} catch(MongoCommandException e) {
// The fact that we got a response saying "Unauthorized" means that the connection to the
// MongoDB instance is valid. It also means we don't have access to the admin database, but
// that's okay for our purposes here.
return "Unauthorized".equals(e.getErrorCodeName())
? new DatasourceTestResult()
: new DatasourceTestResult(e.getMessage());
} catch (Exception e) {
return new DatasourceTestResult(e.getMessage());