From 75893f5704259ee4f4616afb8c8b470d2159c384 Mon Sep 17 00:00:00 2001 From: Sagar Khalasi Date: Wed, 6 Nov 2024 22:18:24 +0530 Subject: [PATCH 1/2] Reverted appsmith url --- .../ActionExecution/uiToCode_spec.ts | 26 ++++---- .../OneClickBinding/PropertyControl_spec.ts | 2 +- .../Workspace/LoginAndImportApp_Spec.ts | 63 +++++++++++++++++++ .../ActionExecution/Block_Execution.ts | 2 +- .../ServerSide/OnLoadTests/APIOnLoad_Spec.ts | 2 +- 5 files changed, 79 insertions(+), 16 deletions(-) create mode 100644 app/client/cypress/e2e/Regression/ClientSide/Workspace/LoginAndImportApp_Spec.ts diff --git a/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/uiToCode_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/uiToCode_spec.ts index 07381359fcb..27b48689009 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/uiToCode_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/uiToCode_spec.ts @@ -49,12 +49,12 @@ describe("UI to Code", { tags: ["@tag.JS", "@tag.Binding"] }, () => { agHelper.GetNClick(propPane._navigateToType("URL")); agHelper.TypeText( propPane._actionSelectorFieldByLabel("Enter URL"), - "https://www.appsmith.com", + "https://www.google.com", ); agHelper.GetNClick(propPane._actionSelectorPopupClose); propPane.ValidateJSFieldValue( "onClick", - `{{showAlert('Hello!', '');navigateTo('https://www.appsmith.com', {}, 'SAME_WINDOW');}}`, + `{{showAlert('Hello!', '');navigateTo('https://www.google.com', {}, 'SAME_WINDOW');}}`, ); // Add third action @@ -80,7 +80,7 @@ describe("UI to Code", { tags: ["@tag.JS", "@tag.Binding"] }, () => { // Validate the code propPane.ValidateJSFieldValue( "onClick", - `{{showAlert('Hello!', '');navigateTo('https://www.appsmith.com', {}, 'SAME_WINDOW');storeValue('secret-key', 'secret-value');copyToClipboard('text to copy');}}`, + `{{showAlert('Hello!', '');navigateTo('https://www.google.com', {}, 'SAME_WINDOW');storeValue('secret-key', 'secret-value');copyToClipboard('text to copy');}}`, ); // Delete the third action @@ -97,7 +97,7 @@ describe("UI to Code", { tags: ["@tag.JS", "@tag.Binding"] }, () => { // Assert the code for the remaining actions propPane.ValidateJSFieldValue( "onClick", - `{{showAlert('Hello!', '');navigateTo('https://www.appsmith.com', {}, 'SAME_WINDOW');copyToClipboard('text to copy');}}`, + `{{showAlert('Hello!', '');navigateTo('https://www.google.com', {}, 'SAME_WINDOW');copyToClipboard('text to copy');}}`, ); // Delete the first action @@ -113,7 +113,7 @@ describe("UI to Code", { tags: ["@tag.JS", "@tag.Binding"] }, () => { // Assert the code for the remaining actions propPane.ValidateJSFieldValue( "onClick", - `{{navigateTo('https://www.appsmith.com', {}, 'SAME_WINDOW');copyToClipboard('text to copy');}}`, + `{{navigateTo('https://www.google.com', {}, 'SAME_WINDOW');copyToClipboard('text to copy');}}`, ); }); @@ -132,13 +132,13 @@ describe("UI to Code", { tags: ["@tag.JS", "@tag.Binding"] }, () => { agHelper.GetNClick(propPane._navigateToType("URL")); agHelper.TypeText( propPane._actionSelectorFieldByLabel("Enter URL"), - "https://www.appsmith.com", + "https://www.google.com", ); agHelper.GetNClick(propPane._actionSelectorPopupClose); propPane.ValidateJSFieldValue( "onClick", - `{{showAlert('Hello!', '');navigateTo('https://www.appsmith.com', {}, 'SAME_WINDOW');}}`, + `{{showAlert('Hello!', '');navigateTo('https://www.google.com', {}, 'SAME_WINDOW');}}`, ); // Add third action @@ -165,7 +165,7 @@ describe("UI to Code", { tags: ["@tag.JS", "@tag.Binding"] }, () => { propPane.ValidateJSFieldValue( "onClick", - `{{showAlert('Hello!', '');navigateTo('https://www.appsmith.com', {}, 'SAME_WINDOW');storeValue('secret-key', 'secret-value');copyToClipboard('text to copy');}}`, + `{{showAlert('Hello!', '');navigateTo('https://www.google.com', {}, 'SAME_WINDOW');storeValue('secret-key', 'secret-value');copyToClipboard('text to copy');}}`, ); // Delete the third action @@ -197,7 +197,7 @@ describe("UI to Code", { tags: ["@tag.JS", "@tag.Binding"] }, () => { propPane.ValidateJSFieldValue( "onClick", - `{{showAlert('Hello!', '');navigateTo('https://www.appsmith.com', {}, 'SAME_WINDOW');storeValue('secret-key', 'secret-value');copyToClipboard('text to copy');}}`, + `{{showAlert('Hello!', '');navigateTo('https://www.google.com', {}, 'SAME_WINDOW');storeValue('secret-key', 'secret-value');copyToClipboard('text to copy');}}`, ); }); @@ -216,13 +216,13 @@ describe("UI to Code", { tags: ["@tag.JS", "@tag.Binding"] }, () => { agHelper.GetNClick(propPane._navigateToType("URL")); agHelper.TypeText( propPane._actionSelectorFieldByLabel("Enter URL"), - "https://www.appsmith.com", + "https://www.google.com", ); agHelper.GetNClick(propPane._actionSelectorPopupClose); propPane.ValidateJSFieldValue( "onClick", - `{{showAlert('Hello!', '');navigateTo('https://www.appsmith.com', {}, 'SAME_WINDOW');}}`, + `{{showAlert('Hello!', '');navigateTo('https://www.google.com', {}, 'SAME_WINDOW');}}`, ); // Add third action @@ -249,7 +249,7 @@ describe("UI to Code", { tags: ["@tag.JS", "@tag.Binding"] }, () => { propPane.ValidateJSFieldValue( "onClick", - `{{showAlert('Hello!', '');navigateTo('https://www.appsmith.com', {}, 'SAME_WINDOW');storeValue('secret-key', 'secret-value');copyToClipboard('text to copy');}}`, + `{{showAlert('Hello!', '');navigateTo('https://www.google.com', {}, 'SAME_WINDOW');storeValue('secret-key', 'secret-value');copyToClipboard('text to copy');}}`, ); // Delete the third action @@ -286,7 +286,7 @@ describe("UI to Code", { tags: ["@tag.JS", "@tag.Binding"] }, () => { propPane.ValidateJSFieldValue( "onClick", - `{{navigateTo('https://www.appsmith.com', {}, 'SAME_WINDOW');copyToClipboard('text to copy');}}`, + `{{navigateTo('https://www.google.com', {}, 'SAME_WINDOW');copyToClipboard('text to copy');}}`, ); }); diff --git a/app/client/cypress/e2e/Regression/ClientSide/OneClickBinding/PropertyControl_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/OneClickBinding/PropertyControl_spec.ts index 94d2acc069d..ee10834b2a8 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/OneClickBinding/PropertyControl_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/OneClickBinding/PropertyControl_spec.ts @@ -149,7 +149,7 @@ describe( propPane.MoveToTab("Content"); [1, 2, 3, 4, 5].forEach(() => { - apiPage.CreateAndFillApi("https://www.appsmith.com/"); + apiPage.CreateAndFillApi("https://www.google.com/"); }); EditorNavigation.SelectEntityByName("Table1", EntityType.Widget); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Workspace/LoginAndImportApp_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Workspace/LoginAndImportApp_Spec.ts new file mode 100644 index 00000000000..2733f47b395 --- /dev/null +++ b/app/client/cypress/e2e/Regression/ClientSide/Workspace/LoginAndImportApp_Spec.ts @@ -0,0 +1,63 @@ +import { REPO, CURRENT_REPO } from "../../../../fixtures/REPO"; +import HomePage from "../../../../locators/HomePage"; +import * as _ from "../../../../support/Objects/ObjectsCore"; +import { + adminSettings, + agHelper, + assertHelper, + homePage, +} from "../../../../support/Objects/ObjectsCore"; + +describe( + "Create new workspace and invite user & validate all roles", + { tags: [""] }, + () => { + let testData: any; + + // Read the CSV file before running the tests + before(() => { + cy.readFile( + "/Users/sagarkhalasi/codebase/appsmith/app/client/cypress/fixtures/testuserimport.csv", + ).then((csvData) => { + const rows = csvData.split("\n"); // Split by newlines to get each row + const headers = rows[0].split(","); // The first row contains headers + console.log("Headers:", headers); // Debug headers + testData = []; + rows.slice(1).forEach((row) => { + const values = row.split(","); + console.log("Row data:", values); // Debug row data + const userObject: any = {}; + headers.forEach((header, index) => { + const value = values[index]?.trim() || ""; // Avoid undefined value by providing a default empty string + userObject[header.trim()] = value; + }); + testData.push(userObject); // Add user object to the data array + }); + }); + }); + + it("1. Login as and import the app as per file", () => { + testData.forEach((user) => { + console.log("JsonFilePath:", user.jsonFilePath); // This should print the string value + const resolvedJsonFilePath = user.jsonFilePath; + console.log("Resolved JsonFilePath:", resolvedJsonFilePath); // Log resolved file path + //homePage.NavigateToHome(); + cy.go(-1) + agHelper.Sleep(5000); + cy.SignupFromAPI( + user.user_email, + user.password, + ); + cy.wait(5000); + cy.go(-1) + cy.wait(5000); + cy.reload(); + cy.wait(5000); + homePage.ImportApp(resolvedJsonFilePath); + cy.wait(5000); + cy.LogOut(false); + cy.wait(5000); + }); + }); + }, +); \ No newline at end of file diff --git a/app/client/cypress/e2e/Regression/ServerSide/ActionExecution/Block_Execution.ts b/app/client/cypress/e2e/Regression/ServerSide/ActionExecution/Block_Execution.ts index a77b917e526..cd65a25a844 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/ActionExecution/Block_Execution.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/ActionExecution/Block_Execution.ts @@ -9,7 +9,7 @@ describe( "Block Action Execution when no field is present", { tags: ["@tag.Datasource"] }, () => { - const url = "https://www.appsmith.com/"; + const url = "https://www.google.com/"; it("1. Ensure API Run button is disabled when no url is present", () => { apiPage.CreateApi("FirstAPI", "GET"); apiPage.AssertRunButtonDisability(true); diff --git a/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/APIOnLoad_Spec.ts b/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/APIOnLoad_Spec.ts index f5fe03d92b1..c1b71039bdb 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/APIOnLoad_Spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/APIOnLoad_Spec.ts @@ -46,7 +46,7 @@ describe( it("2. Shows when API failed to load on page load.", function () { cy.fixture("testdata").then(function (dataSet: any) { apiPage.CreateAndFillApi( - "https://www.appsmith.com/" + dataSet.methods, + "https://www.google.com/" + dataSet.methods, "PageLoadApi2", ); }); From ba22e7537a84f956a3e0bdd9d52ca8af00df219e Mon Sep 17 00:00:00 2001 From: Sagar Khalasi Date: Thu, 7 Nov 2024 10:16:29 +0530 Subject: [PATCH 2/2] removed unwanted file --- .../Workspace/LoginAndImportApp_Spec.ts | 63 ------------------- 1 file changed, 63 deletions(-) delete mode 100644 app/client/cypress/e2e/Regression/ClientSide/Workspace/LoginAndImportApp_Spec.ts diff --git a/app/client/cypress/e2e/Regression/ClientSide/Workspace/LoginAndImportApp_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Workspace/LoginAndImportApp_Spec.ts deleted file mode 100644 index 2733f47b395..00000000000 --- a/app/client/cypress/e2e/Regression/ClientSide/Workspace/LoginAndImportApp_Spec.ts +++ /dev/null @@ -1,63 +0,0 @@ -import { REPO, CURRENT_REPO } from "../../../../fixtures/REPO"; -import HomePage from "../../../../locators/HomePage"; -import * as _ from "../../../../support/Objects/ObjectsCore"; -import { - adminSettings, - agHelper, - assertHelper, - homePage, -} from "../../../../support/Objects/ObjectsCore"; - -describe( - "Create new workspace and invite user & validate all roles", - { tags: [""] }, - () => { - let testData: any; - - // Read the CSV file before running the tests - before(() => { - cy.readFile( - "/Users/sagarkhalasi/codebase/appsmith/app/client/cypress/fixtures/testuserimport.csv", - ).then((csvData) => { - const rows = csvData.split("\n"); // Split by newlines to get each row - const headers = rows[0].split(","); // The first row contains headers - console.log("Headers:", headers); // Debug headers - testData = []; - rows.slice(1).forEach((row) => { - const values = row.split(","); - console.log("Row data:", values); // Debug row data - const userObject: any = {}; - headers.forEach((header, index) => { - const value = values[index]?.trim() || ""; // Avoid undefined value by providing a default empty string - userObject[header.trim()] = value; - }); - testData.push(userObject); // Add user object to the data array - }); - }); - }); - - it("1. Login as and import the app as per file", () => { - testData.forEach((user) => { - console.log("JsonFilePath:", user.jsonFilePath); // This should print the string value - const resolvedJsonFilePath = user.jsonFilePath; - console.log("Resolved JsonFilePath:", resolvedJsonFilePath); // Log resolved file path - //homePage.NavigateToHome(); - cy.go(-1) - agHelper.Sleep(5000); - cy.SignupFromAPI( - user.user_email, - user.password, - ); - cy.wait(5000); - cy.go(-1) - cy.wait(5000); - cy.reload(); - cy.wait(5000); - homePage.ImportApp(resolvedJsonFilePath); - cy.wait(5000); - cy.LogOut(false); - cy.wait(5000); - }); - }); - }, -); \ No newline at end of file