From 3064a1865ad603a07c0715797e20f0ba1383ffce Mon Sep 17 00:00:00 2001 From: Abhinav Jha Date: Fri, 20 Nov 2020 17:08:51 +0530 Subject: [PATCH 1/2] Fix RTE line break issue Fix issue where empty defaultValue wasn't getting updated --- .../designSystems/appsmith/RichTextEditorComponent.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/client/src/components/designSystems/appsmith/RichTextEditorComponent.tsx b/app/client/src/components/designSystems/appsmith/RichTextEditorComponent.tsx index 7cd6e10ef76..f9d0b55000c 100644 --- a/app/client/src/components/designSystems/appsmith/RichTextEditorComponent.tsx +++ b/app/client/src/components/designSystems/appsmith/RichTextEditorComponent.tsx @@ -37,13 +37,16 @@ export const RichtextEditorComponent = ( useEffect(() => { if ( editorInstance !== null && - props.defaultValue !== editorContent.current + (editorContent.current.length === 0 || + editorContent.current !== props.defaultValue) ) { setTimeout(() => { const content = props.defaultValue ? props.defaultValue.replace(/\n/g, "
") : props.defaultValue; - editorInstance.setContent(props.defaultValue, { format: "html" }); + editorInstance.setContent(content, { + format: "html", + }); }, 200); } }, [props.defaultValue]); From c5f3dd62650b585b5ab6ae4c77ed0cc896b22b71 Mon Sep 17 00:00:00 2001 From: Arpit Mohan Date: Fri, 20 Nov 2020 17:14:33 +0530 Subject: [PATCH 2/2] Adding the Google maps API key as an env variable to client.yml This will ensure that we can run the Cypress tests for the map widget. --- .github/workflows/client.yml | 3 +++ contributions/docs/TestAutomation.md | 15 +++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/.github/workflows/client.yml b/.github/workflows/client.yml index 3dc14666c04..83c7aa1612e 100644 --- a/.github/workflows/client.yml +++ b/.github/workflows/client.yml @@ -197,6 +197,7 @@ jobs: CYPRESS_TESTUSERNAME2: ${{ secrets.CYPRESS_TESTUSERNAME2 }} CYPRESS_TESTPASSWORD2: ${{ secrets.CYPRESS_TESTPASSWORD1 }} APPSMITH_DISABLE_TELEMETRY: true + APPSMITH_GOOGLE_MAPS_API_KEY: ${{ secrets.APPSMITH_GOOGLE_MAPS_API_KEY }} POSTGRES_PASSWORD: postgres run: | ./cypress/setup-test.sh @@ -213,6 +214,8 @@ jobs: CYPRESS_TESTPASSWORD1: ${{ secrets.CYPRESS_TESTPASSWORD1 }} CYPRESS_TESTUSERNAME2: ${{ secrets.CYPRESS_TESTUSERNAME2 }} CYPRESS_TESTPASSWORD2: ${{ secrets.CYPRESS_TESTPASSWORD1 }} + APPSMITH_DISABLE_TELEMETRY: true + APPSMITH_GOOGLE_MAPS_API_KEY: ${{ secrets.APPSMITH_GOOGLE_MAPS_API_KEY }} COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title }} with: browser: chrome diff --git a/contributions/docs/TestAutomation.md b/contributions/docs/TestAutomation.md index e1ad2232020..ced6ae01a54 100644 --- a/contributions/docs/TestAutomation.md +++ b/contributions/docs/TestAutomation.md @@ -49,3 +49,18 @@ Config add your registered username and password. ``` 12. Once the cypress.json file is ready, we can actually run tests from the cypress client. 13. Cypress supports Chrome/Firefox/electron browsers. Select a suitable browser and check the status of your tests. + +## How do I add environment variables required for Cypress tests? + +**Note:** This can only be done by the project maintainers. Please contact one of them if you require this step to be accomplished. + +1. Go to [https://github.com/appsmithorg/appsmith/settings/secrets/actions](https://github.com/appsmithorg/appsmith/settings/secrets/actions). +2. Click on "New Repository Secret" +3. Add the secret key & value here. These values will be masked in the CI output logs incase they are printed out. +4. Save the value. +5. In the file `.github/workflows/client.yml`, find the steps named: "Setting up the cypress tests" & "Run the cypress test". These steps are responsible for setting up & executing the Cypress tests. +6. Add the env variable there in the form: +``` +YOUR_SECRET_KEY: ${{ secrets.APPSMITH_YOUR_SECRET_KEY }} +``` +7. Commit & push the file `.github/workflows/client.yml` to the default branch (`release`). Please remember that the changes to the build file will not take effect unless they are committed against the default branch. \ No newline at end of file