diff --git a/.github/workflows/build-client-server.yml b/.github/workflows/build-client-server.yml index 32440c87f7..ea090a91ea 100644 --- a/.github/workflows/build-client-server.yml +++ b/.github/workflows/build-client-server.yml @@ -207,7 +207,7 @@ jobs: - name: Print cypress dashboard url id: dashboard_url run: | - cypress_url=$(cat ~/cypress_url) + cypress_url="https://internal.appsmith.com/app/cypressdashboard/rundetails-64ec3df0c632e24c00764938?branch=master&workflowId=${{ github.run_id }}&attempt=${{ github.run_attempt }}" echo "dashboard_url=$cypress_url" >> $GITHUB_OUTPUT # Download failed_spec list for all jobs @@ -306,7 +306,7 @@ jobs: - name: Print cypress dashboard url id: dashboard_url run: | - cypress_url=$(cat ~/cypress_url) + cypress_url="https://internal.appsmith.com/app/cypressdashboard/rundetails-64ec3df0c632e24c00764938?branch=master&workflowId=${{ github.run_id }}&attempt=${{ github.run_attempt }}" echo "dashboard_url=$cypress_url" >> $GITHUB_OUTPUT # Download failed_spec list for all jobs diff --git a/.github/workflows/integration-tests-command.yml b/.github/workflows/integration-tests-command.yml index 44eb9287bd..2108fbcb6c 100644 --- a/.github/workflows/integration-tests-command.yml +++ b/.github/workflows/integration-tests-command.yml @@ -118,7 +118,7 @@ jobs: continue-on-error: true id: dashboard_url run: | - cypress_url=$(cat ~/cypress_url) + cypress_url="https://internal.appsmith.com/app/cypressdashboard/rundetails-64ec3df0c632e24c00764938?branch=master&workflowId=${{ github.run_id }}&attempt=${{ github.run_attempt }}" echo "dashboard_url=$cypress_url" >> $GITHUB_OUTPUT # Download failed_spec list for all jobs diff --git a/.github/workflows/integration-tests-with-documentdb-command.yml b/.github/workflows/integration-tests-with-documentdb-command.yml index 8bee0f8edc..fa29139e17 100644 --- a/.github/workflows/integration-tests-with-documentdb-command.yml +++ b/.github/workflows/integration-tests-with-documentdb-command.yml @@ -118,7 +118,7 @@ jobs: continue-on-error: true id: dashboard_url run: | - cypress_url=$(cat ~/cypress_url) + cypress_url="https://internal.appsmith.com/app/cypressdashboard/rundetails-64ec3df0c632e24c00764938?branch=master&workflowId=${{ github.run_id }}&attempt=${{ github.run_attempt }}" echo "dashboard_url=$cypress_url" >> $GITHUB_OUTPUT # Download failed_spec list for all jobs diff --git a/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/Connection_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/Connection_spec.js index 58e1627cbf..f89bb177d9 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/Connection_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/Connection_spec.js @@ -5,12 +5,9 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; const httpsRepoURL = "https://github.com/test/test.git"; const invalidURL = "test"; const invalidURLDetectedOnTheBackend = "test@"; - const invalidEmail = "test"; const invalidEmailWithAmp = "test@hello"; -const GITHUB_API_BASE = "https://api.github.com"; - let repoName; let generatedKey; let windowOpenSpy; @@ -59,34 +56,11 @@ describe("Git sync modal: connect tab", function () { cy.intercept("POST", "/api/v1/applications/ssh-keypair/*").as( "generateKey", ); - - // Stubbing window.open - cy.window().then((window) => { - windowOpenSpy = cy.stub(window, "open").callsFake((url) => { - expect(url.startsWith("https://docs.appsmith.com/")).to.be.true; - windowOpenSpy.restore(); - }); - }); - cy.get(gitSyncLocators.learnMoreSshUrl).click(); - cy.get(gitSyncLocators.generateDeployKeyBtn).click(); cy.wait("@generateKey").then((result) => { generatedKey = result.response.body.data.publicKey; }); - - // generate key learn more - cy.window().then((window) => { - windowOpenSpy = cy.stub(window, "open").callsFake((url) => { - expect( - url.startsWith( - "https://docs.github.com/en/developers/overview/managing-deploy-keys", - ), - ).to.be.true; - windowOpenSpy.restore(); - }); - }); - cy.xpath(gitSyncLocators.learnMoreDeployKey).click({ force: true }); }); it("2. validates copy key and validates repo url input after key generation", function () { @@ -95,7 +69,8 @@ describe("Git sync modal: connect tab", function () { }); cy.get(gitSyncLocators.copySshKey).click(); - cy.get(gitSyncLocators.gitRepoInput).type(`{selectAll}${httpsRepoURL}`); + cy.wait(2000); + cy.get(gitSyncLocators.gitRepoInput).clear().type(`${httpsRepoURL}`); cy.contains(Cypress.env("MESSAGES").PASTE_SSH_URL_INFO()); cy.get(gitSyncLocators.connectSubmitBtn).should("be.disabled"); @@ -267,7 +242,6 @@ describe("Git sync modal: connect tab", function () { }); after(() => { - //cy.deleteTestGithubRepo(repoName); _.gitSync.DeleteTestGithubRepo(repoName); }); }); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/LearnMore_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/LearnMore_spec.ts new file mode 100644 index 0000000000..bcd91bbbd8 --- /dev/null +++ b/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/LearnMore_spec.ts @@ -0,0 +1,74 @@ +import gitSyncLocators from "../../../../../locators/gitSyncLocators"; +import homePage from "../../../../../locators/HomePage"; +import * as _ from "../../../../../support/Objects/ObjectsCore"; + +const httpsRepoURL = "https://github.com/test/test.git"; +const invalidURL = "test"; + +let repoName; +let generatedKey; +let windowOpenSpy; +describe("Git sync modal: Learn more links", function () { + it("1. validates repo URL", function () { + // open gitSync modal + cy.get(homePage.deployPopupOptionTrigger).click({ force: true }); + cy.get(homePage.connectToGitBtn).click({ force: true }); + + cy.get(gitSyncLocators.gitRepoInput).type(`{selectAll}${httpsRepoURL}`); + cy.contains(Cypress.env("MESSAGES").PASTE_SSH_URL_INFO()); + cy.get(gitSyncLocators.generateDeployKeyBtn).should("not.exist"); + + cy.get(gitSyncLocators.gitRepoInput).type(`{selectAll}${invalidURL}`); + cy.contains(Cypress.env("MESSAGES").PASTE_SSH_URL_INFO()); + cy.get(gitSyncLocators.generateDeployKeyBtn).should("not.exist"); + + // generate key button should be disappeared if empty repo + cy.get(gitSyncLocators.gitRepoInput).type(`{selectAll}${""}`); + cy.get(gitSyncLocators.generateDeployKeyBtn).should("not.exist"); + + cy.get(gitSyncLocators.gitRepoInput).type( + `{selectAll}${_.dataManager.GITEA_API_URL_TED}/${repoName}.git`, + ); + cy.contains(Cypress.env("MESSAGES").PASTE_SSH_URL_INFO()).should( + "not.exist", + ); + + cy.get(gitSyncLocators.generateDeployKeyBtn).should("not.be.disabled"); + + cy.intercept("POST", "/api/v1/applications/ssh-keypair/*").as( + "generateKey", + ); + + // Stubbing window.open + // cy.window().then((window) => { + // windowOpenSpy = cy.stub(window, "open").callsFake((url) => { + // expect(url.startsWith("https://docs.appsmith.com/")).to.be.true; + // windowOpenSpy.restore(); + // }); + // }); + + cy.window().then((window) => { + windowOpenSpy = cy.stub(window, "open").callsFake((url) => { + if ( + url.includes("/version-control-with-git/connecting-to-git-repository") + ) { + expect(url).to.contain( + "/version-control-with-git/connecting-to-git-repository", + ); + } else if (url.includes("overview/managing-deploy-keys")) { + expect(url).to.contain("overview/managing-deploy-keys"); + } + windowOpenSpy.restore(); + }); + }); + + // Click the "Learn More" link + cy.get(gitSyncLocators.learnMoreSshUrl).click(); + cy.get(gitSyncLocators.generateDeployKeyBtn).click(); + + cy.wait("@generateKey").then((result) => { + generatedKey = result.response.body.data.publicKey; + }); + cy.xpath(gitSyncLocators.learnMoreDeployKey).click({ force: true }); + }); +}); diff --git a/app/client/cypress/e2e/Regression/ServerSide/Datasources/Oracle_Spec.ts b/app/client/cypress/e2e/Regression/ServerSide/Datasources/Oracle_Spec.ts index 9042c667c9..54014bc65e 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/Datasources/Oracle_Spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/Datasources/Oracle_Spec.ts @@ -4,22 +4,24 @@ import { propPane, dataManager, locators, + entityExplorer, + deployMode, + draggableWidgets, + table, } from "../../../../support/Objects/ObjectsCore"; +import { Widgets } from "../../../../support/Pages/DataSources"; describe("Validate Oracle DS", () => { - let dataSourceName: string; + let dataSourceName: string, guid: any; before("Generate GUID", () => { agHelper.GenerateUUID(); cy.get("@guid").then((uid) => { + guid = uid; dataSourceName = "Oracle" + " " + uid; }); }); - after("Delete Oracle DS", () => { - dataSources.DeleteDatasouceFromActiveTab(dataSourceName); - }); - it("1. Tc #2354, #2204 - Oracle placeholder & mandatory mark verification", () => { dataSources.NavigateToDSCreateNew(); dataSources.CreatePlugIn("Oracle"); @@ -107,4 +109,190 @@ describe("Validate Oracle DS", () => { dataSources.AssertDSInActiveList(dataSourceName); // }); }); + + it("3. Tc #2359, Tc # 2360 , Tc # 2358 - Create Insert, Alter & Select queries", () => { + dataSources.NavigateFromActiveDS(dataSourceName, true); + let query = `CREATE TABLE ${guid} ( + aircraft_id NUMBER(5) PRIMARY KEY, + aircraft_type VARCHAR2(50) NOT NULL, + registration_number VARCHAR2(20) UNIQUE, + manufacturer VARCHAR2(50), + seating_capacity NUMBER(3), + maximum_speed NUMBER(5, 2), + range NUMBER(7, 2), + purchase_date DATE, + maintenance_last_date DATE, + notes CLOB + );`; + agHelper.RenameWithInPane("CreateAircraft"); + dataSources.EnterQuery(query); + dataSources.RunQuery(); + entityExplorer.ExpandCollapseEntity("Datasources"); + entityExplorer.ExpandCollapseEntity(dataSourceName); + entityExplorer.ActionContextMenuByEntityName({ + entityNameinLeftSidebar: dataSourceName, + action: "Refresh", + }); + agHelper.AssertElementVisibility( + entityExplorer._entityNameInExplorer(guid.toUpperCase()), + ); + query = `INSERT INTO ${guid} ( + aircraft_id, + aircraft_type, + registration_number, + manufacturer, + seating_capacity, + maximum_speed, + range, + purchase_date, + maintenance_last_date, + notes) VALUES ( + 1, + 'Cargo Plane', + 'N12345', + 'Boeing', + 150, + 550.03, + 3500.30, + TO_DATE('2020-01-15', 'YYYY-MM-DD'), + TO_DATE('September 14, 2023', 'Month DD, YYYY'), + 'This aircraft is used for domestic flights.');`; + entityExplorer.ActionTemplateMenuByEntityName(guid.toUpperCase(), "SELECT"); + dataSources.RunQuery(); + agHelper + .GetText(dataSources._noRecordFound) + .then(($noRecMsg) => expect($noRecMsg).to.eq("No data records to show")); + dataSources.EnterQuery(query); + dataSources.RunQuery(); + let selectQuery = `SELECT * FROM ${guid} WHERE ROWNUM < 10`; + dataSources.EnterQuery(selectQuery); + dataSources.RunQueryNVerifyResponseViews(); + query = `ALTER TABLE ${guid} ADD (raw_data RAW(16), maintenance_interval INTERVAL YEAR(3) TO MONTH);`; + dataSources.EnterQuery(query); + dataSources.RunQuery(); + query = `INSERT INTO ${guid} ( + aircraft_id, + aircraft_type, + registration_number, + manufacturer, + seating_capacity, + maximum_speed, + range, + purchase_date, + maintenance_last_date, + notes, + raw_data, + maintenance_interval) VALUES ( + 4, + 'Passenger Plane', + 'N77777', + 'Airbus', + 100, + 600.67, + 3800.82, + TO_DATE('2017-05-25', 'YYYY-MM-DD'), + TO_DATE('2023-02-18', 'YYYY-MM-DD'), + 'This aircraft is part of the international fleet.', + UTL_RAW.CAST_TO_RAW('raw_value'), + INTERVAL '1' YEAR(3) -- 1 year maintenance interval +);`; + dataSources.EnterQuery(query); + dataSources.RunQuery(); + dataSources.EnterQuery(selectQuery); + dataSources.RunQueryNVerifyResponseViews(2); + query = `INSERT ALL + INTO ${guid} ( + aircraft_id, + aircraft_type, + registration_number, + manufacturer, + seating_capacity, + maximum_speed, + range, + purchase_date, + maintenance_last_date, + notes, + raw_data, + maintenance_interval + ) + VALUES ( + 5, + 'Cargo Plane', + 'N45678', + 'Boeing', + 280, + 570.00, + 5500.00, + TO_DATE('2018-08-30', 'YYYY-MM-DD'), + TO_DATE('2022-12-12', 'YYYY-MM-DD'), + 'This cargo aircraft is used for long-haul freight.', + UTL_RAW.CAST_TO_RAW('cargo_raw_data'), + INTERVAL '2' YEAR(3) -- Two-year maintenance interval + ) + INTO ${guid} ( + aircraft_id, + aircraft_type, + registration_number, + manufacturer, + seating_capacity, + maximum_speed, + range, + purchase_date, + maintenance_last_date, + notes, + raw_data, + maintenance_interval + ) + VALUES ( + 6, + 'Helicopter', + 'N98765', + 'Robinson', + 2, + 150.00, + 350.00, + TO_DATE('2019-06-15', 'YYYY-MM-DD'), + TO_DATE('2023-08-20', 'YYYY-MM-DD'), + 'This helicopter is used for aerial photography.', + UTL_RAW.CAST_TO_RAW('helicopter_raw'), + INTERVAL '6' MONTH -- Six-month maintenance interval + ); + SELECT * FROM DUAL;`; + dataSources.EnterQuery(query); + dataSources.RunQuery(); + dataSources.EnterQuery(selectQuery); + dataSources.RunQueryNVerifyResponseViews(4); + selectQuery = selectQuery + ` and aircraft_id IN (1, 6)`; + dataSources.EnterQuery(selectQuery); + dataSources.RunQueryNVerifyResponseViews(2); + dataSources.AddSuggestedWidget(Widgets.Table); + deployMode.DeployApp(locators._widgetInDeployed(draggableWidgets.TABLE)); + table.WaitUntilTableLoad(0, 0, "v2"); + table.ReadTableRowColumnData(0, 10, "v2").then(($cellData) => { + expect($cellData).to.be.empty; + }); + table.ReadTableRowColumnData(0, 11, "v2").then(($cellData) => { + expect($cellData).to.be.empty; + }); + table.ReadTableRowColumnData(1, 10, "v2").then(($cellData) => { + expect($cellData).not.to.be.empty; + }); + table.ReadTableRowColumnData(1, 11, "v2").then(($cellData) => { + expect($cellData).not.to.be.empty; + }); + deployMode.NavigateBacktoEditor(); + }); + + after( + "Verify Deletion of the Oracle datasource after all created queries are deleted", + () => { + dataSources.DeleteDatasouceFromWinthinDS(dataSourceName, 409); //Since all queries exists + entityExplorer.ExpandCollapseEntity("Queries/JS"); + entityExplorer.DeleteAllQueriesForDB(dataSourceName); + deployMode.DeployApp(); + deployMode.NavigateBacktoEditor(); + entityExplorer.ExpandCollapseEntity("Queries/JS"); + dataSources.DeleteDatasouceFromWinthinDS(dataSourceName, 200); + }, + ); }); diff --git a/app/client/cypress/support/Pages/GitSync.ts b/app/client/cypress/support/Pages/GitSync.ts index b290e67831..d2349d8b6f 100644 --- a/app/client/cypress/support/Pages/GitSync.ts +++ b/app/client/cypress/support/Pages/GitSync.ts @@ -44,6 +44,7 @@ export class GitSync { public _discardCallout = "[data-testid='t--discard-callout']"; public _gitStatusChanges = "[data-testid='t--git-change-statuses']"; private _gitSyncBranches = ".t--sync-branches"; + learnMoreSshUrl = ".t--learn-more-ssh-url"; OpenGitSyncModal() { this.agHelper.GetNClick(this._connectGitBottomBar);