diff --git a/.github/workflows/ci-test-limited.yml b/.github/workflows/ci-test-limited.yml index 5f28cdb153..bbe842e036 100644 --- a/.github/workflows/ci-test-limited.yml +++ b/.github/workflows/ci-test-limited.yml @@ -269,7 +269,7 @@ jobs: # https://docs.github.com/en/actions/learn-github-actions/workflow-commands-for-github-actions#environment-files run: | echo COMMIT_INFO_BRANCH=$(git rev-parse --abbrev-ref HEAD) >> $GITHUB_ENV - echo COMMIT_INFO_MESSAGE=TestLimit run on PR# ${{ inputs.pr }} >> $GITHUB_ENV + echo COMMIT_INFO_MESSAGE=LimitedTests run on PR# ${{ inputs.pr }} >> $GITHUB_ENV echo COMMIT_INFO_EMAIL=$(git show -s --pretty=%ae) >> $GITHUB_ENV echo COMMIT_INFO_AUTHOR=$(git show -s --pretty=%an) >> $GITHUB_ENV echo COMMIT_INFO_SHA=$(git show -s --pretty=%H) >> $GITHUB_ENV @@ -292,8 +292,10 @@ jobs: env: EVENT_COMMITS: ${{ toJson(github.event.commits[0].message) }} run: | - if [[ ${{ inputs.pr }} -ne 0 ]]; then + if [[ ${{ inputs.pr }} -ne 0 && ${{github.event_name}} == 'repository_dispatch' ]]; then echo "COMMIT_INFO_MESSAGE=${{ env.COMMIT_INFO_MESSAGE }}" >> $GITHUB_ENV + elif [[ ${{ inputs.pr }} -ne 0 && ${{github.event_name}} == 'workflow_dispatch' ]]; then + echo "COMMIT_INFO_MESSAGE=Workflow run on PR# ${{ inputs.pr }}" >> $GITHUB_ENV else echo "COMMIT_INFO_MESSAGE=$(echo \"${{ env.EVENT_COMMITS }}\" | awk -F '\\\\n' '{print $1}' | sed 's/^\"//')" >> $GITHUB_ENV fi diff --git a/app/client/cypress/e2e/Regression/ClientSide/Autocomplete/JS_AC_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Autocomplete/JS_AC1_spec.ts similarity index 66% rename from app/client/cypress/e2e/Regression/ClientSide/Autocomplete/JS_AC_spec.ts rename to app/client/cypress/e2e/Regression/ClientSide/Autocomplete/JS_AC1_spec.ts index d32b448bac..df654505bb 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Autocomplete/JS_AC_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Autocomplete/JS_AC1_spec.ts @@ -308,166 +308,4 @@ describe("Autocomplete tests", () => { agHelper.TypeText(locators._codeMirrorTextArea, "."); agHelper.GetNAssertElementText(locators._hints, "geolocation"); }); - - it("9. Bug #17059 Autocomplete does not suggest same function name that belongs to a different object", () => { - // create js object - JSObject1 - jsEditor.CreateJSObject(jsObjectBody, { - paste: true, - completeReplace: true, - toRun: false, - shouldCreateNewJSObj: true, - prettify: false, - }); - - // create js object - JSObject2 - jsEditor.CreateJSObject(jsObjectBody, { - paste: true, - completeReplace: true, - toRun: false, - shouldCreateNewJSObj: true, - prettify: false, - }); - - agHelper.GetNClick(jsEditor._lineinJsEditor(5)); - agHelper.TypeText(locators._codeMirrorTextArea, "JSObject1."); - - agHelper.GetNAssertElementText( - locators._hints, - "myFun1.data", - "have.text", - 0, - ); - - agHelper.GetNAssertElementText(locators._hints, "myFun1()", "have.text", 4); - - // Same check in JSObject1 - entityExplorer.SelectEntityByName("JSObject1", "Queries/JS"); - agHelper.GetNClick(jsEditor._lineinJsEditor(5)); - agHelper.TypeText(locators._codeMirrorTextArea, "JSObject2"); - agHelper.Sleep(500); - agHelper.TypeText(locators._codeMirrorTextArea, "."); - - agHelper.GetNAssertElementText( - locators._hints, - "myFun1.data", - "have.text", - 0, - ); - - agHelper.GetNAssertElementText(locators._hints, "myFun1()", "have.text", 4); - entityExplorer.ActionContextMenuByEntityName({ - entityNameinLeftSidebar: "JSObject1", - action: "Delete", - entityType: entityItems.JSObject, - }); - entityExplorer.ActionContextMenuByEntityName({ - entityNameinLeftSidebar: "JSObject2", - action: "Delete", - entityType: entityItems.JSObject, - }); - }); - - it("10. Bug #10115 Autocomplete needs to show async await keywords instead of showing 'no suggestions'", () => { - // create js object - jsEditor.CreateJSObject(jsObjectBody, { - paste: true, - completeReplace: true, - toRun: false, - shouldCreateNewJSObj: true, - prettify: false, - }); - - agHelper.GetNClick(jsEditor._lineinJsEditor(5)); - agHelper.TypeText(locators._codeMirrorTextArea, "aw"); - - agHelper.GetNAssertElementText(locators._hints, "await", "have.text", 0); - - agHelper.RemoveCharsNType(locators._codeMirrorTextArea, 2, "as"); - agHelper.GetNAssertElementText(locators._hints, "async", "have.text", 0); - cy.get("@jsObjName").then((jsObjName) => { - jsName = jsObjName; - entityExplorer.SelectEntityByName(jsName as string, "Queries/JS"); - entityExplorer.ActionContextMenuByEntityName({ - entityNameinLeftSidebar: jsName as string, - action: "Delete", - entityType: entityItems.JSObject, - }); - }); - }); - - it("10. Bug #15429 Random keystrokes trigger autocomplete to show up", () => { - // create js object - jsEditor.CreateJSObject( - `export default - myFunc1() { - showAlert("Hello world"); - - } - }`, - { - paste: true, - completeReplace: true, - toRun: false, - shouldCreateNewJSObj: true, - prettify: false, - }, - ); - - //Paste the code and assert that the hints are not present - jsEditor.CreateJSObject(`const x = "Hello world;"`, { - paste: true, - completeReplace: true, - toRun: false, - shouldCreateNewJSObj: false, - prettify: false, - }); - - agHelper.AssertElementAbsence(locators._hints); - - //Paste the code and assert that the hints are not present - jsEditor.CreateJSObject( - `export default - myFunc1() { - showAlert("Hello world"); - - } - }`, - { - paste: true, - completeReplace: true, - toRun: false, - shouldCreateNewJSObj: false, - prettify: false, - }, - ); - - agHelper.AssertElementAbsence(locators._hints); - - agHelper.GetElement(jsEditor._lineinJsEditor(4)).click(); - - //Assert that hints are not present inside the string - agHelper.TypeText(locators._codeMirrorTextArea, `const x = "`); - - agHelper.AssertElementAbsence(locators._hints); - - agHelper.SelectNRemoveLineText(jsEditor._lineinJsEditor(4)); - - //Assert that hints are not present when line is cleared with backspace - agHelper.AssertElementAbsence(locators._hints); - - //Assert that hints are not present when token is a comment - agHelper.TypeText(locators._codeMirrorTextArea, "// showA'"); - - agHelper.AssertElementAbsence(locators._hints); - - cy.get("@jsObjName").then((jsObjName) => { - jsName = jsObjName; - entityExplorer.SelectEntityByName(jsName as string, "Queries/JS"); - entityExplorer.ActionContextMenuByEntityName({ - entityNameinLeftSidebar: jsName as string, - action: "Delete", - entityType: entityItems.JSObject, - }); - }); - }); }); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Autocomplete/JS_AC2_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Autocomplete/JS_AC2_spec.ts new file mode 100644 index 0000000000..3e94dcba93 --- /dev/null +++ b/app/client/cypress/e2e/Regression/ClientSide/Autocomplete/JS_AC2_spec.ts @@ -0,0 +1,175 @@ +import { + agHelper, + entityExplorer, + entityItems, + jsEditor, + locators, +} from "../../../../support/Objects/ObjectsCore"; + +let jsName: any; + +const jsObjectBody = `export default { + myVar1: [], + myVar2: {}, + myFun1(){ + + }, + myFun2: async () => { + //use async-await or promises + } +}`; + +describe("Autocomplete tests", () => { + it("1. Bug #17059 Autocomplete does not suggest same function name that belongs to a different object", () => { + // create js object - JSObject1 + jsEditor.CreateJSObject(jsObjectBody, { + paste: true, + completeReplace: true, + toRun: false, + shouldCreateNewJSObj: true, + prettify: false, + }); + + // create js object - JSObject2 + jsEditor.CreateJSObject(jsObjectBody, { + paste: true, + completeReplace: true, + toRun: false, + shouldCreateNewJSObj: true, + prettify: false, + }); + + agHelper.GetNClick(jsEditor._lineinJsEditor(5)); + agHelper.TypeText(locators._codeMirrorTextArea, "JSObject1."); + + agHelper.GetNAssertElementText( + locators._hints, + "myFun1.data", + "have.text", + 0, + ); + + agHelper.GetNAssertElementText(locators._hints, "myFun1()", "have.text", 4); + + // Same check in JSObject1 + entityExplorer.SelectEntityByName("JSObject1", "Queries/JS"); + agHelper.GetNClick(jsEditor._lineinJsEditor(5)); + agHelper.TypeText(locators._codeMirrorTextArea, "JSObject2"); + agHelper.Sleep(500); + agHelper.TypeText(locators._codeMirrorTextArea, "."); + + agHelper.GetNAssertElementText( + locators._hints, + "myFun1.data", + "have.text", + 0, + ); + + agHelper.GetNAssertElementText(locators._hints, "myFun1()", "have.text", 4); + entityExplorer.ActionContextMenuByEntityName({ + entityNameinLeftSidebar: "JSObject1", + action: "Delete", + entityType: entityItems.JSObject, + }); + entityExplorer.ActionContextMenuByEntityName({ + entityNameinLeftSidebar: "JSObject2", + action: "Delete", + entityType: entityItems.JSObject, + }); + }); + + it("2. Bug #10115 Autocomplete needs to show async await keywords instead of showing 'no suggestions'", () => { + // create js object + jsEditor.CreateJSObject(jsObjectBody, { + paste: true, + completeReplace: true, + toRun: false, + shouldCreateNewJSObj: true, + prettify: false, + }); + + agHelper.GetNClick(jsEditor._lineinJsEditor(5)); + agHelper.TypeText(locators._codeMirrorTextArea, "aw"); + + agHelper.GetNAssertElementText(locators._hints, "await", "have.text", 0); + + agHelper.RemoveCharsNType(locators._codeMirrorTextArea, 2, "as"); + agHelper.GetNAssertElementText(locators._hints, "async", "have.text", 0); + cy.get("@jsObjName").then((jsObjName) => { + jsName = jsObjName; + entityExplorer.SelectEntityByName(jsName as string, "Queries/JS"); + entityExplorer.ActionContextMenuByEntityName({ + entityNameinLeftSidebar: jsName as string, + action: "Delete", + entityType: entityItems.JSObject, + }); + }); + }); + + it("3. Bug #15429 Random keystrokes trigger autocomplete to show up", () => { + // create js object & assert no hints just show up + jsEditor.CreateJSObject( + `export default + myFunc1() { + showAlert("Hello world"); + + } + }`, + { + paste: true, + completeReplace: true, + toRun: false, + shouldCreateNewJSObj: true, + prettify: false, + }, + ); + agHelper.AssertElementAbsence(locators._hints); + + //Paste the code and assert that the hints are not present + jsEditor.CreateJSObject( + `export default + myFunc1() { + showAlert("Hello world"); + + } + }`, + { + paste: true, + completeReplace: true, + toRun: false, + shouldCreateNewJSObj: false, + prettify: false, + }, + ); + + agHelper.AssertElementAbsence(locators._hints); + + agHelper.GetElement(jsEditor._lineinJsEditor(4)).click(); + agHelper.WaitUntilAllToastsDisappear(); + + //Assert that hints are not present inside the string + agHelper.TypeText(locators._codeMirrorTextArea, `const x = "`); + + agHelper.AssertElementAbsence(locators._hints); + + agHelper.SelectNRemoveLineText(jsEditor._lineinJsEditor(4)); + + //Assert that hints are not present when line is cleared with backspace + agHelper.AssertElementAbsence(locators._hints); + + //Assert that hints are not present when token is a comment + agHelper.TypeText(locators._codeMirrorTextArea, "// showA'"); + + agHelper.AssertElementAbsence(locators._hints); + + cy.get("@jsObjName").then((jsObjName) => { + jsName = jsObjName; + entityExplorer.SelectEntityByName(jsName as string, "Queries/JS"); + entityExplorer.ActionContextMenuByEntityName({ + entityNameinLeftSidebar: jsName as string, + action: "Delete", + entityType: entityItems.JSObject, + }); + }); + }); +}); diff --git a/app/client/cypress/e2e/Regression/ClientSide/BugTests/CatchBlock_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/BugTests/CatchBlock_Spec.ts index 50f6d7926b..58208f1bbd 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/BugTests/CatchBlock_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/BugTests/CatchBlock_Spec.ts @@ -4,11 +4,12 @@ import { apiPage, entityExplorer, entityItems, + hostPort, } from "../../../../support/Objects/ObjectsCore"; describe("Bug #15372 Catch block was not triggering in Safari/firefox", () => { it("1. Triggers the catch block when the API hits a 404", () => { - apiPage.CreateAndFillApi("https://swapi.dev/api/people/18261826"); + apiPage.CreateAndFillApi(hostPort.mockHttpCodeUrl + "404"); jsEditor.CreateJSObject( `export default { fun: async () => { diff --git a/app/client/cypress/e2e/Regression/ClientSide/BugTests/InputTruncateCheck_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/BugTests/InputTruncateCheck_Spec.ts index 3193147add..177541ace7 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/BugTests/InputTruncateCheck_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/BugTests/InputTruncateCheck_Spec.ts @@ -2,10 +2,18 @@ import { PROPERTY_SELECTOR, getWidgetSelector, } from "../../../../locators/WidgetLocators"; -import * as _ from "../../../../support/Objects/ObjectsCore"; +import { + agHelper, + locators, + entityExplorer, + propPane, + apiPage, + draggableWidgets, + fakerHelper, +} from "../../../../support/Objects/ObjectsCore"; const widgetsToTest = { - [_.draggableWidgets.INPUT_V2]: { + [draggableWidgets.INPUT_V2]: { testCases: [ { input: "test", charToClear: 0 }, { input: "12", charToClear: 0 }, @@ -20,14 +28,14 @@ const widgetsToTest = { charToClear: 2, }, { - input: _.fakerHelper.GetRandomText(), + input: fakerHelper.GetRandomText(), charToClear: -1, }, ], widgetName: "Input widget", widgetPrefixName: "Input", }, - [_.draggableWidgets.PHONE_INPUT]: { + [draggableWidgets.PHONE_INPUT]: { testCases: [ { input: "9999999999", @@ -42,14 +50,14 @@ const widgetsToTest = { charToClear: 2, }, { - input: _.fakerHelper.GetUSPhoneNumber(), + input: fakerHelper.GetUSPhoneNumber(), charToClear: -1, }, ], widgetName: "Phone Input widget", widgetPrefixName: "PhoneInput", }, - [_.draggableWidgets.CURRENCY_INPUT]: { + [draggableWidgets.CURRENCY_INPUT]: { testCases: [ { input: "1233", charToClear: 0 }, { @@ -61,7 +69,7 @@ const widgetsToTest = { charToClear: 2, }, { - input: _.fakerHelper.GetRandomNumber(), + input: fakerHelper.GetRandomNumber(), charToClear: -1, }, ], @@ -72,9 +80,9 @@ const widgetsToTest = { function configureApi() { cy.fixture("datasources").then((datasourceFormData) => { - _.apiPage.CreateAndFillApi(datasourceFormData["mockApiUrl"], "FirstAPI"); + apiPage.CreateAndFillApi(datasourceFormData["mockApiUrl"], "FirstAPI"); }); - _.apiPage.EnterHeader("value", "{{this.params.value}}"); + apiPage.EnterHeader("value", "{{this.params.value}}"); } Object.entries(widgetsToTest).forEach(([widgetSelector, testConfig], index) => { @@ -83,33 +91,29 @@ Object.entries(widgetsToTest).forEach(([widgetSelector, testConfig], index) => { if (index === 0) { configureApi(); } - _.entityExplorer.PinUnpinEntityExplorer(false); - _.entityExplorer.DragDropWidgetNVerify(widgetSelector, 300, 200); - _.entityExplorer.DragDropWidgetNVerify( - _.draggableWidgets.BUTTON, - 400, - 400, - ); - //_.entityExplorer.SelectEntityByName(_.draggableWidgets.BUTTONNAME("1")); + entityExplorer.PinUnpinEntityExplorer(false); + entityExplorer.DragDropWidgetNVerify(widgetSelector, 300, 200); + entityExplorer.DragDropWidgetNVerify(draggableWidgets.BUTTON, 400, 400); + //entityExplorer.SelectEntityByName(draggableWidgets.BUTTONNAME("1")); // Set onClick action, storing value - _.propPane.EnterJSContext( + propPane.EnterJSContext( PROPERTY_SELECTOR.onClickFieldName, `{{storeValue('textPayloadOnSubmit',${testConfig.widgetPrefixName}1.text); FirstAPI.run({ value: ${testConfig.widgetPrefixName}1.text })}}`, ); - _.entityExplorer.DragDropWidgetNVerify(_.draggableWidgets.TEXT, 500, 300); - //_.entityExplorer.SelectEntityByName(_.draggableWidgets.TEXTNAME("1")); + entityExplorer.DragDropWidgetNVerify(draggableWidgets.TEXT, 500, 300); + //entityExplorer.SelectEntityByName(draggableWidgets.TEXTNAME("1")); // Display the bound store value - _.propPane.UpdatePropertyFieldValue( + propPane.UpdatePropertyFieldValue( PROPERTY_SELECTOR.TextFieldName, `{{appsmith.store.textPayloadOnSubmit}}`, ); - _.entityExplorer.PinUnpinEntityExplorer(true); + entityExplorer.PinUnpinEntityExplorer(true); }); it("2. StoreValue should have complete input value", () => { // if default input widget type is changed from text to any other type then uncomment below code. - // if (widgetSelector === _.draggableWidgets.INPUT_V2) { + // if (widgetSelector === draggableWidgets.INPUT_V2) { // cy.openPropertyPane(widgetSelector); // cy.selectDropdownValue(".t--property-control-datatype", "Text"); // cy.get(".t--property-control-required label") @@ -119,7 +123,7 @@ Object.entries(widgetsToTest).forEach(([widgetSelector, testConfig], index) => { // } const inputs = testConfig.testCases; - _.agHelper.ClearInputText("Label"); + agHelper.ClearInputText("Label"); inputs.forEach(({ charToClear, input }) => { // Input text and hit enter key @@ -131,19 +135,19 @@ Object.entries(widgetsToTest).forEach(([widgetSelector, testConfig], index) => { // cy.get(getWidgetInputSelector(widgetSelector)).type(`${input}`); // } - _.agHelper.RemoveCharsNType( - _.locators._widgetInputSelector(widgetSelector), + agHelper.RemoveCharsNType( + locators._widgetInputSelector(widgetSelector), charToClear, input, ); - _.agHelper.GetNClick(getWidgetSelector(_.draggableWidgets.BUTTON)); + agHelper.GetNClick(getWidgetSelector(draggableWidgets.BUTTON)); - _.agHelper - .GetText(_.locators._widgetInputSelector(widgetSelector), "val") + agHelper + .GetText(locators._widgetInputSelector(widgetSelector), "val") .then(($expected: any) => { // Assert if the Currency widget has random number with trailing zero, then - // if (widgetSelector === _.draggableWidgets.CURRENCY_INPUT) { - // cy.get(getWidgetSelector(_.draggableWidgets.TEXT)).should( + // if (widgetSelector === draggableWidgets.CURRENCY_INPUT) { + // cy.get(getWidgetSelector(draggableWidgets.TEXT)).should( // "have.text", // expected == null // ? input @@ -152,9 +156,9 @@ Object.entries(widgetsToTest).forEach(([widgetSelector, testConfig], index) => { // .replace(/(^,)|(,$)/g, "")//to remove start & end comma's if any // : expected, // ); - - _.agHelper - .GetText(getWidgetSelector(_.draggableWidgets.TEXT)) + agHelper.Sleep(500); //Adding time for CI flakyness in reading Label value + agHelper + .GetText(getWidgetSelector(draggableWidgets.TEXT)) .then(($label) => { expect($label).to.eq($expected); }); @@ -170,15 +174,15 @@ Object.entries(widgetsToTest).forEach(([widgetSelector, testConfig], index) => { }); it("3. Delete all the widgets on canvas", () => { - _.agHelper.GetNClick(_.locators._widgetInputSelector(widgetSelector)); - _.agHelper.PressDelete(); + agHelper.GetNClick(locators._widgetInputSelector(widgetSelector)); + agHelper.PressDelete(); - _.agHelper.GetNClick(getWidgetSelector(_.draggableWidgets.BUTTON)); - _.agHelper.AssertContains("is not defined"); //Since widget is removed & Button is still holding its reference - _.agHelper.PressDelete(); + agHelper.GetNClick(getWidgetSelector(draggableWidgets.BUTTON)); + agHelper.AssertContains("is not defined"); //Since widget is removed & Button is still holding its reference + agHelper.PressDelete(); - _.agHelper.GetNClick(getWidgetSelector(_.draggableWidgets.TEXT)).click(); - _.agHelper.GetNClick(_.propPane._deleteWidget); + agHelper.GetNClick(getWidgetSelector(draggableWidgets.TEXT)).click(); + agHelper.GetNClick(propPane._deleteWidget); }); }); }); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Fork/ForkAppWithMultipleDS_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Fork/ForkAppWithMultipleDS_Spec.ts index 73997138b9..59e554bcc6 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Fork/ForkAppWithMultipleDS_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Fork/ForkAppWithMultipleDS_Spec.ts @@ -42,10 +42,10 @@ describe("Fork application with multiple datasources", function () { homePage.ForkApplication(appname, workspaceId); }); // In the forked application, reconnect all datasources - dataSources.ReconnectDSbyName("MongoDBUri"); - dataSources.ReconnectDSbyName("PostgreSQL"); - dataSources.ReconnectDSbyName("MySQL"); - dataSources.ReconnectDSbyName("S3"); + dataSources.ReconnectDSbyType("MongoDBUri"); + dataSources.ReconnectDSbyType("PostgreSQL"); + dataSources.ReconnectDSbyType("MySQL"); + dataSources.ReconnectDSbyType("S3"); // assert if the datasources are connected as expeced homePage.AssertNCloseImport(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/columnTypes/checkboxCell_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/columnTypes/checkboxCell_spec.js index 25a03d2cb8..0a5af5184b 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/columnTypes/checkboxCell_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/columnTypes/checkboxCell_spec.js @@ -2,7 +2,6 @@ import * as _ from "../../../../../../support/Objects/ObjectsCore"; const publishPage = require("../../../../../../locators/publishWidgetspage.json"); const commonLocators = require("../../../../../../locators/commonlocators.json"); import widgetsJson from "../../../../../../locators/Widgets.json"; -import * as _ from "../../../../../../support/Objects/ObjectsCore"; const tableData = `[ { 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 358d5285ab..5bd31f48f0 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/Mongo_Spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/Mongo_Spec.ts @@ -98,7 +98,7 @@ describe("Validate Mongo CRUD with JSON Form", () => { assertHelper.AssertNetworkStatus("@postExecute", 200); agHelper.GetNClick(dataSources._visibleTextSpan("Got it")); assertHelper.AssertNetworkStatus("@updateLayout", 200); - deployMode.DeployApp(); + deployMode.DeployApp(locators._widgetInDeployed("tablewidget")); //Validating loaded table agHelper.AssertElementExist(dataSources._selectedRow); diff --git a/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/MySQL1_Spec.ts b/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/MySQL1_Spec.ts index 124b147b1d..71ff5f3757 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/MySQL1_Spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/MySQL1_Spec.ts @@ -180,7 +180,7 @@ describe("Validate MySQL Generate CRUD with JSON Form", () => { assertHelper.AssertNetworkStatus("@postExecute", 200); agHelper.GetNClick(dataSources._visibleTextSpan("Got it")); assertHelper.AssertNetworkStatus("@updateLayout", 200); - deployMode.DeployApp(); + deployMode.DeployApp(locators._widgetInDeployed("tablewidget")); //Validating loaded table agHelper.AssertElementExist(dataSources._selectedRow); diff --git a/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/MySQL2_Spec.ts b/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/MySQL2_Spec.ts index dafba802fb..2ef798c64d 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/MySQL2_Spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/MySQL2_Spec.ts @@ -399,7 +399,7 @@ describe("Validate MySQL Generate CRUD with JSON Form", () => { assertHelper.AssertNetworkStatus("@postExecute", 200); agHelper.GetNClick(dataSources._visibleTextSpan("Got it")); assertHelper.AssertNetworkStatus("@updateLayout", 200); - deployMode.DeployApp(); + deployMode.DeployApp(locators._widgetInDeployed("tablewidget")); table.WaitUntilTableLoad(); //Validating loaded table diff --git a/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/Postgres1_Spec.ts b/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/Postgres1_Spec.ts index 8c8bf577a5..a1c66fc719 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/Postgres1_Spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/Postgres1_Spec.ts @@ -132,7 +132,7 @@ describe("Postgres Generate CRUD with JSON Form", () => { assertHelper.AssertNetworkStatus("@postExecute", 200); agHelper.GetNClick(dataSources._visibleTextSpan("Got it")); assertHelper.AssertNetworkStatus("@updateLayout", 200); - deployMode.DeployApp(); + deployMode.DeployApp(locators._widgetInDeployed("tablewidget")); //Validating loaded table agHelper.AssertElementExist(dataSources._selectedRow); diff --git a/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/Postgres2_Spec.ts b/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/Postgres2_Spec.ts index 6c33bce245..fcd22e6c62 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/Postgres2_Spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/Postgres2_Spec.ts @@ -95,7 +95,7 @@ describe("Validate Postgres Generate CRUD with JSON Form", () => { assertHelper.AssertNetworkStatus("@postExecute", 200); agHelper.GetNClick(dataSources._visibleTextSpan("Got it")); assertHelper.AssertNetworkStatus("@updateLayout", 200); - deployMode.DeployApp(); + deployMode.DeployApp(locators._widgetInDeployed("tablewidget")); //Validating loaded table agHelper.AssertElementExist(dataSources._selectedRow); @@ -652,45 +652,6 @@ describe("Validate Postgres Generate CRUD with JSON Form", () => { dataSources.DeleteDatasouceFromWinthinDS(dsName, 200); }); - function GenerateCRUDNValidateDeployPage( - col1Text: string, - col2Text: string, - col3Text: string, - jsonFromHeader: string, - ) { - agHelper.GetNClick(dataSources._generatePageBtn); - assertHelper.AssertNetworkStatus("@replaceLayoutWithCRUDPage", 201); - agHelper.AssertContains("Successfully generated a page"); - //assertHelper.AssertNetworkStatus("@getActions", 200);//Since failing sometimes - assertHelper.AssertNetworkStatus("@postExecute", 200); - agHelper.GetNClick(dataSources._visibleTextSpan("Got it")); - assertHelper.AssertNetworkStatus("@updateLayout", 200); - deployMode.DeployApp(); - - //Validating loaded table - agHelper.AssertElementExist(dataSources._selectedRow); - table.ReadTableRowColumnData(0, 1, "v1", 4000).then(($cellData) => { - expect($cellData).to.eq(col1Text); - }); - table.ReadTableRowColumnData(0, 3, "v1", 200).then(($cellData) => { - expect($cellData).to.eq(col2Text); - }); - table.ReadTableRowColumnData(0, 4, "v1", 200).then(($cellData) => { - expect($cellData).to.eq(col3Text); - }); - - //Validating loaded JSON form - cy.xpath(locators._spanButton("Update")).then((selector) => { - cy.wrap(selector) - .invoke("attr", "class") - .then((classes) => { - //cy.log("classes are:" + classes); - expect(classes).not.contain("bp3-disabled"); - }); - }); - dataSources.AssertJSONFormHeader(0, 0, jsonFromHeader); - } - function generateCallsignInfo(rowIndex: number) { //let callSign: string = ""; table diff --git a/app/client/cypress/e2e/Sanity/Datasources/Airtable_Basic_Spec.ts b/app/client/cypress/e2e/Sanity/Datasources/Airtable_Basic_Spec.ts index 571449ac1b..6d94b185d6 100644 --- a/app/client/cypress/e2e/Sanity/Datasources/Airtable_Basic_Spec.ts +++ b/app/client/cypress/e2e/Sanity/Datasources/Airtable_Basic_Spec.ts @@ -235,6 +235,8 @@ describe("excludeForAirgap", "Validate Airtable Ds", () => { inputFieldName: "View", }); + dataSources.RunQuery({ toValidateResponse: false }); //For CI failure! + agHelper.Sleep(); dataSources.RunQuery(); cy.get("@postExecute").then((resObj: any) => { diff --git a/app/client/cypress/limited-tests.txt b/app/client/cypress/limited-tests.txt index c260d0c798..f99ae3e629 100644 --- a/app/client/cypress/limited-tests.txt +++ b/app/client/cypress/limited-tests.txt @@ -1 +1,4 @@ +# For running all specs - uncomment below: cypress/e2e/**/**/* +# TO run only limited tests - give the spec names in below format: +#cypress/e2e/Regression/ServerSide/GenerateCRUD/Mongo_Spec.ts diff --git a/app/client/cypress/support/Objects/Hostport.ts b/app/client/cypress/support/Objects/Hostport.ts index 940d164452..37411f7705 100644 --- a/app/client/cypress/support/Objects/Hostport.ts +++ b/app/client/cypress/support/Objects/Hostport.ts @@ -83,6 +83,7 @@ export class DefaultHostPort { mockApiUrl = "http://host.docker.internal:5001/v1/mock-api?records=10"; echoApiUrl = "http://host.docker.internal:5001/v1/mock-api/echo"; randomCatfactUrl = "http://host.docker.internal:5001/v1/catfact/random"; + mockHttpCodeUrl = "http://host.docker.internal:5001/v1/mock-http-codes/"; firestore_database_url = "https://appsmith-22e8b.firebaseio.com"; firestore_projectID = "appsmith-22e8b"; diff --git a/app/client/cypress/support/Pages/DataSources.ts b/app/client/cypress/support/Pages/DataSources.ts index f63029efa6..744b2eef04 100644 --- a/app/client/cypress/support/Pages/DataSources.ts +++ b/app/client/cypress/support/Pages/DataSources.ts @@ -853,7 +853,7 @@ export class DataSources { this.agHelper.AssertElementVisible(this._testDs); //Making sure modal is fully loaded } - public ReconnectDSbyName( + public ReconnectDSbyType( dsName: "PostgreSQL" | "MySQL" | "MongoDB" | "S3" | "MongoDBUri", ) { this.WaitForReconnectModalToAppear(); diff --git a/app/client/cypress/support/Pages/Onboarding.ts b/app/client/cypress/support/Pages/Onboarding.ts index ba643cb4c7..60e3a3deb6 100644 --- a/app/client/cypress/support/Pages/Onboarding.ts +++ b/app/client/cypress/support/Pages/Onboarding.ts @@ -16,7 +16,11 @@ export class Onboarding { .GetElement(OnboardingLocator.checklistConnectionBtn) .realHover() .should("have.css", "cursor", "not-allowed"); - cy.get(OnboardingLocator.checklistDatasourceBtn).click(); + this._aggregateHelper.GetHoverNClick( + OnboardingLocator.checklistDatasourceBtn, + 0, + true, + ); this._aggregateHelper.AssertElementVisible( OnboardingLocator.datasourcePage, );