diff --git a/app/client/cypress/e2e/Regression/Apps/EchoApiCMS_spec.js b/app/client/cypress/e2e/Regression/Apps/EchoApiCMS_spec.js index a9a04d449b..4f93d03f75 100644 --- a/app/client/cypress/e2e/Regression/Apps/EchoApiCMS_spec.js +++ b/app/client/cypress/e2e/Regression/Apps/EchoApiCMS_spec.js @@ -10,10 +10,9 @@ import { describe("Content Management System App", function () { before(() => { - homePage.NavigateToHome(); agHelper.GenerateUUID(); cy.get("@guid").then((uid) => { - homePage.CreateNewWorkspace("EchoApiCMS" + uid); + homePage.CreateNewWorkspace("EchoApiCMS" + uid, true); homePage.CreateAppInWorkspace("EchoApiCMS" + uid, "EchoApiCMSApp"); agHelper.AddDsl("CMSdsl"); }); diff --git a/app/client/cypress/e2e/Regression/Apps/MongoDBShoppingCart_spec.ts b/app/client/cypress/e2e/Regression/Apps/MongoDBShoppingCart_spec.ts index f196563fcd..e47e6f5878 100644 --- a/app/client/cypress/e2e/Regression/Apps/MongoDBShoppingCart_spec.ts +++ b/app/client/cypress/e2e/Regression/Apps/MongoDBShoppingCart_spec.ts @@ -12,10 +12,9 @@ describe("Shopping cart App", function () { let datasourceName: string, repoName: any; before(() => { - homePage.NavigateToHome(); agHelper.GenerateUUID(); cy.get("@guid").then((uid) => { - homePage.CreateNewWorkspace("MongoDBShop" + uid); + homePage.CreateNewWorkspace("MongoDBShop" + uid, true); homePage.CreateAppInWorkspace("MongoDBShop" + uid, "MongoDBShopApp"); agHelper.AddDsl("mongoAppdsl"); }); diff --git a/app/client/cypress/e2e/Regression/ClientSide/BugTests/DatasourceSchema_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/BugTests/DatasourceSchema_spec.ts index 902a224b1b..fdf94c895d 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/BugTests/DatasourceSchema_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/BugTests/DatasourceSchema_spec.ts @@ -1,19 +1,26 @@ import { featureFlagIntercept } from "../../../../support/Objects/FeatureFlags"; -import { ObjectsRegistry } from "../../../../support/Objects/Registry"; - -const agHelper = ObjectsRegistry.AggregateHelper, - dataSources = ObjectsRegistry.DataSources, - ee = ObjectsRegistry.EntityExplorer; +import { + agHelper, + entityItems, + dataSources, + entityExplorer, + homePage, +} from "../../../../support/Objects/ObjectsCore"; let guid; let dataSourceName: string; describe("Datasource form related tests", function () { + before(() => { + homePage.CreateNewWorkspace("FetchSchemaOnce", true); + homePage.CreateAppInWorkspace("FetchSchemaOnce"); + }); + it("1. Bug - 17238 Verify datasource structure refresh on save - invalid datasource", () => { agHelper.GenerateUUID(); cy.get("@guid").then((uid) => { guid = uid; dataSourceName = "Postgres " + guid; - ee.ExpandCollapseEntity("Datasources"); + entityExplorer.ExpandCollapseEntity("Datasources"); dataSources.NavigateToDSCreateNew(); dataSources.CreatePlugIn("PostgreSQL"); agHelper.RenameWithInPane(dataSourceName, false); @@ -36,14 +43,16 @@ describe("Datasource form related tests", function () { it("2. Verify if schema was fetched once #18448", () => { agHelper.RefreshPage(); - ee.ExpandCollapseEntity("Datasources"); - ee.ExpandCollapseEntity(dataSourceName, false); - cy.intercept("GET", dataSources._getStructureReq).as("getDSStructure"); - ee.ExpandCollapseEntity("Datasources"); - ee.ExpandCollapseEntity(dataSourceName); + entityExplorer.ExpandCollapseEntity("Datasources"); + entityExplorer.ExpandCollapseEntity(dataSourceName, false); + entityExplorer.ExpandCollapseEntity("Datasources"); + entityExplorer.ExpandCollapseEntity(dataSourceName); agHelper.Sleep(1500); agHelper.VerifyCallCount(`@getDatasourceStructure`, 1); - dataSources.DeleteQuery("Query1"); + agHelper.ActionContextMenuWithInPane({ + action: "Delete", + entityType: entityItems.Query, + }); dataSources.DeleteDatasouceFromWinthinDS(dataSourceName); }); @@ -61,7 +70,7 @@ describe("Datasource form related tests", function () { dataSources.CreateMockDB("Users"); dataSources.CreateQueryAfterDSSaved(); dataSources.VerifyTableSchemaOnQueryEditor("public.users"); - ee.ExpandCollapseEntity("public.users"); + entityExplorer.ExpandCollapseEntity("public.users"); dataSources.VerifyColumnSchemaOnQueryEditor("id"); dataSources.FilterAndVerifyDatasourceSchemaBySearch( "gender", diff --git a/app/client/cypress/e2e/Regression/ClientSide/BugTests/GitBugs_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/BugTests/GitBugs_Spec.ts index 0aeb22078a..f7132b4756 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/BugTests/GitBugs_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/BugTests/GitBugs_Spec.ts @@ -9,10 +9,9 @@ let tempBranch3: any; describe("Git Bugs", function () { before(() => { - _.homePage.NavigateToHome(); _.agHelper.GenerateUUID(); cy.get("@guid").then((uid) => { - _.homePage.CreateNewWorkspace("GitBugs" + uid); + _.homePage.CreateNewWorkspace("GitBugs" + uid, true); _.homePage.CreateAppInWorkspace("GitBugs" + uid); }); }); diff --git a/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/API_Pane_spec.js b/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/API_Pane_spec.js index beac47b703..b3a2d19580 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/API_Pane_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/API_Pane_spec.js @@ -11,8 +11,7 @@ let ee = ObjectsRegistry.EntityExplorer, describe("Entity explorer API pane related testcases", function () { it("1. Empty Message validation for Widgets/API/Queries", function () { - homePage.NavigateToHome(); - homePage.CreateNewWorkspace("EmptyMsgCheck"); + homePage.CreateNewWorkspace("EmptyMsgCheck", true); homePage.CreateAppInWorkspace("EmptyMsgCheck"); ee.ExpandCollapseEntity("Widgets"); agHelper.AssertElementVisible( diff --git a/app/client/cypress/e2e/Regression/ClientSide/Fork/ForkAppWithMultipleDS_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Fork/ForkAppWithMultipleDS_Spec.ts index 59e554bcc6..62a72547ce 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Fork/ForkAppWithMultipleDS_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Fork/ForkAppWithMultipleDS_Spec.ts @@ -32,11 +32,10 @@ describe("Fork application with multiple datasources", function () { it("1. Bug Id: 24708 - fork and test the forked application", function () { // Create a new workspace and fork application const appname: string = localStorage.getItem("AppName") || "randomApp"; - homePage.NavigateToHome(); agHelper.GenerateUUID(); cy.get("@guid").then((uid) => { workspaceId = "forkApp" + uid; - homePage.CreateNewWorkspace(workspaceId); + homePage.CreateNewWorkspace(workspaceId, true); agHelper.PressEscape(); cy.log("------------------" + workspaceId); homePage.ForkApplication(appname, workspaceId); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Fork/ForkApplicationReconnectModal_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Fork/ForkApplicationReconnectModal_spec.ts index 68191c848f..2216aac1d6 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Fork/ForkApplicationReconnectModal_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Fork/ForkApplicationReconnectModal_spec.ts @@ -8,13 +8,12 @@ let currentWorkspace: string, currentAppName: string, forkWorkspaceName: string; describe("Fork application across workspaces", function () { it("Bug 24702: Signed user should be able to fork a public forkable app & Check if the forked application has the same dsl as the original", function () { - homePage.NavigateToHome(); // Create new workspace to create App in agHelper.GenerateUUID(); cy.get("@guid").then((uid) => { currentWorkspace = "CurrentWorkspace " + uid; currentAppName = "MongoQueryApp " + uid; - homePage.CreateNewWorkspace(currentWorkspace); + homePage.CreateNewWorkspace(currentWorkspace, true); homePage.CreateAppInWorkspace(currentWorkspace, currentAppName); // Create datasource and query @@ -23,12 +22,11 @@ describe("Fork application across workspaces", function () { // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(2000); - homePage.NavigateToHome(); agHelper.GenerateUUID(); cy.get("@guid").then((uid) => { forkWorkspaceName = "ForkApplication" + uid; - homePage.CreateNewWorkspace(forkWorkspaceName); + homePage.CreateNewWorkspace(forkWorkspaceName, true); homePage.FilterApplication(currentAppName); agHelper.Sleep(500); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Git/ExistingApps/v1.9.24/DSCrudAndBindings_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Git/ExistingApps/v1.9.24/DSCrudAndBindings_Spec.ts index 8edd00b84a..fa6b11e304 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Git/ExistingApps/v1.9.24/DSCrudAndBindings_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Git/ExistingApps/v1.9.24/DSCrudAndBindings_Spec.ts @@ -19,11 +19,10 @@ describe("Import and validate older app (app created in older versions of Appsmi keyId: any, workspaceName: any; before(() => { - homePage.NavigateToHome(); agHelper.GenerateUUID(); cy.get("@guid").then((uid) => { workspaceName = "GitImport_" + uid; - homePage.CreateNewWorkspace(workspaceName); + homePage.CreateNewWorkspace(workspaceName, true); }); //Import App From Gitea gitSync.ImportAppFromGit(workspaceName, appRepoName, true); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Dropdown/Dropdown_onOptionChange_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Dropdown/Dropdown_onOptionChange_spec.js index 78925deddb..f06d14b406 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Dropdown/Dropdown_onOptionChange_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Dropdown/Dropdown_onOptionChange_spec.js @@ -19,7 +19,7 @@ describe("Dropdown Widget", function () { entityExplorer.ExpandCollapseEntity("Container3", "Widgets"); entityExplorer.SelectEntityByName("Dropdown1", "Widgets"); propPane.UpdatePropertyFieldValue( - "Options", + "Source Data", JSON.stringify(this.dataSet.input), ); //creating the Modal and verify Modal name //to fix below diff --git a/app/client/cypress/limited-tests.txt b/app/client/cypress/limited-tests.txt index f5a96631e3..ce8d36c1b9 100644 --- a/app/client/cypress/limited-tests.txt +++ b/app/client/cypress/limited-tests.txt @@ -3,3 +3,5 @@ # To run only limited tests - give the spec names in below format: cypress/e2e/Regression/ClientSide/Widgets/Dropdown/Dropdown_onOptionChange_spec.js +cypress/e2e/Regression/ClientSide/Widgets/Button/Button_onClickAction_spec.js +cypress/e2e/Regression/ClientSide/BugTests/DatasourceSchema_spec.ts diff --git a/app/client/cypress/support/Pages/DataSources.ts b/app/client/cypress/support/Pages/DataSources.ts index 812b0a6c8d..36a2be6119 100644 --- a/app/client/cypress/support/Pages/DataSources.ts +++ b/app/client/cypress/support/Pages/DataSources.ts @@ -180,7 +180,6 @@ export class DataSources { _gsScopeOptions = ".ads-v2-select__dropdown .rc-select-item-option"; private _queryTimeout = "//input[@name='actionConfiguration.timeoutInMillisecond']"; - _getStructureReq = "/api/v1/datasources/*/structure?ignoreCache=true"; _editDatasourceFromActiveTab = (dsName: string) => ".t--datasource-name:contains('" + dsName + "')"; private _suggestedWidget = (widgetType: string) => @@ -1265,7 +1264,6 @@ export class DataSources { schema: string, isUpdate = false, ) { - cy.intercept("GET", this._getStructureReq).as("getDSStructure"); if (isUpdate) { this.UpdateDatasource(); } else { @@ -1275,7 +1273,7 @@ export class DataSources { entityNameinLeftSidebar: dataSourceName, action: "Refresh", }); - cy.wait("@getDSStructure").then(() => { + cy.wait("@getDatasourceStructure").then(() => { cy.get(".bp3-collapse-body").contains(schema); }); } diff --git a/app/client/cypress/support/Pages/HomePage.ts b/app/client/cypress/support/Pages/HomePage.ts index 8c52d7e668..2d136ccf39 100644 --- a/app/client/cypress/support/Pages/HomePage.ts +++ b/app/client/cypress/support/Pages/HomePage.ts @@ -124,7 +124,11 @@ export class HomePage { this.agHelper.GetNClick(this._homeTab); } - public CreateNewWorkspace(workspaceNewName: string) { + public CreateNewWorkspace( + workspaceNewName: string, + toNavigateToHome = false, + ) { + if (toNavigateToHome) this.NavigateToHome(); let oldName = ""; this.agHelper.GetNClick(this._newWorkSpaceLink); this.assertHelper.AssertNetworkStatus("createWorkspace", 201); @@ -255,6 +259,7 @@ export class HomePage { //Maps to CreateAppForWorkspace in command.js public CreateAppInWorkspace(workspaceName: string, appname = "") { cy.xpath(this._existingWorkspaceCreateNewApp(workspaceName)) + .last() .scrollIntoView() .should("be.visible") .click({ force: true }); diff --git a/app/client/cypress/support/commands.js b/app/client/cypress/support/commands.js index 1dcca340a3..6d06215d54 100644 --- a/app/client/cypress/support/commands.js +++ b/app/client/cypress/support/commands.js @@ -864,7 +864,8 @@ Cypress.Commands.add( (forSuccess, forFailure, actionType, actionValue, idx = 0) => { propPane.SelectActionByTitleAndValue(actionType, actionValue); - agHelper.GetNClick(propPane._actionCallbacks); + agHelper.Sleep(); + agHelper.GetNClick(propPane._actionCallbacks, 0, true); // add a success callback cy.get(propPane._actionAddCallback("success")).click().wait(500);