From 9e7fa1d725019a8c7a15e18d082b87c1f7914115 Mon Sep 17 00:00:00 2001 From: Sagar Khalasi Date: Thu, 19 Sep 2024 18:21:58 +0530 Subject: [PATCH] chore: Added sanity and tags for blank tag specs (#36421) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description Added relevant tags with sanity tags. Fixes `https://github.com/appsmithorg/appsmith/issues/36415` ## Automation /ok-to-test tags="@tag.Sanity" ### :mag: Cypress test results > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: > Commit: 8383cf735da821760853af77f232b5c992904a19 > Cypress dashboard. > Tags: `@tag.Sanity` > Spec: >
Thu, 19 Sep 2024 11:41:23 UTC ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [x] No ## Summary by CodeRabbit - **New Features** - Enhanced test suites with additional `@tag.Sanity` tags for improved categorization and organization. - **Bug Fixes** - Updated various test suite tags to include `@tag.Sanity`, ensuring comprehensive coverage of functionalities. - **Documentation** - Improved tagging structure across multiple test suites for better clarity and maintainability. - **Chores** - General modifications to existing test suite descriptors to include new tags without altering core functionalities. --- .../Apps/ImportExportForkApplication_spec.js | 2 +- .../Apps/MongoDBShoppingCart_spec.ts | 382 ++++---- .../ActionExecution/NavigateTo_spec.ts | 2 +- .../ActionExecution/PostWindowMessage_spec.ts | 2 +- .../ActionExecution/StoreValue_spec.ts | 2 +- .../AppNavigationWithGit_spec.ts | 2 +- .../AppNavigationWithMultiplePages_spec.ts | 2 +- .../AppNavigation/NavigationSettings_spec.ts | 134 +-- .../Autocomplete/autocomplete_spec.ts | 100 +- .../Binding/JSObject_Postgress_Table_spec.js | 2 +- .../TableV2_Widget_API_Pagination_spec.js | 2 +- .../BugTests/AllWidgets_Reset_Spec.ts | 2 +- .../Debugger/JSObjects_navigation_spec.ts | 2 +- .../DynamicHeight/Auto_Height_Limit_spec.ts | 2 +- .../DynamicHeight/Auto_Height_spec.ts | 2 +- .../Widgets_Copy_Delete_Undo_spec.js | 2 +- .../ForkApplicationReconnectModal_spec.ts | 2 +- .../v1.9.24/DSCrudAndBindings_Spec.ts | 2 +- .../ClientSide/Git/GitAutocommit_spec.ts | 9 +- .../GitDiscardChange/DiscardChanges_spec.js | 384 ++++---- .../Git/GitImport/GitImport_spec.js | 352 +++---- .../Git/GitSync/DeleteBranch_spec.js | 2 +- .../ClientSide/Git/GitSync/Deploy_spec.js | 98 +- .../Git/GitSync/GitConnectV2_spec.ts | 2 +- .../Git/GitSync/GitSyncGitBugs_spec.js | 458 +++++----- .../ClientSide/Git/GitSync/Merge_spec.js | 2 +- .../Git/GitSync/SwitchBranches_spec.js | 2 +- .../GitwithCustomJSLibrary_spec.js | 2 +- .../Git/GitWithTheming/GitWithTheming_spec.js | 190 ++-- .../JSONFormWidget/JSONForm_mongoDB_spec.ts | 2 +- .../SelectWidget/mongoDB_spec.ts | 2 +- .../SelectWidget/postgres_spec.ts | 2 +- .../TableWidget/Table_postgres_spec.ts | 2 +- .../OtherUIFeatures/ErrorMessages_spec.ts | 2 +- .../OtherUIFeatures/GlobalSearch_spec.js | 2 +- .../OtherUIFeatures/Inspect_Element_spec.js | 30 +- .../ClientSide/OtherUIFeatures/Logs1_spec.js | 2 +- .../OtherUIFeatures/PageOnLoad_spec.ts | 38 +- .../OtherUIFeatures/PreviewMode_spec.js | 84 +- .../OtherUIFeatures/Replay_Editor_spec.js | 259 +++--- .../ClientSide/OtherUIFeatures/Replay_spec.js | 416 ++++----- .../ClientSide/OtherUIFeatures/Resize_spec.js | 38 +- .../OtherUIFeatures/Unique_key_spec.js | 2 +- .../OtherUIFeatures/UpdateApplication_spec.js | 2 +- .../OtherUIFeatures/ViewMode_spec.js | 2 +- .../OtherUIFeatures/Widget_Error_spec.js | 2 +- .../SettingsPane/PageSettings_spec.ts | 2 +- .../CreateNewAppFromTemplates_spec.ts | 9 +- .../Fork_Template_Existing_app_spec.js | 2 +- .../Templates/TemplatesPage_spec.ts | 2 +- .../Button/Button_onClickAction_spec.js | 2 +- .../Widgets/Chart/ChartDataPoint_Spec.ts | 2 +- .../JSONForm_AutoGenerateFormDisabled_spec.js | 2 +- .../JSONForm_AutoGenerateFormEnabled_spec.js | 2 +- .../Widgets/JSONForm/JSONForm_Basic_spec.js | 2 +- .../ListV2/ListV2_PageNo_PageSize_spec.js | 2 +- .../ListV2/ListV2_SerververSide_spec.js | 2 +- .../ListV2/ListV2_nested_List_widget_spec.js | 2 +- ...Listv2_BasicChildWidgetInteraction_spec.js | 2 +- .../ListV2/Listv2_BasicClientSideData_spec.js | 2 +- .../Listv2_Nested_EventBindings_spec.js | 2 +- .../Widgets/ListV2/Listv2_onItemClick_spec.js | 2 +- .../Widgets/Multiselect/MultiSelect1_spec.js | 2 +- .../Widgets/Select/Select_Validation_spec.js | 2 +- .../Widgets/Select/Select_widget1_spec.js | 2 +- .../Widgets/TableV2/AddNewRow1_spec.js | 316 +++---- .../Widgets/TableV2/AddNewRow2_spec.js | 304 ++++--- .../Widgets/TableV2/AddNewRow3_spec.js | 2 +- .../TableV2/TableV2_FilteredTableData_spec.js | 2 +- .../TableV2/TableV2_pagination_spec.js | 2 +- .../ClientSide/Workspace/MemberRoles_Spec.ts | 2 +- .../Workspace/ShareAppTests_Spec.ts | 2 +- .../WorkspaceImportApplication_spec.js | 2 +- ...TestExecuteWithDynamicBindingInUrl_spec.ts | 2 +- .../ServerSide/GenerateCRUD/Mongo_Spec.ts | 2 +- .../JSFunctionExecution_spec.ts | 856 +++++++++--------- .../LoginTests/LoginFailure_spec.js | 2 +- .../OnLoadTests/OnLoadActions_Spec.ts | 2 +- .../OnLoadTests/PostgresConnections_spec.ts | 2 +- .../ServerSide/QueryPane/Mongo1_spec.ts | 2 +- .../QueryPane/Querypane_Mongo_Spec.js | 2 +- .../Generate_Crud_New_Page_spec.ts | 2 +- 82 files changed, 2346 insertions(+), 2237 deletions(-) diff --git a/app/client/cypress/e2e/Regression/Apps/ImportExportForkApplication_spec.js b/app/client/cypress/e2e/Regression/Apps/ImportExportForkApplication_spec.js index ba3e8ba06c0..8ae788c61da 100644 --- a/app/client/cypress/e2e/Regression/Apps/ImportExportForkApplication_spec.js +++ b/app/client/cypress/e2e/Regression/Apps/ImportExportForkApplication_spec.js @@ -9,7 +9,7 @@ import { describe( "Import, Export and Fork application and validate data binding", - { tags: ["@tag.ImportExport"] }, + { tags: ["@tag.ImportExport", "@tag.Sanity"] }, function () { let workspaceId; let newWorkspaceName; diff --git a/app/client/cypress/e2e/Regression/Apps/MongoDBShoppingCart_spec.ts b/app/client/cypress/e2e/Regression/Apps/MongoDBShoppingCart_spec.ts index 6c2d1acd817..1e9ad7dbd2a 100644 --- a/app/client/cypress/e2e/Regression/Apps/MongoDBShoppingCart_spec.ts +++ b/app/client/cypress/e2e/Regression/Apps/MongoDBShoppingCart_spec.ts @@ -10,210 +10,214 @@ import { table, } from "../../../support/Objects/ObjectsCore"; -describe("Shopping cart App", { tags: ["@tag.Datasource"] }, function () { - let datasourceName: string, repoName: any; +describe( + "Shopping cart App", + { tags: ["@tag.Datasource", "@tag.Sanity"] }, + function () { + let datasourceName: string, repoName: any; - before(() => { - agHelper.AddDsl("mongoAppdsl"); - dataSources.CreateDataSource("Mongo"); - cy.get("@saveDatasource").then((httpResponse: any) => { - datasourceName = httpResponse.response.body.data.name; + before(() => { + agHelper.AddDsl("mongoAppdsl"); + dataSources.CreateDataSource("Mongo"); + cy.get("@saveDatasource").then((httpResponse: any) => { + datasourceName = httpResponse.response.body.data.name; + }); }); - }); - it("1. Create MongoDB datasource and add Insert, Find, Update and Delete queries", function () { - dataSources.CreateQueryAfterDSSaved("", "GetProduct"); - dataSources.EnterJSContext({ - fieldLabel: "Collection", - fieldValue: "Productnames", - }); - // GetProduct query to fetch all products - agHelper.AssertAutoSave(); - // EditProducts query to update the cart - dataSources.CreateQueryFromOverlay(datasourceName, "", "EditProducts"); - dataSources.ValidateNSelectDropdown( - "Command", - "Find document(s)", - "Update document(s)", - ); - dataSources.EnterJSContext({ - fieldLabel: "Collection", - fieldValue: "Productnames", - }); - agHelper.EnterValue('{"title": "{{Table1.selectedRow.title}}"}', { - propFieldName: "", - directInput: false, - inputFieldName: "Query", - }); - agHelper.EnterValue( - `{"title" : "{{title.text}}", + it("1. Create MongoDB datasource and add Insert, Find, Update and Delete queries", function () { + dataSources.CreateQueryAfterDSSaved("", "GetProduct"); + dataSources.EnterJSContext({ + fieldLabel: "Collection", + fieldValue: "Productnames", + }); + // GetProduct query to fetch all products + agHelper.AssertAutoSave(); + // EditProducts query to update the cart + dataSources.CreateQueryFromOverlay(datasourceName, "", "EditProducts"); + dataSources.ValidateNSelectDropdown( + "Command", + "Find document(s)", + "Update document(s)", + ); + dataSources.EnterJSContext({ + fieldLabel: "Collection", + fieldValue: "Productnames", + }); + agHelper.EnterValue('{"title": "{{Table1.selectedRow.title}}"}', { + propFieldName: "", + directInput: false, + inputFieldName: "Query", + }); + agHelper.EnterValue( + `{"title" : "{{title.text}}", "description" :"{{description.text}}", "price" : {{price.text}}, "quantity":{{quantity.text}}}`, - { + { + propFieldName: "", + directInput: false, + inputFieldName: "Update", + }, + ); + + agHelper.AssertAutoSave(); + + // AddProducts query to add to cart + dataSources.CreateQueryFromOverlay(datasourceName, "", "AddProduct"); + dataSources.ValidateNSelectDropdown( + "Command", + "Find document(s)", + "Insert document(s)", + ); + dataSources.EnterJSContext({ + fieldLabel: "Collection", + fieldValue: "Productnames", + }); + const documentText = [ + { + title: "{{Title.text}}", + description: "{{Description.text}}", + price: "{{Price.text}}", + quantity: "{{Quantity.text}}", + }, + ]; + agHelper.EnterValue(JSON.stringify(documentText), { propFieldName: "", directInput: false, - inputFieldName: "Update", - }, - ); - - agHelper.AssertAutoSave(); + inputFieldName: "Documents", + }); - // AddProducts query to add to cart - dataSources.CreateQueryFromOverlay(datasourceName, "", "AddProduct"); - dataSources.ValidateNSelectDropdown( - "Command", - "Find document(s)", - "Insert document(s)", - ); - dataSources.EnterJSContext({ - fieldLabel: "Collection", - fieldValue: "Productnames", - }); - const documentText = [ - { - title: "{{Title.text}}", - description: "{{Description.text}}", - price: "{{Price.text}}", - quantity: "{{Quantity.text}}", - }, - ]; - agHelper.EnterValue(JSON.stringify(documentText), { - propFieldName: "", - directInput: false, - inputFieldName: "Documents", - }); + agHelper.AssertAutoSave(); - agHelper.AssertAutoSave(); + // Delete product + dataSources.CreateQueryFromOverlay(datasourceName, "", "DeleteProduct"); + dataSources.ValidateNSelectDropdown( + "Command", + "Find document(s)", + "Delete document(s)", + ); + dataSources.EnterJSContext({ + fieldLabel: "Collection", + fieldValue: "Productnames", + }); + agHelper.EnterValue('{"title":"{{Table1.selectedRow.title}}"}', { + propFieldName: "", + directInput: false, + inputFieldName: "Query", + }); - // Delete product - dataSources.CreateQueryFromOverlay(datasourceName, "", "DeleteProduct"); - dataSources.ValidateNSelectDropdown( - "Command", - "Find document(s)", - "Delete document(s)", - ); - dataSources.EnterJSContext({ - fieldLabel: "Collection", - fieldValue: "Productnames", + agHelper.AssertAutoSave(); + deployMode.DeployApp(appPage.bookname); }); - agHelper.EnterValue('{"title":"{{Table1.selectedRow.title}}"}', { - propFieldName: "", - directInput: false, - inputFieldName: "Query", - }); - - agHelper.AssertAutoSave(); - deployMode.DeployApp(appPage.bookname); - }); - it("2. Perform CRUD operations and validate data", function () { - // Adding the books to the Add cart form - agHelper.GetNClick(appPage.bookname); - //Wait for element to be in DOM - agHelper.AssertElementLength(appPage.inputValues, 9); - agHelper.ClearNType( - appPage.bookname + "//" + locators._inputField, - "Atomic habits", - 0, - true, - ); - agHelper.ClearNType( - appPage.bookgenre + "//" + locators._inputField, - "Self help", - 0, - true, - ); - agHelper.ClearNType( - appPage.bookprice + "//" + locators._inputField, - "200", - 0, - true, - ); - agHelper.ClearNType( - appPage.bookquantity + "//" + locators._inputField, - "2", - 0, - true, - ); - agHelper.GetNClick(appPage.addButton, 0, true); - assertHelper.AssertNetworkStatus("@postExecute"); - agHelper.GetNClick(appPage.bookname); - agHelper.ClearNType( - appPage.bookname + "//" + locators._inputField, - "A man called ove", - 0, - true, - ); - agHelper.ClearNType( - appPage.bookgenre + "//" + locators._inputField, - "Fiction", - 0, - true, - ); - agHelper.ClearNType( - appPage.bookprice + "//" + locators._inputField, - "100", - 0, - true, - ); - agHelper.ClearNType( - appPage.bookquantity + "//" + locators._inputField, - "1", - 0, - true, - ); - agHelper.GetNClick(appPage.addButton, 0, true); - assertHelper.AssertNetworkStatus("@postExecute"); - // Select the table row & Deleting the book from the cart - table.SelectTableRow(1); - agHelper.GetNClick(appPage.deleteButton, 1, false); - assertHelper.AssertNetworkStatus("@postExecute"); - assertHelper.AssertNetworkStatus("@postExecute"); + it("2. Perform CRUD operations and validate data", function () { + // Adding the books to the Add cart form + agHelper.GetNClick(appPage.bookname); + //Wait for element to be in DOM + agHelper.AssertElementLength(appPage.inputValues, 9); + agHelper.ClearNType( + appPage.bookname + "//" + locators._inputField, + "Atomic habits", + 0, + true, + ); + agHelper.ClearNType( + appPage.bookgenre + "//" + locators._inputField, + "Self help", + 0, + true, + ); + agHelper.ClearNType( + appPage.bookprice + "//" + locators._inputField, + "200", + 0, + true, + ); + agHelper.ClearNType( + appPage.bookquantity + "//" + locators._inputField, + "2", + 0, + true, + ); + agHelper.GetNClick(appPage.addButton, 0, true); + assertHelper.AssertNetworkStatus("@postExecute"); + agHelper.GetNClick(appPage.bookname); + agHelper.ClearNType( + appPage.bookname + "//" + locators._inputField, + "A man called ove", + 0, + true, + ); + agHelper.ClearNType( + appPage.bookgenre + "//" + locators._inputField, + "Fiction", + 0, + true, + ); + agHelper.ClearNType( + appPage.bookprice + "//" + locators._inputField, + "100", + 0, + true, + ); + agHelper.ClearNType( + appPage.bookquantity + "//" + locators._inputField, + "1", + 0, + true, + ); + agHelper.GetNClick(appPage.addButton, 0, true); + assertHelper.AssertNetworkStatus("@postExecute"); + // Select the table row & Deleting the book from the cart + table.SelectTableRow(1); + agHelper.GetNClick(appPage.deleteButton, 1, false); + assertHelper.AssertNetworkStatus("@postExecute"); + assertHelper.AssertNetworkStatus("@postExecute"); - // validating that the book is deleted - agHelper.AssertElementLength(appPage.deleteButton + "/parent::div", 1); - // Updating the book quantity from edit cart - agHelper.ClearNType( - appPage.editbookquantity + "//" + locators._inputField, - "3", - 0, - true, - ); - agHelper.GetNClick(appPage.editButton, 0, true); + // validating that the book is deleted + agHelper.AssertElementLength(appPage.deleteButton + "/parent::div", 1); + // Updating the book quantity from edit cart + agHelper.ClearNType( + appPage.editbookquantity + "//" + locators._inputField, + "3", + 0, + true, + ); + agHelper.GetNClick(appPage.editButton, 0, true); - //Wait for all post execute calls to finish - assertHelper.AssertNetworkExecutionSuccess("@postExecute"); - // validating updated value in the cart - agHelper - .GetElement(dataSources._selectedRow) - .children() - .eq(3) - .should("have.text", "3"); - }); + //Wait for all post execute calls to finish + assertHelper.AssertNetworkExecutionSuccess("@postExecute"); + // validating updated value in the cart + agHelper + .GetElement(dataSources._selectedRow) + .children() + .eq(3) + .should("have.text", "3"); + }); - it("3. Connect the application to git and validate data in deploy mode and edit mode", function () { - deployMode.NavigateBacktoEditor(); - gitSync.CreateNConnectToGit(repoName); - cy.get("@gitRepoName").then((repName) => { - repoName = repName; + it("3. Connect the application to git and validate data in deploy mode and edit mode", function () { + deployMode.NavigateBacktoEditor(); + gitSync.CreateNConnectToGit(repoName); + cy.get("@gitRepoName").then((repName) => { + repoName = repName; + }); + cy.latestDeployPreview(); + agHelper + .GetElement(dataSources._selectedRow) + .children() + .eq(0) + .should("have.text", "A man called ove"); + deployMode.NavigateBacktoEditor(); + agHelper + .GetElement(dataSources._selectedRow) + .children() + .eq(0) + .should("have.text", "A man called ove"); }); - cy.latestDeployPreview(); - agHelper - .GetElement(dataSources._selectedRow) - .children() - .eq(0) - .should("have.text", "A man called ove"); - deployMode.NavigateBacktoEditor(); - agHelper - .GetElement(dataSources._selectedRow) - .children() - .eq(0) - .should("have.text", "A man called ove"); - }); - after(() => { - //clean up - gitSync.DeleteTestGithubRepo(repoName); - }); -}); + after(() => { + //clean up + gitSync.DeleteTestGithubRepo(repoName); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/NavigateTo_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/NavigateTo_spec.ts index 443512bbd98..827cb3f9614 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/NavigateTo_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/NavigateTo_spec.ts @@ -13,7 +13,7 @@ import EditorNavigation, { } from "../../../../support/Pages/EditorNavigation"; import PageList from "../../../../support/Pages/PageList"; -describe("Navigate To feature", { tags: ["@tag.JS"] }, () => { +describe("Navigate To feature", { tags: ["@tag.JS", "@tag.Sanity"] }, () => { it("1. Navigates to page name clicked from the page name tab of navigate to", () => { EditorNavigation.SelectEntityByName("Page1", EntityType.Page); entityExplorer.DragDropWidgetNVerify(draggableWidgets.TEXT, 500, 600); diff --git a/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/PostWindowMessage_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/PostWindowMessage_spec.ts index 8b074f21c39..87ee86ff315 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/PostWindowMessage_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/PostWindowMessage_spec.ts @@ -10,7 +10,7 @@ import EditorNavigation, { EntityType, } from "../../../../support/Pages/EditorNavigation"; -describe("Post window message", { tags: ["@tag.JS"] }, () => { +describe("Post window message", { tags: ["@tag.JS", "@tag.Sanity"] }, () => { it("1. Posts message to an iframe within Appsmith", () => { entityExplorer.DragDropWidgetNVerify(draggableWidgets.BUTTON, 200, 200); entityExplorer.DragDropWidgetNVerify(draggableWidgets.IFRAME, 200, 300); diff --git a/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/StoreValue_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/StoreValue_spec.ts index e13c374025a..683fcc7bd66 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/StoreValue_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/StoreValue_spec.ts @@ -14,7 +14,7 @@ import EditorNavigation, { PagePaneSegment, } from "../../../../support/Pages/EditorNavigation"; -describe("storeValue Action test", { tags: ["@tag.JS"] }, () => { +describe("storeValue Action test", { tags: ["@tag.JS", "@tag.Sanity"] }, () => { before(() => { entityExplorer.DragDropWidgetNVerify("buttonwidget", 100, 100); PageLeftPane.switchSegment(PagePaneSegment.JS); diff --git a/app/client/cypress/e2e/Regression/ClientSide/AppNavigation/AppNavigationWithGit_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/AppNavigation/AppNavigationWithGit_spec.ts index 036ac24618f..477cc3c87dd 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/AppNavigation/AppNavigationWithGit_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/AppNavigation/AppNavigationWithGit_spec.ts @@ -12,7 +12,7 @@ import PageList from "../../../../support/Pages/PageList"; describe( "General checks for app navigation with Git", - { tags: ["@tag.IDE", "@tag.Git"] }, + { tags: ["@tag.IDE", "@tag.Git", "@tag.Sanity"] }, function () { it("Issue #32050 - Branch parameter should not be removed when navigating from the inline nav more dropdown", () => { gitSync.CreateNConnectToGit(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/AppNavigation/AppNavigationWithMultiplePages_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/AppNavigation/AppNavigationWithMultiplePages_spec.ts index 74584f5303c..d3e11d7f5d7 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/AppNavigation/AppNavigationWithMultiplePages_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/AppNavigation/AppNavigationWithMultiplePages_spec.ts @@ -18,7 +18,7 @@ let currentUrl: string; describe( "Page orientation and navigation related usecases ", - { tags: ["@tag.IDE"] }, + { tags: ["@tag.IDE", "@tag.Sanity"] }, function () { it("1. Change 'Orientation' to 'Side', sidebar should appear", () => { AppSidebar.navigate(AppSidebarButton.Settings); diff --git a/app/client/cypress/e2e/Regression/ClientSide/AppNavigation/NavigationSettings_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/AppNavigation/NavigationSettings_spec.ts index 5be9194171b..b1abc8d29f1 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/AppNavigation/NavigationSettings_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/AppNavigation/NavigationSettings_spec.ts @@ -10,71 +10,79 @@ import { } from "../../../../support/Pages/EditorNavigation"; import PageList from "../../../../support/Pages/PageList"; -describe("Test app's navigation settings", { tags: ["@tag.IDE"] }, function () { - it("1. Open app settings and navigation tab should be there and when the navigation tab is selected, navigation preview should be visible", () => { - AppSidebar.navigate(AppSidebarButton.Settings); - agHelper.AssertElementVisibility( - appSettings.locators._navigationSettingsTab, - ); +describe( + "Test app's navigation settings", + { tags: ["@tag.IDE", "@tag.Sanity"] }, + function () { + it("1. Open app settings and navigation tab should be there and when the navigation tab is selected, navigation preview should be visible", () => { + AppSidebar.navigate(AppSidebarButton.Settings); + agHelper.AssertElementVisibility( + appSettings.locators._navigationSettingsTab, + ); - // Should not exist when the tab is not selected - agHelper.AssertElementAbsence(appSettings.locators._navigationPreview); - agHelper.GetNClick(appSettings.locators._navigationSettingsTab); + // Should not exist when the tab is not selected + agHelper.AssertElementAbsence(appSettings.locators._navigationPreview); + agHelper.GetNClick(appSettings.locators._navigationSettingsTab); - // Should exist when the tab is selected - agHelper.AssertElementVisibility(appSettings.locators._navigationPreview); - }); + // Should exist when the tab is selected + agHelper.AssertElementVisibility(appSettings.locators._navigationPreview); + }); - it("2. Toggle 'Show navbar' to off, the app header and navigation should not appear when deployed", () => { - // Toggle show navbar to off - agHelper.GetNClick( - appSettings.locators._navigationSettings._showNavbar, - 0, - true, - ); - deployMode.DeployApp(locators._emptyPageTxt); - agHelper.AssertElementAbsence(appSettings.locators._header); - agHelper.AssertElementAbsence(appSettings.locators._topStacked); - //Browser back is used as the Navbar is off and there wont be option to come back to editor - agHelper.BrowserNavigation(-1); - // Wait for the app to load - AppSidebar.navigate(AppSidebarButton.Settings); - agHelper.GetNClick(appSettings.locators._navigationSettingsTab); - // Toggle show navbar back to on - agHelper.GetNClick( - appSettings.locators._navigationSettings._showNavbar, - 0, - true, - ); - }); + it("2. Toggle 'Show navbar' to off, the app header and navigation should not appear when deployed", () => { + // Toggle show navbar to off + agHelper.GetNClick( + appSettings.locators._navigationSettings._showNavbar, + 0, + true, + ); + deployMode.DeployApp(locators._emptyPageTxt); + agHelper.AssertElementAbsence(appSettings.locators._header); + agHelper.AssertElementAbsence(appSettings.locators._topStacked); + //Browser back is used as the Navbar is off and there wont be option to come back to editor + agHelper.BrowserNavigation(-1); + // Wait for the app to load + AppSidebar.navigate(AppSidebarButton.Settings); + agHelper.GetNClick(appSettings.locators._navigationSettingsTab); + // Toggle show navbar back to on + agHelper.GetNClick( + appSettings.locators._navigationSettings._showNavbar, + 0, + true, + ); + }); - it("3. Change 'Orientation' to 'Side', deploy, and the sidebar should appear", () => { - agHelper.GetNClick( - appSettings.locators._navigationSettings._orientationOptions._side, - 0, - true, - ); - agHelper.AssertElementVisibility(appSettings.locators._sideNavbar); - deployMode.DeployApp(); - agHelper.AssertElementAbsence(appSettings.locators._header); - agHelper.AssertElementAbsence(appSettings.locators._topStacked); - agHelper.AssertElementVisibility(appSettings.locators._sideNavbar); - deployMode.NavigateBacktoEditor(); - }); + it("3. Change 'Orientation' to 'Side', deploy, and the sidebar should appear", () => { + agHelper.GetNClick( + appSettings.locators._navigationSettings._orientationOptions._side, + 0, + true, + ); + agHelper.AssertElementVisibility(appSettings.locators._sideNavbar); + deployMode.DeployApp(); + agHelper.AssertElementAbsence(appSettings.locators._header); + agHelper.AssertElementAbsence(appSettings.locators._topStacked); + agHelper.AssertElementVisibility(appSettings.locators._sideNavbar); + deployMode.NavigateBacktoEditor(); + }); - it("4. Change 'Orientation' back to 'Top', and 'Nav style' to 'Inline', page navigation items should appear inline", () => { - PageList.AddNewPage(); - AppSidebar.navigate(AppSidebarButton.Settings); - agHelper.GetNClick(appSettings.locators._navigationSettingsTab); - agHelper.GetNClick( - appSettings.locators._navigationSettings._orientationOptions._top, - 0, - true, - ); - agHelper.GetNClick(appSettings.locators._navStyleOptions._inline, 0, true); - deployMode.DeployApp(); - agHelper.AssertElementVisibility(appSettings.locators._header); - agHelper.AssertElementAbsence(appSettings.locators._topStacked); - agHelper.AssertElementVisibility(appSettings.locators._topInline); - }); -}); + it("4. Change 'Orientation' back to 'Top', and 'Nav style' to 'Inline', page navigation items should appear inline", () => { + PageList.AddNewPage(); + AppSidebar.navigate(AppSidebarButton.Settings); + agHelper.GetNClick(appSettings.locators._navigationSettingsTab); + agHelper.GetNClick( + appSettings.locators._navigationSettings._orientationOptions._top, + 0, + true, + ); + agHelper.GetNClick( + appSettings.locators._navStyleOptions._inline, + 0, + true, + ); + deployMode.DeployApp(); + agHelper.AssertElementVisibility(appSettings.locators._header); + agHelper.AssertElementAbsence(appSettings.locators._topStacked); + agHelper.AssertElementVisibility(appSettings.locators._topInline); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Autocomplete/autocomplete_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Autocomplete/autocomplete_spec.ts index 9fa5a84008a..d5525d2dc54 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Autocomplete/autocomplete_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Autocomplete/autocomplete_spec.ts @@ -5,56 +5,60 @@ import { agHelper } from "../../../../support/Objects/ObjectsCore"; const dynamicInputLocators = require("../../../../locators/DynamicInput.json"); -describe("Dynamic input autocomplete", { tags: ["@tag.JS"] }, () => { - before(() => { - agHelper.AddDsl("autocomp"); - }); - - it("1. Opens autocomplete for bindings", () => { - EditorNavigation.SelectEntityByName("Aditya", EntityType.Widget); - EditorNavigation.SelectEntityByName("Button2", EntityType.Widget, {}, [ - "TestModal", - ]); - cy.testJsontext("label", "", { - parseSpecialCharSequences: true, +describe( + "Dynamic input autocomplete", + { tags: ["@tag.JS", "@tag.Sanity"] }, + () => { + before(() => { + agHelper.AddDsl("autocomp"); }); - cy.get(dynamicInputLocators.input) - .first() - .click({ force: true }) - .type("{uparrow}", { parseSpecialCharSequences: true }) - .type("{ctrl}{shift}{downarrow}", { parseSpecialCharSequences: true }) - .type("{backspace}", { parseSpecialCharSequences: true }) - .then(() => { - cy.get(dynamicInputLocators.input) - .first() - .click({ force: true }) - .type("{{", { + + it("1. Opens autocomplete for bindings", () => { + EditorNavigation.SelectEntityByName("Aditya", EntityType.Widget); + EditorNavigation.SelectEntityByName("Button2", EntityType.Widget, {}, [ + "TestModal", + ]); + cy.testJsontext("label", "", { + parseSpecialCharSequences: true, + }); + cy.get(dynamicInputLocators.input) + .first() + .click({ force: true }) + .type("{uparrow}", { parseSpecialCharSequences: true }) + .type("{ctrl}{shift}{downarrow}", { parseSpecialCharSequences: true }) + .type("{backspace}", { parseSpecialCharSequences: true }) + .then(() => { + cy.get(dynamicInputLocators.input) + .first() + .click({ force: true }) + .type("{{", { + parseSpecialCharSequences: true, + }); + + // Tests if autocomplete will open + cy.get(dynamicInputLocators.hints).should("exist"); + // Tests if data tree entities are sorted + cy.get(`${dynamicInputLocators.hints} li`) + .eq(1) + .should("have.text", "Button1.text"); + cy.testJsontext("label", "", { parseSpecialCharSequences: true, }); - - // Tests if autocomplete will open - cy.get(dynamicInputLocators.hints).should("exist"); - // Tests if data tree entities are sorted - cy.get(`${dynamicInputLocators.hints} li`) - .eq(1) - .should("have.text", "Button1.text"); - cy.testJsontext("label", "", { - parseSpecialCharSequences: true, }); - }); - }); + }); - it("2. Test if action inside non event field throws error & open current value popup", () => { - cy.get(dynamicInputLocators.input) - .first() - .click({ force: true }) - .type("{backspace}".repeat(12)) - .type("{{storeValue()}}", { parseSpecialCharSequences: false }); - cy.evaluateErrorMessage( - "Please remove any direct/indirect references to {{actionName}} and try again. Data fields cannot execute framework actions.".replaceAll( - "{{actionName}}", - "storeValue()", - ), - ); - }); -}); + it("2. Test if action inside non event field throws error & open current value popup", () => { + cy.get(dynamicInputLocators.input) + .first() + .click({ force: true }) + .type("{backspace}".repeat(12)) + .type("{{storeValue()}}", { parseSpecialCharSequences: false }); + cy.evaluateErrorMessage( + "Please remove any direct/indirect references to {{actionName}} and try again. Data fields cannot execute framework actions.".replaceAll( + "{{actionName}}", + "storeValue()", + ), + ); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Binding/JSObject_Postgress_Table_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Binding/JSObject_Postgress_Table_spec.js index 7e75ad2fa70..edd3c88533f 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Binding/JSObject_Postgress_Table_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Binding/JSObject_Postgress_Table_spec.js @@ -10,7 +10,7 @@ let currentUrl; describe( "Addwidget from Query and bind with other widgets", - { tags: ["@tag.Binding"] }, + { tags: ["@tag.Binding", "@tag.Sanity"] }, function () { beforeEach(() => { _.dataSources.StartDataSourceRoutes(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Binding/TableV2_Widget_API_Pagination_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Binding/TableV2_Widget_API_Pagination_spec.js index c67cbd6cc53..03a7d1e93af 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Binding/TableV2_Widget_API_Pagination_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Binding/TableV2_Widget_API_Pagination_spec.js @@ -13,7 +13,7 @@ import { describe( "Test Create Api and Bind to Table widget V2", - { tags: ["@tag.Binding"] }, + { tags: ["@tag.Binding", "@tag.Sanity"] }, function () { before(() => { agHelper.AddDsl("tableV2TextPaginationDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/BugTests/AllWidgets_Reset_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/BugTests/AllWidgets_Reset_Spec.ts index 0945e34aea5..523dd65efee 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/BugTests/AllWidgets_Reset_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/BugTests/AllWidgets_Reset_Spec.ts @@ -414,7 +414,7 @@ function filePickerWidgetAndReset() { Object.entries(widgetsToTest).forEach(([widgetSelector, testConfig]) => { describe( `${testConfig.widgetName} widget test for validating reset assertWidgetReset`, - { tags: ["@tag.Widget"] }, + { tags: ["@tag.Widget", "@tag.Sanity"] }, () => { beforeEach(() => { _.agHelper.RestoreLocalStorageCache(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Debugger/JSObjects_navigation_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Debugger/JSObjects_navigation_spec.ts index 6d00f9aecd6..4852cd6ba58 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Debugger/JSObjects_navigation_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Debugger/JSObjects_navigation_spec.ts @@ -7,7 +7,7 @@ import { } from "../../../../support/Objects/ObjectsCore"; import EditorNavigation from "../../../../support/Pages/EditorNavigation"; -describe("JSObjects", () => { +describe("JSObjects", { tags: ["@tag.JS"] }, () => { it("1. Focus and position cursor on the ch,line having an error", () => { const JS_OBJECT_BODY = `export default { myVar1: [], diff --git a/app/client/cypress/e2e/Regression/ClientSide/DynamicHeight/Auto_Height_Limit_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/DynamicHeight/Auto_Height_Limit_spec.ts index ecd442fdb89..333a0fd34fd 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/DynamicHeight/Auto_Height_Limit_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/DynamicHeight/Auto_Height_Limit_spec.ts @@ -5,7 +5,7 @@ import EditorNavigation, { describe( "Dynamic Height Width validation with limits", - { tags: ["@tag.AutoHeight"] }, + { tags: ["@tag.AutoHeight", "@tag.Sanity"] }, function () { it("1. Validate change in auto height with limits width for widgets and highlight section validation", function () { agHelper.AddDsl("dynamicHeightContainerdsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/DynamicHeight/Auto_Height_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/DynamicHeight/Auto_Height_spec.ts index 4ba99b83f1c..08b53f1fcfe 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/DynamicHeight/Auto_Height_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/DynamicHeight/Auto_Height_spec.ts @@ -11,7 +11,7 @@ import EditorNavigation, { describe( "Dynamic Height Width validation", - { tags: ["@tag.AutoHeight"] }, + { tags: ["@tag.AutoHeight", "@tag.Sanity"] }, function () { afterEach(() => { agHelper.SaveLocalStorageCache(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Widgets_Copy_Delete_Undo_spec.js b/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Widgets_Copy_Delete_Undo_spec.js index 38e1ebd5ee1..9c8d981cda5 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Widgets_Copy_Delete_Undo_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Widgets_Copy_Delete_Undo_spec.js @@ -17,7 +17,7 @@ before(() => { describe( "Test Suite to validate copy/delete/undo functionalites", - { tags: ["@tag.IDE"] }, + { tags: ["@tag.IDE", "@tag.Sanity"] }, function () { const modifierKey = Cypress.platform === "darwin" ? "meta" : "ctrl"; 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 b95fe225fef..3495f3942d8 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Fork/ForkApplicationReconnectModal_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Fork/ForkApplicationReconnectModal_spec.ts @@ -8,7 +8,7 @@ let currentWorkspace: string, currentAppName: string, forkWorkspaceName: string; describe( "Fork application across workspaces", - { tags: ["@tag.Fork"] }, + { tags: ["@tag.Fork", "@tag.Sanity"] }, 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 () { // Create new workspace to create App in 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 3882701471f..85eb6edf6ec 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,7 +19,7 @@ import EditorNavigation, { describe( "Import and validate older app (app created in older versions of Appsmith) from Gitea", - { tags: ["@tag.Git"] }, + { tags: ["@tag.Git", "@tag.Sanity"] }, function () { let appRepoName = "TestMigration", appName = "UpgradeAppToLatestVersion", diff --git a/app/client/cypress/e2e/Regression/ClientSide/Git/GitAutocommit_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Git/GitAutocommit_spec.ts index 724e9c72a04..56caa3725d9 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Git/GitAutocommit_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Git/GitAutocommit_spec.ts @@ -11,7 +11,14 @@ let repoName: string = "TED-testrepo1"; describe( "Git Autocommit", - { tags: ["@tag.Git", "@tag.GitAutocommit", "@tag.excludeForAirgap"] }, + { + tags: [ + "@tag.Git", + "@tag.GitAutocommit", + "@tag.excludeForAirgap", + "@tag.Sanity", + ], + }, function () { it("Check if autocommit progress bar is visible and network requests are properly called", function () { featureFlagIntercept({ diff --git a/app/client/cypress/e2e/Regression/ClientSide/Git/GitDiscardChange/DiscardChanges_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Git/GitDiscardChange/DiscardChanges_spec.js index df7a398ff8b..fd1877ce5c2 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Git/GitDiscardChange/DiscardChanges_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Git/GitDiscardChange/DiscardChanges_spec.js @@ -17,203 +17,209 @@ import EditorNavigation, { } from "../../../../../support/Pages/EditorNavigation"; import PageList from "../../../../../support/Pages/PageList"; -describe("Git discard changes:", { tags: ["@tag.Git"] }, function () { - let datasourceName; - let repoName; - const query1 = "get_employees"; - const query2 = "get_category"; - const jsObject = "JSObject1"; - const page2 = "Page2"; - const page3 = "Page3"; - - it("1. Create an app with Query1 and JSObject1, connect it to git", () => { - // Create new postgres datasource - dataSources.CreateDataSource("Postgres"); - cy.get("@dsName").then(($dsName) => { - datasourceName = $dsName; - dataSources.CreateQueryAfterDSSaved( - `SELECT * FROM public."employees" where employee_id=1`, - query1, +describe( + "Git discard changes:", + { tags: ["@tag.Git", "@tag.Sanity"] }, + function () { + let datasourceName; + let repoName; + const query1 = "get_employees"; + const query2 = "get_category"; + const jsObject = "JSObject1"; + const page2 = "Page2"; + const page3 = "Page3"; + + it("1. Create an app with Query1 and JSObject1, connect it to git", () => { + // Create new postgres datasource + dataSources.CreateDataSource("Postgres"); + cy.get("@dsName").then(($dsName) => { + datasourceName = $dsName; + dataSources.CreateQueryAfterDSSaved( + `SELECT * FROM public."employees" where employee_id=1`, + query1, + ); + dataSources.RunQuery(); + }); + + EditorNavigation.SelectEntityByName("Page1", EntityType.Page); + cy.wait("@getPage"); + // bind input widget to postgres query on page1 + entityExplorer.DragDropWidgetNVerify(draggableWidgets.INPUT_V2); + propPane.UpdatePropertyFieldValue( + "Default value", + `{{${query1}.data[0].first_name}}`, + ); + PageList.AddNewPage(); + EditorNavigation.SelectEntityByName(page2, EntityType.Page); + cy.wait("@getPage"); + jsEditor.CreateJSObject('return "Success";'); + entityExplorer.DragDropWidgetNVerify(draggableWidgets.INPUT_V2); + propPane.UpdatePropertyFieldValue( + "Default value", + `{{JSObject1.myFun1()}}`, + ); + PageLeftPane.switchSegment(PagePaneSegment.UI); + // connect app to git + gitSync.CreateNConnectToGit(); + gitSync.CreateGitBranch(); + cy.get("@gitRepoName").then((repName) => { + repoName = repName; + }); + }); + + it("2. Add new datasource query, discard changes, verify query is deleted", () => { + EditorNavigation.SelectEntityByName("Page1", EntityType.Page); + cy.wait("@getPage"); + // create new postgres query + dataSources.CreateQueryForDS( + datasourceName, + `SELECT * FROM public."category" LIMIT 10;`, + query2, ); dataSources.RunQuery(); + // navigate to Page1 + EditorNavigation.SelectEntityByName("Page1", EntityType.Page); + cy.wait("@getPage"); + // discard changes + gitSync.DiscardChanges(); + PageLeftPane.switchSegment(PagePaneSegment.Queries); + // verify query2 is not present + PageLeftPane.assertAbsence(query2); + }); + + it("3. Add new JSObject , discard changes verify JSObject is deleted", () => { + jsEditor.CreateJSObject('return "Success";'); + PageLeftPane.switchSegment(PagePaneSegment.JS); + PageLeftPane.assertPresence(jsObject); + gitSync.DiscardChanges(); + PageLeftPane.switchSegment(PagePaneSegment.JS); + // verify jsObject2 is deleted after discarding changes + PageLeftPane.assertAbsence(jsObject); }); - EditorNavigation.SelectEntityByName("Page1", EntityType.Page); - cy.wait("@getPage"); - // bind input widget to postgres query on page1 - entityExplorer.DragDropWidgetNVerify(draggableWidgets.INPUT_V2); - propPane.UpdatePropertyFieldValue( - "Default value", - `{{${query1}.data[0].first_name}}`, - ); - PageList.AddNewPage(); - EditorNavigation.SelectEntityByName(page2, EntityType.Page); - cy.wait("@getPage"); - jsEditor.CreateJSObject('return "Success";'); - entityExplorer.DragDropWidgetNVerify(draggableWidgets.INPUT_V2); - propPane.UpdatePropertyFieldValue( - "Default value", - `{{JSObject1.myFun1()}}`, - ); - PageLeftPane.switchSegment(PagePaneSegment.UI); - // connect app to git - gitSync.CreateNConnectToGit(); - gitSync.CreateGitBranch(); - cy.get("@gitRepoName").then((repName) => { - repoName = repName; + it("4. Delete page2 and trigger discard flow, page2 should be available again", () => { + PageList.DeletePage(page2); + // verify page is deleted + PageList.assertAbsence(page2); + gitSync.DiscardChanges(); + // verify page2 is recovered back + PageList.assertPresence(page2); + EditorNavigation.SelectEntityByName(page2, EntityType.Page); + cy.wait("@getPage"); + // verify data binding on page2 + cy.get(".bp3-input").should("have.value", "Success"); }); - }); - - it("2. Add new datasource query, discard changes, verify query is deleted", () => { - EditorNavigation.SelectEntityByName("Page1", EntityType.Page); - cy.wait("@getPage"); - // create new postgres query - dataSources.CreateQueryForDS( - datasourceName, - `SELECT * FROM public."category" LIMIT 10;`, - query2, - ); - dataSources.RunQuery(); - // navigate to Page1 - EditorNavigation.SelectEntityByName("Page1", EntityType.Page); - cy.wait("@getPage"); - // discard changes - gitSync.DiscardChanges(); - PageLeftPane.switchSegment(PagePaneSegment.Queries); - // verify query2 is not present - PageLeftPane.assertAbsence(query2); - }); - - it("3. Add new JSObject , discard changes verify JSObject is deleted", () => { - jsEditor.CreateJSObject('return "Success";'); - PageLeftPane.switchSegment(PagePaneSegment.JS); - PageLeftPane.assertPresence(jsObject); - gitSync.DiscardChanges(); - PageLeftPane.switchSegment(PagePaneSegment.JS); - // verify jsObject2 is deleted after discarding changes - PageLeftPane.assertAbsence(jsObject); - }); - - it("4. Delete page2 and trigger discard flow, page2 should be available again", () => { - PageList.DeletePage(page2); - // verify page is deleted - PageList.assertAbsence(page2); - gitSync.DiscardChanges(); - // verify page2 is recovered back - PageList.assertPresence(page2); - EditorNavigation.SelectEntityByName(page2, EntityType.Page); - cy.wait("@getPage"); - // verify data binding on page2 - cy.get(".bp3-input").should("have.value", "Success"); - }); - - it("5. Delete Query1 and trigger discard flow, Query1 will be recovered", () => { - // navigate to Page1 - EditorNavigation.SelectEntityByName("Page1", EntityType.Page); - // delete query1 - EditorNavigation.SelectEntityByName(query1, EntityType.Query); - entityExplorer.ActionContextMenuByEntityName({ - entityNameinLeftSidebar: query1, - action: "Delete", - entityType: entityItems.Query, + + it("5. Delete Query1 and trigger discard flow, Query1 will be recovered", () => { + // navigate to Page1 + EditorNavigation.SelectEntityByName("Page1", EntityType.Page); + // delete query1 + EditorNavigation.SelectEntityByName(query1, EntityType.Query); + entityExplorer.ActionContextMenuByEntityName({ + entityNameinLeftSidebar: query1, + action: "Delete", + entityType: entityItems.Query, + }); + // verify Query1 is deleted + PageLeftPane.assertAbsence(query1); + // discard changes + gitSync.DiscardChanges(); + //verify query1 is recovered + PageLeftPane.switchSegment(PagePaneSegment.Queries); + PageLeftPane.assertPresence(query1); + PageLeftPane.switchSegment(PagePaneSegment.UI); + cy.get(".bp3-input").should("have.value", "Nancy"); }); - // verify Query1 is deleted - PageLeftPane.assertAbsence(query1); - // discard changes - gitSync.DiscardChanges(); - //verify query1 is recovered - PageLeftPane.switchSegment(PagePaneSegment.Queries); - PageLeftPane.assertPresence(query1); - PageLeftPane.switchSegment(PagePaneSegment.UI); - cy.get(".bp3-input").should("have.value", "Nancy"); - }); - - it("6. Delete JSObject1 and trigger discard flow, JSObject1 should be active again", () => { - // navigate to page2 - EditorNavigation.SelectEntityByName(page2, EntityType.Page); - cy.wait("@getPage"); - cy.wait(3000); - /* create and save jsObject */ - // jsEditor.CreateJSObject('return "Success";'); - // delete jsObject1 - EditorNavigation.SelectEntityByName(jsObject, EntityType.JSObject); - agHelper.ActionContextMenuWithInPane({ - action: "Delete", + + it("6. Delete JSObject1 and trigger discard flow, JSObject1 should be active again", () => { + // navigate to page2 + EditorNavigation.SelectEntityByName(page2, EntityType.Page); + cy.wait("@getPage"); + cy.wait(3000); + /* create and save jsObject */ + // jsEditor.CreateJSObject('return "Success";'); + // delete jsObject1 + EditorNavigation.SelectEntityByName(jsObject, EntityType.JSObject); + agHelper.ActionContextMenuWithInPane({ + action: "Delete", + }); + PageLeftPane.assertAbsence(jsObject); + // discard changes + gitSync.DiscardChanges(); + EditorNavigation.SelectEntityByName(page2, EntityType.Page); + cy.wait("@getPage"); + cy.wait(3000); + //verify JSObject is recovered + PageLeftPane.switchSegment(PagePaneSegment.JS); + PageLeftPane.assertPresence(jsObject); + PageLeftPane.switchSegment(PagePaneSegment.UI); + cy.get(".bp3-input").should("have.value", "Success"); + }); + + it("7. Add new page i.e page3, go to page2 & discard changes, verify page3 is removed", () => { + // create new page page3 and move to page2 + cy.Createpage(page3); + EditorNavigation.SelectEntityByName(page2, EntityType.Page); + // discard changes + gitSync.DiscardChanges(); + // verify page3 is removed + PageList.assertAbsence(page3); }); - PageLeftPane.assertAbsence(jsObject); - // discard changes - gitSync.DiscardChanges(); - EditorNavigation.SelectEntityByName(page2, EntityType.Page); - cy.wait("@getPage"); - cy.wait(3000); - //verify JSObject is recovered - PageLeftPane.switchSegment(PagePaneSegment.JS); - PageLeftPane.assertPresence(jsObject); - PageLeftPane.switchSegment(PagePaneSegment.UI); - cy.get(".bp3-input").should("have.value", "Success"); - }); - - it("7. Add new page i.e page3, go to page2 & discard changes, verify page3 is removed", () => { - // create new page page3 and move to page2 - cy.Createpage(page3); - EditorNavigation.SelectEntityByName(page2, EntityType.Page); - // discard changes - gitSync.DiscardChanges(); - // verify page3 is removed - PageList.assertAbsence(page3); - }); - - it(`8. Add new page i.e page3, discard changes should not throw error: "resource not found"`, () => { - cy.Createpage(page3); - gitSync.DiscardChanges(); - PageList.assertAbsence(page3); - }); - - it("9. On discard failure an error message should be show and user should be able to discard again", () => { - cy.Createpage(page3); - - agHelper.GetNClick(gitSyncLocators.bottomBarCommitButton); - agHelper.AssertElementVisibility(gitSyncLocators.discardChanges); - cy.intercept("PUT", "/api/v1/git/discard/app/*", { - body: { - responseMeta: { - status: 500, - success: false, - error: { - code: 5000, - message: - "Provided file format is incompatible, please upgrade your instance to resolve this conflict.", - errorType: "INTERNAL_ERROR", + + it(`8. Add new page i.e page3, discard changes should not throw error: "resource not found"`, () => { + cy.Createpage(page3); + gitSync.DiscardChanges(); + PageList.assertAbsence(page3); + }); + + it("9. On discard failure an error message should be show and user should be able to discard again", () => { + cy.Createpage(page3); + + agHelper.GetNClick(gitSyncLocators.bottomBarCommitButton); + agHelper.AssertElementVisibility(gitSyncLocators.discardChanges); + cy.intercept("PUT", "/api/v1/git/discard/app/*", { + body: { + responseMeta: { + status: 500, + success: false, + error: { + code: 5000, + message: + "Provided file format is incompatible, please upgrade your instance to resolve this conflict.", + errorType: "INTERNAL_ERROR", + }, }, }, - }, - delay: 1000, + delay: 1000, + }); + + agHelper + .GetElement(gitSyncLocators.discardChanges) + .children() + .should("have.text", "Discard & pull"); + + agHelper.GetNClick(gitSyncLocators.discardChanges); + agHelper.AssertContains( + Cypress.env("MESSAGES").DISCARD_CHANGES_WARNING(), + ); + agHelper + .GetElement(gitSyncLocators.discardChanges) + .children() + .should("have.text", "Are you sure?"); + agHelper.GetNClick(gitSyncLocators.discardChanges); + agHelper.AssertContains( + Cypress.env("MESSAGES").DISCARDING_AND_PULLING_CHANGES(), + ); + cy.contains(Cypress.env("MESSAGES").DISCARDING_AND_PULLING_CHANGES()); + agHelper.Sleep(2000); + + agHelper.AssertElementVisibility(".ads-v2-callout__children"); + agHelper.AssertElementVisibility(gitSyncLocators.discardChanges); }); - agHelper - .GetElement(gitSyncLocators.discardChanges) - .children() - .should("have.text", "Discard & pull"); - - agHelper.GetNClick(gitSyncLocators.discardChanges); - agHelper.AssertContains(Cypress.env("MESSAGES").DISCARD_CHANGES_WARNING()); - agHelper - .GetElement(gitSyncLocators.discardChanges) - .children() - .should("have.text", "Are you sure?"); - agHelper.GetNClick(gitSyncLocators.discardChanges); - agHelper.AssertContains( - Cypress.env("MESSAGES").DISCARDING_AND_PULLING_CHANGES(), - ); - cy.contains(Cypress.env("MESSAGES").DISCARDING_AND_PULLING_CHANGES()); - agHelper.Sleep(2000); - - agHelper.AssertElementVisibility(".ads-v2-callout__children"); - agHelper.AssertElementVisibility(gitSyncLocators.discardChanges); - }); - - after(() => { - //clean up - //gitSync.DeleteTestGithubRepo(repoName); - }); -}); + after(() => { + //clean up + //gitSync.DeleteTestGithubRepo(repoName); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Git/GitImport/GitImport_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Git/GitImport/GitImport_spec.js index 80f564b873e..0c64032af71 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Git/GitImport/GitImport_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Git/GitImport/GitImport_spec.js @@ -21,205 +21,213 @@ import EditorNavigation, { } from "../../../../../support/Pages/EditorNavigation"; import PageList from "../../../../../support/Pages/PageList"; -describe("Git import flow ", { tags: ["@tag.Git"] }, function () { - it("1. Import an app from JSON with Postgres, MySQL, Mongo db & then connect it to Git", () => { - homePage.NavigateToHome(); - agHelper.GetNClick(homePageLocators.createNew, 0); - cy.get(homePageLocators.workspaceImportAppOption).click({ force: true }); - cy.get(homePageLocators.workspaceImportAppModal).should("be.visible"); - cy.wait(1000); - cy.xpath(homePageLocators.uploadLogo).selectFile( - "cypress/fixtures/gitImport.json", - { force: true }, - ); - cy.wait(4000); - cy.wait("@importNewApplication").then((interception) => { - cy.log(interception.response.body.data); +describe( + "Git import flow ", + { tags: ["@tag.Git", "@tag.Sanity"] }, + function () { + it("1. Import an app from JSON with Postgres, MySQL, Mongo db & then connect it to Git", () => { + homePage.NavigateToHome(); + agHelper.GetNClick(homePageLocators.createNew, 0); + cy.get(homePageLocators.workspaceImportAppOption).click({ force: true }); + cy.get(homePageLocators.workspaceImportAppModal).should("be.visible"); cy.wait(1000); - // should check reconnect modal opening + cy.xpath(homePageLocators.uploadLogo).selectFile( + "cypress/fixtures/gitImport.json", + { force: true }, + ); + cy.wait(4000); + cy.wait("@importNewApplication").then((interception) => { + cy.log(interception.response.body.data); + cy.wait(1000); + // should check reconnect modal opening + cy.get(reconnectDatasourceModal.Modal).should("be.visible"); + cy.ReconnectDatasource("TEDPostgres"); + cy.wait(1000); + dataSources.FillPostgresDSForm(); + cy.testDatasource(true); + agHelper.GetNClick(dataSources._saveDs); + cy.wait(1000); + cy.ReconnectDatasource("TEDMySQL"); + cy.wait(500); + dataSources.FillMySqlDSForm(); + cy.testDatasource(true); + agHelper.GetNClick(dataSources._saveDs); + cy.wait(1000); + cy.ReconnectDatasource("TEDMongo"); + cy.wait(1000); + dataSources.FillMongoDSForm(); + cy.testDatasource(true); + dataSources.SaveDatasource(true); + cy.wait("@getWorkspace"); + cy.get(reconnectDatasourceModal.ImportSuccessModal).should( + "be.visible", + ); + cy.get(reconnectDatasourceModal.ImportSuccessModalCloseBtn).click({ + force: true, + }); + cy.wait(1000); + + gitSync.CreateNConnectToGit(); + cy.get("@gitRepoName").then((repName) => { + repoName = repName; + gitSync.CreateGitBranch(repoName); + }); + + agHelper.AssertElementExist(gitSync._bottomBarPull); + }); + }); + + it("2. Import the previous app connected to Git and reconnect Postgres, MySQL and Mongo db ", () => { + homePage.NavigateToHome(); + cy.createWorkspace(); + let newWorkspaceName; + cy.wait("@createWorkspace").then((interception) => { + newWorkspaceName = interception.response.body.data.name; + cy.CreateAppForWorkspace(newWorkspaceName, "gitImport"); + }); + gitSync.ImportAppFromGit(newWorkspaceName, repoName); + cy.wait(5000); cy.get(reconnectDatasourceModal.Modal).should("be.visible"); cy.ReconnectDatasource("TEDPostgres"); - cy.wait(1000); - dataSources.FillPostgresDSForm(); + cy.wait(500); + cy.fillPostgresDatasourceForm(); + cy.get(datasourceEditor.sectionAuthentication).click(); cy.testDatasource(true); agHelper.GetNClick(dataSources._saveDs); - cy.wait(1000); + cy.wait(500); cy.ReconnectDatasource("TEDMySQL"); cy.wait(500); - dataSources.FillMySqlDSForm(); + cy.fillMySQLDatasourceForm(); + cy.get(datasourceEditor.sectionAuthentication).click(); cy.testDatasource(true); agHelper.GetNClick(dataSources._saveDs); - cy.wait(1000); + cy.wait(500); cy.ReconnectDatasource("TEDMongo"); - cy.wait(1000); + cy.wait(500); dataSources.FillMongoDSForm(); + cy.get(datasourceEditor.sectionAuthentication).click(); cy.testDatasource(true); - dataSources.SaveDatasource(true); - cy.wait("@getWorkspace"); + agHelper.GetNClick(dataSources._saveDs); + cy.wait(2000); cy.get(reconnectDatasourceModal.ImportSuccessModal).should("be.visible"); cy.get(reconnectDatasourceModal.ImportSuccessModalCloseBtn).click({ force: true, }); - cy.wait(1000); - - gitSync.CreateNConnectToGit(); - cy.get("@gitRepoName").then((repName) => { - repoName = repName; - gitSync.CreateGitBranch(repoName); + cy.wait("@gitStatus").then((interception) => { + cy.log(interception.response.body.data); + cy.wait(1000); }); - agHelper.AssertElementExist(gitSync._bottomBarPull); - }); - }); - it("2. Import the previous app connected to Git and reconnect Postgres, MySQL and Mongo db ", () => { - homePage.NavigateToHome(); - cy.createWorkspace(); - let newWorkspaceName; - cy.wait("@createWorkspace").then((interception) => { - newWorkspaceName = interception.response.body.data.name; - cy.CreateAppForWorkspace(newWorkspaceName, "gitImport"); - }); - gitSync.ImportAppFromGit(newWorkspaceName, repoName); - cy.wait(5000); - cy.get(reconnectDatasourceModal.Modal).should("be.visible"); - cy.ReconnectDatasource("TEDPostgres"); - cy.wait(500); - cy.fillPostgresDatasourceForm(); - cy.get(datasourceEditor.sectionAuthentication).click(); - cy.testDatasource(true); - agHelper.GetNClick(dataSources._saveDs); - cy.wait(500); - cy.ReconnectDatasource("TEDMySQL"); - cy.wait(500); - cy.fillMySQLDatasourceForm(); - cy.get(datasourceEditor.sectionAuthentication).click(); - cy.testDatasource(true); - agHelper.GetNClick(dataSources._saveDs); - cy.wait(500); - cy.ReconnectDatasource("TEDMongo"); - cy.wait(500); - dataSources.FillMongoDSForm(); - cy.get(datasourceEditor.sectionAuthentication).click(); - cy.testDatasource(true); - agHelper.GetNClick(dataSources._saveDs); - cy.wait(2000); - cy.get(reconnectDatasourceModal.ImportSuccessModal).should("be.visible"); - cy.get(reconnectDatasourceModal.ImportSuccessModalCloseBtn).click({ - force: true, - }); - cy.wait("@gitStatus").then((interception) => { - cy.log(interception.response.body.data); - cy.wait(1000); + cy.wait(3000); //for uncommited changes to appear if any! + cy.get("body").then(($body) => { + if ($body.find(gitSyncLocators.gitPullCount).length > 0) { + gitSync.CommitAndPush(); + } + }); }); - agHelper.AssertElementExist(gitSync._bottomBarPull); - cy.wait(3000); //for uncommited changes to appear if any! - cy.get("body").then(($body) => { - if ($body.find(gitSyncLocators.gitPullCount).length > 0) { - gitSync.CommitAndPush(); - } + it("3. Verfiy imported app should have all the data binding visible in view and edit mode", () => { + // verify postgres data binded to table + cy.get(".tbody").should("contain.text", "Test user 7"); + //verify MySQL data binded to table + cy.get(".tbody").should("contain.text", "New Config"); + // verify api response binded to input widget + cy.xpath("//input[@value='this is a test']").should("be.visible"); + // verify js object binded to input widget + cy.xpath("//input[@value='Success']").should("be.visible"); }); - }); - - it("3. Verfiy imported app should have all the data binding visible in view and edit mode", () => { - // verify postgres data binded to table - cy.get(".tbody").should("contain.text", "Test user 7"); - //verify MySQL data binded to table - cy.get(".tbody").should("contain.text", "New Config"); - // verify api response binded to input widget - cy.xpath("//input[@value='this is a test']").should("be.visible"); - // verify js object binded to input widget - cy.xpath("//input[@value='Success']").should("be.visible"); - }); - it("4. Create a new branch, clone page and validate data on that branch in view and edit mode", () => { - //cy.createGitBranch(newBranch); - gitSync.CreateGitBranch(newBranch, true); + it("4. Create a new branch, clone page and validate data on that branch in view and edit mode", () => { + //cy.createGitBranch(newBranch); + gitSync.CreateGitBranch(newBranch, true); - cy.get("@gitbranchName").then((branName) => { - newBranch = branName; - cy.log("newBranch is " + newBranch); - }); - cy.get(".tbody").should("contain.text", "Test user 7"); - // verify MySQL data binded to table - cy.get(".tbody").should("contain.text", "New Config"); - // verify api response binded to input widget - cy.xpath("//input[@value='this is a test']"); - // verify js object binded to input widget - cy.xpath("//input[@value='Success']"); + cy.get("@gitbranchName").then((branName) => { + newBranch = branName; + cy.log("newBranch is " + newBranch); + }); + cy.get(".tbody").should("contain.text", "Test user 7"); + // verify MySQL data binded to table + cy.get(".tbody").should("contain.text", "New Config"); + // verify api response binded to input widget + cy.xpath("//input[@value='this is a test']"); + // verify js object binded to input widget + cy.xpath("//input[@value='Success']"); - PageList.ClonePage(); + PageList.ClonePage(); - // verify jsObject is not duplicated - agHelper.Sleep(2000); //for cloning of table data to finish - EditorNavigation.SelectEntityByName(jsObject, EntityType.JSObject); //Also checking jsobject exists after cloning the page - PageLeftPane.switchSegment(PagePaneSegment.UI); - cy.xpath("//input[@class='bp3-input' and @value='Success']").should( - "be.visible", - ); + // verify jsObject is not duplicated + agHelper.Sleep(2000); //for cloning of table data to finish + EditorNavigation.SelectEntityByName(jsObject, EntityType.JSObject); //Also checking jsobject exists after cloning the page + PageLeftPane.switchSegment(PagePaneSegment.UI); + cy.xpath("//input[@class='bp3-input' and @value='Success']").should( + "be.visible", + ); - // deploy the app and validate data binding - cy.wait(2000); - cy.get(homePageLocators.publishButton).click(); - agHelper.AssertElementExist(gitSync._bottomBarPull); - cy.get(gitSyncLocators.commitCommentInput).type("Initial Commit"); - cy.get(gitSyncLocators.commitButton).click(); - cy.intercept("POST", "api/v1/git/commit/app/*").as("commit"); - agHelper.AssertElementExist(gitSync._bottomBarPull); - cy.get(gitSyncLocators.closeGitSyncModal).click(); - cy.wait(2000); - gitSync.MergeToMaster(); - cy.wait(2000); - cy.latestDeployPreview(); - table.AssertTableLoaded(); - // verify api response binded to input widget - cy.xpath("//input[@value='this is a test']"); - // verify js object binded to input widget - cy.xpath("//input[@value='Success']"); - // navigate to Page1 and verify data - cy.get(".t--page-switch-tab").contains("Page1").click({ force: true }); - table.AssertTableLoaded(); - // verify api response binded to input widget - cy.xpath("//input[@value='this is a test']"); - // verify js object binded to input widget - cy.xpath("//input[@value='Success']"); - deployMode.NavigateBacktoEditor(); - }); + // deploy the app and validate data binding + cy.wait(2000); + cy.get(homePageLocators.publishButton).click(); + agHelper.AssertElementExist(gitSync._bottomBarPull); + cy.get(gitSyncLocators.commitCommentInput).type("Initial Commit"); + cy.get(gitSyncLocators.commitButton).click(); + cy.intercept("POST", "api/v1/git/commit/app/*").as("commit"); + agHelper.AssertElementExist(gitSync._bottomBarPull); + cy.get(gitSyncLocators.closeGitSyncModal).click(); + cy.wait(2000); + gitSync.MergeToMaster(); + cy.wait(2000); + cy.latestDeployPreview(); + table.AssertTableLoaded(); + // verify api response binded to input widget + cy.xpath("//input[@value='this is a test']"); + // verify js object binded to input widget + cy.xpath("//input[@value='Success']"); + // navigate to Page1 and verify data + cy.get(".t--page-switch-tab").contains("Page1").click({ force: true }); + table.AssertTableLoaded(); + // verify api response binded to input widget + cy.xpath("//input[@value='this is a test']"); + // verify js object binded to input widget + cy.xpath("//input[@value='Success']"); + deployMode.NavigateBacktoEditor(); + }); - it("5. Switch to master and verify data in edit and view mode", () => { - cy.switchGitBranch("master"); - cy.wait(2000); - // validate data binding in edit and deploy mode - cy.latestDeployPreview(); - cy.get(".tbody").should("have.length", 2); - table.AssertTableLoaded(0, 1, "v1"); - cy.xpath("//input[@value='this is a test']"); - cy.xpath("//input[@value='Success']"); - // navigate to Page1 and verify data - cy.get(".t--page-switch-tab").contains("Page1 Copy").click({ force: true }); - table.AssertTableLoaded(0, 1, "v1"); - cy.xpath("//input[@value='this is a test']"); - cy.xpath("//input[@value='Success']"); - deployMode.NavigateBacktoEditor(); - }); + it("5. Switch to master and verify data in edit and view mode", () => { + cy.switchGitBranch("master"); + cy.wait(2000); + // validate data binding in edit and deploy mode + cy.latestDeployPreview(); + cy.get(".tbody").should("have.length", 2); + table.AssertTableLoaded(0, 1, "v1"); + cy.xpath("//input[@value='this is a test']"); + cy.xpath("//input[@value='Success']"); + // navigate to Page1 and verify data + cy.get(".t--page-switch-tab") + .contains("Page1 Copy") + .click({ force: true }); + table.AssertTableLoaded(0, 1, "v1"); + cy.xpath("//input[@value='this is a test']"); + cy.xpath("//input[@value='Success']"); + deployMode.NavigateBacktoEditor(); + }); - it("6. Add widget to master, merge then checkout to child branch and verify data", () => { - PageLeftPane.switchSegment(PagePaneSegment.UI); - cy.wait(2000); // wait for transition - cy.dragAndDropToCanvas("buttonwidget", { x: 300, y: 600 }); - cy.wait(3000); - gitSync.CommitAndPush(); - cy.merge(newBranch); - cy.get(gitSyncLocators.closeGitSyncModal).click(); - cy.wait(2000); - cy.switchGitBranch(newBranch); - cy.wait(4000); - // verify button widget is visible on child branch - cy.get(".t--widget-buttonwidget").should("be.visible"); - }); + it("6. Add widget to master, merge then checkout to child branch and verify data", () => { + PageLeftPane.switchSegment(PagePaneSegment.UI); + cy.wait(2000); // wait for transition + cy.dragAndDropToCanvas("buttonwidget", { x: 300, y: 600 }); + cy.wait(3000); + gitSync.CommitAndPush(); + cy.merge(newBranch); + cy.get(gitSyncLocators.closeGitSyncModal).click(); + cy.wait(2000); + cy.switchGitBranch(newBranch); + cy.wait(4000); + // verify button widget is visible on child branch + cy.get(".t--widget-buttonwidget").should("be.visible"); + }); - after(() => { - gitSync.DeleteTestGithubRepo(repoName); - }); -}); + after(() => { + gitSync.DeleteTestGithubRepo(repoName); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/DeleteBranch_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/DeleteBranch_spec.js index ec41b6a83e8..f1259df417d 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/DeleteBranch_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/DeleteBranch_spec.js @@ -7,7 +7,7 @@ import { } from "../../../../../support/Pages/EditorNavigation"; let repoName, branchName; -describe("Delete branch flow", { tags: ["@tag.Git"] }, () => { +describe("Delete branch flow", { tags: ["@tag.Git", "@tag.Sanity"] }, () => { it("1. Connect app to git, create new branch and delete it", () => { // create git repo and connect app to git gitSync.CreateNConnectToGit(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/Deploy_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/Deploy_spec.js index 14f34e78313..e2d3411a371 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/Deploy_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/Deploy_spec.js @@ -3,57 +3,61 @@ import homePage from "../../../../../locators/HomePage"; import * as _ from "../../../../../support/Objects/ObjectsCore"; let repoName; -describe("Git sync modal: deploy tab", { tags: ["@tag.Git"] }, function () { - before(() => { - _.homePage.NavigateToHome(); - cy.createWorkspace(); - //_.homePage.CreateNewWorkspace("DeployGitTest"); - cy.wait("@createWorkspace").then((interception) => { - const newWorkspaceName = interception.response.body.data.name; - cy.CreateAppForWorkspace(newWorkspaceName, newWorkspaceName); +describe( + "Git sync modal: deploy tab", + { tags: ["@tag.Git", "@tag.Sanity"] }, + function () { + before(() => { + _.homePage.NavigateToHome(); + cy.createWorkspace(); + //_.homePage.CreateNewWorkspace("DeployGitTest"); + cy.wait("@createWorkspace").then((interception) => { + const newWorkspaceName = interception.response.body.data.name; + cy.CreateAppForWorkspace(newWorkspaceName, newWorkspaceName); + }); + _.gitSync.CreateNConnectToGit("Test"); + cy.get("@gitRepoName").then((repName) => { + repoName = repName; + }); }); - _.gitSync.CreateNConnectToGit("Test"); - cy.get("@gitRepoName").then((repName) => { - repoName = repName; + + it("1. Validate commit comment inputbox and last deployed preview", function () { + // last deployed preview + // The deploy preview Link should be displayed only after the first commit done + cy.get(gitSyncLocators.bottomBarCommitButton).click(); + + cy.get(gitSyncLocators.commitCommentInput).should("be.disabled"); + cy.get(gitSyncLocators.commitButton).should("be.disabled"); + cy.get(gitSyncLocators.closeGitSyncModal).click(); }); - }); - - it("1. Validate commit comment inputbox and last deployed preview", function () { - // last deployed preview - // The deploy preview Link should be displayed only after the first commit done - cy.get(gitSyncLocators.bottomBarCommitButton).click(); - - cy.get(gitSyncLocators.commitCommentInput).should("be.disabled"); - cy.get(gitSyncLocators.commitButton).should("be.disabled"); - cy.get(gitSyncLocators.closeGitSyncModal).click(); - }); - - it("2. Post connection app name deploy menu", function () { - // deploy - _.agHelper.GetNClick(_.locators._publishButton); - - cy.get(gitSyncLocators.gitSyncModal); - cy.get(gitSyncLocators.gitSyncModalDeployTab) - .should("have.attr", "aria-selected", "true") - .and("not.be.empty"); - cy.window().then((window) => { - cy.stub(window, "open").callsFake((url) => { - expect(url.indexOf("branch=master")).to.be.at.least(0); - expect(!!url).to.be.true; + + it("2. Post connection app name deploy menu", function () { + // deploy + _.agHelper.GetNClick(_.locators._publishButton); + + cy.get(gitSyncLocators.gitSyncModal); + cy.get(gitSyncLocators.gitSyncModalDeployTab) + .should("have.attr", "aria-selected", "true") + .and("not.be.empty"); + cy.window().then((window) => { + cy.stub(window, "open").callsFake((url) => { + expect(url.indexOf("branch=master")).to.be.at.least(0); + expect(!!url).to.be.true; + }); }); - }); - cy.get(gitSyncLocators.closeGitSyncModal).click(); + cy.get(gitSyncLocators.closeGitSyncModal).click(); - // current deployed version - _.agHelper.GetNClick(homePage.deployPopupOptionTrigger); - _.agHelper.AssertElementExist(homePage.currentDeployedPreviewBtn); + // current deployed version + _.agHelper.GetNClick(homePage.deployPopupOptionTrigger); + _.agHelper.AssertElementExist(homePage.currentDeployedPreviewBtn); - // connect to git - _.agHelper.AssertElementAbsence(homePage.connectToGitBtn); - }); + // connect to git + _.agHelper.AssertElementAbsence(homePage.connectToGitBtn); + }); - after(() => { - _.gitSync.DeleteTestGithubRepo(repoName); - }); -}); + after(() => { + _.gitSync.DeleteTestGithubRepo(repoName); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/GitConnectV2_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/GitConnectV2_spec.ts index 1deae827594..26cbff86c2a 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/GitConnectV2_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/GitConnectV2_spec.ts @@ -10,7 +10,7 @@ let app1Name: string; let repoName: any; let branchName: any; -describe("Git Connect V2", { tags: ["@tag.Git"] }, function () { +describe("Git Connect V2", { tags: ["@tag.Git", "@tag.Sanity"] }, function () { before(() => { _.agHelper.GenerateUUID(); cy.get("@guid").then((uid) => { diff --git a/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/GitSyncGitBugs_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/GitSyncGitBugs_spec.js index 65c3ebb47a5..e803036ac36 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/GitSyncGitBugs_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/GitSyncGitBugs_spec.js @@ -25,217 +25,90 @@ const mainBranch = "master"; const jsObject = "JSObject1"; let repoName; -describe("Git sync Bug #10773", { tags: ["@tag.Git"] }, function () { - beforeEach(() => { - agHelper.RestoreLocalStorageCache(); - }); - - afterEach(() => { - agHelper.SaveLocalStorageCache(); - }); - - it("1. Bug:10773 When user delete a resource form the child branch and merge it back to parent branch, still the deleted resource will show up in the newly created branch", () => { - homePage.NavigateToHome(); - cy.createWorkspace(); - cy.wait("@createWorkspace").then((interception) => { - const newWorkspaceName = interception.response.body.data.name; - cy.CreateAppForWorkspace(newWorkspaceName, "app-1"); - gitSync.CreateNConnectToGit(); - cy.get("@gitRepoName").then((repName) => { - repoName = repName; - // adding a new page "ChildPage" to master - cy.Createpage(pagename); - EditorNavigation.SelectEntityByName("Page1", EntityType.Page); - cy.commitAndPush(); - cy.wait(2000); - gitSync.CreateGitBranch(tempBranch, false); - //cy.createGitBranch(tempBranch); - // verify tempBranch should contain this page - EditorNavigation.SelectEntityByName(pagename, EntityType.Page); - // delete page from tempBranch and merge to master - PageList.DeletePage(pagename); - cy.get(homePageLocators.publishButton).click(); - cy.get(gitSyncLocators.commitCommentInput).type("Initial Commit"); - cy.get(gitSyncLocators.commitButton).click(); - cy.wait(8000); - cy.get(gitSyncLocators.closeGitSyncModal).click(); - cy.merge(mainBranch); - cy.get(gitSyncLocators.closeGitSyncModal).click(); - // verify ChildPage is not on master - cy.switchGitBranch(mainBranch); - PageList.ShowList(); - PageLeftPane.assertAbsence(pagename); - // create another branch and verify deleted page doesn't exist on it - //cy.createGitBranch(tempBranch0); - gitSync.CreateGitBranch(tempBranch0, false); - PageList.ShowList(); - PageLeftPane.assertAbsence(pagename); - gitSync.DeleteTestGithubRepo(repoName); - }); +describe( + "Git sync Bug #10773", + { tags: ["@tag.Git", "@tag.Sanity"] }, + function () { + beforeEach(() => { + agHelper.RestoreLocalStorageCache(); }); - }); - it("2. Connect app to git, clone the Page ,verify JSobject duplication should not happen and validate data binding in deploy mode and edit mode", () => { - homePage.NavigateToHome(); - cy.createWorkspace(); - cy.wait("@createWorkspace").then((interception) => { - const newWorkspaceName = interception.response.body.data.name; - cy.CreateAppForWorkspace(newWorkspaceName, "app-2"); - agHelper.AddDsl("JsObjecWithGitdsl"); - // connect app to git - gitSync.CreateNConnectToGit(); - cy.get("@gitRepoName").then((repName) => { - repoName = repName; + afterEach(() => { + agHelper.SaveLocalStorageCache(); + }); - // create JS Object and validate its data on Page1 - jsEditor.CreateJSObject('return "Success";'); - EditorNavigation.SelectEntityByName("Page1", EntityType.Page); - cy.wait(1000); - EditorNavigation.ShowCanvas(); - cy.xpath("//input[@class='bp3-input' and @value='Success']").should( - "be.visible", - ); - // clone the page1 and validate data binding - entityExplorer.ActionContextMenuByEntityName({ - entityNameinLeftSidebar: "Page1", - action: "Clone", - entityType: EntityItems.Page, + it("1. Bug:10773 When user delete a resource form the child branch and merge it back to parent branch, still the deleted resource will show up in the newly created branch", () => { + homePage.NavigateToHome(); + cy.createWorkspace(); + cy.wait("@createWorkspace").then((interception) => { + const newWorkspaceName = interception.response.body.data.name; + cy.CreateAppForWorkspace(newWorkspaceName, "app-1"); + gitSync.CreateNConnectToGit(); + cy.get("@gitRepoName").then((repName) => { + repoName = repName; + // adding a new page "ChildPage" to master + cy.Createpage(pagename); + EditorNavigation.SelectEntityByName("Page1", EntityType.Page); + cy.commitAndPush(); + cy.wait(2000); + gitSync.CreateGitBranch(tempBranch, false); + //cy.createGitBranch(tempBranch); + // verify tempBranch should contain this page + EditorNavigation.SelectEntityByName(pagename, EntityType.Page); + // delete page from tempBranch and merge to master + PageList.DeletePage(pagename); + cy.get(homePageLocators.publishButton).click(); + cy.get(gitSyncLocators.commitCommentInput).type("Initial Commit"); + cy.get(gitSyncLocators.commitButton).click(); + cy.wait(8000); + cy.get(gitSyncLocators.closeGitSyncModal).click(); + cy.merge(mainBranch); + cy.get(gitSyncLocators.closeGitSyncModal).click(); + // verify ChildPage is not on master + cy.switchGitBranch(mainBranch); + PageList.ShowList(); + PageLeftPane.assertAbsence(pagename); + // create another branch and verify deleted page doesn't exist on it + //cy.createGitBranch(tempBranch0); + gitSync.CreateGitBranch(tempBranch0, false); + PageList.ShowList(); + PageLeftPane.assertAbsence(pagename); + gitSync.DeleteTestGithubRepo(repoName); }); - cy.wait("@clonePage").should( - "have.nested.property", - "response.body.responseMeta.status", - 201, - ); - PageLeftPane.switchSegment(PagePaneSegment.JS); - // verify jsObject is not duplicated - PageLeftPane.assertPresence(jsObject); - EditorNavigation.ShowCanvas(); - cy.xpath("//input[@class='bp3-input' and @value='Success']").should( - "be.visible", - ); - // deploy the app and validate data binding - cy.get(homePageLocators.publishButton).click(); - agHelper.AssertElementExist(gitSync._bottomBarPull); - cy.get(gitSyncLocators.commitCommentInput).type("Initial Commit"); - cy.get(gitSyncLocators.commitButton).click(); - cy.wait(8000); - cy.get(gitSyncLocators.closeGitSyncModal).click(); - cy.latestDeployPreview(); - cy.wait(2000); - cy.xpath("//input[@class='bp3-input' and @value='Success']").should( - "be.visible", - ); - // switch to Page1 and validate data binding - cy.get(".t--page-switch-tab").contains("Page1").click({ force: true }); - cy.xpath("//input[@class='bp3-input' and @value='Success']").should( - "be.visible", - ); - deployMode.NavigateBacktoEditor(); }); }); - }); - it("3. Bug:12724 Js objects are merged to single page when user creates a new branch", () => { - // create a new branch, clone page and validate jsObject data binding - //cy.createGitBranch(tempBranch); - cy.wait(3000); - - gitSync.CreateGitBranch(tempBranch, true); - cy.wait(2000); - EditorNavigation.SelectEntityByName("Page1", EntityType.Page); - PageLeftPane.switchSegment(PagePaneSegment.JS); - // verify jsObject is not duplicated - PageLeftPane.assertPresence(jsObject); - EditorNavigation.ShowCanvas(); - cy.xpath("//input[@class='bp3-input' and @value='Success']").should( - "be.visible", - ); - entityExplorer.ActionContextMenuByEntityName({ - entityNameinLeftSidebar: "Page1", - action: "Clone", - entityType: EntityItems.Page, - }); - cy.wait("@clonePage").should( - "have.nested.property", - "response.body.responseMeta.status", - 201, - ); - gitSync.DeleteTestGithubRepo(repoName); - }); - - it("4. Create an app with JSObject, connect it to git and verify its data in edit and deploy mode", function () { - homePage.NavigateToHome(); - cy.createWorkspace(); - cy.wait("@createWorkspace").then((interception) => { - const newWorkspaceName = interception.response.body.data.name; - cy.CreateAppForWorkspace(newWorkspaceName, newWorkspaceName); - agHelper.AddDsl("JsObjecWithGitdsl"); - }); - // create JS Object and validate its data on Page1 - jsEditor.CreateJSObject('return "Success";'); - EditorNavigation.SelectEntityByName("Page1", EntityType.Page); - cy.wait(1000); - EditorNavigation.ShowCanvas(); - cy.xpath("//input[@class='bp3-input' and @value='Success']").should( - "be.visible", - ); - // clone the page1 and validate data binding - entityExplorer.ActionContextMenuByEntityName({ - entityNameinLeftSidebar: "Page1", - action: "Clone", - entityType: EntityItems.Page, - }); - cy.wait("@clonePage").should( - "have.nested.property", - "response.body.responseMeta.status", - 201, - ); - // connect app to git and deploy - gitSync.CreateNConnectToGit(); - cy.get("@gitRepoName").then((repName) => { - repoName = repName; - cy.wait(2000); - - cy.window() - .its("store") - .invoke("getState") - .then((state) => { - const commitInputDisabled = - state.ui.gitSync.gitStatus?.isClean || - state.ui.gitSync.isCommitting; - - if (!commitInputDisabled) { - cy.commitAndPush(); - } - - // check last deploy preview - if (state.ui.applications.currentApplication?.lastDeployedAt) { - cy.latestDeployPreview(); - cy.wait(1000); - cy.xpath("//input[@class='bp3-input' and @value='Success']").should( - "be.visible", - ); - // switch to Page1 and validate data binding - cy.get(".t--page-switch-tab") - .contains("Page1") - .click({ force: true }); - cy.xpath("//input[@class='bp3-input' and @value='Success']").should( - "be.visible", - ); - cy.get(commonlocators.backToEditor).click(); - } else if (state.ui.gitSync.isGitSyncModalOpen) { - cy.get(gitSyncLocators.closeGitSyncModal).click({ force: true }); - } + it("2. Connect app to git, clone the Page ,verify JSobject duplication should not happen and validate data binding in deploy mode and edit mode", () => { + homePage.NavigateToHome(); + cy.createWorkspace(); + cy.wait("@createWorkspace").then((interception) => { + const newWorkspaceName = interception.response.body.data.name; + cy.CreateAppForWorkspace(newWorkspaceName, "app-2"); + agHelper.AddDsl("JsObjecWithGitdsl"); + // connect app to git + gitSync.CreateNConnectToGit(); + cy.get("@gitRepoName").then((repName) => { + repoName = repName; - // verify jsObject data binding on Page 1 - PageLeftPane.switchSegment(PagePaneSegment.JS); - PageLeftPane.assertPresence(jsObject); + // create JS Object and validate its data on Page1 + jsEditor.CreateJSObject('return "Success";'); + EditorNavigation.SelectEntityByName("Page1", EntityType.Page); + cy.wait(1000); EditorNavigation.ShowCanvas(); cy.xpath("//input[@class='bp3-input' and @value='Success']").should( "be.visible", ); - // switch to Page1 copy and verify jsObject data binding - EditorNavigation.SelectEntityByName("Page1", EntityType.Page); + // clone the page1 and validate data binding + entityExplorer.ActionContextMenuByEntityName({ + entityNameinLeftSidebar: "Page1", + action: "Clone", + entityType: EntityItems.Page, + }); + cy.wait("@clonePage").should( + "have.nested.property", + "response.body.responseMeta.status", + 201, + ); PageLeftPane.switchSegment(PagePaneSegment.JS); // verify jsObject is not duplicated PageLeftPane.assertPresence(jsObject); @@ -243,40 +116,173 @@ describe("Git sync Bug #10773", { tags: ["@tag.Git"] }, function () { cy.xpath("//input[@class='bp3-input' and @value='Success']").should( "be.visible", ); + // deploy the app and validate data binding + cy.get(homePageLocators.publishButton).click(); + agHelper.AssertElementExist(gitSync._bottomBarPull); + cy.get(gitSyncLocators.commitCommentInput).type("Initial Commit"); + cy.get(gitSyncLocators.commitButton).click(); + cy.wait(8000); + cy.get(gitSyncLocators.closeGitSyncModal).click(); + cy.latestDeployPreview(); + cy.wait(2000); + cy.xpath("//input[@class='bp3-input' and @value='Success']").should( + "be.visible", + ); + // switch to Page1 and validate data binding + cy.get(".t--page-switch-tab") + .contains("Page1") + .click({ force: true }); + cy.xpath("//input[@class='bp3-input' and @value='Success']").should( + "be.visible", + ); + deployMode.NavigateBacktoEditor(); }); + }); + }); + + it("3. Bug:12724 Js objects are merged to single page when user creates a new branch", () => { + // create a new branch, clone page and validate jsObject data binding + //cy.createGitBranch(tempBranch); + cy.wait(3000); + + gitSync.CreateGitBranch(tempBranch, true); + cy.wait(2000); + EditorNavigation.SelectEntityByName("Page1", EntityType.Page); + PageLeftPane.switchSegment(PagePaneSegment.JS); + // verify jsObject is not duplicated + PageLeftPane.assertPresence(jsObject); + EditorNavigation.ShowCanvas(); + cy.xpath("//input[@class='bp3-input' and @value='Success']").should( + "be.visible", + ); + entityExplorer.ActionContextMenuByEntityName({ + entityNameinLeftSidebar: "Page1", + action: "Clone", + entityType: EntityItems.Page, + }); + cy.wait("@clonePage").should( + "have.nested.property", + "response.body.responseMeta.status", + 201, + ); gitSync.DeleteTestGithubRepo(repoName); }); - }); - it("5. Bug:13385 : Unable to see application in home page after the git connect flow is aborted in middle", () => { - homePage.NavigateToHome(); - cy.createWorkspace(); - cy.wait("@createWorkspace").then((interception) => { - const newWorkspaceName = interception.response.body.data.name; - cy.CreateAppForWorkspace(newWorkspaceName, `${newWorkspaceName}app`); + it("4. Create an app with JSObject, connect it to git and verify its data in edit and deploy mode", function () { + homePage.NavigateToHome(); + cy.createWorkspace(); + cy.wait("@createWorkspace").then((interception) => { + const newWorkspaceName = interception.response.body.data.name; + cy.CreateAppForWorkspace(newWorkspaceName, newWorkspaceName); + agHelper.AddDsl("JsObjecWithGitdsl"); + }); + // create JS Object and validate its data on Page1 + jsEditor.CreateJSObject('return "Success";'); + EditorNavigation.SelectEntityByName("Page1", EntityType.Page); + cy.wait(1000); + EditorNavigation.ShowCanvas(); + cy.xpath("//input[@class='bp3-input' and @value='Success']").should( + "be.visible", + ); + // clone the page1 and validate data binding + entityExplorer.ActionContextMenuByEntityName({ + entityNameinLeftSidebar: "Page1", + action: "Clone", + entityType: EntityItems.Page, + }); + cy.wait("@clonePage").should( + "have.nested.property", + "response.body.responseMeta.status", + 201, + ); + // connect app to git and deploy + gitSync.CreateNConnectToGit(); + cy.get("@gitRepoName").then((repName) => { + repoName = repName; + cy.wait(2000); + + cy.window() + .its("store") + .invoke("getState") + .then((state) => { + const commitInputDisabled = + state.ui.gitSync.gitStatus?.isClean || + state.ui.gitSync.isCommitting; - cy.generateUUID().then((uid) => { - repoName = uid; - gitSync.CreateTestGiteaRepo(repoName); - gitSync.OpenGitSyncModal(); + if (!commitInputDisabled) { + cy.commitAndPush(); + } - agHelper.GetNClick(gitSync.providerRadioOthers); - agHelper.GetNClick(gitSync.existingEmptyRepoYes); - agHelper.GetNClick(gitSync.gitConnectNextBtn); - agHelper.TypeText( - gitSync.remoteUrlInput, - `${dataManager.GIT_CLONE_URL}/${repoName}.git`, - ); - agHelper.GetNClick(gitSync.gitConnectNextBtn); + // check last deploy preview + if (state.ui.applications.currentApplication?.lastDeployedAt) { + cy.latestDeployPreview(); + cy.wait(1000); + cy.xpath( + "//input[@class='bp3-input' and @value='Success']", + ).should("be.visible"); + // switch to Page1 and validate data binding + cy.get(".t--page-switch-tab") + .contains("Page1") + .click({ force: true }); + cy.xpath( + "//input[@class='bp3-input' and @value='Success']", + ).should("be.visible"); + cy.get(commonlocators.backToEditor).click(); + } else if (state.ui.gitSync.isGitSyncModalOpen) { + cy.get(gitSyncLocators.closeGitSyncModal).click({ force: true }); + } - // abort git flow after generating key - cy.get(gitSyncLocators.closeGitSyncModal).click(); + // verify jsObject data binding on Page 1 + PageLeftPane.switchSegment(PagePaneSegment.JS); + PageLeftPane.assertPresence(jsObject); + EditorNavigation.ShowCanvas(); + cy.xpath("//input[@class='bp3-input' and @value='Success']").should( + "be.visible", + ); + // switch to Page1 copy and verify jsObject data binding + EditorNavigation.SelectEntityByName("Page1", EntityType.Page); + PageLeftPane.switchSegment(PagePaneSegment.JS); + // verify jsObject is not duplicated + PageLeftPane.assertPresence(jsObject); + EditorNavigation.ShowCanvas(); + cy.xpath("//input[@class='bp3-input' and @value='Success']").should( + "be.visible", + ); + }); + gitSync.DeleteTestGithubRepo(repoName); }); - // verify app is visible and open + }); + + it("5. Bug:13385 : Unable to see application in home page after the git connect flow is aborted in middle", () => { homePage.NavigateToHome(); - cy.reload(); - cy.wait(3000); - cy.SearchApp(`${newWorkspaceName}app`); + cy.createWorkspace(); + cy.wait("@createWorkspace").then((interception) => { + const newWorkspaceName = interception.response.body.data.name; + cy.CreateAppForWorkspace(newWorkspaceName, `${newWorkspaceName}app`); + + cy.generateUUID().then((uid) => { + repoName = uid; + gitSync.CreateTestGiteaRepo(repoName); + gitSync.OpenGitSyncModal(); + + agHelper.GetNClick(gitSync.providerRadioOthers); + agHelper.GetNClick(gitSync.existingEmptyRepoYes); + agHelper.GetNClick(gitSync.gitConnectNextBtn); + agHelper.TypeText( + gitSync.remoteUrlInput, + `${dataManager.GIT_CLONE_URL}/${repoName}.git`, + ); + agHelper.GetNClick(gitSync.gitConnectNextBtn); + + // abort git flow after generating key + cy.get(gitSyncLocators.closeGitSyncModal).click(); + }); + // verify app is visible and open + homePage.NavigateToHome(); + cy.reload(); + cy.wait(3000); + cy.SearchApp(`${newWorkspaceName}app`); + }); }); - }); -}); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/Merge_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/Merge_spec.js index 2a532eec8b5..59e70823498 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/Merge_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/Merge_spec.js @@ -7,7 +7,7 @@ let childBranchKey = "ChildBranch"; let mainBranch = "master"; describe( "Git sync modal: merge tab", - { tags: ["@tag.Git", "@tag.Git"] }, + { tags: ["@tag.Git", "@tag.Git", "@tag.Sanity"] }, function () { before(() => { _.homePage.NavigateToHome(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/SwitchBranches_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/SwitchBranches_spec.js index 93f24e1e272..b411c8b7919 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/SwitchBranches_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/SwitchBranches_spec.js @@ -23,7 +23,7 @@ let parentBranchKey = "ParentBranch", branchQueryKey = "branch"; let repoName; -describe("Git sync:", { tags: ["@tag.Git"] }, function () { +describe("Git sync:", { tags: ["@tag.Git", "@tag.Sanity"] }, function () { before(() => { gitSync.CreateNConnectToGit(); cy.get("@gitRepoName").then((repName) => { diff --git a/app/client/cypress/e2e/Regression/ClientSide/Git/GitWithJSLibrary/GitwithCustomJSLibrary_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Git/GitWithJSLibrary/GitwithCustomJSLibrary_spec.js index 531da3883b7..269e4c51558 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Git/GitWithJSLibrary/GitwithCustomJSLibrary_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Git/GitWithJSLibrary/GitwithCustomJSLibrary_spec.js @@ -17,7 +17,7 @@ let repoName; describe( "Tests JS Library with Git", - { tags: ["@tag.Git", "@tag.excludeForAirgap"] }, + { tags: ["@tag.Git", "@tag.excludeForAirgap", "@tag.Sanity"] }, () => { before(() => { homePage.NavigateToHome(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Git/GitWithTheming/GitWithTheming_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Git/GitWithTheming/GitWithTheming_spec.js index 2e1378a967b..874af31e989 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Git/GitWithTheming/GitWithTheming_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Git/GitWithTheming/GitWithTheming_spec.js @@ -2,102 +2,105 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; const widgetsPage = require("../../../../../locators/Widgets.json"); const commonlocators = require("../../../../../locators/commonlocators.json"); -describe("Git with Theming:", { tags: ["@tag.Git"] }, function () { - const backgroudColorMaster = "rgb(22, 163, 74)"; - const backgroudColorChildBranch = "rgb(100, 116, 139)"; - const tempBranch = "tempBranch"; - let repoName; - let applicationId = null; - let applicationName = null; - before(() => { - _.homePage.NavigateToHome(); - cy.createWorkspace(); - cy.wait("@createWorkspace").then((interception) => { - const newWorkspaceName = interception.response.body.data.name; - cy.generateUUID().then((uid) => { - cy.CreateAppForWorkspace(newWorkspaceName, uid); - applicationName = uid; - cy.get("@currentApplicationId").then( - (currentAppId) => (applicationId = currentAppId), - ); +describe( + "Git with Theming:", + { tags: ["@tag.Git", "@tag.Sanity"] }, + function () { + const backgroudColorMaster = "rgb(22, 163, 74)"; + const backgroudColorChildBranch = "rgb(100, 116, 139)"; + const tempBranch = "tempBranch"; + let repoName; + let applicationId = null; + let applicationName = null; + before(() => { + _.homePage.NavigateToHome(); + cy.createWorkspace(); + cy.wait("@createWorkspace").then((interception) => { + const newWorkspaceName = interception.response.body.data.name; + cy.generateUUID().then((uid) => { + cy.CreateAppForWorkspace(newWorkspaceName, uid); + applicationName = uid; + cy.get("@currentApplicationId").then( + (currentAppId) => (applicationId = currentAppId), + ); + }); }); - }); - _.gitSync.CreateNConnectToGit(); - cy.get("@gitRepoName").then((repName) => { - repoName = repName; - _.gitSync.CreateGitBranch(repoName); + _.gitSync.CreateNConnectToGit(); + cy.get("@gitRepoName").then((repName) => { + repoName = repName; + _.gitSync.CreateGitBranch(repoName); + }); }); - }); - it("1. Bug #13860 Theming is not getting applied on view mode when the app is connected to Git", function () { - _.appSettings.OpenAppSettings(); - _.appSettings.GoToThemeSettings(); - // apply theme on master branch and deploy - cy.get(commonlocators.changeThemeBtn).click({ force: true }); + it("1. Bug #13860 Theming is not getting applied on view mode when the app is connected to Git", function () { + _.appSettings.OpenAppSettings(); + _.appSettings.GoToThemeSettings(); + // apply theme on master branch and deploy + cy.get(commonlocators.changeThemeBtn).click({ force: true }); - cy.get(commonlocators.themeCard).eq(1).click({ force: true }); + cy.get(commonlocators.themeCard).eq(1).click({ force: true }); - // check for alert - cy.get(`${commonlocators.themeCard}`) - .eq(1) - .siblings("div") - .first() - .invoke("text") - .then((text) => { - cy.get(commonlocators.toastmsg).contains(`Theme ${text} applied`); - }); - _.appSettings.ClosePane(); - // drag a widget and assert theme is applied - cy.dragAndDropToCanvas("buttonwidget", { x: 300, y: 700 }); - //cy.get('.t--draggable-buttonwidget').closest("div").should('have.css' , 'background-color', backgroudColorChildBranch) - cy.get(widgetsPage.widgetBtn).should( - "have.css", - "background-color", - backgroudColorMaster, - ); //Widget Color - cy.commitAndPush(); - cy.wait(2000); - _.gitSync.CreateGitBranch(tempBranch); - //cy.createGitBranch(tempBranch); - cy.wait(1000); - cy.get(".canvas").click(0, 0, { force: true }); - // change theme on tempBranch - _.appSettings.OpenAppSettings(); - _.appSettings.GoToThemeSettings(); - cy.get(commonlocators.changeThemeBtn).click({ force: true }); + // check for alert + cy.get(`${commonlocators.themeCard}`) + .eq(1) + .siblings("div") + .first() + .invoke("text") + .then((text) => { + cy.get(commonlocators.toastmsg).contains(`Theme ${text} applied`); + }); + _.appSettings.ClosePane(); + // drag a widget and assert theme is applied + cy.dragAndDropToCanvas("buttonwidget", { x: 300, y: 700 }); + //cy.get('.t--draggable-buttonwidget').closest("div").should('have.css' , 'background-color', backgroudColorChildBranch) + cy.get(widgetsPage.widgetBtn).should( + "have.css", + "background-color", + backgroudColorMaster, + ); //Widget Color + cy.commitAndPush(); + cy.wait(2000); + _.gitSync.CreateGitBranch(tempBranch); + //cy.createGitBranch(tempBranch); + cy.wait(1000); + cy.get(".canvas").click(0, 0, { force: true }); + // change theme on tempBranch + _.appSettings.OpenAppSettings(); + _.appSettings.GoToThemeSettings(); + cy.get(commonlocators.changeThemeBtn).click({ force: true }); - // select a theme - cy.get(commonlocators.themeCard).last().click({ force: true }); + // select a theme + cy.get(commonlocators.themeCard).last().click({ force: true }); - // check for alert - cy.get(`${commonlocators.themeCard}`) - .last() - .siblings("div") - .first() - .invoke("text") - .then((text) => { - cy.get(commonlocators.toastmsg).contains(`Theme ${text} applied`); - }); - _.appSettings.ClosePane(); + // check for alert + cy.get(`${commonlocators.themeCard}`) + .last() + .siblings("div") + .first() + .invoke("text") + .then((text) => { + cy.get(commonlocators.toastmsg).contains(`Theme ${text} applied`); + }); + _.appSettings.ClosePane(); - cy.get(widgetsPage.widgetBtn).should( - "have.css", - "background-color", - backgroudColorChildBranch, - ); //Widget Color - cy.commitAndPush(); - //assert theme is applied in view mode - cy.latestDeployPreview(); - cy.get(widgetsPage.widgetBtn).should( - "have.css", - "background-color", - backgroudColorChildBranch, - ); //Widget Color - cy.get(commonlocators.backToEditor).click(); - cy.wait(2000); - }); - // commenting test until bug is closed - /*it("Bug #14645 Custom themes are not getting copied for create branch", function() { + cy.get(widgetsPage.widgetBtn).should( + "have.css", + "background-color", + backgroudColorChildBranch, + ); //Widget Color + cy.commitAndPush(); + //assert theme is applied in view mode + cy.latestDeployPreview(); + cy.get(widgetsPage.widgetBtn).should( + "have.css", + "background-color", + backgroudColorChildBranch, + ); //Widget Color + cy.get(commonlocators.backToEditor).click(); + cy.wait(2000); + }); + // commenting test until bug is closed + /*it("Bug #14645 Custom themes are not getting copied for create branch", function() { cy.xpath("(//button[@type='button'])").should( "have.css", "background-color", @@ -132,8 +135,9 @@ describe("Git with Theming:", { tags: ["@tag.Git"] }, function () { ); }); */ - after(() => { - //clean up - _.gitSync.DeleteTestGithubRepo(repoName); - }); -}); + after(() => { + //clean up + _.gitSync.DeleteTestGithubRepo(repoName); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/OneClickBinding/JSONFormWidget/JSONForm_mongoDB_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/OneClickBinding/JSONFormWidget/JSONForm_mongoDB_spec.ts index 1c9184f7f8b..8672687d16e 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/OneClickBinding/JSONFormWidget/JSONForm_mongoDB_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/OneClickBinding/JSONFormWidget/JSONForm_mongoDB_spec.ts @@ -18,7 +18,7 @@ const oneClickBinding = new OneClickBinding(); describe( "JSONForm widget one click binding feature", - { tags: ["@tag.Binding"] }, + { tags: ["@tag.Binding", "@tag.Sanity"] }, () => { let datasourceName: string; it("1.Create flow: should check that queries are created and bound to jsonform widget properly", () => { diff --git a/app/client/cypress/e2e/Regression/ClientSide/OneClickBinding/SelectWidget/mongoDB_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/OneClickBinding/SelectWidget/mongoDB_spec.ts index e60d5cebc10..c98992a6918 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/OneClickBinding/SelectWidget/mongoDB_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/OneClickBinding/SelectWidget/mongoDB_spec.ts @@ -19,7 +19,7 @@ const oneClickBinding = new OneClickBinding(); describe( "Table widget one click binding feature", - { tags: ["@tag.Binding"] }, + { tags: ["@tag.Binding", "@tag.Sanity"] }, () => { it("should check that queries are created and bound to table widget properly", () => { entityExplorer.DragDropWidgetNVerify(draggableWidgets.SELECT, 450, 200); diff --git a/app/client/cypress/e2e/Regression/ClientSide/OneClickBinding/SelectWidget/postgres_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/OneClickBinding/SelectWidget/postgres_spec.ts index d3418f256af..19c32a3ce65 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/OneClickBinding/SelectWidget/postgres_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/OneClickBinding/SelectWidget/postgres_spec.ts @@ -19,7 +19,7 @@ const oneClickBinding = new OneClickBinding(); describe( "Table widget one click binding feature", - { tags: ["@tag.Binding"] }, + { tags: ["@tag.Binding", "@tag.Sanity"] }, () => { it("should check that queries are created and bound to table widget properly", () => { entityExplorer.DragDropWidgetNVerify(draggableWidgets.SELECT, 450, 200); diff --git a/app/client/cypress/e2e/Regression/ClientSide/OneClickBinding/TableWidget/Table_postgres_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/OneClickBinding/TableWidget/Table_postgres_spec.ts index 456de842c93..2afc1985b6d 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/OneClickBinding/TableWidget/Table_postgres_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/OneClickBinding/TableWidget/Table_postgres_spec.ts @@ -16,7 +16,7 @@ const oneClickBinding = new OneClickBinding(); describe( "Table widget one click binding feature", - { tags: ["@tag.Binding"] }, + { tags: ["@tag.Binding", "@tag.Sanity"] }, () => { it("should check that queries are created and bound to table widget properly", () => { entityExplorer.DragDropWidgetNVerify(draggableWidgets.TABLE, 450, 200); diff --git a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/ErrorMessages_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/ErrorMessages_spec.ts index 6bc10f52d43..673fda46d38 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/ErrorMessages_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/ErrorMessages_spec.ts @@ -3,7 +3,7 @@ import EditorNavigation, { EntityType, } from "../../../../support/Pages/EditorNavigation"; -describe("Sanitise toast error messages", () => { +describe("Sanitise toast error messages", { tags: ["@tag.JS"] }, () => { before(() => { _.jsEditor.CreateJSObject( `export default { diff --git a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/GlobalSearch_spec.js b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/GlobalSearch_spec.js index 80ed386debd..d719772fe1c 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/GlobalSearch_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/GlobalSearch_spec.js @@ -13,7 +13,7 @@ const datasourceHomeLocators = require("../../../../locators/apiWidgetslocator.j const datasourceLocators = require("../../../../locators/DatasourcesEditor.json"); import * as _ from "../../../../support/Objects/ObjectsCore"; -describe("GlobalSearch", function () { +describe("GlobalSearch", { tags: ["@tag.Sanity"] }, function () { before(() => { _.agHelper.AddDsl("MultipleWidgetDsl"); }); diff --git a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Inspect_Element_spec.js b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Inspect_Element_spec.js index b4f51bc7282..5e5adb4afa4 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Inspect_Element_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Inspect_Element_spec.js @@ -1,15 +1,19 @@ import * as _ from "../../../../support/Objects/ObjectsCore"; -describe("Inspect Entity", function () { - before(() => { - _.agHelper.AddDsl("debuggerDependencyDsl"); - }); - it("1. Check whether depedencies and references are shown correctly", function () { - cy.openPropertyPane("inputwidgetv2"); - cy.testJsontext("defaultvalue", "{{Button1.text}}"); - _.debuggerHelper.OpenDebugger(); - cy.contains(".ads-v2-tabs__list-tab", "Inspect entity").click(); - cy.contains(".t--dependencies-item", "Button1").click(); - cy.contains(".t--dependencies-item", "Input1"); - }); -}); +describe( + "Inspect Entity", + { tags: ["@tag.Widget", "@tag.PropertyPane"] }, + function () { + before(() => { + _.agHelper.AddDsl("debuggerDependencyDsl"); + }); + it("1. Check whether depedencies and references are shown correctly", function () { + cy.openPropertyPane("inputwidgetv2"); + cy.testJsontext("defaultvalue", "{{Button1.text}}"); + _.debuggerHelper.OpenDebugger(); + cy.contains(".ads-v2-tabs__list-tab", "Inspect entity").click(); + cy.contains(".t--dependencies-item", "Button1").click(); + cy.contains(".t--dependencies-item", "Input1"); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Logs1_spec.js b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Logs1_spec.js index 42b84b43474..a6aa206e83a 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Logs1_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Logs1_spec.js @@ -19,7 +19,7 @@ const generateTestLogString = () => { return logString; }; -describe("Debugger logs", function () { +describe("Debugger logs", { tags: ["@tag.Widget", "@tag.IDE"] }, function () { this.beforeEach(() => { logString = generateTestLogString(); }); diff --git a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/PageOnLoad_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/PageOnLoad_spec.ts index 30f17147ebe..7a0ddf08e3e 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/PageOnLoad_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/PageOnLoad_spec.ts @@ -8,21 +8,25 @@ import { } from "../../../../support/Objects/ObjectsCore"; const testdata = require("../../../../fixtures/testdata.json"); -describe("Check debugger logs state when there are onPageLoad actions", function () { - before(() => { - agHelper.AddDsl("debuggerTableDsl"); - }); +describe( + "Check debugger logs state when there are onPageLoad actions", + { tags: ["@tag.IDE", "@tag.Datasource"] }, + function () { + before(() => { + agHelper.AddDsl("debuggerTableDsl"); + }); - it("1. Check debugger logs state when there are onPageLoad actions", function () { - EditorNavigation.SelectEntityByName("Table1", EntityType.Widget); - apiPage.CreateAndFillApi(testdata.baseUrl + testdata.methods, "TestApi"); - apiPage.RunAPI(); - EditorNavigation.ShowCanvas(); - agHelper.RefreshPage(); - // Wait for the debugger icon to be visible - agHelper.AssertElementVisibility(".t--debugger-count"); - // debuggerHelper.isErrorCount(0); - cy.wait("@postExecute"); - debuggerHelper.AssertErrorCount(1); - }); -}); + it("1. Check debugger logs state when there are onPageLoad actions", function () { + EditorNavigation.SelectEntityByName("Table1", EntityType.Widget); + apiPage.CreateAndFillApi(testdata.baseUrl + testdata.methods, "TestApi"); + apiPage.RunAPI(); + EditorNavigation.ShowCanvas(); + agHelper.RefreshPage(); + // Wait for the debugger icon to be visible + agHelper.AssertElementVisibility(".t--debugger-count"); + // debuggerHelper.isErrorCount(0); + cy.wait("@postExecute"); + debuggerHelper.AssertErrorCount(1); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/PreviewMode_spec.js b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/PreviewMode_spec.js index 4d6b64fe5bf..6370ecf2866 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/PreviewMode_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/PreviewMode_spec.js @@ -4,43 +4,47 @@ const commonlocators = require("../../../../locators/commonlocators.json"); const publishPage = require("../../../../locators/publishWidgetspage.json"); import * as _ from "../../../../support/Objects/ObjectsCore"; -describe("Preview mode functionality", { tags: ["@tag.IDE"] }, function () { - before(() => { - _.agHelper.AddDsl("previewMode"); - }); - - it("1. Checks entity explorer and property pane visiblity", function () { - _.agHelper.GetNClick(_.locators._previewModeToggle("edit")); - // in preview mode, entity explorer and property pane are not visible - cy.get(PageLeftPane.locators.selector).should("not.be.visible"); - cy.get(".t--property-pane-sidebar").should("not.be.visible"); - - //checks if widgets can be selected or not - // in preview mode, entity explorer and property pane are not visible - // Also, draggable and resizable components are not available. - const selector = `.t--draggable-buttonwidget`; - cy.wait(500); - cy.get(selector).first().trigger("mouseover", { force: true }).wait(500); - - cy.get( - `${selector}:first-of-type .t--widget-propertypane-toggle > .t--widget-name`, - ).should("not.exist"); - }); - - it("2. Check invisible widget should not show in proview mode and should show in edit mode", function () { - _.agHelper.GetNClick(_.locators._previewModeToggle("preview")); - cy.openPropertyPane("buttonwidget"); - cy.UncheckWidgetProperties(commonlocators.visibleCheckbox); - - // button should not show in preview mode - _.agHelper.GetNClick(_.locators._previewModeToggle("edit")); - cy.get(`${publishPage.buttonWidget} button`).should("not.exist"); - - // Text widget should show - cy.get(`${publishPage.textWidget} .bp3-ui-text`).should("exist"); - - // button should show in edit mode - _.agHelper.GetNClick(_.locators._previewModeToggle("preview")); - cy.get(`${publishPage.buttonWidget} button`).should("exist"); - }); -}); +describe( + "Preview mode functionality", + { tags: ["@tag.IDE", "@tag.Sanity"] }, + function () { + before(() => { + _.agHelper.AddDsl("previewMode"); + }); + + it("1. Checks entity explorer and property pane visiblity", function () { + _.agHelper.GetNClick(_.locators._previewModeToggle("edit")); + // in preview mode, entity explorer and property pane are not visible + cy.get(PageLeftPane.locators.selector).should("not.be.visible"); + cy.get(".t--property-pane-sidebar").should("not.be.visible"); + + //checks if widgets can be selected or not + // in preview mode, entity explorer and property pane are not visible + // Also, draggable and resizable components are not available. + const selector = `.t--draggable-buttonwidget`; + cy.wait(500); + cy.get(selector).first().trigger("mouseover", { force: true }).wait(500); + + cy.get( + `${selector}:first-of-type .t--widget-propertypane-toggle > .t--widget-name`, + ).should("not.exist"); + }); + + it("2. Check invisible widget should not show in proview mode and should show in edit mode", function () { + _.agHelper.GetNClick(_.locators._previewModeToggle("preview")); + cy.openPropertyPane("buttonwidget"); + cy.UncheckWidgetProperties(commonlocators.visibleCheckbox); + + // button should not show in preview mode + _.agHelper.GetNClick(_.locators._previewModeToggle("edit")); + cy.get(`${publishPage.buttonWidget} button`).should("not.exist"); + + // Text widget should show + cy.get(`${publishPage.textWidget} .bp3-ui-text`).should("exist"); + + // button should show in edit mode + _.agHelper.GetNClick(_.locators._previewModeToggle("preview")); + cy.get(`${publishPage.buttonWidget} button`).should("exist"); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Replay_Editor_spec.js b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Replay_Editor_spec.js index 872c252556a..dd5b11c69ed 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Replay_Editor_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Replay_Editor_spec.js @@ -9,142 +9,151 @@ import { dataSources, } from "../../../../support/Objects/ObjectsCore"; -describe("Undo/Redo functionality", function () { - const modifierKey = Cypress.platform === "darwin" ? "meta" : "ctrl"; - let postgresDatasourceName; +describe( + "Undo/Redo functionality", + { tags: ["@tag.JS", "@tag.Datasource"] }, + function () { + const modifierKey = Cypress.platform === "darwin" ? "meta" : "ctrl"; + let postgresDatasourceName; - it("1. Checks undo/redo in datasource forms", () => { - dataSources.NavigateToDSCreateNew(); - agHelper.GetNClick(datasource.PostgreSQL); - cy.generateUUID().then((uid) => { - postgresDatasourceName = uid; + it("1. Checks undo/redo in datasource forms", () => { + dataSources.NavigateToDSCreateNew(); + agHelper.GetNClick(datasource.PostgreSQL); + cy.generateUUID().then((uid) => { + postgresDatasourceName = uid; - cy.get(".t--edit-datasource-name").click(); - cy.get(".t--edit-datasource-name input") - .clear() - .type(postgresDatasourceName, { force: true }) - .should("have.value", postgresDatasourceName) - .blur(); + cy.get(".t--edit-datasource-name").click(); + cy.get(".t--edit-datasource-name input") + .clear() + .type(postgresDatasourceName, { force: true }) + .should("have.value", postgresDatasourceName) + .blur(); - cy.get(datasourceEditor.sectionAuthentication).click(); - cy.get(datasourceEditor.username).type( - datasourceFormData["postgres-username"], + cy.get(datasourceEditor.sectionAuthentication).click(); + cy.get(datasourceEditor.username).type( + datasourceFormData["postgres-username"], + ); + cy.wait(500); + cy.get(datasourceEditor.password).type( + datasourceFormData["postgres-password"], + ); + //cy.get(datasourceEditor.sectionAuthentication).trigger("click").wait(1000); + + cy.get("body").type(`{${modifierKey}}z`); + cy.get("body").type(`{${modifierKey}}{shift}z`); + cy.get(datasourceEditor.saveBtn).click({ force: true }); + dataSources.AssertDSInActiveList(postgresDatasourceName); + }); + }); + + it("2. Checks undo/redo for Api pane", function () { + cy.CreateAPI("FirstAPI"); + cy.get(`${apiwidget.resourceUrl} .CodeMirror-placeholder`).should( + "have.text", + "https://mock-api.appsmith.com/users", //testing placeholder! ); - cy.wait(500); - cy.get(datasourceEditor.password).type( - datasourceFormData["postgres-password"], + cy.enterDatasourceAndPath(testdata.baseUrl, testdata.methods); + agHelper.RemoveUIElement( + "Tooltip", + Cypress.env("MESSAGES").ADD_QUERY_JS_TOOLTIP(), ); - //cy.get(datasourceEditor.sectionAuthentication).trigger("click").wait(1000); - + cy.get(`${apiwidget.headerKey}`).type("Authorization"); + cy.get("body").click(0, 0); + cy.get(apiwidget.settings).click({ force: true }); + //cy.get(apiwidget.onPageLoad).click({ force: true }); + cy.get("body").click(0, 0); cy.get("body").type(`{${modifierKey}}z`); + // cy.wait(2000); + // cy.get("body").type(`{${modifierKey}}z`); + cy.wait(2000); + cy.get("body").click(0, 0); + cy.get("body").type(`{${modifierKey}}z`); + cy.get(apiwidget.headers) + .parent() + .should("have.attr", "aria-selected", "true"); + cy.get("body").type(`{${modifierKey}}z`); + + cy.get(`${apiwidget.resourceUrl} .CodeMirror-placeholder`).should( + "have.text", + "https://mock-api.appsmith.com/users", + ); + cy.get(`${apiwidget.headerKey} .CodeMirror-placeholder`).should( + "have.text", + "Key 1", + ); cy.get("body").type(`{${modifierKey}}{shift}z`); - cy.get(datasourceEditor.saveBtn).click({ force: true }); - dataSources.AssertDSInActiveList(postgresDatasourceName); + cy.get("body").type(`{${modifierKey}}{shift}z`); + cy.get(`${apiwidget.headerKey} .cm-m-null`).should( + "have.text", + "Authorization", + ); }); - }); - it("2. Checks undo/redo for Api pane", function () { - cy.CreateAPI("FirstAPI"); - cy.get(`${apiwidget.resourceUrl} .CodeMirror-placeholder`).should( - "have.text", - "https://mock-api.appsmith.com/users", //testing placeholder! - ); - cy.enterDatasourceAndPath(testdata.baseUrl, testdata.methods); - agHelper.RemoveUIElement( - "Tooltip", - Cypress.env("MESSAGES").ADD_QUERY_JS_TOOLTIP(), - ); - cy.get(`${apiwidget.headerKey}`).type("Authorization"); - cy.get("body").click(0, 0); - cy.get(apiwidget.settings).click({ force: true }); - //cy.get(apiwidget.onPageLoad).click({ force: true }); - cy.get("body").click(0, 0); - cy.get("body").type(`{${modifierKey}}z`); - // cy.wait(2000); - // cy.get("body").type(`{${modifierKey}}z`); - cy.wait(2000); - cy.get("body").click(0, 0); - cy.get("body").type(`{${modifierKey}}z`); - cy.get(apiwidget.headers) - .parent() - .should("have.attr", "aria-selected", "true"); - cy.get("body").type(`{${modifierKey}}z`); + it("3. Checks undo/redo in query editor", () => { + dataSources.CreateQueryForDS(postgresDatasourceName); + cy.get(".CodeMirror textarea").first().focus().type("{{FirstAPI}}", { + force: true, + parseSpecialCharSequences: false, + }); + cy.get("body").click(0, 0); - cy.get(`${apiwidget.resourceUrl} .CodeMirror-placeholder`).should( - "have.text", - "https://mock-api.appsmith.com/users", - ); - cy.get(`${apiwidget.headerKey} .CodeMirror-placeholder`).should( - "have.text", - "Key 1", - ); - cy.get("body").type(`{${modifierKey}}{shift}z`); - cy.get("body").type(`{${modifierKey}}{shift}z`); - cy.get(`${apiwidget.headerKey} .cm-m-null`).should( - "have.text", - "Authorization", - ); - }); + // Removed the verification of relationships as we have removed the `Relationships` element from the new bindings UI - it("3. Checks undo/redo in query editor", () => { - dataSources.CreateQueryForDS(postgresDatasourceName); - cy.get(".CodeMirror textarea").first().focus().type("{{FirstAPI}}", { - force: true, - parseSpecialCharSequences: false, + cy.get("body").type(`{${modifierKey}}z`); + cy.get(".CodeEditorTarget textarea").should( + "not.have.text", + "{{FirstAPI}}", + ); + cy.get("body").type(`{${modifierKey}}{shift}z`); + cy.get(".CodeMirror-code span").contains("{{FirstAPI}}"); + cy.get("body").type(`{${modifierKey}}z`); + cy.get(".CodeMirror-code span") + .last() + .should("not.have.text", "{{FirstAPI}}"); }); - cy.get("body").click(0, 0); - - // Removed the verification of relationships as we have removed the `Relationships` element from the new bindings UI - cy.get("body").type(`{${modifierKey}}z`); - cy.get(".CodeEditorTarget textarea").should( - "not.have.text", - "{{FirstAPI}}", - ); - cy.get("body").type(`{${modifierKey}}{shift}z`); - cy.get(".CodeMirror-code span").contains("{{FirstAPI}}"); - cy.get("body").type(`{${modifierKey}}z`); - cy.get(".CodeMirror-code span") - .last() - .should("not.have.text", "{{FirstAPI}}"); - }); - - it("4. Checks undo/redo in JS Objects", () => { - jsEditor.NavigateToNewJSEditor(); - cy.wait(1000); - cy.get(".CodeMirror textarea") - .first() - .focus() - .type("{downarrow}{downarrow}{downarrow} ") - .type("testJSFunction:()=>{},"); - cy.get("body").type(`{${modifierKey}}z{${modifierKey}}z{${modifierKey}}z`); - // verifying testJSFunction is not visible on page after undo - cy.contains("testJSFunction").should("not.exist"); - cy.get("body").type( - `{${modifierKey}}{shift}z{${modifierKey}}{shift}z{${modifierKey}}{shift}z`, - ); - // verifying testJSFunction is visible on page after redo - cy.contains("testJSFunction").should("exist"); - cy.get("body").type(`{${modifierKey}}z`); - // cy.get(".function-name").should("not.contain.text", "test"); - }); + it("4. Checks undo/redo in JS Objects", () => { + jsEditor.NavigateToNewJSEditor(); + cy.wait(1000); + cy.get(".CodeMirror textarea") + .first() + .focus() + .type("{downarrow}{downarrow}{downarrow} ") + .type("testJSFunction:()=>{},"); + cy.get("body").type( + `{${modifierKey}}z{${modifierKey}}z{${modifierKey}}z`, + ); + // verifying testJSFunction is not visible on page after undo + cy.contains("testJSFunction").should("not.exist"); + cy.get("body").type( + `{${modifierKey}}{shift}z{${modifierKey}}{shift}z{${modifierKey}}{shift}z`, + ); + // verifying testJSFunction is visible on page after redo + cy.contains("testJSFunction").should("exist"); + cy.get("body").type(`{${modifierKey}}z`); + // cy.get(".function-name").should("not.contain.text", "test"); + }); - it("5. Checks undo/redo for Authenticated APIs", () => { - cy.NavigateToAPI_Panel(); - cy.get(apiwidget.createAuthApiDatasource).click({ force: true }); - cy.wait(2000); - agHelper.TypeText(dataSources._headerKey, testdata.headerKey); - agHelper.TypeText(dataSources._urlInputControl, testdata.baseUrl); - agHelper.Sleep(1000); - cy.get("body").click(0, 0); - cy.get("body").type(`{${modifierKey}}z`); - cy.get("input[name='url']").should("have.value", ""); - cy.get("body").type(`{${modifierKey}}z`); - cy.get("input[name='headers[0].key']").should("have.value", ""); - cy.get("body").click(0, 0); - cy.get("body").type(`{${modifierKey}}{shift}z`); - cy.get("body").type(`{${modifierKey}}{shift}z`); - cy.get("input[name='url']").should("have.value", testdata.baseUrl); - cy.get("input[name='headers[0].key']").should("have.value", "Content-Type"); - }); -}); + it("5. Checks undo/redo for Authenticated APIs", () => { + cy.NavigateToAPI_Panel(); + cy.get(apiwidget.createAuthApiDatasource).click({ force: true }); + cy.wait(2000); + agHelper.TypeText(dataSources._headerKey, testdata.headerKey); + agHelper.TypeText(dataSources._urlInputControl, testdata.baseUrl); + agHelper.Sleep(1000); + cy.get("body").click(0, 0); + cy.get("body").type(`{${modifierKey}}z`); + cy.get("input[name='url']").should("have.value", ""); + cy.get("body").type(`{${modifierKey}}z`); + cy.get("input[name='headers[0].key']").should("have.value", ""); + cy.get("body").click(0, 0); + cy.get("body").type(`{${modifierKey}}{shift}z`); + cy.get("body").type(`{${modifierKey}}{shift}z`); + cy.get("input[name='url']").should("have.value", testdata.baseUrl); + cy.get("input[name='headers[0].key']").should( + "have.value", + "Content-Type", + ); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Replay_spec.js b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Replay_spec.js index b5709cf3db8..f4c9e6fec7e 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Replay_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Replay_spec.js @@ -12,208 +12,214 @@ import EditorNavigation, { EntityType, } from "../../../../support/Pages/EditorNavigation"; -describe("Undo/Redo functionality", function () { - const modifierKey = Cypress.platform === "darwin" ? "meta" : "ctrl"; - - before(() => { - agHelper.AddDsl("replay"); - }); - - it("1. checks undo/redo for new widgets", function () { - entityExplorer.DragDropWidgetNVerify(draggableWidgets.CHECKBOX, 200, 200); - cy.focused().blur(); - - cy.get(widgetsPage.checkboxWidget).should("exist"); - - cy.get("body").type(`{${modifierKey}}z`); - cy.wait(100); - cy.get(widgetsPage.checkboxWidget).should("not.exist"); - - cy.get("body").type(`{${modifierKey}}{shift}z`); - cy.wait(100); - cy.get(widgetsPage.checkboxWidget).should("exist"); - }); - - // it("checks moving of widgets", function() { - // cy.document().then((doc) => { - // const initialPosition = doc - // .querySelector(widgetsPage.checkboxWidget) - // .getBoundingClientRect(); - - // cy.get(commonlocators.editIcon) - // .trigger("mousedown", { which: 1 }) - // .trigger("dragstart", { force: true }); - - // cy.get(explorer.dropHere) - // .trigger("mousemove", 200, 300, { eventConstructor: "MouseEvent" }) - // .trigger("mousemove", 200, 300, { eventConstructor: "MouseEvent" }) - // .trigger("mouseup", 200, 300, { eventConstructor: "MouseEvent" }); - - // cy.wait(1000).then(() => { - // const positionAfterChange = doc - // .querySelector(widgetsPage.checkboxWidget) - // .getBoundingClientRect(); - - // expect(positionAfterChange.top).to.not.equal(initialPosition.top); - // }); - - // cy.get("body").type(`{${modifierKey}}z`); - - // cy.wait(1000).then(() => { - // const positionAfterUndo = doc - // .querySelector(widgetsPage.checkboxWidget) - // .getBoundingClientRect(); - - // expect(positionAfterUndo.top).to.equal(initialPosition.top); - // }); - - // cy.get("body").type(`{${modifierKey}}{shift}z`); - - // cy.wait(1000).then(() => { - // const positionAfterRedo = doc - // .querySelector(widgetsPage.checkboxWidget) - // .getBoundingClientRect(); - - // expect(positionAfterRedo.top).to.equal(initialPosition.top); - // }); - // }); - // }); - - it("2. checks undo/redo for toggle control in property pane", function () { - cy.openPropertyPane("checkboxwidget"); - cy.CheckWidgetProperties(commonlocators.disableCheckbox); - - cy.get("body").type(`{${modifierKey}}z`); - cy.wait(100); - cy.get(`${widgetsPage.disable} input`).should("not.be.checked"); - cy.get(widgetLocators.checkboxWidget + " " + "input").should( - "not.be.disabled", - ); - - cy.get("body").type(`{${modifierKey}}{shift}z`); - cy.wait(100); - - cy.get(`${widgetsPage.disable} input`).should("be.checked"); - cy.get(widgetLocators.checkboxWidget + " " + "input").should("be.disabled"); - }); - - it("3. checks undo/redo for input control in property pane", function () { - cy.get(widgetsPage.inputLabelControl).type("1"); - cy.get(widgetsPage.inputLabelControl).contains("Label1"); - - cy.get("body").type(`{${modifierKey}}z`); - cy.wait(100); - cy.get(widgetsPage.inputLabelControl).contains("Label"); - cy.get(`${publish.checkboxWidget} label`).should("have.text", "Label"); - - cy.get("body").type(`{${modifierKey}}{shift}z`); - cy.wait(100); - cy.get(widgetsPage.inputLabelControl).contains("Label1"); - cy.get(`${publish.checkboxWidget} label`).should("have.text", "Label1"); - }); - - it("4. checks undo/redo for deletion of widgets", function () { - cy.deleteWidget(widgetsPage.checkboxWidget); - cy.get(widgetsPage.checkboxWidget).should("not.exist"); - - cy.get("body").type(`{${modifierKey}}z`); - cy.wait(100); - cy.get(widgetsPage.checkboxWidget).should("exist"); - - // cy.get("body").type(`{${modifierKey}}{shift}z`); - // cy.wait(100); - // cy.get(widgetsPage.checkboxWidget).should("not.exist"); - }); - - it("5. checks if property Pane is open on undo/redo property changes", function () { - cy.dragAndDropToCanvas("textwidget", { x: 400, y: 400 }); - - cy.wait(100); - propPane.UpdatePropertyFieldValue("Text", "Label"); - - cy.closePropertyPane(); - - cy.get("body").type(`{${modifierKey}}z`); - cy.wait(100); - cy.get(widgetsPage.propertypaneText).should("exist"); - cy.get(widgetsPage.inputTextControl).contains( - "Hello {{appsmith.user.name || appsmith.user.email}}", - ); - - cy.closePropertyPane(); - - cy.get("body").type(`{${modifierKey}}{shift}z`); - cy.wait(100); - cy.get(widgetsPage.propertypaneText).should("exist"); - cy.get(widgetsPage.inputTextControl).contains("Label"); - cy.deleteWidget(widgetsPage.textWidget); - }); - - it("6. checks if toast is shown while undo/redo widget deletion or creation only the first time", function () { - cy.dragAndDropToCanvas("textwidget", { x: 400, y: 400 }); - localStorage.removeItem("undoToastShown"); - localStorage.removeItem("redoToastShown"); - - cy.get("body").type(`{${modifierKey}}z`); - cy.get(commonlocators.toastmsg).contains("is removed"); - cy.get(commonlocators.toastmsg).contains("redo"); - cy.get(commonlocators.toastBody).first().click({ force: true }); - - cy.wait(100); - cy.get("body").type(`{${modifierKey}}{shift}z`); - cy.get(commonlocators.toastmsg).contains("is added back"); - cy.get(commonlocators.toastmsg).contains("undo"); - cy.deleteWidget(widgetsPage.textWidget); - }); - - it("7. checks undo/redo for color picker", function () { - cy.dragAndDropToCanvas("textwidget", { x: 100, y: 100 }); - cy.moveToStyleTab(); - cy.selectColor("textcolor"); - cy.get("body").click({ force: true }); - // eslint-disable-next-line cypress/no-unnecessary-waiting - cy.wait(500); - cy.wait("@updateLayout"); - cy.readTextDataValidateCSS("color", "rgb(219, 234, 254)"); - cy.get("body").click({ force: true }).type(`{${modifierKey}}z`); - EditorNavigation.SelectEntityByName("Text1", EntityType.Widget); - propPane.MoveToTab("Style"); - cy.get(widgetsPage.textColor) - .first() - .invoke("attr", "value") - .should("contain", "#231F20"); - - cy.get("body").type(`{${modifierKey}}{shift}z`); - EditorNavigation.SelectEntityByName("Text1", EntityType.Widget); - propPane.MoveToTab("Style"); - cy.get(widgetsPage.textColor) - .first() - .invoke("attr", "value") - .should("contain", "#dbeafe"); - }); - - it("8. checks undo/redo for option control for radio button", function () { - cy.dragAndDropToCanvas("radiogroupwidget", { x: 200, y: 600 }); - - cy.get(widgetsPage.RadioInput).first().type("1"); - - cy.get(widgetsPage.RadioInput).first().blur(); - - // eslint-disable-next-line cypress/no-unnecessary-waiting - cy.wait(200); - - cy.get("body").type(`{${modifierKey}}z`); - EditorNavigation.SelectEntityByName("RadioGroup1", EntityType.Widget); - cy.get(widgetsPage.RadioInput) - .first() - .invoke("attr", "value") - .should("contain", "Yes"); - - cy.get("body").type(`{${modifierKey}}{shift}z`); - EditorNavigation.SelectEntityByName("RadioGroup1", EntityType.Widget); - cy.get(widgetsPage.RadioInput) - .first() - .invoke("attr", "value") - .should("contain", "Yes1"); - }); -}); +describe( + "Undo/Redo functionality", + { tags: ["@tag.Widget", "@tag.PropertyPane"] }, + function () { + const modifierKey = Cypress.platform === "darwin" ? "meta" : "ctrl"; + + before(() => { + agHelper.AddDsl("replay"); + }); + + it("1. checks undo/redo for new widgets", function () { + entityExplorer.DragDropWidgetNVerify(draggableWidgets.CHECKBOX, 200, 200); + cy.focused().blur(); + + cy.get(widgetsPage.checkboxWidget).should("exist"); + + cy.get("body").type(`{${modifierKey}}z`); + cy.wait(100); + cy.get(widgetsPage.checkboxWidget).should("not.exist"); + + cy.get("body").type(`{${modifierKey}}{shift}z`); + cy.wait(100); + cy.get(widgetsPage.checkboxWidget).should("exist"); + }); + + // it("checks moving of widgets", function() { + // cy.document().then((doc) => { + // const initialPosition = doc + // .querySelector(widgetsPage.checkboxWidget) + // .getBoundingClientRect(); + + // cy.get(commonlocators.editIcon) + // .trigger("mousedown", { which: 1 }) + // .trigger("dragstart", { force: true }); + + // cy.get(explorer.dropHere) + // .trigger("mousemove", 200, 300, { eventConstructor: "MouseEvent" }) + // .trigger("mousemove", 200, 300, { eventConstructor: "MouseEvent" }) + // .trigger("mouseup", 200, 300, { eventConstructor: "MouseEvent" }); + + // cy.wait(1000).then(() => { + // const positionAfterChange = doc + // .querySelector(widgetsPage.checkboxWidget) + // .getBoundingClientRect(); + + // expect(positionAfterChange.top).to.not.equal(initialPosition.top); + // }); + + // cy.get("body").type(`{${modifierKey}}z`); + + // cy.wait(1000).then(() => { + // const positionAfterUndo = doc + // .querySelector(widgetsPage.checkboxWidget) + // .getBoundingClientRect(); + + // expect(positionAfterUndo.top).to.equal(initialPosition.top); + // }); + + // cy.get("body").type(`{${modifierKey}}{shift}z`); + + // cy.wait(1000).then(() => { + // const positionAfterRedo = doc + // .querySelector(widgetsPage.checkboxWidget) + // .getBoundingClientRect(); + + // expect(positionAfterRedo.top).to.equal(initialPosition.top); + // }); + // }); + // }); + + it("2. checks undo/redo for toggle control in property pane", function () { + cy.openPropertyPane("checkboxwidget"); + cy.CheckWidgetProperties(commonlocators.disableCheckbox); + + cy.get("body").type(`{${modifierKey}}z`); + cy.wait(100); + cy.get(`${widgetsPage.disable} input`).should("not.be.checked"); + cy.get(widgetLocators.checkboxWidget + " " + "input").should( + "not.be.disabled", + ); + + cy.get("body").type(`{${modifierKey}}{shift}z`); + cy.wait(100); + + cy.get(`${widgetsPage.disable} input`).should("be.checked"); + cy.get(widgetLocators.checkboxWidget + " " + "input").should( + "be.disabled", + ); + }); + + it("3. checks undo/redo for input control in property pane", function () { + cy.get(widgetsPage.inputLabelControl).type("1"); + cy.get(widgetsPage.inputLabelControl).contains("Label1"); + + cy.get("body").type(`{${modifierKey}}z`); + cy.wait(100); + cy.get(widgetsPage.inputLabelControl).contains("Label"); + cy.get(`${publish.checkboxWidget} label`).should("have.text", "Label"); + + cy.get("body").type(`{${modifierKey}}{shift}z`); + cy.wait(100); + cy.get(widgetsPage.inputLabelControl).contains("Label1"); + cy.get(`${publish.checkboxWidget} label`).should("have.text", "Label1"); + }); + + it("4. checks undo/redo for deletion of widgets", function () { + cy.deleteWidget(widgetsPage.checkboxWidget); + cy.get(widgetsPage.checkboxWidget).should("not.exist"); + + cy.get("body").type(`{${modifierKey}}z`); + cy.wait(100); + cy.get(widgetsPage.checkboxWidget).should("exist"); + + // cy.get("body").type(`{${modifierKey}}{shift}z`); + // cy.wait(100); + // cy.get(widgetsPage.checkboxWidget).should("not.exist"); + }); + + it("5. checks if property Pane is open on undo/redo property changes", function () { + cy.dragAndDropToCanvas("textwidget", { x: 400, y: 400 }); + + cy.wait(100); + propPane.UpdatePropertyFieldValue("Text", "Label"); + + cy.closePropertyPane(); + + cy.get("body").type(`{${modifierKey}}z`); + cy.wait(100); + cy.get(widgetsPage.propertypaneText).should("exist"); + cy.get(widgetsPage.inputTextControl).contains( + "Hello {{appsmith.user.name || appsmith.user.email}}", + ); + + cy.closePropertyPane(); + + cy.get("body").type(`{${modifierKey}}{shift}z`); + cy.wait(100); + cy.get(widgetsPage.propertypaneText).should("exist"); + cy.get(widgetsPage.inputTextControl).contains("Label"); + cy.deleteWidget(widgetsPage.textWidget); + }); + + it("6. checks if toast is shown while undo/redo widget deletion or creation only the first time", function () { + cy.dragAndDropToCanvas("textwidget", { x: 400, y: 400 }); + localStorage.removeItem("undoToastShown"); + localStorage.removeItem("redoToastShown"); + + cy.get("body").type(`{${modifierKey}}z`); + cy.get(commonlocators.toastmsg).contains("is removed"); + cy.get(commonlocators.toastmsg).contains("redo"); + cy.get(commonlocators.toastBody).first().click({ force: true }); + + cy.wait(100); + cy.get("body").type(`{${modifierKey}}{shift}z`); + cy.get(commonlocators.toastmsg).contains("is added back"); + cy.get(commonlocators.toastmsg).contains("undo"); + cy.deleteWidget(widgetsPage.textWidget); + }); + + it("7. checks undo/redo for color picker", function () { + cy.dragAndDropToCanvas("textwidget", { x: 100, y: 100 }); + cy.moveToStyleTab(); + cy.selectColor("textcolor"); + cy.get("body").click({ force: true }); + // eslint-disable-next-line cypress/no-unnecessary-waiting + cy.wait(500); + cy.wait("@updateLayout"); + cy.readTextDataValidateCSS("color", "rgb(219, 234, 254)"); + cy.get("body").click({ force: true }).type(`{${modifierKey}}z`); + EditorNavigation.SelectEntityByName("Text1", EntityType.Widget); + propPane.MoveToTab("Style"); + cy.get(widgetsPage.textColor) + .first() + .invoke("attr", "value") + .should("contain", "#231F20"); + + cy.get("body").type(`{${modifierKey}}{shift}z`); + EditorNavigation.SelectEntityByName("Text1", EntityType.Widget); + propPane.MoveToTab("Style"); + cy.get(widgetsPage.textColor) + .first() + .invoke("attr", "value") + .should("contain", "#dbeafe"); + }); + + it("8. checks undo/redo for option control for radio button", function () { + cy.dragAndDropToCanvas("radiogroupwidget", { x: 200, y: 600 }); + + cy.get(widgetsPage.RadioInput).first().type("1"); + + cy.get(widgetsPage.RadioInput).first().blur(); + + // eslint-disable-next-line cypress/no-unnecessary-waiting + cy.wait(200); + + cy.get("body").type(`{${modifierKey}}z`); + EditorNavigation.SelectEntityByName("RadioGroup1", EntityType.Widget); + cy.get(widgetsPage.RadioInput) + .first() + .invoke("attr", "value") + .should("contain", "Yes"); + + cy.get("body").type(`{${modifierKey}}{shift}z`); + EditorNavigation.SelectEntityByName("RadioGroup1", EntityType.Widget); + cy.get(widgetsPage.RadioInput) + .first() + .invoke("attr", "value") + .should("contain", "Yes1"); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Resize_spec.js b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Resize_spec.js index 4673b3ff24a..0f56a228f4f 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Resize_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Resize_spec.js @@ -1,23 +1,31 @@ const commonlocators = require("../../../../locators/commonlocators.json"); import { agHelper, propPane } from "../../../../support/Objects/ObjectsCore"; -describe("Canvas Resize", function () { - before(() => { - agHelper.AddDsl("CanvasResizeDsl"); - }); - it("1. Deleting bottom widget should resize canvas", function () { - const InitHeight = "2950px"; - cy.get(commonlocators.dropTarget).should("have.css", "height", InitHeight); - //cy.openPropertyPane("textwidget"); - cy.intercept("PUT", "/api/v1/layouts/*/pages/*").as("deleteUpdate"); - propPane.DeleteWidgetFromPropertyPane("Text2"); - cy.wait("@deleteUpdate").then((response) => { - const dsl = response.response.body.data.dsl; +describe( + "Canvas Resize", + { tags: ["@tag.Widget", "@tag.AutoHeight"] }, + function () { + before(() => { + agHelper.AddDsl("CanvasResizeDsl"); + }); + it("1. Deleting bottom widget should resize canvas", function () { + const InitHeight = "2950px"; cy.get(commonlocators.dropTarget).should( "have.css", "height", - `${dsl.minHeight - 12}px`, // Reducing 12 px for container padding. + InitHeight, ); + //cy.openPropertyPane("textwidget"); + cy.intercept("PUT", "/api/v1/layouts/*/pages/*").as("deleteUpdate"); + propPane.DeleteWidgetFromPropertyPane("Text2"); + cy.wait("@deleteUpdate").then((response) => { + const dsl = response.response.body.data.dsl; + cy.get(commonlocators.dropTarget).should( + "have.css", + "height", + `${dsl.minHeight - 12}px`, // Reducing 12 px for container padding. + ); + }); }); - }); -}); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Unique_key_spec.js b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Unique_key_spec.js index 94fadcf674f..581acca07d8 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Unique_key_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Unique_key_spec.js @@ -4,7 +4,7 @@ import * as _ from "../../../../support/Objects/ObjectsCore"; // Since we cannot test the root cause as it does not show up on the DOM, we are testing the sideEffects // the root cause is when widget has same keys, which are not visible in DOM but confuses React when the list is modified. // please refer to issue, https://github.com/appsmithorg/appsmith/issues/7415 for more details. -describe("Unique react keys", function () { +describe("Unique react keys", { tags: ["@tag.Widget"] }, function () { afterEach(() => { _.agHelper.SaveLocalStorageCache(); }); diff --git a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/UpdateApplication_spec.js b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/UpdateApplication_spec.js index 706334ea084..d3d2940cc8c 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/UpdateApplication_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/UpdateApplication_spec.js @@ -2,7 +2,7 @@ import homePage from "../../../../locators/HomePage"; import { agHelper } from "../../../../support/Objects/ObjectsCore"; const commonlocators = require("../../../../locators/commonlocators.json"); -describe("Update Application", () => { +describe("Update Application", { tags: ["@tag.Workspace"] }, () => { let appname, workspaceName; let iconname; let veryLongAppName = `gnerwihnireongionihgnerwihnireongionihgnerwihnireongionihgnerwihnireongionihgnerwihnireongionihgnerwihnireongionih1gnerwihnireongionihgnerwihnireongionihgnerwihnireongionihgnerwihnireongionihgnerwihnireongionihgnerwihnireongionih1${Math.random() diff --git a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/ViewMode_spec.js b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/ViewMode_spec.js index b7da0c5c6a2..1b3c7b6c0d1 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/ViewMode_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/ViewMode_spec.js @@ -14,7 +14,7 @@ Cypress.Commands.add("getSharedUrl", () => { return Cypress.sharedStore.url; }); -describe("Preview mode functionality", function () { +describe("Preview mode functionality", { tags: ["@tag.IDE"] }, () => { before(() => { agHelper.AddDsl("previewMode"); deployMode.DeployApp(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Widget_Error_spec.js b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Widget_Error_spec.js index 5b35f24d796..2f35d8795cb 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Widget_Error_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Widget_Error_spec.js @@ -6,7 +6,7 @@ const widgetLocators = require("../../../../locators/Widgets.json"); import * as _ from "../../../../support/Objects/ObjectsCore"; import { WIDGET } from "../../../../locators/WidgetLocators"; -describe("Widget error state", function () { +describe("Widget error state", { tags: ["@tag.Widget"] }, function () { const modifierKey = Cypress.platform === "darwin" ? "meta" : "ctrl"; before(() => { diff --git a/app/client/cypress/e2e/Regression/ClientSide/SettingsPane/PageSettings_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/SettingsPane/PageSettings_spec.ts index ccaecba8962..4ae4eaf7a19 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/SettingsPane/PageSettings_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/SettingsPane/PageSettings_spec.ts @@ -1,7 +1,7 @@ import * as _ from "../../../../support/Objects/ObjectsCore"; import PageList from "../../../../support/Pages/PageList"; -describe("Page Settings", { tags: ["@tag.Settings"] }, () => { +describe("Page Settings", { tags: ["@tag.Settings", "@tag.Sanity"] }, () => { it("1. Page name change updates URL", () => { _.appSettings.OpenAppSettings(); _.appSettings.GoToPageSettings("Page1"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Templates/CreateNewAppFromTemplates_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Templates/CreateNewAppFromTemplates_spec.ts index 4f548e55068..291512d7c45 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Templates/CreateNewAppFromTemplates_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Templates/CreateNewAppFromTemplates_spec.ts @@ -8,7 +8,14 @@ import reconnectDatasourceLocators from "../../../../locators/ReconnectLocators. describe( "Create new application from template", - { tags: ["@tag.excludeForAirgap", "@tag.Workspace", "@tag.Templates"] }, + { + tags: [ + "@tag.excludeForAirgap", + "@tag.Workspace", + "@tag.Templates", + "@tag.Sanity", + ], + }, function () { beforeEach(() => { homePage.NavigateToHome(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Templates/Fork_Template_Existing_app_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Templates/Fork_Template_Existing_app_spec.js index 95f4246c88d..7cc1d638ed5 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Templates/Fork_Template_Existing_app_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Templates/Fork_Template_Existing_app_spec.js @@ -23,7 +23,7 @@ beforeEach(() => { describe( "Fork a template to the current app from new page popover", - { tags: ["@tag.Templates", "@tag.excludeForAirgap"] }, + { tags: ["@tag.Templates", "@tag.excludeForAirgap", "@tag.Sanity"] }, () => { it("1. Fork template from page section", () => { //Fork template button to be visible always diff --git a/app/client/cypress/e2e/Regression/ClientSide/Templates/TemplatesPage_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Templates/TemplatesPage_spec.ts index bd1858a86f8..63fff9dfdc8 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Templates/TemplatesPage_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Templates/TemplatesPage_spec.ts @@ -3,7 +3,7 @@ import PageList from "../../../../support/Pages/PageList"; describe( "Templates page", - { tags: ["@tag.Templates", "@tag.excludeForAirgap"] }, + { tags: ["@tag.Templates", "@tag.excludeForAirgap", "@tag.Sanity"] }, () => { it("1. Templates Modal should have show only 'allowPageImport:true' templates", () => { cy.fixture("Templates/AllowPageImportTemplates.json").then((data) => { diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Button/Button_onClickAction_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Button/Button_onClickAction_spec.js index 56080c5d115..703cfc151a1 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Button/Button_onClickAction_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Button/Button_onClickAction_spec.js @@ -16,7 +16,7 @@ import { describe( "Button Widget Functionality", - { tags: ["@tag.Widget", "@tag.Button"] }, + { tags: ["@tag.Widget", "@tag.Button", "@tag.Sanity"] }, function () { before(() => { agHelper.AddDsl("newFormDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Chart/ChartDataPoint_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Chart/ChartDataPoint_Spec.ts index f007ed8ebce..3f12e9eb6f7 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Chart/ChartDataPoint_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Chart/ChartDataPoint_Spec.ts @@ -16,7 +16,7 @@ let dataSet: any, dsl: any; describe( "Input widget test with default value from chart datapoint", - { tags: ["@tag.Widget", "@tag.Chart"] }, + { tags: ["@tag.Widget", "@tag.Chart", "@tag.Sanity"] }, () => { //beforeEach - to enable re-attempt passing! beforeEach(() => { diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_AutoGenerateFormDisabled_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_AutoGenerateFormDisabled_spec.js index 3e7e83aae5b..23894738bcb 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_AutoGenerateFormDisabled_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_AutoGenerateFormDisabled_spec.js @@ -13,7 +13,7 @@ import { describe( "JSON Form Widget AutoGenerate Disabled", - { tags: ["@tag.Widget", "@tag.JSONForm"] }, + { tags: ["@tag.Widget", "@tag.JSONForm", "@tag.Sanity"] }, () => { before(() => { agHelper.AddDsl("jsonFormDslWithSchemaAndWithoutSourceData"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_AutoGenerateFormEnabled_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_AutoGenerateFormEnabled_spec.js index f6b2870a46f..11a286f7a22 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_AutoGenerateFormEnabled_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_AutoGenerateFormEnabled_spec.js @@ -16,7 +16,7 @@ let locators = ObjectsRegistry.CommonLocators; describe( "JSON Form Widget AutoGenerate Enabled", - { tags: ["@tag.Widget", "@tag.JSONForm"] }, + { tags: ["@tag.Widget", "@tag.JSONForm", "@tag.Sanity"] }, () => { beforeEach(() => { agHelper.RestoreLocalStorageCache(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_Basic_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_Basic_spec.js index d9a8cf6d709..c2f299b7b88 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_Basic_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_Basic_spec.js @@ -11,7 +11,7 @@ const { describe( "JsonForm widget basis c usecases", - { tags: ["@tag.Widget", "@tag.JSONForm"] }, + { tags: ["@tag.Widget", "@tag.JSONForm", "@tag.Sanity"] }, function () { before(() => { cy.dragAndDropToCanvas("jsonformwidget", { x: 200, y: 200 }); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/ListV2_PageNo_PageSize_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/ListV2_PageNo_PageSize_spec.js index 26ec43b37f7..00e3059cd5a 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/ListV2_PageNo_PageSize_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/ListV2_PageNo_PageSize_spec.js @@ -88,7 +88,7 @@ const listData = [ describe( "List widget V2 page number and page size", - { tags: ["@tag.Widget", "@tag.List"] }, + { tags: ["@tag.Widget", "@tag.List", "@tag.Sanity"] }, () => { before(() => { _.agHelper.AddDsl("listv2PaginationDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/ListV2_SerververSide_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/ListV2_SerververSide_spec.js index d655cdab6ba..061e83a4c9e 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/ListV2_SerververSide_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/ListV2_SerververSide_spec.js @@ -15,7 +15,7 @@ const widgetSelector = (name) => `[data-widgetname-cy="${name}"]`; describe( "List widget V2 Serverside Pagination", - { tags: ["@tag.Widget", "@tag.List"] }, + { tags: ["@tag.Widget", "@tag.List", "@tag.Sanity"] }, () => { before(() => { agHelper.AddDsl("Listv2/Listv2JSObjects"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/ListV2_nested_List_widget_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/ListV2_nested_List_widget_spec.js index 4d6a2525baa..0aafd27f8e5 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/ListV2_nested_List_widget_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/ListV2_nested_List_widget_spec.js @@ -27,7 +27,7 @@ function checkAutosuggestion(label, type) { } describe( " Nested List Widgets ", - { tags: ["@tag.Widget", "@tag.List"] }, + { tags: ["@tag.Widget", "@tag.List", "@tag.Sanity"] }, function () { const modifierKey = Cypress.platform === "darwin" ? "meta" : "ctrl"; beforeEach(() => { diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_BasicChildWidgetInteraction_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_BasicChildWidgetInteraction_spec.js index e1b24950bd0..1bdbef59b94 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_BasicChildWidgetInteraction_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_BasicChildWidgetInteraction_spec.js @@ -51,7 +51,7 @@ function checkSelectedRadioValue(selector, value) { describe( "List widget v2 - Basic Child Widget Interaction", - { tags: ["@tag.Widget", "@tag.List"] }, + { tags: ["@tag.Widget", "@tag.List", "@tag.Sanity"] }, () => { before(() => { _.agHelper.AddDsl("Listv2/emptyList"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_BasicClientSideData_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_BasicClientSideData_spec.js index f6c14c63db3..59ebf8744cd 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_BasicClientSideData_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_BasicClientSideData_spec.js @@ -26,7 +26,7 @@ const simpleListData1 = [ describe( "List widget v2 - Basic client side data tests", - { tags: ["@tag.Widget", "@tag.List"] }, + { tags: ["@tag.Widget", "@tag.List", "@tag.Sanity"] }, () => { beforeEach(() => { _.agHelper.RestoreLocalStorageCache(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_Nested_EventBindings_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_Nested_EventBindings_spec.js index 046260141a2..344b4116035 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_Nested_EventBindings_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_Nested_EventBindings_spec.js @@ -6,7 +6,7 @@ const widgetSelector = (name) => `[data-widgetname-cy="${name}"]`; describe( "Listv2 - Event bindings spec", - { tags: ["@tag.Widget", "@tag.List"] }, + { tags: ["@tag.Widget", "@tag.List", "@tag.Sanity"] }, () => { it("1. nested list - inner widget should have access to currentItem, currentIndex, currentView and level_1", () => { cy.addDsl(nestedListDSL); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_onItemClick_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_onItemClick_spec.js index 647f5a6e031..7d3e5f1d4e9 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_onItemClick_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_onItemClick_spec.js @@ -30,7 +30,7 @@ function deleteAllWidgetsInContainer() { describe( "List widget v2 onItemClick", - { tags: ["@tag.Widget", "@tag.List"] }, + { tags: ["@tag.Widget", "@tag.List", "@tag.Sanity"] }, () => { it("1. List widget V2 with onItemClick", () => { cy.dragAndDropToCanvas("listwidgetv2", { diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Multiselect/MultiSelect1_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Multiselect/MultiSelect1_spec.js index e9793d48382..90dce2f693b 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Multiselect/MultiSelect1_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Multiselect/MultiSelect1_spec.js @@ -3,7 +3,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "MultiSelect Widget Functionality", - { tags: ["@tag.Widget", "@tag.Multiselect"] }, + { tags: ["@tag.Widget", "@tag.Multiselect", "@tag.Sanity"] }, function () { before(() => { _.agHelper.AddDsl("emptyDSL"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Select/Select_Validation_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Select/Select_Validation_spec.js index bf3d44f067c..7924ea4e9ec 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Select/Select_Validation_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Select/Select_Validation_spec.js @@ -8,7 +8,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Select Widget Functionality", - { tags: ["@tag.Widget", "@tag.Select"] }, + { tags: ["@tag.Widget", "@tag.Select", "@tag.Sanity"] }, function () { before(() => { _.entityExplorer.DragDropWidgetNVerify(_.draggableWidgets.SELECT); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Select/Select_widget1_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Select/Select_widget1_spec.js index 843c76e50c1..4dc40ede6cf 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Select/Select_widget1_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Select/Select_widget1_spec.js @@ -9,7 +9,7 @@ const defaultValue = ` describe( "Select Widget Functionality", - { tags: ["@tag.Widget", "@tag.Select"] }, + { tags: ["@tag.Widget", "@tag.Select", "@tag.Sanity"] }, function () { before(() => { _.agHelper.AddDsl("emptyDSL"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/AddNewRow1_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/AddNewRow1_spec.js index cc0c32b1d9c..d3e05b789db 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/AddNewRow1_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/AddNewRow1_spec.js @@ -5,172 +5,176 @@ import { } from "../../../../../support/Objects/ObjectsCore"; const commonlocators = require("../../../../../locators/commonlocators.json"); -describe("Basic flow ", { tags: ["@tag.Widget", "@tag.Table"] }, () => { - before(() => { - agHelper.RestoreLocalStorageCache(); - agHelper.AddDsl("Table/InlineEditingDSL"); - }); - - it("1.1. should test that allow Add new row property is present", () => { - cy.openPropertyPane("tablewidgetv2"); - cy.get(".t--property-control-allowaddingarow").should("exist"); - cy.get(".t--property-control-allowaddingarow input").should("exist"); - cy.get(".t--add-new-row").should("not.exist"); - propPane.TogglePropertyState("Allow adding a row", "Off", null); - cy.get(".t--add-new-row").should("not.exist"); - cy.get(".t--property-control-onsave").should("not.exist"); - cy.get(".t--property-control-ondiscard").should("not.exist"); - cy.get(".t--property-control-defaultvalues").should("not.exist"); - // onSave, onDiscard and default row are showing up only when the allow add new property is enabled - propPane.TogglePropertyState("Allow adding a row", "On"); - cy.get(".t--add-new-row").should("exist"); - cy.get(".t--property-control-onsave").should("exist"); - cy.get(".t--property-control-ondiscard").should("exist"); - cy.get(".t--property-control-defaultvalues").should("exist"); - cy.get(".t--add-new-row.disabled").should("not.exist"); - // add new row link is disabled during the inline editing flow - table.toggleColumnEditableViaColSettingsPane("step"); - cy.editTableCell(0, 0); - cy.get(".t--add-new-row.disabled").should("exist"); - cy.openPropertyPane("tablewidgetv2"); - cy.get(".tableWrap .new-row").should("not.exist"); - // clicking on add new row link adds an empty row at the top of the table - cy.get(".t--add-new-row").click(); - cy.get(".tableWrap .new-row").should("exist"); - cy.get(".t--discard-new-row").click({ force: true }); - }); +describe( + "Basic flow ", + { tags: ["@tag.Widget", "@tag.Table", "@tag.Sanity"] }, + () => { + before(() => { + agHelper.RestoreLocalStorageCache(); + agHelper.AddDsl("Table/InlineEditingDSL"); + }); - it("1.2. should test that new row is getting populated with the default row property value", () => { - cy.updateCodeInput( - ".t--property-control-defaultvalues", - "{{{step: 'newStepCell'}}}", - ); - cy.get(".t--add-new-row").click(); - cy.get(".tableWrap .new-row").should("exist"); - cy.readTableV2data(0, 0).then((val) => { - expect(val).to.equal("newStepCell"); + it("1.1. should test that allow Add new row property is present", () => { + cy.openPropertyPane("tablewidgetv2"); + cy.get(".t--property-control-allowaddingarow").should("exist"); + cy.get(".t--property-control-allowaddingarow input").should("exist"); + cy.get(".t--add-new-row").should("not.exist"); + propPane.TogglePropertyState("Allow adding a row", "Off", null); + cy.get(".t--add-new-row").should("not.exist"); + cy.get(".t--property-control-onsave").should("not.exist"); + cy.get(".t--property-control-ondiscard").should("not.exist"); + cy.get(".t--property-control-defaultvalues").should("not.exist"); + // onSave, onDiscard and default row are showing up only when the allow add new property is enabled + propPane.TogglePropertyState("Allow adding a row", "On"); + cy.get(".t--add-new-row").should("exist"); + cy.get(".t--property-control-onsave").should("exist"); + cy.get(".t--property-control-ondiscard").should("exist"); + cy.get(".t--property-control-defaultvalues").should("exist"); + cy.get(".t--add-new-row.disabled").should("not.exist"); + // add new row link is disabled during the inline editing flow + table.toggleColumnEditableViaColSettingsPane("step"); + cy.editTableCell(0, 0); + cy.get(".t--add-new-row.disabled").should("exist"); + cy.openPropertyPane("tablewidgetv2"); + cy.get(".tableWrap .new-row").should("not.exist"); + // clicking on add new row link adds an empty row at the top of the table + cy.get(".t--add-new-row").click(); + cy.get(".tableWrap .new-row").should("exist"); + cy.get(".t--discard-new-row").click({ force: true }); }); - cy.get(".t--discard-new-row").click({ force: true }); - }); - it("1.3. should test that inline editing, row selection, pagination, search, filters are actions cannot be performed while in add new row feature", () => { - cy.get(".t--widget-tablewidgetv2 .t--search-input").should("exist"); - cy.get(".t--widget-tablewidgetv2 .t--table-filter-toggle-btn").should( - "exist", - ); - cy.get(".t--widget-tablewidgetv2 .t--table-download-btn").should("exist"); - cy.get(".t--widget-tablewidgetv2 .t--add-new-row").should("exist"); - cy.get(".t--widget-tablewidgetv2 .show-page-items").should("exist"); - cy.get(".t--widget-tablewidgetv2 .t--table-widget-prev-page").should( - "exist", - ); - cy.get(".t--widget-tablewidgetv2 .t--table-widget-page-input").should( - "exist", - ); - cy.get(".t--widget-tablewidgetv2 .t--table-widget-next-page").should( - "exist", - ); + it("1.2. should test that new row is getting populated with the default row property value", () => { + cy.updateCodeInput( + ".t--property-control-defaultvalues", + "{{{step: 'newStepCell'}}}", + ); + cy.get(".t--add-new-row").click(); + cy.get(".tableWrap .new-row").should("exist"); + cy.readTableV2data(0, 0).then((val) => { + expect(val).to.equal("newStepCell"); + }); + cy.get(".t--discard-new-row").click({ force: true }); + }); - cy.get(".t--add-new-row").click(); + it("1.3. should test that inline editing, row selection, pagination, search, filters are actions cannot be performed while in add new row feature", () => { + cy.get(".t--widget-tablewidgetv2 .t--search-input").should("exist"); + cy.get(".t--widget-tablewidgetv2 .t--table-filter-toggle-btn").should( + "exist", + ); + cy.get(".t--widget-tablewidgetv2 .t--table-download-btn").should("exist"); + cy.get(".t--widget-tablewidgetv2 .t--add-new-row").should("exist"); + cy.get(".t--widget-tablewidgetv2 .show-page-items").should("exist"); + cy.get(".t--widget-tablewidgetv2 .t--table-widget-prev-page").should( + "exist", + ); + cy.get(".t--widget-tablewidgetv2 .t--table-widget-page-input").should( + "exist", + ); + cy.get(".t--widget-tablewidgetv2 .t--table-widget-next-page").should( + "exist", + ); - cy.get(".t--widget-tablewidgetv2 .t--search-input").should("not.exist"); - cy.get(".t--widget-tablewidgetv2 .t--table-filter-toggle-btn").should( - "not.exist", - ); - cy.get(".t--widget-tablewidgetv2 .t--table-download-btn").should( - "not.exist", - ); - cy.get(".t--widget-tablewidgetv2 .t--add-new-row").should("not.exist"); - cy.get(".t--widget-tablewidgetv2 .show-page-items").should("not.exist"); - cy.get(".t--widget-tablewidgetv2 .t--table-widget-prev-page").should( - "not.exist", - ); - cy.get(".t--widget-tablewidgetv2 .t--table-widget-page-input").should( - "not.exist", - ); - cy.get(".t--widget-tablewidgetv2 .t--table-widget-next-page").should( - "not.exist", - ); - cy.get(".t--discard-new-row").click({ force: true }); - }); + cy.get(".t--add-new-row").click(); - it("1.4. should test that only editable column cells are in editmode in the new row", () => { - cy.get(".t--add-new-row").click(); - cy.get(`[data-colindex=0][data-rowindex=0] .t--inlined-cell-editor`).should( - "exist", - ); - cy.get(`[data-colindex=1][data-rowindex=0] .t--inlined-cell-editor`).should( - "not.exist", - ); - table.toggleColumnEditableViaColSettingsPane("task"); - cy.get(`[data-colindex=0][data-rowindex=0] .t--inlined-cell-editor`).should( - "exist", - ); - cy.get(`[data-colindex=1][data-rowindex=0] .t--inlined-cell-editor`).should( - "exist", - ); - table.toggleColumnEditableViaColSettingsPane("step", "v2", false); - table.toggleColumnEditableViaColSettingsPane("task", "v2", false); - cy.get(`[data-colindex=0][data-rowindex=0] .t--inlined-cell-editor`).should( - "not.exist", - ); - cy.get(`[data-colindex=1][data-rowindex=0] .t--inlined-cell-editor`).should( - "not.exist", - ); - }); + cy.get(".t--widget-tablewidgetv2 .t--search-input").should("not.exist"); + cy.get(".t--widget-tablewidgetv2 .t--table-filter-toggle-btn").should( + "not.exist", + ); + cy.get(".t--widget-tablewidgetv2 .t--table-download-btn").should( + "not.exist", + ); + cy.get(".t--widget-tablewidgetv2 .t--add-new-row").should("not.exist"); + cy.get(".t--widget-tablewidgetv2 .show-page-items").should("not.exist"); + cy.get(".t--widget-tablewidgetv2 .t--table-widget-prev-page").should( + "not.exist", + ); + cy.get(".t--widget-tablewidgetv2 .t--table-widget-page-input").should( + "not.exist", + ); + cy.get(".t--widget-tablewidgetv2 .t--table-widget-next-page").should( + "not.exist", + ); + cy.get(".t--discard-new-row").click({ force: true }); + }); - it("1.5. should test that newRow property holds the entered data", () => { - table.toggleColumnEditableViaColSettingsPane("step"); - table.toggleColumnEditableViaColSettingsPane("task"); - cy.enterTableCellValue(0, 0, "22"); - cy.enterTableCellValue(1, 0, "21"); - cy.dragAndDropToCanvas("textwidget", { x: 300, y: 600 }); - cy.openPropertyPane("textwidget"); - cy.updateCodeInput(".t--property-control-text", `{{Table1.newRow}}`); - cy.get(".t--widget-textwidget .bp3-ui-text").should( - "contain", - `{ "step": "22", "task": "21"}`, - ); - }); + it("1.4. should test that only editable column cells are in editmode in the new row", () => { + cy.get(".t--add-new-row").click(); + cy.get( + `[data-colindex=0][data-rowindex=0] .t--inlined-cell-editor`, + ).should("exist"); + cy.get( + `[data-colindex=1][data-rowindex=0] .t--inlined-cell-editor`, + ).should("not.exist"); + table.toggleColumnEditableViaColSettingsPane("task"); + cy.get( + `[data-colindex=0][data-rowindex=0] .t--inlined-cell-editor`, + ).should("exist"); + cy.get( + `[data-colindex=1][data-rowindex=0] .t--inlined-cell-editor`, + ).should("exist"); + table.toggleColumnEditableViaColSettingsPane("step", "v2", false); + table.toggleColumnEditableViaColSettingsPane("task", "v2", false); + cy.get( + `[data-colindex=0][data-rowindex=0] .t--inlined-cell-editor`, + ).should("not.exist"); + cy.get( + `[data-colindex=1][data-rowindex=0] .t--inlined-cell-editor`, + ).should("not.exist"); + }); - it("1.6. should test that non data (iconBitton, button, menubutton) column cells are not showing up", () => { - cy.openPropertyPane("tablewidgetv2"); - table.toggleColumnEditableViaColSettingsPane("step", "v2", false, false); - ["Button", "Menu button", "Icon button"].forEach((columnType) => { - cy.get(commonlocators.changeColType).last().click(); - cy.get(".t--dropdown-option").children().contains(columnType).click(); - cy.wait("@updateLayout"); - cy.get(`[data-colindex=0][data-rowindex=0] button`).should("not.exist"); + it("1.5. should test that newRow property holds the entered data", () => { + table.toggleColumnEditableViaColSettingsPane("step"); + table.toggleColumnEditableViaColSettingsPane("task"); + cy.enterTableCellValue(0, 0, "22"); + cy.enterTableCellValue(1, 0, "21"); + cy.dragAndDropToCanvas("textwidget", { x: 300, y: 600 }); + cy.openPropertyPane("textwidget"); + cy.updateCodeInput(".t--property-control-text", `{{Table1.newRow}}`); + cy.get(".t--widget-textwidget .bp3-ui-text").should( + "contain", + `{ "step": "22", "task": "21"}`, + ); }); - cy.get("[data-testid='t--property-pane-back-btn']").click(); - }); - it("1.7. should not hide the header section when add new row button is enabled and another header element is disabled", () => { - cy.get(".t--discard-new-row").click({ force: true }); - //disable all header widgets for the table - [ - "Show pagination", - "Allow searching", - "Allow download", - "Allow filtering", - "Allow adding a row", - ].forEach((val) => { - propPane.TogglePropertyState(val, "Off"); + it("1.6. should test that non data (iconBitton, button, menubutton) column cells are not showing up", () => { + cy.openPropertyPane("tablewidgetv2"); + table.toggleColumnEditableViaColSettingsPane("step", "v2", false, false); + ["Button", "Menu button", "Icon button"].forEach((columnType) => { + cy.get(commonlocators.changeColType).last().click(); + cy.get(".t--dropdown-option").children().contains(columnType).click(); + cy.wait("@updateLayout"); + cy.get(`[data-colindex=0][data-rowindex=0] button`).should("not.exist"); + }); + cy.get("[data-testid='t--property-pane-back-btn']").click(); }); - cy.wait(1000); - //intially enable 2 sections to show pagination and "add new row" button to the header section - propPane.TogglePropertyState("Show pagination", "On"); - propPane.TogglePropertyState("Allow adding a row", "On"); + it("1.7. should not hide the header section when add new row button is enabled and another header element is disabled", () => { + cy.get(".t--discard-new-row").click({ force: true }); + //disable all header widgets for the table + [ + "Show pagination", + "Allow searching", + "Allow download", + "Allow filtering", + "Allow adding a row", + ].forEach((val) => { + propPane.TogglePropertyState(val, "Off"); + }); + cy.wait(1000); + + //intially enable 2 sections to show pagination and "add new row" button to the header section + propPane.TogglePropertyState("Show pagination", "On"); + propPane.TogglePropertyState("Allow adding a row", "On"); - //"add new row" button should be present - cy.get(".t--add-new-row").should("exist"); - //turn off pagination and now the "add new row" button should be the only component left in the header section - propPane.TogglePropertyState("Show pagination", "Off"); - //"add new row" should continue to be present - cy.get(".t--add-new-row").should("exist"); - //finally turn off allow adding a row then the "add new row" button should be removed from the header section - propPane.TogglePropertyState("Allow adding a row", "Off"); - cy.get(".t--add-new-row").should("not.exist"); - }); -}); + //"add new row" button should be present + cy.get(".t--add-new-row").should("exist"); + //turn off pagination and now the "add new row" button should be the only component left in the header section + propPane.TogglePropertyState("Show pagination", "Off"); + //"add new row" should continue to be present + cy.get(".t--add-new-row").should("exist"); + //finally turn off allow adding a row then the "add new row" button should be removed from the header section + propPane.TogglePropertyState("Allow adding a row", "Off"); + cy.get(".t--add-new-row").should("not.exist"); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/AddNewRow2_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/AddNewRow2_spec.js index ac43df3ec57..23508651c00 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/AddNewRow2_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/AddNewRow2_spec.js @@ -1,167 +1,171 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; const commonlocators = require("../../../../../locators/commonlocators.json"); -describe("Validation flow", { tags: ["@tag.Widget", "@tag.Table"] }, () => { - before(() => { - cy.startServerAndRoutes(); - _.agHelper.RestoreLocalStorageCache(); - _.agHelper.AddDsl("Table/InlineEditingDSL"); - }); +describe( + "Validation flow", + { tags: ["@tag.Widget", "@tag.Table", "@tag.Sanity"] }, + () => { + before(() => { + cy.startServerAndRoutes(); + _.agHelper.RestoreLocalStorageCache(); + _.agHelper.AddDsl("Table/InlineEditingDSL"); + }); - it("2.1. should test that validation is working for a new row cell", () => { - cy.openPropertyPane("tablewidgetv2"); - _.propPane.TogglePropertyState("Allow adding a row", "On"); - cy.get(".t--add-new-row").click(); - _.table.toggleColumnEditableViaColSettingsPane("step", "v2", true, false); + it("2.1. should test that validation is working for a new row cell", () => { + cy.openPropertyPane("tablewidgetv2"); + _.propPane.TogglePropertyState("Allow adding a row", "On"); + cy.get(".t--add-new-row").click(); + _.table.toggleColumnEditableViaColSettingsPane("step", "v2", true, false); - _.propPane.UpdatePropertyFieldValue("Valid", "{{editedValue === '#1'}}"); - cy.wait(500); - cy.get(`.t--inlined-cell-editor-has-error`).should("not.exist"); - cy.enterTableCellValue(0, 0, "22"); - cy.wait(500); - cy.get(`.t--inlined-cell-editor-has-error`).should("exist"); - cy.enterTableCellValue(0, 0, "#1"); - cy.wait(500); - cy.get(`.t--inlined-cell-editor-has-error`).should("not.exist"); - _.propPane.UpdatePropertyFieldValue("Valid", ""); + _.propPane.UpdatePropertyFieldValue("Valid", "{{editedValue === '#1'}}"); + cy.wait(500); + cy.get(`.t--inlined-cell-editor-has-error`).should("not.exist"); + cy.enterTableCellValue(0, 0, "22"); + cy.wait(500); + cy.get(`.t--inlined-cell-editor-has-error`).should("exist"); + cy.enterTableCellValue(0, 0, "#1"); + cy.wait(500); + cy.get(`.t--inlined-cell-editor-has-error`).should("not.exist"); + _.propPane.UpdatePropertyFieldValue("Valid", ""); - _.propPane.UpdatePropertyFieldValue("Regex", "^#1$"); - cy.wait(500); - cy.get(`.t--inlined-cell-editor-has-error`).should("not.exist"); - cy.enterTableCellValue(0, 0, "22"); - cy.wait(500); - cy.get(`.t--inlined-cell-editor-has-error`).should("exist"); - cy.enterTableCellValue(0, 0, "#1"); - cy.wait(500); - cy.get(`.t--inlined-cell-editor-has-error`).should("not.exist"); - _.propPane.UpdatePropertyFieldValue("Regex", ""); + _.propPane.UpdatePropertyFieldValue("Regex", "^#1$"); + cy.wait(500); + cy.get(`.t--inlined-cell-editor-has-error`).should("not.exist"); + cy.enterTableCellValue(0, 0, "22"); + cy.wait(500); + cy.get(`.t--inlined-cell-editor-has-error`).should("exist"); + cy.enterTableCellValue(0, 0, "#1"); + cy.wait(500); + cy.get(`.t--inlined-cell-editor-has-error`).should("not.exist"); + _.propPane.UpdatePropertyFieldValue("Regex", ""); - _.propPane.TogglePropertyState("Required", "On"); - cy.enterTableCellValue(0, 0, "22"); - cy.wait(500); - cy.get(`.t--inlined-cell-editor-has-error`).should("not.exist"); - cy.enterTableCellValue(0, 0, "#1"); - cy.wait(500); - cy.get(`.t--inlined-cell-editor-has-error`).should("not.exist"); - cy.enterTableCellValue(0, 0, ""); - cy.wait(500); - cy.get(`.t--inlined-cell-editor-has-error`).should("exist"); + _.propPane.TogglePropertyState("Required", "On"); + cy.enterTableCellValue(0, 0, "22"); + cy.wait(500); + cy.get(`.t--inlined-cell-editor-has-error`).should("not.exist"); + cy.enterTableCellValue(0, 0, "#1"); + cy.wait(500); + cy.get(`.t--inlined-cell-editor-has-error`).should("not.exist"); + cy.enterTableCellValue(0, 0, ""); + cy.wait(500); + cy.get(`.t--inlined-cell-editor-has-error`).should("exist"); - cy.get(commonlocators.changeColType).last().click(); - cy.get(".t--dropdown-option").children().contains("Number").click(); - cy.wait("@updateLayout"); + cy.get(commonlocators.changeColType).last().click(); + cy.get(".t--dropdown-option").children().contains("Number").click(); + cy.wait("@updateLayout"); - _.propPane.UpdatePropertyFieldValue("Min", "5"); - cy.enterTableCellValue(0, 0, "6"); - cy.wait(500); - cy.get(`.t--inlined-cell-editor-has-error`).should("not.exist"); - cy.enterTableCellValue(0, 0, "7"); - cy.wait(500); - cy.get(`.t--inlined-cell-editor-has-error`).should("not.exist"); - cy.enterTableCellValue(0, 0, "4"); - cy.wait(500); - cy.get(`.t--inlined-cell-editor-has-error`).should("exist"); - cy.enterTableCellValue(0, 0, "3"); - cy.wait(500); - cy.get(`.t--inlined-cell-editor-has-error`).should("exist"); - cy.enterTableCellValue(0, 0, "8"); - cy.wait(500); - cy.get(`.t--inlined-cell-editor-has-error`).should("not.exist"); - _.propPane.UpdatePropertyFieldValue("Min", ""); + _.propPane.UpdatePropertyFieldValue("Min", "5"); + cy.enterTableCellValue(0, 0, "6"); + cy.wait(500); + cy.get(`.t--inlined-cell-editor-has-error`).should("not.exist"); + cy.enterTableCellValue(0, 0, "7"); + cy.wait(500); + cy.get(`.t--inlined-cell-editor-has-error`).should("not.exist"); + cy.enterTableCellValue(0, 0, "4"); + cy.wait(500); + cy.get(`.t--inlined-cell-editor-has-error`).should("exist"); + cy.enterTableCellValue(0, 0, "3"); + cy.wait(500); + cy.get(`.t--inlined-cell-editor-has-error`).should("exist"); + cy.enterTableCellValue(0, 0, "8"); + cy.wait(500); + cy.get(`.t--inlined-cell-editor-has-error`).should("not.exist"); + _.propPane.UpdatePropertyFieldValue("Min", ""); - _.propPane.UpdatePropertyFieldValue("Max", "5"); - cy.enterTableCellValue(0, 0, "6"); - cy.wait(500); - cy.get(`.t--inlined-cell-editor-has-error`).should("exist"); - cy.enterTableCellValue(0, 0, "7"); - cy.wait(500); - cy.get(`.t--inlined-cell-editor-has-error`).should("exist"); - cy.enterTableCellValue(0, 0, "4"); - cy.wait(500); - cy.get(`.t--inlined-cell-editor-has-error`).should("not.exist"); - cy.enterTableCellValue(0, 0, "3"); - cy.wait(500); - cy.get(`.t--inlined-cell-editor-has-error`).should("not.exist"); - cy.enterTableCellValue(0, 0, "8"); - cy.wait(500); - cy.get(`.t--inlined-cell-editor-has-error`).should("exist"); - _.propPane.UpdatePropertyFieldValue("Max", ""); + _.propPane.UpdatePropertyFieldValue("Max", "5"); + cy.enterTableCellValue(0, 0, "6"); + cy.wait(500); + cy.get(`.t--inlined-cell-editor-has-error`).should("exist"); + cy.enterTableCellValue(0, 0, "7"); + cy.wait(500); + cy.get(`.t--inlined-cell-editor-has-error`).should("exist"); + cy.enterTableCellValue(0, 0, "4"); + cy.wait(500); + cy.get(`.t--inlined-cell-editor-has-error`).should("not.exist"); + cy.enterTableCellValue(0, 0, "3"); + cy.wait(500); + cy.get(`.t--inlined-cell-editor-has-error`).should("not.exist"); + cy.enterTableCellValue(0, 0, "8"); + cy.wait(500); + cy.get(`.t--inlined-cell-editor-has-error`).should("exist"); + _.propPane.UpdatePropertyFieldValue("Max", ""); - // check that date isRequired validation is working - cy.get(commonlocators.changeColType).last().click(); - cy.get(".t--dropdown-option").children().contains("Date").click(); - cy.wait("@updateLayout"); - cy.enterTableCellValue(0, 0, ""); - cy.get(`.t--inlined-cell-editor-has-error`).should("exist"); + // check that date isRequired validation is working + cy.get(commonlocators.changeColType).last().click(); + cy.get(".t--dropdown-option").children().contains("Date").click(); + cy.wait("@updateLayout"); + cy.enterTableCellValue(0, 0, ""); + cy.get(`.t--inlined-cell-editor-has-error`).should("exist"); - // revert to Number for remainder of tests - cy.get(commonlocators.changeColType).last().click(); - cy.get(".t--dropdown-option").children().contains("Number").click(); - cy.wait("@updateLayout"); + // revert to Number for remainder of tests + cy.get(commonlocators.changeColType).last().click(); + cy.get(".t--dropdown-option").children().contains("Number").click(); + cy.wait("@updateLayout"); - cy.get(".t--discard-new-row").click({ force: true }); - }); + cy.get(".t--discard-new-row").click({ force: true }); + }); - it("2.2. should test that validation variable isNewRow is working", () => { - _.propPane.UpdatePropertyFieldValue( - "Valid", - "{{isNewRow ? (editedValue === 1) : (editedValue === 2)}}", - ); + it("2.2. should test that validation variable isNewRow is working", () => { + _.propPane.UpdatePropertyFieldValue( + "Valid", + "{{isNewRow ? (editedValue === 1) : (editedValue === 2)}}", + ); - cy.editTableCell(0, 0); - cy.enterTableCellValue(0, 0, "3"); - cy.wait(500); - cy.get(`.t--inlined-cell-editor-has-error`).should("exist"); - cy.enterTableCellValue(0, 0, "2"); - cy.wait(500); - cy.get(`.t--inlined-cell-editor-has-error`).should("not.exist"); - cy.discardTableCellValue(0, 0); - cy.wait(500); - cy.get(".t--add-new-row").click(); - cy.wait(1000); - cy.enterTableCellValue(0, 0, "3"); - cy.wait(500); - cy.get(`.t--inlined-cell-editor-has-error`).should("exist"); - cy.enterTableCellValue(0, 0, "2"); - cy.wait(500); - cy.get(`.t--inlined-cell-editor-has-error`).should("exist"); - cy.enterTableCellValue(0, 0, "1"); - cy.wait(500); - cy.get(`.t--inlined-cell-editor-has-error`).should("not.exist"); - cy.get(".t--discard-new-row").click({ force: true }); - }); + cy.editTableCell(0, 0); + cy.enterTableCellValue(0, 0, "3"); + cy.wait(500); + cy.get(`.t--inlined-cell-editor-has-error`).should("exist"); + cy.enterTableCellValue(0, 0, "2"); + cy.wait(500); + cy.get(`.t--inlined-cell-editor-has-error`).should("not.exist"); + cy.discardTableCellValue(0, 0); + cy.wait(500); + cy.get(".t--add-new-row").click(); + cy.wait(1000); + cy.enterTableCellValue(0, 0, "3"); + cy.wait(500); + cy.get(`.t--inlined-cell-editor-has-error`).should("exist"); + cy.enterTableCellValue(0, 0, "2"); + cy.wait(500); + cy.get(`.t--inlined-cell-editor-has-error`).should("exist"); + cy.enterTableCellValue(0, 0, "1"); + cy.wait(500); + cy.get(`.t--inlined-cell-editor-has-error`).should("not.exist"); + cy.get(".t--discard-new-row").click({ force: true }); + }); - it("2.3. should test that validation is working for more than one add new row cell at a time", () => { - _.propPane.UpdatePropertyFieldValue("Valid", "{{editedValue === 1}}"); - cy.get("[data-testid='t--property-pane-back-btn']").click(); - cy.wait(500); - _.table.toggleColumnEditableViaColSettingsPane("task", "v2", true, false); - _.propPane.UpdatePropertyFieldValue( - "Valid", - "{{editedValue === 'invalid'}}", - ); - _.propPane.TogglePropertyState("Required", "On"); - cy.get(".t--add-new-row").click(); - cy.get(`.t--inlined-cell-editor-has-error`).should("have.length", 2); - }); + it("2.3. should test that validation is working for more than one add new row cell at a time", () => { + _.propPane.UpdatePropertyFieldValue("Valid", "{{editedValue === 1}}"); + cy.get("[data-testid='t--property-pane-back-btn']").click(); + cy.wait(500); + _.table.toggleColumnEditableViaColSettingsPane("task", "v2", true, false); + _.propPane.UpdatePropertyFieldValue( + "Valid", + "{{editedValue === 'invalid'}}", + ); + _.propPane.TogglePropertyState("Required", "On"); + cy.get(".t--add-new-row").click(); + cy.get(`.t--inlined-cell-editor-has-error`).should("have.length", 2); + }); - it("2.4. should test that validation error message only appears when a cell is in focus", () => { - cy.get(".error-tooltip .bp3-popover-content").should("not.exist"); - cy.get(`[data-colindex=1][data-rowindex=0] input`).focus(); - cy.get(".error-tooltip .bp3-popover-content").should("have.length", 1); - cy.openPropertyPane("tablewidgetv2"); - cy.get(".error-tooltip .bp3-popover-content").should("not.exist"); - cy.get(`[data-colindex=0][data-rowindex=0] input`).focus(); - cy.get(".error-tooltip .bp3-popover-content").should("have.length", 1); - // save button is disabled when there is an error - cy.get(".t--save-new-row").should("be.disabled"); - cy.get(`.t--inlined-cell-editor-has-error`).should("have.length", 2); - cy.enterTableCellValue(0, 0, "1"); - cy.wait(1000); - cy.get(`.t--inlined-cell-editor-has-error`).should("have.length", 1); - cy.enterTableCellValue(1, 0, "invalid"); - cy.wait(1000); - cy.get(`.t--inlined-cell-editor-has-error`).should("have.length", 0); - cy.get(".t--save-new-row").should("not.be.disabled"); - }); -}); + it("2.4. should test that validation error message only appears when a cell is in focus", () => { + cy.get(".error-tooltip .bp3-popover-content").should("not.exist"); + cy.get(`[data-colindex=1][data-rowindex=0] input`).focus(); + cy.get(".error-tooltip .bp3-popover-content").should("have.length", 1); + cy.openPropertyPane("tablewidgetv2"); + cy.get(".error-tooltip .bp3-popover-content").should("not.exist"); + cy.get(`[data-colindex=0][data-rowindex=0] input`).focus(); + cy.get(".error-tooltip .bp3-popover-content").should("have.length", 1); + // save button is disabled when there is an error + cy.get(".t--save-new-row").should("be.disabled"); + cy.get(`.t--inlined-cell-editor-has-error`).should("have.length", 2); + cy.enterTableCellValue(0, 0, "1"); + cy.wait(1000); + cy.get(`.t--inlined-cell-editor-has-error`).should("have.length", 1); + cy.enterTableCellValue(1, 0, "invalid"); + cy.wait(1000); + cy.get(`.t--inlined-cell-editor-has-error`).should("have.length", 0); + cy.get(".t--save-new-row").should("not.be.disabled"); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/AddNewRow3_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/AddNewRow3_spec.js index d5632632983..e6a161c1bb2 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/AddNewRow3_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/AddNewRow3_spec.js @@ -3,7 +3,7 @@ const widgetsPage = require("../../../../../locators/Widgets.json"); describe( "Actions flow (save, discard)", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Sanity"] }, () => { before(() => { cy.startServerAndRoutes(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_FilteredTableData_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_FilteredTableData_spec.js index 572d38337ca..e3ca472a8bf 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_FilteredTableData_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_FilteredTableData_spec.js @@ -11,7 +11,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Table Widget V2 Filtered Table data in autocomplete", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Sanity"] }, function () { before("Table Widget V2 Functionality", () => { _.agHelper.AddDsl("tableV2AndTextDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_pagination_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_pagination_spec.js index e666fced118..d55d58c2124 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_pagination_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_pagination_spec.js @@ -3,7 +3,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Table Widget property pane feature validation", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Sanity"] }, function () { before(() => { _.agHelper.AddDsl("tableV2NewDslWithPagination"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Workspace/MemberRoles_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Workspace/MemberRoles_Spec.ts index 5154a056401..f747ffc96d2 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Workspace/MemberRoles_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Workspace/MemberRoles_Spec.ts @@ -5,7 +5,7 @@ let workspaceId: any, appid: any; describe( "Create new workspace and invite user & validate all roles", - { tags: ["@tag.Workspace"] }, + { tags: ["@tag.Workspace", "@tag.Sanity"] }, () => { it("1. Create new Workspace, Share with a user from UI & verify", () => { if (CURRENT_REPO === REPO.EE) _.adminSettings.EnableGAC(true, false); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Workspace/ShareAppTests_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Workspace/ShareAppTests_Spec.ts index ee6b2466475..54ea1884ee1 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Workspace/ShareAppTests_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Workspace/ShareAppTests_Spec.ts @@ -13,7 +13,7 @@ const appNavigationLocators = require("../../../../locators/AppNavigation.json") describe( "Create new workspace and share with a user", - { tags: ["@tag.Workspace"] }, + { tags: ["@tag.Workspace", "@tag.Sanity"] }, function () { let workspaceId: string, appid: string, currentUrl: any; diff --git a/app/client/cypress/e2e/Regression/ClientSide/Workspace/WorkspaceImportApplication_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Workspace/WorkspaceImportApplication_spec.js index 9123f3b6698..ba5a8f83d1d 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Workspace/WorkspaceImportApplication_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Workspace/WorkspaceImportApplication_spec.js @@ -3,7 +3,7 @@ import { agHelper, homePage } from "../../../../support/Objects/ObjectsCore"; describe( "Workspace Import Application", - { tags: ["@tag.Workspace"] }, + { tags: ["@tag.Workspace", "@tag.Sanity"] }, function () { let workspaceId; let newWorkspaceName; diff --git a/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_TestExecuteWithDynamicBindingInUrl_spec.ts b/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_TestExecuteWithDynamicBindingInUrl_spec.ts index 964de8a7983..36df01ae346 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_TestExecuteWithDynamicBindingInUrl_spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_TestExecuteWithDynamicBindingInUrl_spec.ts @@ -8,7 +8,7 @@ import { describe( "Test API execution with dynamic binding in URL - Bug #24218", - { tags: ["@tag.Datasource"] }, + { tags: ["@tag.Datasource", "@tag.Sanity"] }, () => { it("1. Test API execution with dynamic binding in URL", () => { // Create JS Object to set Appsmith store variable to mockApiUrl diff --git a/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/Mongo_Spec.ts b/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/Mongo_Spec.ts index 94cf82fc284..c6fbdd13f5b 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/Mongo_Spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/Mongo_Spec.ts @@ -16,7 +16,7 @@ import PageList from "../../../../support/Pages/PageList"; describe( "Validate Mongo CRUD with JSON Form", - { tags: ["@tag.Datasource"] }, + { tags: ["@tag.Datasource", "@tag.Sanity"] }, () => { let dsName: any; diff --git a/app/client/cypress/e2e/Regression/ServerSide/JsFunctionExecution/JSFunctionExecution_spec.ts b/app/client/cypress/e2e/Regression/ServerSide/JsFunctionExecution/JSFunctionExecution_spec.ts index 201b69d0e61..71c7ac4762c 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/JsFunctionExecution/JSFunctionExecution_spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/JsFunctionExecution/JSFunctionExecution_spec.ts @@ -28,493 +28,500 @@ let onPageLoadAndConfirmExecuteFunctionsLength: number, functionsLength: number, jsObj: string; -describe("JS Function Execution", { tags: ["@tag.JS"] }, function () { - const FUNCTIONS_SETTINGS_DEFAULT_DATA: IFunctionSettingData[] = [ - { - name: "getId", - onPageLoad: true, - confirmBeforeExecute: false, - isMarkedAsync: true, - }, - { - name: "zip", - onPageLoad: true, - confirmBeforeExecute: true, - isMarkedAsync: false, - }, - { - name: "base", - onPageLoad: false, - confirmBeforeExecute: false, - isMarkedAsync: true, - }, - { - name: "assert", - onPageLoad: false, - confirmBeforeExecute: false, - isMarkedAsync: false, - }, - { - name: "test", - onPageLoad: true, - confirmBeforeExecute: true, - isMarkedAsync: true, - }, - ]; - - before(() => { - agHelper.AddDsl("tablev1NewDsl"); - }); - - function assertAsyncFunctionsOrder(data: IFunctionSettingData[]) { - // sorts functions alphabetically - const sortFunctions = (data: IFunctionSettingData[]) => - data.sort((a, b) => a.name.localeCompare(b.name)); - cy.get(jsEditor._asyncJSFunctionSettings).then(function ($lis) { - const asyncFunctionLength = $lis.length; - // Assert number of functions - expect(asyncFunctionLength).to.equal(functionsLength); - Object.values(sortFunctions(data)).forEach((functionSetting, idx) => { - // Assert alphabetical order - expect($lis.eq(idx)).to.have.id( - jsEditor._getJSFunctionSettingsId(functionSetting.name), - ); - }); +describe( + "JS Function Execution", + { tags: ["@tag.JS", "@tag.Sanity"] }, + function () { + const FUNCTIONS_SETTINGS_DEFAULT_DATA: IFunctionSettingData[] = [ + { + name: "getId", + onPageLoad: true, + confirmBeforeExecute: false, + isMarkedAsync: true, + }, + { + name: "zip", + onPageLoad: true, + confirmBeforeExecute: true, + isMarkedAsync: false, + }, + { + name: "base", + onPageLoad: false, + confirmBeforeExecute: false, + isMarkedAsync: true, + }, + { + name: "assert", + onPageLoad: false, + confirmBeforeExecute: false, + isMarkedAsync: false, + }, + { + name: "test", + onPageLoad: true, + confirmBeforeExecute: true, + isMarkedAsync: true, + }, + ]; + + before(() => { + agHelper.AddDsl("tablev1NewDsl"); }); - } - it("1. Allows execution of js function when lint warnings(not errors) are present in code", function () { - jsEditor.CreateJSObject( - `export default { + function assertAsyncFunctionsOrder(data: IFunctionSettingData[]) { + // sorts functions alphabetically + const sortFunctions = (data: IFunctionSettingData[]) => + data.sort((a, b) => a.name.localeCompare(b.name)); + cy.get(jsEditor._asyncJSFunctionSettings).then(function ($lis) { + const asyncFunctionLength = $lis.length; + // Assert number of functions + expect(asyncFunctionLength).to.equal(functionsLength); + Object.values(sortFunctions(data)).forEach((functionSetting, idx) => { + // Assert alphabetical order + expect($lis.eq(idx)).to.have.id( + jsEditor._getJSFunctionSettingsId(functionSetting.name), + ); + }); + }); + } + + it("1. Allows execution of js function when lint warnings(not errors) are present in code", function () { + jsEditor.CreateJSObject( + `export default { myFun1: ()=>{ f; return "yes" } }`, - { - paste: true, - completeReplace: true, - toRun: false, - shouldCreateNewJSObj: true, - prettify: false, - }, - ); + { + paste: true, + completeReplace: true, + toRun: false, + shouldCreateNewJSObj: true, + prettify: false, + }, + ); - jsEditor.AssertParseError(false); - agHelper.ActionContextMenuWithInPane({ - action: "Delete", - entityType: entityItems.JSObject, + jsEditor.AssertParseError(false); + agHelper.ActionContextMenuWithInPane({ + action: "Delete", + entityType: entityItems.JSObject, + }); }); - }); - it("2. Prevents execution of js function when parse errors are present in code", function () { - jsEditor.CreateJSObject( - `export default { + it("2. Prevents execution of js function when parse errors are present in code", function () { + jsEditor.CreateJSObject( + `export default { myFun1: ()=>>{ return "yes" } }`, - { - paste: true, - completeReplace: true, - toRun: false, - shouldCreateNewJSObj: true, - prettify: false, - }, - ); - //Debugger shouldn't open when there is a parse error. - //It should open only in case of execution error. - debuggerHelper.AssertClosed(); - //Verify there is no error shown in the response tab. - debuggerHelper.OpenDebugger(); - debuggerHelper.ClickResponseTab(); - jsEditor.AssertParseError(false); - agHelper.ActionContextMenuWithInPane({ - action: "Delete", - entityType: entityItems.JSObject, + { + paste: true, + completeReplace: true, + toRun: false, + shouldCreateNewJSObj: true, + prettify: false, + }, + ); + //Debugger shouldn't open when there is a parse error. + //It should open only in case of execution error. + debuggerHelper.AssertClosed(); + //Verify there is no error shown in the response tab. + debuggerHelper.OpenDebugger(); + debuggerHelper.ClickResponseTab(); + jsEditor.AssertParseError(false); + agHelper.ActionContextMenuWithInPane({ + action: "Delete", + entityType: entityItems.JSObject, + }); }); - }); - it("3. Prioritizes parse errors that render JS Object invalid over function execution parse errors in debugger callouts", function () { - const JSObjectWithFunctionExecutionParseErrors = `export default { + it("3. Prioritizes parse errors that render JS Object invalid over function execution parse errors in debugger callouts", function () { + const JSObjectWithFunctionExecutionParseErrors = `export default { myFun1 :()=>{ return f } }`; - const JSObjectWithParseErrors = `export default { + const JSObjectWithParseErrors = `export default { myFun1: (a ,b)=>>{ return "yes" } }`; - // create jsObject with parse error (that doesn't render JS Object invalid) - jsEditor.CreateJSObject(JSObjectWithFunctionExecutionParseErrors, { - paste: true, - completeReplace: true, - toRun: true, - shouldCreateNewJSObj: true, - prettify: false, - }); + // create jsObject with parse error (that doesn't render JS Object invalid) + jsEditor.CreateJSObject(JSObjectWithFunctionExecutionParseErrors, { + paste: true, + completeReplace: true, + toRun: true, + shouldCreateNewJSObj: true, + prettify: false, + }); - // Assert presence of function execution parse error callout - jsEditor.AssertParseError(true); + // Assert presence of function execution parse error callout + jsEditor.AssertParseError(true); - // Add parse error that renders JS Object invalid in code - jsEditor.CreateJSObject(JSObjectWithParseErrors, { - paste: true, - completeReplace: true, - toRun: false, - shouldCreateNewJSObj: false, - prettify: false, - }); + // Add parse error that renders JS Object invalid in code + jsEditor.CreateJSObject(JSObjectWithParseErrors, { + paste: true, + completeReplace: true, + toRun: false, + shouldCreateNewJSObj: false, + prettify: false, + }); - agHelper.Sleep(2000); // Giving more time for parsing to reduce flakiness! + agHelper.Sleep(2000); // Giving more time for parsing to reduce flakiness! - // Assert presence of parse error callout (entire JS Object is invalid) - jsEditor.AssertParseError(true); - agHelper.ActionContextMenuWithInPane({ - action: "Delete", - entityType: entityItems.JSObject, + // Assert presence of parse error callout (entire JS Object is invalid) + jsEditor.AssertParseError(true); + agHelper.ActionContextMenuWithInPane({ + action: "Delete", + entityType: entityItems.JSObject, + }); }); - }); - - it("4. Shows lint error and toast modal when JS Object doesn't start with 'export default'", () => { - const invalidJSObjectStartToastMessage = "Start object with export default"; - const jsComment = "// This is a comment"; - const jsObjectStartLine = `export default{`; - const jsObjectStartLineWithSpace = `export  default{`; - const jsObjectStartingWithAComment = `${jsComment} + + it("4. Shows lint error and toast modal when JS Object doesn't start with 'export default'", () => { + const invalidJSObjectStartToastMessage = + "Start object with export default"; + const jsComment = "// This is a comment"; + const jsObjectStartLine = `export default{`; + const jsObjectStartLineWithSpace = `export  default{`; + const jsObjectStartingWithAComment = `${jsComment} ${jsObjectStartLine} fun1:()=>true }`; - const jsObjectStartingWithASpace = `${jsObjectStartLineWithSpace} + const jsObjectStartingWithASpace = `${jsObjectStartLineWithSpace} fun1:()=>true }`; - const jsObjectStartingWithANewLine = ` + const jsObjectStartingWithANewLine = ` ${jsObjectStartLine} fun1:()=>true }`; - const assertInvalidJSObjectStart = ( - jsCode: string, - highlightedLintText: string, - ) => { - // create jsObject that doesn't start with 'export default' - jsEditor.CreateJSObject(jsCode, { + const assertInvalidJSObjectStart = ( + jsCode: string, + highlightedLintText: string, + ) => { + // create jsObject that doesn't start with 'export default' + jsEditor.CreateJSObject(jsCode, { + paste: true, + completeReplace: true, + toRun: false, + shouldCreateNewJSObj: true, + }); + + // Assert presence of toast message + agHelper.AssertContains(invalidJSObjectStartToastMessage); + + // Assert presence of lint error at the start line + agHelper.GetNAssertElementText( + locators._lintErrorElement, + highlightedLintText, + "contain.text", + -1, + ); + agHelper.WaitUntilAllToastsDisappear(); + agHelper.ActionContextMenuWithInPane({ + action: "Delete", + entityType: entityItems.JSObject, + }); + }; + assertInvalidJSObjectStart(jsObjectStartingWithAComment, jsComment); + assertInvalidJSObjectStart( + jsObjectStartingWithANewLine, + jsObjectStartLine, + ); + assertInvalidJSObjectStart( + jsObjectStartingWithASpace, + jsObjectStartLineWithSpace, + ); + }); + + it("5. Supports the use of large JSON data (doesn't crash)", () => { + const jsObjectWithLargeJSONData = `export default{ + largeData: ${JSON.stringify(largeJSONData)}, + myfun1: ()=> this.largeData + }`; + const crashMessage = "Oops! Something went wrong"; + // create jsObject with large json data and run + jsEditor.CreateJSObject(jsObjectWithLargeJSONData, { paste: true, completeReplace: true, toRun: false, shouldCreateNewJSObj: true, }); - // Assert presence of toast message - agHelper.AssertContains(invalidJSObjectStartToastMessage); + // wait for 3 secs and assert that App doesn't crash + agHelper.Sleep(3000); + agHelper.AssertContains(crashMessage, "not.exist"); - // Assert presence of lint error at the start line - agHelper.GetNAssertElementText( - locators._lintErrorElement, - highlightedLintText, - "contain.text", - -1, - ); - agHelper.WaitUntilAllToastsDisappear(); - agHelper.ActionContextMenuWithInPane({ - action: "Delete", - entityType: entityItems.JSObject, + // Edit JSObject and run + jsEditor.CreateJSObject(" ", { + paste: true, + completeReplace: false, + toRun: true, + shouldCreateNewJSObj: false, }); - }; - assertInvalidJSObjectStart(jsObjectStartingWithAComment, jsComment); - assertInvalidJSObjectStart(jsObjectStartingWithANewLine, jsObjectStartLine); - assertInvalidJSObjectStart( - jsObjectStartingWithASpace, - jsObjectStartLineWithSpace, - ); - }); - - it("5. Supports the use of large JSON data (doesn't crash)", () => { - const jsObjectWithLargeJSONData = `export default{ - largeData: ${JSON.stringify(largeJSONData)}, - myfun1: ()=> this.largeData - }`; - const crashMessage = "Oops! Something went wrong"; - // create jsObject with large json data and run - jsEditor.CreateJSObject(jsObjectWithLargeJSONData, { - paste: true, - completeReplace: true, - toRun: false, - shouldCreateNewJSObj: true, - }); - // wait for 3 secs and assert that App doesn't crash - agHelper.Sleep(3000); - agHelper.AssertContains(crashMessage, "not.exist"); - - // Edit JSObject and run - jsEditor.CreateJSObject(" ", { - paste: true, - completeReplace: false, - toRun: true, - shouldCreateNewJSObj: false, - }); - - cy.get("@jsObjName").then((jsObjName) => { - EditorNavigation.SelectEntityByName("Table1", EntityType.Widget); - propPane.UpdatePropertyFieldValue( - "Table data", - `{{${jsObjName}.largeData}}`, - ); - }); + cy.get("@jsObjName").then((jsObjName) => { + EditorNavigation.SelectEntityByName("Table1", EntityType.Widget); + propPane.UpdatePropertyFieldValue( + "Table data", + `{{${jsObjName}.largeData}}`, + ); + }); - // Deploy App and test that table loads properly - deployMode.DeployApp(); - table.WaitUntilTableLoad(); - table.ReadTableRowColumnData(0, 1, "v1", 2000).then(($cellData) => { - expect($cellData).to.eq("1"); //validating id column value - row 0 - deployMode.NavigateBacktoEditor(); - }); - EditorNavigation.SelectEntityByName("JSObject1", EntityType.JSObject); - entityExplorer.ActionContextMenuByEntityName({ - entityNameinLeftSidebar: "JSObject1", - action: "Delete", - entityType: entityItems.JSObject, + // Deploy App and test that table loads properly + deployMode.DeployApp(); + table.WaitUntilTableLoad(); + table.ReadTableRowColumnData(0, 1, "v1", 2000).then(($cellData) => { + expect($cellData).to.eq("1"); //validating id column value - row 0 + deployMode.NavigateBacktoEditor(); + }); + EditorNavigation.SelectEntityByName("JSObject1", EntityType.JSObject); + entityExplorer.ActionContextMenuByEntityName({ + entityNameinLeftSidebar: "JSObject1", + action: "Delete", + entityType: entityItems.JSObject, + }); }); - }); - it("6. Doesn't cause cyclic dependency when function name is edited", () => { - const syncJSCode = `export default { + it("6. Doesn't cause cyclic dependency when function name is edited", () => { + const syncJSCode = `export default { myFun1 :()=>{ return "yes"`; - const syncJSCodeWithRenamedFunction1 = `export default { + const syncJSCodeWithRenamedFunction1 = `export default { myFun2 :()=>{ return "yes" } }`; - const syncJSCodeWithRenamedFunction2 = `export default { + const syncJSCodeWithRenamedFunction2 = `export default { myFun3 :()=>{ return "yes" } }`; - const asyncJSCode = `export default { + const asyncJSCode = `export default { myFun1 :async ()=>{ return "yes"`; - const asyncJSCodeWithRenamedFunction1 = `export default { + const asyncJSCodeWithRenamedFunction1 = `export default { myFun2 :async ()=>{ return "yes" } }`; - const asyncJSCodeWithRenamedFunction2 = `export default { + const asyncJSCodeWithRenamedFunction2 = `export default { myFun3 :async ()=>{ return "yes" } }`; - jsEditor.CreateJSObject(syncJSCode, { - paste: false, - completeReplace: true, - toRun: false, - shouldCreateNewJSObj: true, - prettify: false, - }); + jsEditor.CreateJSObject(syncJSCode, { + paste: false, + completeReplace: true, + toRun: false, + shouldCreateNewJSObj: true, + prettify: false, + }); - // change sync function name and test that cyclic dependency is not created - jsEditor.EditJSObj(syncJSCodeWithRenamedFunction1, false); - agHelper.AssertContains("Cyclic dependency", "not.exist"); - jsEditor.EditJSObj(syncJSCodeWithRenamedFunction2, false); - agHelper.AssertContains("Cyclic dependency", "not.exist"); - - jsEditor.CreateJSObject(asyncJSCode, { - paste: false, - completeReplace: true, - toRun: false, - shouldCreateNewJSObj: true, - prettify: false, - }); - // change function name and test that cyclic dependency is not created - jsEditor.EditJSObj(asyncJSCodeWithRenamedFunction1, false); - agHelper.AssertContains("Cyclic dependency", "not.exist"); - jsEditor.EditJSObj(asyncJSCodeWithRenamedFunction2, false); - agHelper.AssertContains("Cyclic dependency", "not.exist"); - agHelper.ActionContextMenuWithInPane({ - action: "Delete", - entityType: entityItems.JSObject, + // change sync function name and test that cyclic dependency is not created + jsEditor.EditJSObj(syncJSCodeWithRenamedFunction1, false); + agHelper.AssertContains("Cyclic dependency", "not.exist"); + jsEditor.EditJSObj(syncJSCodeWithRenamedFunction2, false); + agHelper.AssertContains("Cyclic dependency", "not.exist"); + + jsEditor.CreateJSObject(asyncJSCode, { + paste: false, + completeReplace: true, + toRun: false, + shouldCreateNewJSObj: true, + prettify: false, + }); + // change function name and test that cyclic dependency is not created + jsEditor.EditJSObj(asyncJSCodeWithRenamedFunction1, false); + agHelper.AssertContains("Cyclic dependency", "not.exist"); + jsEditor.EditJSObj(asyncJSCodeWithRenamedFunction2, false); + agHelper.AssertContains("Cyclic dependency", "not.exist"); + agHelper.ActionContextMenuWithInPane({ + action: "Delete", + entityType: entityItems.JSObject, + }); }); - }); - - it("7. Maintains order of functions in settings tab alphabetically at all times", function () { - functionsLength = FUNCTIONS_SETTINGS_DEFAULT_DATA.length; - // Number of functions set to run on page load and should also confirm before execute - onPageLoadAndConfirmExecuteFunctionsLength = - FUNCTIONS_SETTINGS_DEFAULT_DATA.filter( - (func) => func.onPageLoad && func.confirmBeforeExecute, - ).length; - - getJSObject = (data: IFunctionSettingData[]) => { - let JS_OBJECT_BODY = `export default`; - for (let i = 0; i < functionsLength; i++) { - const functionName = data[i].name; - const isMarkedAsync = data[i].isMarkedAsync; - JS_OBJECT_BODY += - i === 0 - ? `{ + + it("7. Maintains order of functions in settings tab alphabetically at all times", function () { + functionsLength = FUNCTIONS_SETTINGS_DEFAULT_DATA.length; + // Number of functions set to run on page load and should also confirm before execute + onPageLoadAndConfirmExecuteFunctionsLength = + FUNCTIONS_SETTINGS_DEFAULT_DATA.filter( + (func) => func.onPageLoad && func.confirmBeforeExecute, + ).length; + + getJSObject = (data: IFunctionSettingData[]) => { + let JS_OBJECT_BODY = `export default`; + for (let i = 0; i < functionsLength; i++) { + const functionName = data[i].name; + const isMarkedAsync = data[i].isMarkedAsync; + JS_OBJECT_BODY += + i === 0 + ? `{ ${functionName}: ${ isMarkedAsync ? "async" : "" } ()=>"${functionName}",` - : i === functionsLength - 1 - ? ` + : i === functionsLength - 1 + ? ` ${functionName}: ${ isMarkedAsync ? "async" : "" } ()=>"${functionName}", }` - : ` + : ` ${functionName}: ${ isMarkedAsync ? "async" : "" } ()=> "${functionName}",`; - } - return JS_OBJECT_BODY; - }; - - // Create js object - jsEditor.CreateJSObject(getJSObject(FUNCTIONS_SETTINGS_DEFAULT_DATA), { - paste: true, - completeReplace: true, - toRun: false, - shouldCreateNewJSObj: true, - prettify: false, - }); + } + return JS_OBJECT_BODY; + }; - cy.get("@jsObjName").then((jsObjName: any) => { - jsObj = jsObjName; + // Create js object + jsEditor.CreateJSObject(getJSObject(FUNCTIONS_SETTINGS_DEFAULT_DATA), { + paste: true, + completeReplace: true, + toRun: false, + shouldCreateNewJSObj: true, + prettify: false, + }); + + cy.get("@jsObjName").then((jsObjName: any) => { + jsObj = jsObjName; + }); + // Switch to settings tab + agHelper.GetNClick(jsEditor._settingsTab); + // Add settings for each function (according to data) + Object.values(FUNCTIONS_SETTINGS_DEFAULT_DATA).forEach( + (functionSetting) => { + jsEditor.EnableDisableAsyncFuncSettings( + functionSetting.name, + functionSetting.onPageLoad, + ); + }, + ); + // Switch to settings tab + agHelper.GetNClick(jsEditor._settingsTab); + //After JSObj is created - check methods are in alphabetical order + assertAsyncFunctionsOrder(FUNCTIONS_SETTINGS_DEFAULT_DATA); + + agHelper.RefreshPage(); + agHelper.Sleep(2000); //for confirmatiom modal to appear before clicking on "Yes" button for CI runs + // Switch to settings tab and assert order + agHelper.GetNClick(jsEditor._settingsTab); + assertAsyncFunctionsOrder(FUNCTIONS_SETTINGS_DEFAULT_DATA); }); - // Switch to settings tab - agHelper.GetNClick(jsEditor._settingsTab); - // Add settings for each function (according to data) - Object.values(FUNCTIONS_SETTINGS_DEFAULT_DATA).forEach( - (functionSetting) => { - jsEditor.EnableDisableAsyncFuncSettings( - functionSetting.name, - functionSetting.onPageLoad, - ); - }, - ); - // Switch to settings tab - agHelper.GetNClick(jsEditor._settingsTab); - //After JSObj is created - check methods are in alphabetical order - assertAsyncFunctionsOrder(FUNCTIONS_SETTINGS_DEFAULT_DATA); - - agHelper.RefreshPage(); - agHelper.Sleep(2000); //for confirmatiom modal to appear before clicking on "Yes" button for CI runs - // Switch to settings tab and assert order - agHelper.GetNClick(jsEditor._settingsTab); - assertAsyncFunctionsOrder(FUNCTIONS_SETTINGS_DEFAULT_DATA); - }); - - it("8. Verify Async methods have alphabetical order after cloning page and renaming it", () => { - const FUNCTIONS_SETTINGS_RENAMED_DATA: IFunctionSettingData[] = [ - { - name: "newGetId", - onPageLoad: true, - confirmBeforeExecute: false, - isMarkedAsync: false, - }, - { - name: "zip1", - onPageLoad: true, - confirmBeforeExecute: true, - isMarkedAsync: true, - }, - { - name: "base", - onPageLoad: false, - confirmBeforeExecute: false, - isMarkedAsync: true, - }, - { - name: "newAssert", - onPageLoad: true, - confirmBeforeExecute: false, - isMarkedAsync: false, - }, - { - name: "test", - onPageLoad: true, - confirmBeforeExecute: true, - isMarkedAsync: true, - }, - ]; - // clone page and assert order of functions - PageList.ClonePage(); - agHelper.Sleep(); - agHelper.WaitUntilAllToastsDisappear(); - agHelper.Sleep(); - - EditorNavigation.SelectEntityByName(jsObj, EntityType.JSObject); - agHelper.GetNClick(jsEditor._settingsTab); - assertAsyncFunctionsOrder(FUNCTIONS_SETTINGS_DEFAULT_DATA); - - // rename functions and assert order - agHelper.GetNClick(jsEditor._codeTab); - jsEditor.EditJSObj(getJSObject(FUNCTIONS_SETTINGS_RENAMED_DATA), false); - agHelper.Sleep(3000); - agHelper.GetNClick(jsEditor._settingsTab); - assertAsyncFunctionsOrder(FUNCTIONS_SETTINGS_RENAMED_DATA); - agHelper.ActionContextMenuWithInPane({ - action: "Delete", - entityType: entityItems.JSObject, + it("8. Verify Async methods have alphabetical order after cloning page and renaming it", () => { + const FUNCTIONS_SETTINGS_RENAMED_DATA: IFunctionSettingData[] = [ + { + name: "newGetId", + onPageLoad: true, + confirmBeforeExecute: false, + isMarkedAsync: false, + }, + { + name: "zip1", + onPageLoad: true, + confirmBeforeExecute: true, + isMarkedAsync: true, + }, + { + name: "base", + onPageLoad: false, + confirmBeforeExecute: false, + isMarkedAsync: true, + }, + { + name: "newAssert", + onPageLoad: true, + confirmBeforeExecute: false, + isMarkedAsync: false, + }, + { + name: "test", + onPageLoad: true, + confirmBeforeExecute: true, + isMarkedAsync: true, + }, + ]; + + // clone page and assert order of functions + PageList.ClonePage(); + agHelper.Sleep(); + agHelper.WaitUntilAllToastsDisappear(); + agHelper.Sleep(); + + EditorNavigation.SelectEntityByName(jsObj, EntityType.JSObject); + agHelper.GetNClick(jsEditor._settingsTab); + assertAsyncFunctionsOrder(FUNCTIONS_SETTINGS_DEFAULT_DATA); + + // rename functions and assert order + agHelper.GetNClick(jsEditor._codeTab); + jsEditor.EditJSObj(getJSObject(FUNCTIONS_SETTINGS_RENAMED_DATA), false); + agHelper.Sleep(3000); + agHelper.GetNClick(jsEditor._settingsTab); + assertAsyncFunctionsOrder(FUNCTIONS_SETTINGS_RENAMED_DATA); + agHelper.ActionContextMenuWithInPane({ + action: "Delete", + entityType: entityItems.JSObject, + }); }); - }); - it("9. Bug 13197: Verify converting async functions to sync doesn't reset all settings", () => { - const asyncJSCode = `export default { + it("9. Bug 13197: Verify converting async functions to sync doesn't reset all settings", () => { + const asyncJSCode = `export default { name: "Appsmith", asyncToSync : async ()=>{ return "yes";`; - const syncJSCode = `export default { + const syncJSCode = `export default { name: "Appsmith", asyncToSync : ()=>{ return "yes"; }, }`; - jsEditor.CreateJSObject(asyncJSCode, { - paste: false, - completeReplace: true, - toRun: false, - shouldCreateNewJSObj: true, - prettify: false, - }); + jsEditor.CreateJSObject(asyncJSCode, { + paste: false, + completeReplace: true, + toRun: false, + shouldCreateNewJSObj: true, + prettify: false, + }); + + // Switch to settings tab + agHelper.GetNClick(jsEditor._settingsTab); + // Enable all settings + jsEditor.EnableDisableAsyncFuncSettings("asyncToSync", true); - // Switch to settings tab - agHelper.GetNClick(jsEditor._settingsTab); - // Enable all settings - jsEditor.EnableDisableAsyncFuncSettings("asyncToSync", true); - - // Modify js object - jsEditor.EditJSObj(syncJSCode, false); - agHelper.RefreshPage(); - jsEditor.VerifyAsyncFuncSettings("asyncToSync", true); - agHelper.ActionContextMenuWithInPane({ - action: "Delete", - entityType: entityItems.JSObject, + // Modify js object + jsEditor.EditJSObj(syncJSCode, false); + agHelper.RefreshPage(); + jsEditor.VerifyAsyncFuncSettings("asyncToSync", true); + agHelper.ActionContextMenuWithInPane({ + action: "Delete", + entityType: entityItems.JSObject, + }); }); - }); - it("10. Verify that js function execution errors are logged in debugger and removed when function is deleted", () => { - const JS_OBJECT_WITH_PARSE_ERROR = `export default { + it("10. Verify that js function execution errors are logged in debugger and removed when function is deleted", () => { + const JS_OBJECT_WITH_PARSE_ERROR = `export default { myVar1: [], myVar2: {}, myFun1: () => { return Table1.unknown.id`; - const JS_OBJECT_WITHOUT_PARSE_ERROR = `export default { + const JS_OBJECT_WITHOUT_PARSE_ERROR = `export default { myVar1: [], myVar2: {}, myFun1: () => { @@ -522,60 +529,61 @@ return "yes";`; } }`; - const JS_OBJECT_WITH_DELETED_FUNCTION = `export default { + const JS_OBJECT_WITH_DELETED_FUNCTION = `export default { myVar1: [], myVar2: {} }`; - // Create js object - jsEditor.CreateJSObject(JS_OBJECT_WITH_PARSE_ERROR, { - paste: false, - completeReplace: true, - toRun: true, - shouldCreateNewJSObj: true, - }); + // Create js object + jsEditor.CreateJSObject(JS_OBJECT_WITH_PARSE_ERROR, { + paste: false, + completeReplace: true, + toRun: true, + shouldCreateNewJSObj: true, + }); - // Assert that there is a function execution parse error - jsEditor.AssertParseError(true); - // Assert that response tab is not empty - agHelper.AssertContains("No signs of trouble here!", "not.exist"); - // Assert presence of typeError in response tab - agHelper.AssertContains('"Table1.unknown" is undefined', "exist"); - agHelper.AssertContains("TypeError", "exist"); - - // click the error tab - agHelper.GetNClick(locators._errorTab); - // Assert that errors tab is not empty - agHelper.AssertContains("No signs of trouble here!", "not.exist"); - // Assert presence of typeError in error tab - agHelper.AssertContains('"Table1.unknown" is undefined', "exist"); - agHelper.AssertContains("TypeError", "exist"); - - // Fix parse error and assert that debugger error is removed - jsEditor.EditJSObj(JS_OBJECT_WITHOUT_PARSE_ERROR, true, false); - agHelper.RefreshPage(); - jsEditor.RunJSObj(); - //agHelper.AssertContains("ran successfully"); //commenting since 'Resource not found' comes sometimes due to fast parsing - agHelper.AssertElementAbsence(locators._btnSpinner, 10000); - agHelper.GetNClick(locators._errorTab); - agHelper.AssertContains('"Table1.unknown" is undefined', "not.exist"); - - // Switch back to response tab - agHelper.GetNClick(locators._responseTab); - // Re-introduce parse errors - jsEditor.EditJSObj(JS_OBJECT_WITH_PARSE_ERROR + "}}", false, false); - jsEditor.RunJSObj(); - // Assert that there is a function execution parse error - jsEditor.AssertParseError(true); - - // Delete function - jsEditor.EditJSObj(JS_OBJECT_WITH_DELETED_FUNCTION, true, false); - // Assert that parse error is removed from debugger when function is deleted - agHelper.GetNClick(locators._errorTab); - agHelper.AssertContains('"Table1.unknown" is undefined.', "not.exist"); - agHelper.ActionContextMenuWithInPane({ - action: "Delete", - entityType: entityItems.JSObject, + // Assert that there is a function execution parse error + jsEditor.AssertParseError(true); + // Assert that response tab is not empty + agHelper.AssertContains("No signs of trouble here!", "not.exist"); + // Assert presence of typeError in response tab + agHelper.AssertContains('"Table1.unknown" is undefined', "exist"); + agHelper.AssertContains("TypeError", "exist"); + + // click the error tab + agHelper.GetNClick(locators._errorTab); + // Assert that errors tab is not empty + agHelper.AssertContains("No signs of trouble here!", "not.exist"); + // Assert presence of typeError in error tab + agHelper.AssertContains('"Table1.unknown" is undefined', "exist"); + agHelper.AssertContains("TypeError", "exist"); + + // Fix parse error and assert that debugger error is removed + jsEditor.EditJSObj(JS_OBJECT_WITHOUT_PARSE_ERROR, true, false); + agHelper.RefreshPage(); + jsEditor.RunJSObj(); + //agHelper.AssertContains("ran successfully"); //commenting since 'Resource not found' comes sometimes due to fast parsing + agHelper.AssertElementAbsence(locators._btnSpinner, 10000); + agHelper.GetNClick(locators._errorTab); + agHelper.AssertContains('"Table1.unknown" is undefined', "not.exist"); + + // Switch back to response tab + agHelper.GetNClick(locators._responseTab); + // Re-introduce parse errors + jsEditor.EditJSObj(JS_OBJECT_WITH_PARSE_ERROR + "}}", false, false); + jsEditor.RunJSObj(); + // Assert that there is a function execution parse error + jsEditor.AssertParseError(true); + + // Delete function + jsEditor.EditJSObj(JS_OBJECT_WITH_DELETED_FUNCTION, true, false); + // Assert that parse error is removed from debugger when function is deleted + agHelper.GetNClick(locators._errorTab); + agHelper.AssertContains('"Table1.unknown" is undefined.', "not.exist"); + agHelper.ActionContextMenuWithInPane({ + action: "Delete", + entityType: entityItems.JSObject, + }); }); - }); -}); + }, +); diff --git a/app/client/cypress/e2e/Regression/ServerSide/LoginTests/LoginFailure_spec.js b/app/client/cypress/e2e/Regression/ServerSide/LoginTests/LoginFailure_spec.js index b12ea55aa77..df2411164d6 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/LoginTests/LoginFailure_spec.js +++ b/app/client/cypress/e2e/Regression/ServerSide/LoginTests/LoginFailure_spec.js @@ -5,7 +5,7 @@ import { locators, } from "../../../../support/Objects/ObjectsCore"; -describe("Login failure", function () { +describe("Login failure", { tags: ["@tag.Authentication"] }, function () { it("1. Preserves redirectUrl param on login failure", function () { let urlWithoutQueryParams; deployMode.DeployApp(locators._emptyPageTxt, true, false); diff --git a/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/OnLoadActions_Spec.ts b/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/OnLoadActions_Spec.ts index 302bc1c1c13..8da531365f6 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/OnLoadActions_Spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/OnLoadActions_Spec.ts @@ -15,7 +15,7 @@ import EditorNavigation, { describe( "Layout OnLoad Actions tests", - { tags: ["@tag.PropertyPane", "@tag.JS"] }, + { tags: ["@tag.PropertyPane", "@tag.JS", "@tag.Sanity"] }, function () { beforeEach(() => { agHelper.RestoreLocalStorageCache(); diff --git a/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/PostgresConnections_spec.ts b/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/PostgresConnections_spec.ts index 1dd6b2e1f01..62d096a0f37 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/PostgresConnections_spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/PostgresConnections_spec.ts @@ -17,7 +17,7 @@ let guid: any, dsName_1: any, dsName_2: any; describe( "Test Postgres number of connections on page load + Bug 11572, Bug 11202", - { tags: ["@tag.PropertyPane", "@tag.JS"] }, + { tags: ["@tag.PropertyPane", "@tag.JS", "@tag.Sanity"] }, function () { before(() => { agHelper.GenerateUUID(); diff --git a/app/client/cypress/e2e/Regression/ServerSide/QueryPane/Mongo1_spec.ts b/app/client/cypress/e2e/Regression/ServerSide/QueryPane/Mongo1_spec.ts index 267cbc080e5..d6f16abe1e2 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/QueryPane/Mongo1_spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/QueryPane/Mongo1_spec.ts @@ -21,7 +21,7 @@ let dsName: any; describe( "Validate Mongo Query Pane Validations", - { tags: ["@tag.Datasource"] }, + { tags: ["@tag.Datasource", "@tag.Sanity"] }, () => { before(() => { //dataSources.StartDataSourceRoutes(); //already started in index.js beforeeach diff --git a/app/client/cypress/e2e/Regression/ServerSide/QueryPane/Querypane_Mongo_Spec.js b/app/client/cypress/e2e/Regression/ServerSide/QueryPane/Querypane_Mongo_Spec.js index 44d559645eb..8a5f313c449 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/QueryPane/Querypane_Mongo_Spec.js +++ b/app/client/cypress/e2e/Regression/ServerSide/QueryPane/Querypane_Mongo_Spec.js @@ -22,7 +22,7 @@ let datasourceName; describe( "Validate Mongo query commands", - { tags: ["@tag.Datasource"] }, + { tags: ["@tag.Datasource", "@tag.Sanity"] }, function () { // afterEach(function() { // if (this.currentTest.state === "failed") { diff --git a/app/client/cypress/e2e/Smoke/GenerateCRUD/Generate_Crud_New_Page_spec.ts b/app/client/cypress/e2e/Smoke/GenerateCRUD/Generate_Crud_New_Page_spec.ts index 603cb0b4e5c..a361763aa9b 100644 --- a/app/client/cypress/e2e/Smoke/GenerateCRUD/Generate_Crud_New_Page_spec.ts +++ b/app/client/cypress/e2e/Smoke/GenerateCRUD/Generate_Crud_New_Page_spec.ts @@ -3,7 +3,7 @@ import PageList from "../../../support/Pages/PageList"; describe( "Validate generate CRUD operation by creating a datasource from generate CRUD form", - { tags: ["@tag.Datasource"] }, + { tags: ["@tag.Datasource", "@tag.Sanity"] }, () => { it( "1. Generated CRUD app should work when there are no entities in the page & when there are entities in the current page",