diff --git a/.github/workflows/client.yml b/.github/workflows/client.yml index 506ddcdaa8..2ecc33909f 100644 --- a/.github/workflows/client.yml +++ b/.github/workflows/client.yml @@ -153,6 +153,10 @@ jobs: CYPRESS_URL: ${{ secrets.CYPRESS_URL }} CYPRESS_USERNAME: ${{ secrets.CYPRESS_USERNAME }} CYPRESS_PASSWORD: ${{ secrets.CYPRESS_PASSWORD }} + CYPRESS_TESTUSERNAME1: ${{ secrets.CYPRESS_TESTUSERNAME1 }} + CYPRESS_TESTPASSWORD1: ${{ secrets.CYPRESS_TESTPASSWORD1 }} + CYPRESS_TESTUSERNAME2: ${{ secrets.CYPRESS_TESTUSERNAME2 }} + CYPRESS_TESTPASSWORD2: ${{ secrets.CYPRESS_TESTPASSWORD1 }} run: | ./cypress/setup-test.sh @@ -164,6 +168,10 @@ jobs: CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }} CYPRESS_USERNAME: ${{ secrets.CYPRESS_USERNAME }} CYPRESS_PASSWORD: ${{ secrets.CYPRESS_PASSWORD }} + CYPRESS_TESTUSERNAME1: ${{ secrets.CYPRESS_TESTUSERNAME1 }} + CYPRESS_TESTPASSWORD1: ${{ secrets.CYPRESS_TESTPASSWORD1 }} + CYPRESS_TESTUSERNAME2: ${{ secrets.CYPRESS_TESTUSERNAME2 }} + CYPRESS_TESTPASSWORD2: ${{ secrets.CYPRESS_TESTPASSWORD1 }} with: browser: chrome headless: true diff --git a/app/client/cypress/fixtures/testdata.json b/app/client/cypress/fixtures/testdata.json index e7ef26506d..20efa7f84d 100644 --- a/app/client/cypress/fixtures/testdata.json +++ b/app/client/cypress/fixtures/testdata.json @@ -3,7 +3,7 @@ "methods": "users", "headerKey": "Content-Type", "headerValue": "application/json", - "headerValueBlank": " ", + "headerValueBlank": "", "queryKey": "page", "queryValue": "2", "queryAndValue": "users?page=2", diff --git a/app/client/cypress/integration/Smoke_TestSuite/ApiPaneTests/API_All_Verb_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ApiPaneTests/API_All_Verb_spec.js index aa52f6d8b3..31e34d6ddc 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ApiPaneTests/API_All_Verb_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ApiPaneTests/API_All_Verb_spec.js @@ -112,8 +112,8 @@ describe("API Panel Test Functionality", function() { cy.EnterSourceDetailsWithHeader( testdata.baseUrl, testdata.methods, - testdata.headerKey, - testdata.headerValue, + testdata.headerValueBlank, + testdata.headerValueBlank, ); cy.RunAPI(); cy.ResponseStatusCheck(testdata.successStatusCode); @@ -142,8 +142,8 @@ describe("API Panel Test Functionality", function() { cy.EnterSourceDetailsWithQueryParam( testdata.baseUrl, testdata.methods, - testdata.headerKey, - testdata.headerValue, + testdata.headerValueBlank, + testdata.headerValueBlank, testdata.queryKey, testdata.queryValue, ); diff --git a/app/client/cypress/integration/Smoke_TestSuite/ApiPaneTests/Api_Marketplace_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ApiPaneTests/Api_Marketplace_spec.js index 1e62568093..b377a23b9c 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ApiPaneTests/Api_Marketplace_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ApiPaneTests/Api_Marketplace_spec.js @@ -1,35 +1,39 @@ -/// -const testdata = require("../../../fixtures/testdata.json"); -const apiwidget = require("../../../locators/apiWidgetslocator.json"); -describe("API Panel Test Functionality ", function() { - it("Test Market place API by adding to a page", function() { - cy.log("Login Successful"); - cy.NavigateToAPI_Panel(); - cy.wait("@getCategories"); - cy.wait("@getTemplateCollections"); - cy.wait("@get3PProviders"); - cy.log("Navigation to API Panel screen successful"); - cy.get(apiwidget.marketPlaceapi) - .first() - .click(); - cy.wait("@get3PProviderTemplates"); - cy.get(".apiName") - .first() - .invoke("text") - .then(ApiName => { - cy.get(apiwidget.addPageButton) - .first() - .click(); - const searchApiName = ApiName.replace(/\s/g, ""); - cy.log(searchApiName); - cy.wait("@getActions"); - cy.SearchAPIandClick(searchApiName); - cy.get(apiwidget.apidocumentaionLink) - .invoke("text") - .then(apidocumentation => { - cy.log(apidocumentation); - expect(apidocumentation).to.eq("API documentation"); - }); - }); - }); -}); +/* + * Commenting because CE does not have marketplace anymore + * + * */ +// /// +// const testdata = require("../../../fixtures/testdata.json"); +// const apiwidget = require("../../../locators/apiWidgetslocator.json"); +// describe("API Panel Test Functionality ", function() { +// it("Test Market place API by adding to a page", function() { +// cy.log("Login Successful"); +// cy.NavigateToAPI_Panel(); +// cy.wait("@getCategories"); +// cy.wait("@getTemplateCollections"); +// cy.wait("@get3PProviders"); +// cy.log("Navigation to API Panel screen successful"); +// cy.get(apiwidget.marketPlaceapi) +// .first() +// .click(); +// cy.wait("@get3PProviderTemplates"); +// cy.get(".apiName") +// .first() +// .invoke("text") +// .then(ApiName => { +// cy.get(apiwidget.addPageButton) +// .first() +// .click(); +// const searchApiName = ApiName.replace(/\s/g, ""); +// cy.log(searchApiName); +// cy.wait("@getActions"); +// cy.SearchAPIandClick(searchApiName); +// cy.get(apiwidget.apidocumentaionLink) +// .invoke("text") +// .then(apidocumentation => { +// cy.log(apidocumentation); +// expect(apidocumentation).to.eq("API documentation"); +// }); +// }); +// }); +// }); diff --git a/app/client/cypress/locators/ApiEditor.json b/app/client/cypress/locators/ApiEditor.json index 0370ba9ae3..03ba1329ed 100644 --- a/app/client/cypress/locators/ApiEditor.json +++ b/app/client/cypress/locators/ApiEditor.json @@ -20,4 +20,4 @@ "apiPaginationNextTest": ".t--apiFormPaginationNextTest", "apiPaginationTab": ".t--apiFormPaginationType", "apiTab": ".react-tabs__tab-list li" -} \ No newline at end of file +} diff --git a/app/client/cypress/support/commands.js b/app/client/cypress/support/commands.js index b99463ddcc..ce61024e39 100644 --- a/app/client/cypress/support/commands.js +++ b/app/client/cypress/support/commands.js @@ -1307,10 +1307,8 @@ Cypress.Commands.add("startServerAndRoutes", () => { cy.route("POST", "/api/v1/applications/publish/*").as("publishApp"); cy.route("PUT", "/api/v1/layouts/*/pages/*").as("updateLayout"); - cy.route("PUT", "/api/v1/actions/*").as("putActions"); cy.route("POST", "/track/*").as("postTrack"); cy.route("POST", "/api/v1/actions/execute").as("postExecute"); - cy.route("POST", "/api/v1/actions").as("postaction"); cy.route("POST", "/api/v1/actions").as("createNewApi"); cy.route("POST", "/api/v1/import?type=CURL&pageId=*&name=*").as("curlImport"); diff --git a/app/client/src/actions/actionActions.ts b/app/client/src/actions/actionActions.ts index 766f8c9717..531538fd58 100644 --- a/app/client/src/actions/actionActions.ts +++ b/app/client/src/actions/actionActions.ts @@ -4,7 +4,7 @@ import { ReduxAction, ReduxActionErrorTypes, } from "constants/ReduxActionConstants"; -import { Action, RestAction } from "entities/Action"; +import { Action } from "entities/Action"; import { batchAction } from "actions/batchActions"; export const createActionRequest = (payload: Partial) => { @@ -50,7 +50,7 @@ export const fetchActionsForPage = (pageId: string) => { }; }; -export const fetchActionsForPageSuccess = (actions: RestAction[]) => { +export const fetchActionsForPageSuccess = (actions: Action[]) => { return { type: ReduxActionTypes.FETCH_ACTIONS_FOR_PAGE_SUCCESS, payload: actions, @@ -74,7 +74,7 @@ export const updateAction = (payload: { id: string }) => { }; }; -export const updateActionSuccess = (payload: { data: RestAction }) => { +export const updateActionSuccess = (payload: { data: Action }) => { return { type: ReduxActionTypes.UPDATE_ACTION_SUCCESS, payload, @@ -107,7 +107,7 @@ export const moveActionRequest = (payload: { }; }; -export const moveActionSuccess = (payload: RestAction) => { +export const moveActionSuccess = (payload: Action) => { return { type: ReduxActionTypes.MOVE_ACTION_SUCCESS, payload, @@ -135,10 +135,7 @@ export const copyActionRequest = (payload: { }; }; -export const copyActionSuccess = (payload: { - id: string; - destinationPageId: string; -}) => { +export const copyActionSuccess = (payload: Action) => { return { type: ReduxActionTypes.COPY_ACTION_SUCCESS, payload, diff --git a/app/client/src/components/editorComponents/form/fields/EmbeddedDatasourcePathField.tsx b/app/client/src/components/editorComponents/form/fields/EmbeddedDatasourcePathField.tsx index da1d7a9c7b..04fba4d05f 100644 --- a/app/client/src/components/editorComponents/form/fields/EmbeddedDatasourcePathField.tsx +++ b/app/client/src/components/editorComponents/form/fields/EmbeddedDatasourcePathField.tsx @@ -46,35 +46,17 @@ type Props = EditorProps & class EmbeddedDatasourcePathComponent extends React.Component { handleDatasourceUrlUpdate = (datasourceUrl: string) => { - const { datasource, pluginId, orgId, datasourceList } = this.props; + const { datasource, pluginId, orgId } = this.props; const urlHasUpdated = datasourceUrl !== datasource.datasourceConfiguration?.url; if (urlHasUpdated) { - if ("id" in datasource && datasource.id) { - this.props.updateDatasource({ - ...DEFAULT_DATASOURCE(pluginId, orgId), - datasourceConfiguration: { - ...datasource.datasourceConfiguration, - url: datasourceUrl, - }, - }); - } else { - const matchesExistingDatasource = _.find( - datasourceList, - d => d.datasourceConfiguration?.url === datasourceUrl, - ); - if (matchesExistingDatasource) { - this.props.updateDatasource(matchesExistingDatasource); - } else { - this.props.updateDatasource({ - ...DEFAULT_DATASOURCE(pluginId, orgId), - datasourceConfiguration: { - ...datasource.datasourceConfiguration, - url: datasourceUrl, - }, - }); - } - } + this.props.updateDatasource({ + ...DEFAULT_DATASOURCE(pluginId, orgId), + datasourceConfiguration: { + ...datasource.datasourceConfiguration, + url: datasourceUrl, + }, + }); } }; @@ -113,7 +95,7 @@ class EmbeddedDatasourcePathComponent extends React.Component { const matches = value.match(urlGroupsRegexExp); if (matches && matches.length) { datasourceUrl = matches[1]; - path = `${matches[2]}${matches[3]}`; + path = `${matches[2] || ""}${matches[3] || ""}`; } } else { datasourceUrl = value; diff --git a/app/client/src/reducers/entityReducers/actionsReducer.tsx b/app/client/src/reducers/entityReducers/actionsReducer.tsx index 71e22d6a58..aa12e2e0ba 100644 --- a/app/client/src/reducers/entityReducers/actionsReducer.tsx +++ b/app/client/src/reducers/entityReducers/actionsReducer.tsx @@ -249,6 +249,7 @@ const actionsReducer = createReducer(initialState, { ...a, config: { ...a.config, + id: "TEMP_COPY_ID", name: action.payload.name, pageId: action.payload.destinationPageId, }, diff --git a/app/client/src/sagas/ActionSagas.ts b/app/client/src/sagas/ActionSagas.ts index 1b6e03f552..0665c7e69e 100644 --- a/app/client/src/sagas/ActionSagas.ts +++ b/app/client/src/sagas/ActionSagas.ts @@ -384,7 +384,7 @@ export function* refactorActionName( } function* saveApiNameSaga(action: ReduxAction<{ id: string; name: string }>) { - // Takes from drafts, checks if the name isValid, saves + // Takes from state, checks if the name isValid, saves const apiId = action.payload.id; const api = yield select(state => state.entities.actions.find( diff --git a/deploy/aws/base-install.sh b/deploy/aws/base-install.sh index b3560c9daa..e60c2af255 100755 --- a/deploy/aws/base-install.sh +++ b/deploy/aws/base-install.sh @@ -49,7 +49,7 @@ cd $boot_script_path sudo curl -O https://raw.githubusercontent.com/appsmithorg/appsmith/release/deploy/configure-ssl.sh sudo chown ubuntu:ubuntu $boot_script_path/$config_ssl_file_name && sudo chmod +x $boot_script_path/$config_ssl_file_name -sudo curl -O https://raw.githubusercontent.com/appsmithorg/appsmith/feature/deploy-script/deploy/aws/boot.sh +sudo curl -O https://raw.githubusercontent.com/appsmithorg/appsmith/release/deploy/aws/boot.sh sudo chown ubuntu:ubuntu $boot_script_path/$boot_file_name && sudo chmod +x $boot_script_path/$boot_file_name USER="ubuntu"