ci: Release v1.6.17

This commit is contained in:
Trisha Anand 2022-03-30 18:14:52 +05:30 committed by GitHub
commit 7937d98de2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
673 changed files with 38793 additions and 9107 deletions

View File

@ -410,6 +410,16 @@
"code",
"bug"
]
},
{
"login": "pallavagarwal07",
"name": "Pallav Agarwal",
"avatar_url": "https://avatars.githubusercontent.com/u/9394044?v=4",
"profile": "https://www.varstack.com",
"contributions": [
"code",
"bug"
]
}
],
"contributorsPerLine": 7,

2
.github/config.json vendored

File diff suppressed because one or more lines are too long

View File

@ -103,7 +103,7 @@ jobs:
# Install all the dependencies
- name: Install dependencies
if: steps.run_result.outputs.run_result != 'success'
run: yarn install
run: yarn install --frozen-lockfile
- name: Set the build environment based on the branch
if: steps.run_result.outputs.run_result != 'success'
@ -609,7 +609,7 @@ jobs:
# Install all the dependencies
- name: Install dependencies
if: steps.run_result.outputs.run_result != 'success'
run: yarn install
run: yarn install --frozen-lockfile
- name: Download the react build artifact
if: steps.run_result.outputs.run_result != 'success'

View File

@ -77,7 +77,7 @@ jobs:
# Install all the dependencies
- name: Install dependencies
run: yarn install
run: yarn install --frozen-lockfile
- name: Set the build environment based on the branch
id: vars

11
.github/workflows/copy-labels.yml vendored Normal file
View File

@ -0,0 +1,11 @@
name: Copy labels from a connected issue to the PR
on:
pull_request:
types: [opened, labeled, unlabeled, assigned, edited, reopened, synchronize, ready_for_review]
jobs:
copy-labels-from-issue:
runs-on: ubuntu-latest
steps:
- name: Check and copy labels
uses: hetunandu/copy-labels-from-issue@v1

View File

@ -76,7 +76,7 @@ jobs:
${{ runner.OS }}-
- name: Install dependencies
run: yarn install
run: yarn install --frozen-lockfile
- name: Create the bundle
env:

View File

@ -214,7 +214,7 @@ jobs:
# Install all the dependencies
- name: Install dependencies
if: steps.run_result.outputs.run_result != 'success'
run: yarn install
run: yarn install --frozen-lockfile
- name: Set the build environment based on the branch
if: steps.run_result.outputs.run_result != 'success'
@ -331,6 +331,434 @@ jobs:
# Set status = success
- run: echo "::set-output name=run_result::success" > ~/run_result
buildRts:
defaults:
run:
working-directory: app/rts
runs-on: ubuntu-latest
# Only run this workflow for internally triggered events
if: github.event_name == 'repository_dispatch' &&
github.event.client_payload.slash_command.sha != '' &&
contains(github.event.client_payload.pull_request.head.sha, github.event.client_payload.slash_command.sha)
steps:
# Checkout the code
- uses: actions/checkout@v2
with:
fetch-depth: 0
# Timestamp will be used to create cache key
- id: timestamp
run: echo "::set-output name=timestamp::$(timestamp +'%Y-%m-%dT%H:%M:%S')"
# In case this is second attempt try restoring status of the prior attempt from cache
- name: Restore the previous run result
uses: actions/cache@v2
with:
path: |
~/run_result
key: ${{ github.run_id }}-${{ github.job }}-${{ steps.timestamp.outputs.timestamp }}
restore-keys: |
${{ github.run_id }}-${{ github.job }}-
# Fetch prior run result
- name: Get the previous run result
id: run_result
run: cat ~/run_result 2>/dev/null || echo 'default'
# Incase of prior failure run the job
- if: steps.run_result.outputs.run_result != 'success'
run: echo "I'm alive!" && exit 0
- name: Use Node.js 14.15.4
if: steps.run_result.outputs.run_result != 'success'
uses: actions/setup-node@v1
with:
node-version: "14.15.4"
# Here, the GITHUB_REF is of type /refs/head/<branch_name>. We extract branch_name from this by removing the
# first 11 characters. This can be used to build images for several branches
# Since this is an unreleased build, we get the latest released version number, increment the minor number in it,
# append a `-SNAPSHOT` at it's end to prepare the snapshot version number. This is used as the project's version.
- name: Get the version to tag the Docker image
if: steps.run_result.outputs.run_result != 'success'
id: vars
run: |
# Since this is an unreleased build, we set the version to incremented version number with a
# `-SNAPSHOT` suffix.
latest_released_version="$(git tag --list 'v*' --sort=-version:refname | head -1)"
echo "latest_released_version = $latest_released_version"
next_version="$(echo "$latest_released_version" | awk -F. -v OFS=. '{ $NF++; print }')"
echo "next_version = $next_version"
echo ::set-output name=version::$next_version-SNAPSHOT
echo ::set-output name=tag::$(echo ${GITHUB_REF:11})
- name: Build
if: steps.run_result.outputs.run_result != 'success'
run: |
echo 'export const VERSION = "${{ steps.vars.outputs.version }}"' > src/version.js
./build.sh
ls -l dist
# Restore the previous built bundle if present. If not push the newly built into the cache
- name: Restore the previous bundle
uses: actions/cache@v2
with:
path: |
app/rts/dist/
key: ${{ github.run_id }}-${{ github.job }}-${{ steps.timestamp.outputs.timestamp }}
restore-keys: |
${{ github.run_id }}-${{ github.job }}
# Restore the previous built bundle if present. If not push the newly built into the cache
- name: Restore the previous bundle
uses: actions/cache@v2
with:
path: |
app/rts/node_modules/
key: ${{ github.run_id }}-${{ github.job }}-${{ steps.timestamp.outputs.timestamp }}
restore-keys: |
${{ github.run_id }}-${{ github.job }}
# Upload the build artifact so that it can be used by the test & deploy job in the workflow
- name: Upload server build bundle
uses: actions/upload-artifact@v2
with:
name: rts-build
path: app/rts/dist/
- name: Upload RTS dependencies bundle
uses: actions/upload-artifact@v2
with:
name: rts-build-deps
path: app/rts/node_modules/
fat-conatiner-test:
needs: [build, server-build, buildRts]
# Only run if the build step is successful
if: success()
runs-on: ubuntu-latest
defaults:
run:
shell: bash
strategy:
fail-fast: false
# Service containers to run with this job. Required for running tests
services:
# Label used to access the service container
redis:
# Docker Hub image for Redis
image: redis
ports:
# Opens tcp port 6379 on the host and service container
- 6379:6379
mongo:
image: mongo
ports:
- 27017:27017
steps:
# Check out merge commit
- name: Fork based /ok-to-test checkout
uses: actions/checkout@v2
with:
ref: "refs/pull/${{ github.event.client_payload.pull_request.number }}/merge"
# Timestamp will be used to create cache key
- id: timestamp
run: echo "::set-output name=timestamp::$(timestamp +'%Y-%m-%dT%H:%M:%S')"
# In case this is second attempt try restoring status of the prior attempt from cache
- name: Restore the previous run result
uses: martijnhols/actions-cache@v3
with:
path: |
~/run_result
key: ${{ github.run_id }}-${{ github.job }}-${{ steps.timestamp.outputs.timestamp }}-${{ matrix.job }}
restore-keys: |
${{ github.run_id }}-${{ github.job }}-${{ matrix.job }}
# Fetch prior run result
- name: Get the previous run result
id: run_result
run: cat ~/run_result 2>/dev/null || echo 'default'
# In case this is second attempt try restoring failed tests
- name: Restore the previous failed combine result
if: steps.run_result.outputs.run_result == 'failedtest'
uses: martijnhols/actions-cache/restore@v3
with:
path: |
~/combined_failed_spec
key: ${{ github.run_id }}-"ui-test-result"-${{ steps.timestamp.outputs.timestamp }}
restore-keys: |
${{ github.run_id }}-${{ github.job }}
# failed_spec_env will contain list of all failed specs
# We are using evnironment variable instead of regular to support multiline
- name: Get failed_spec
if: steps.run_result.outputs.run_result == 'failedtest'
run: |
failed_spec_env=$(cat ~/combined_failed_spec)
echo "failed_spec_env<<EOF" >> $GITHUB_ENV
echo "$failed_spec_env" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- if: steps.run_result.outputs.run_result != 'success' && steps.run_result.outputs.run_result != 'failedtest'
run: echo "Starting full run" && exit 0
- if: steps.run_result.outputs.run_result == 'failedtest'
run: echo "Rerunning failed tests" && exit 0
- name: cat run_result
run: echo ${{ steps.run_result.outputs.run_result }}
# Setup Java
- name: Set up JDK 1.11
if: steps.run_result.outputs.run_result != 'success'
uses: actions/setup-java@v1
with:
java-version: "11.0.10"
- name: Download the react build artifact
uses: actions/download-artifact@v2
with:
name: build
path: app/client/build
- name: Download the server build artifact
uses: actions/download-artifact@v2
with:
name: build
path: app/server/dist/
- name: Download the rts build artifact
uses: actions/download-artifact@v2
with:
name: rts-build
path: app/rts/dist/
- name: Download the rts build artifact
uses: actions/download-artifact@v2
with:
name: rts-build-deps
path: app/rts/node_modules/
- name: Build docker image
if: steps.run_result.outputs.run_result != 'success'
working-directory: "."
run: |
docker build -t fatcontainer .
- name: Load docker image
if: steps.run_result.outputs.run_result != 'success'
env:
APPSMITH_LICENSE_KEY: ${{ secrets.APPSMITH_LICENSE_KEY }}
working-directory: "."
run: |
mkdir -p fatcontainerlocal/stacks/configuration/
cd fatcontainerlocal
docker run -d --name appsmith -p 80:80 -p 9001:9001 \
-v "$PWD/stacks:/appsmith-stacks" fatcontainer
sudo chmod a+rw stacks/configuration/docker.env
sudo echo "APPSMITH_LICENSE_KEY=$APPSMITH_LICENSE_KEY" >> stacks/configuration/docker.env
# - name: Restart Appsmith
# if: steps.run_result.outputs.run_result != 'success'
# run: |
# docker restart appsmith
- name: Use Node.js 14.15.4
if: steps.run_result.outputs.run_result != 'success'
uses: actions/setup-node@v1
with:
node-version: "14.15.4"
# Install all the dependencies
- name: Install dependencies
if: steps.run_result.outputs.run_result != 'success'
run: |
cd app/client
yarn install
- name: Setting up the cypress tests
if: steps.run_result.outputs.run_result != 'success'
shell: bash
env:
APPSMITH_SSL_CERTIFICATE: ${{ secrets.APPSMITH_SSL_CERTIFICATE }}
APPSMITH_SSL_KEY: ${{ secrets.APPSMITH_SSL_KEY }}
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 }}
CYPRESS_S3_ACCESS_KEY: ${{ secrets.CYPRESS_S3_ACCESS_KEY }}
CYPRESS_S3_SECRET_KEY: ${{ secrets.CYPRESS_S3_SECRET_KEY }}
CYPRESS_GITHUB_PERSONAL_ACCESS_TOKEN: ${{ secrets.CYPRESS_GITHUB_PERSONAL_ACCESS_TOKEN }}
CYPRESS_TEST_GITHUB_USER_NAME: ${{ secrets.CYPRESS_TEST_GITHUB_USER_NAME }}
APPSMITH_DISABLE_TELEMETRY: true
APPSMITH_GOOGLE_MAPS_API_KEY: ${{ secrets.APPSMITH_GOOGLE_MAPS_API_KEY }}
POSTGRES_PASSWORD: postgres
run: |
cd app/client
chmod a+x ./cypress/setup-test-fat.sh
./cypress/setup-test-fat.sh
- name: Run the cypress test
if: steps.run_result.outputs.run_result != 'success' && steps.run_result.outputs.run_result != 'failedtest'
uses: cypress-io/github-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
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 }}
CYPRESS_S3_ACCESS_KEY: ${{ secrets.CYPRESS_S3_ACCESS_KEY }}
CYPRESS_S3_SECRET_KEY: ${{ secrets.CYPRESS_S3_SECRET_KEY }}
CYPRESS_GITHUB_PERSONAL_ACCESS_TOKEN: ${{ secrets.CYPRESS_GITHUB_PERSONAL_ACCESS_TOKEN }}
CYPRESS_TEST_GITHUB_USER_NAME: ${{ secrets.CYPRESS_TEST_GITHUB_USER_NAME }}
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
headless: true
record: true
install: false
parallel: true
config-file: cypress_fat.json
group: "Electrons on Github Action Fat Container"
spec: "cypress/integration/Smoke_TestSuite_Fat/**/*"
working-directory: app/client
# tag will be either "push" or "pull_request"
tag: ${{ github.event_name }}
env: "NODE_ENV=development"
# Incase of second attemtp only run failed specs
- name: Run the cypress test with failed tests
if: steps.run_result.outputs.run_result == 'failedtest'
uses: cypress-io/github-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
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 }}
CYPRESS_S3_ACCESS_KEY: ${{ secrets.CYPRESS_S3_ACCESS_KEY }}
CYPRESS_S3_SECRET_KEY: ${{ secrets.CYPRESS_S3_SECRET_KEY }}
CYPRESS_GITHUB_PERSONAL_ACCESS_TOKEN: ${{ secrets.CYPRESS_GITHUB_PERSONAL_ACCESS_TOKEN }}
CYPRESS_TEST_GITHUB_USER_NAME: ${{ secrets.CYPRESS_TEST_GITHUB_USER_NAME }}
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
headless: true
record: true
install: false
parallel: true
config-file: cypress_fat.json
group: "Electrons on Github Action"
spec: ${{ env.failed_spec_env }}
working-directory: app/client
# tag will be either "push" or "pull_request"
tag: ${{ github.event_name }}
env: "NODE_ENV=development"
# Set status = failedtest
- name: Set fail if there are test failures
if: failure()
run: echo "::set-output name=run_result::failedtest" > ~/run_result
# Create a directory ~/failed_spec and add a dummy file
# This will ensure upload and download steps are successfull
- name: Create direcotrs for failed tests
if: always()
run: |
mkdir -p ~/failed_spec
echo "empty" >> ~/failed_spec/dummy-${{ matrix.job }}
# add list failed tests to a file
- name: Incase of test failures copy them to a file
if: failure()
run: |
cd ${{ github.workspace }}/app/client/cypress/
find screenshots -type d|grep -i spec |sed 's/screenshots/cypress\/integration/g' > ~/failed_spec/failed_spec-${{ matrix.job }}
# Upload failed test list using common path for all matrix job
- name: Upload failed test list artifact
if: always()
uses: actions/upload-artifact@v2
with:
name: failed-spec
path: ~/failed_spec
# Force store previous run result to cache
- name: Store the previous run result
if: failure()
uses: martijnhols/actions-cache/save@v3
with:
path: |
~/run_result
key: ${{ github.run_id }}-${{ github.job }}-${{ steps.timestamp.outputs.timestamp }}-${{ matrix.job }}
restore-keys: |
${{ github.run_id }}-${{ github.job }}-${{ matrix.job }}
# Force store previous failed test list to cache
- name: Store the previous failed test result
if: failure()
uses: martijnhols/actions-cache/save@v3
with:
path: |
~/failed_spec
key: ${{ github.run_id }}-${{ github.job }}-${{ steps.timestamp.outputs.timestamp }}-${{ matrix.job }}
restore-keys: |
${{ github.run_id }}-${{ github.job }}-${{ matrix.job }}
# Upload the screenshots as artifacts if there's a failure
- uses: actions/upload-artifact@v1
if: failure()
with:
name: cypress-screenshots-${{ matrix.job }}
path: app/client/cypress/screenshots/
- name: Restore the previous bundle
uses: actions/cache@v2
with:
path: |
app/client/cypress/snapshots/
key: ${{ github.run_id }}-${{ github.job }}-${{ steps.timestamp.outputs.timestamp }}-${{ matrix.job }}
restore-keys: |
${{ github.run_id }}-${{ github.job }}-${{ matrix.job }}
# Upload the snapshots as artifacts for layout validation
- uses: actions/upload-artifact@v1
with:
name: cypress-snapshots-visualRegression
path: app/client/cypress/snapshots/
# Upload the log artifact so that it can be used by the test & deploy job in the workflow
- name: Upload server logs bundle on failure
uses: actions/upload-artifact@v2
if: failure()
with:
name: server-logs-${{ matrix.job }}
path: app/server/server-logs.log
# Set status = success
- run: echo "::set-output name=run_result::success" > ~/run_result
ui-test:
needs: [build, server-build]
# Only run if the build step is successful
@ -344,7 +772,7 @@ jobs:
fail-fast: false
matrix:
job: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23]
# Service containers to run with this job. Required for running tests
services:
# Label used to access the service container
@ -443,7 +871,7 @@ jobs:
# Install all the dependencies
- name: Install dependencies
if: steps.run_result.outputs.run_result != 'success'
run: yarn install
run: yarn install --frozen-lockfile
- name: Download the react build artifact
if: steps.run_result.outputs.run_result != 'success'
@ -935,7 +1363,7 @@ jobs:
# Install all the dependencies
- name: Install dependencies
if: steps.run_result.outputs.run_result != 'success'
run: yarn install
run: yarn install --frozen-lockfile
- name: Download the react build artifact
if: steps.run_result.outputs.run_result != 'success'
@ -1018,7 +1446,7 @@ jobs:
if: steps.run_result.outputs.run_result != 'success'
working-directory: app/client/perf
shell: bash
run: yarn install
run: yarn install --frozen-lockfile
- name: Change test script permissions
if: steps.run_result.outputs.run_result != 'success'

View File

@ -109,7 +109,7 @@ jobs:
# Install all the dependencies
- name: Install dependencies
if: steps.run_result.outputs.run_result != 'success'
run: yarn install
run: yarn install --frozen-lockfile
- name: Set the build environment based on the branch
if: steps.run_result.outputs.run_result != 'success'
@ -404,6 +404,345 @@ jobs:
name: rts-build-deps
path: app/rts/node_modules/
fat-container-test:
needs: [buildClient, buildServer, buildRts]
# Only run if the build step is successful
# If the build has been triggered manually via workflow_dispatch or via a push to protected branches
# then we don't check for the PR approved state
if: |
success() &&
(github.event_name == 'workflow_dispatch' ||
github.event_name == 'push' ||
(github.event_name == 'pull_request_review' &&
github.event.review.state == 'approved' &&
github.event.pull_request.head.repo.full_name == github.repository))
runs-on: ubuntu-latest
defaults:
run:
shell: bash
strategy:
fail-fast: false
# Service containers to run with this job. Required for running tests
services:
# Label used to access the service container
redis:
# Docker Hub image for Redis
image: redis
ports:
# Opens tcp port 6379 on the host and service container
- 6379:6379
mongo:
image: mongo
ports:
- 27017:27017
steps:
# Checkout the code
- name: Checkout the merged commit from PR and base branch
if: github.event_name == 'pull_request_review'
uses: actions/checkout@v2
with:
ref: refs/pull/${{ github.event.pull_request.number }}/merge
- name: Checkout the head commit of the branch
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
uses: actions/checkout@v2
# Timestamp will be used to create cache key
- id: timestamp
run: echo "::set-output name=timestamp::$(timestamp +'%Y-%m-%dT%H:%M:%S')"
# In case this is second attempt try restoring status of the prior attempt from cache
- name: Restore the previous run result
uses: martijnhols/actions-cache@v3
with:
path: |
~/run_result
key: ${{ github.run_id }}-${{ github.job }}-${{ steps.timestamp.outputs.timestamp }}-${{ matrix.job }}
restore-keys: |
${{ github.run_id }}-${{ github.job }}-${{ matrix.job }}
# Fetch prior run result
- name: Get the previous run result
id: run_result
run: cat ~/run_result 2>/dev/null || echo 'default'
# In case this is second attempt try restoring failed tests
- name: Restore the previous failed combine result
if: steps.run_result.outputs.run_result == 'failedtest'
uses: martijnhols/actions-cache/restore@v3
with:
path: |
~/combined_failed_spec
key: ${{ github.run_id }}-"ui-test-result"-${{ steps.timestamp.outputs.timestamp }}
restore-keys: |
${{ github.run_id }}-${{ github.job }}
# failed_spec_env will contain list of all failed specs
# We are using evnironment variable instead of regular to support multiline
- name: Get failed_spec
if: steps.run_result.outputs.run_result == 'failedtest'
run: |
failed_spec_env=$(cat ~/combined_failed_spec)
echo "failed_spec_env<<EOF" >> $GITHUB_ENV
echo "$failed_spec_env" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- if: steps.run_result.outputs.run_result != 'success' && steps.run_result.outputs.run_result != 'failedtest'
run: echo "Starting full run" && exit 0
- if: steps.run_result.outputs.run_result == 'failedtest'
run: echo "Rerunning failed tests" && exit 0
- name: cat run_result
run: echo ${{ steps.run_result.outputs.run_result }}
# Setup Java
- name: Set up JDK 1.11
if: steps.run_result.outputs.run_result != 'success'
uses: actions/setup-java@v1
with:
java-version: "11.0.10"
- name: Download the react build artifact
uses: actions/download-artifact@v2
with:
name: client-build
path: app/client/build
- name: Download the server build artifact
uses: actions/download-artifact@v2
with:
name: server-build
path: app/server/dist
- name: Download the rts build artifact
uses: actions/download-artifact@v2
with:
name: rts-build
path: app/rts/dist
- name: Download the rts build artifact
uses: actions/download-artifact@v2
with:
name: rts-build-deps
path: app/rts/node_modules/
- name: Build docker image
if: success() && github.ref == 'refs/heads/release' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
working-directory: "."
run: |
docker build -t fatcontainer .
- name: Load docker image
if: success() && github.ref == 'refs/heads/release' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
env:
APPSMITH_LICENSE_KEY: ${{ secrets.APPSMITH_LICENSE_KEY }}
working-directory: "."
run: |
mkdir -p fatcontainerlocal/stacks/configuration/
cd fatcontainerlocal
docker run -d --name appsmith -p 80:80 -p 9001:9001 \
-v "$PWD/stacks:/appsmith-stacks" fatcontainer
sudo chmod a+rw stacks/configuration/docker.env
sudo echo "APPSMITH_LICENSE_KEY=$APPSMITH_LICENSE_KEY" >> stacks/configuration/docker.env
# - name: Restart Appsmith
# if: steps.run_result.outputs.run_result != 'success'
# run: |
# docker restart appsmith
- name: Use Node.js 14.15.4
if: steps.run_result.outputs.run_result != 'success'
uses: actions/setup-node@v1
with:
node-version: "14.15.4"
# Install all the dependencies
- name: Install dependencies
if: steps.run_result.outputs.run_result != 'success'
run: |
cd app/client
yarn install
- name: Setting up the cypress tests
if: steps.run_result.outputs.run_result != 'success'
shell: bash
env:
APPSMITH_SSL_CERTIFICATE: ${{ secrets.APPSMITH_SSL_CERTIFICATE }}
APPSMITH_SSL_KEY: ${{ secrets.APPSMITH_SSL_KEY }}
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 }}
CYPRESS_S3_ACCESS_KEY: ${{ secrets.CYPRESS_S3_ACCESS_KEY }}
CYPRESS_S3_SECRET_KEY: ${{ secrets.CYPRESS_S3_SECRET_KEY }}
CYPRESS_GITHUB_PERSONAL_ACCESS_TOKEN: ${{ secrets.CYPRESS_GITHUB_PERSONAL_ACCESS_TOKEN }}
CYPRESS_TEST_GITHUB_USER_NAME: ${{ secrets.CYPRESS_TEST_GITHUB_USER_NAME }}
APPSMITH_DISABLE_TELEMETRY: true
APPSMITH_GOOGLE_MAPS_API_KEY: ${{ secrets.APPSMITH_GOOGLE_MAPS_API_KEY }}
POSTGRES_PASSWORD: postgres
run: |
cd app/client
chmod a+x ./cypress/setup-test-fat.sh
./cypress/setup-test-fat.sh
- name: Run the cypress test
if: steps.run_result.outputs.run_result != 'success' && steps.run_result.outputs.run_result != 'failedtest'
uses: cypress-io/github-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
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 }}
CYPRESS_S3_ACCESS_KEY: ${{ secrets.CYPRESS_S3_ACCESS_KEY }}
CYPRESS_S3_SECRET_KEY: ${{ secrets.CYPRESS_S3_SECRET_KEY }}
CYPRESS_GITHUB_PERSONAL_ACCESS_TOKEN: ${{ secrets.CYPRESS_GITHUB_PERSONAL_ACCESS_TOKEN }}
CYPRESS_TEST_GITHUB_USER_NAME: ${{ secrets.CYPRESS_TEST_GITHUB_USER_NAME }}
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
headless: true
record: true
install: false
parallel: true
config-file: cypress_fat.json
group: "Electrons on Github Action Fat Container"
spec: "cypress/integration/Smoke_TestSuite_Fat/**/*"
working-directory: app/client
# tag will be either "push" or "pull_request"
tag: ${{ github.event_name }}
env: "NODE_ENV=development"
# Incase of second attemtp only run failed specs
- name: Run the cypress test with failed tests
if: steps.run_result.outputs.run_result == 'failedtest'
uses: cypress-io/github-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
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 }}
CYPRESS_S3_ACCESS_KEY: ${{ secrets.CYPRESS_S3_ACCESS_KEY }}
CYPRESS_S3_SECRET_KEY: ${{ secrets.CYPRESS_S3_SECRET_KEY }}
CYPRESS_GITHUB_PERSONAL_ACCESS_TOKEN: ${{ secrets.CYPRESS_GITHUB_PERSONAL_ACCESS_TOKEN }}
CYPRESS_TEST_GITHUB_USER_NAME: ${{ secrets.CYPRESS_TEST_GITHUB_USER_NAME }}
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
headless: true
record: true
install: false
parallel: true
config-file: cypress_fat.json
group: "Electrons on Github Action"
spec: ${{ env.failed_spec_env }}
working-directory: app/client
# tag will be either "push" or "pull_request"
tag: ${{ github.event_name }}
env: "NODE_ENV=development"
# Set status = failedtest
- name: Set fail if there are test failures
if: failure()
run: echo "::set-output name=run_result::failedtest" > ~/run_result
# Create a directory ~/failed_spec and add a dummy file
# This will ensure upload and download steps are successfull
- name: Create direcotrs for failed tests
if: always()
run: |
mkdir -p ~/failed_spec
echo "empty" >> ~/failed_spec/dummy-${{ matrix.job }}
# add list failed tests to a file
- name: Incase of test failures copy them to a file
if: failure()
run: |
cd ${{ github.workspace }}/app/client/cypress/
find screenshots -type d|grep -i spec |sed 's/screenshots/cypress\/integration/g' > ~/failed_spec/failed_spec-${{ matrix.job }}
# Upload failed test list using common path for all matrix job
- name: Upload failed test list artifact
if: always()
uses: actions/upload-artifact@v2
with:
name: failed-spec
path: ~/failed_spec
# Force store previous run result to cache
- name: Store the previous run result
if: failure()
uses: martijnhols/actions-cache/save@v3
with:
path: |
~/run_result
key: ${{ github.run_id }}-${{ github.job }}-${{ steps.timestamp.outputs.timestamp }}-${{ matrix.job }}
restore-keys: |
${{ github.run_id }}-${{ github.job }}-${{ matrix.job }}
# Force store previous failed test list to cache
- name: Store the previous failed test result
if: failure()
uses: martijnhols/actions-cache/save@v3
with:
path: |
~/failed_spec
key: ${{ github.run_id }}-${{ github.job }}-${{ steps.timestamp.outputs.timestamp }}-${{ matrix.job }}
restore-keys: |
${{ github.run_id }}-${{ github.job }}-${{ matrix.job }}
# Upload the screenshots as artifacts if there's a failure
- uses: actions/upload-artifact@v1
if: failure()
with:
name: cypress-screenshots-${{ matrix.job }}
path: app/client/cypress/screenshots/
- name: Restore the previous bundle
uses: actions/cache@v2
with:
path: |
app/client/cypress/snapshots/
key: ${{ github.run_id }}-${{ github.job }}-${{ steps.timestamp.outputs.timestamp }}-${{ matrix.job }}
restore-keys: |
${{ github.run_id }}-${{ github.job }}-${{ matrix.job }}
# Upload the snapshots as artifacts for layout validation
- uses: actions/upload-artifact@v1
with:
name: cypress-snapshots-visualRegression
path: app/client/cypress/snapshots/
# Upload the log artifact so that it can be used by the test & deploy job in the workflow
- name: Upload server logs bundle on failure
uses: actions/upload-artifact@v2
if: failure()
with:
name: server-logs-${{ matrix.job }}
path: app/server/server-logs.log
# Set status = success
- run: echo "::set-output name=run_result::success" > ~/run_result
ui-test:
needs: [buildClient, buildServer, buildRts]
# Only run if the build step is successful
@ -605,7 +944,7 @@ jobs:
# Install all the dependencies
- name: Install dependencies
if: steps.run_result.outputs.run_result != 'success'
run: yarn install
run: yarn install --frozen-lockfile
- name: Download the react build artifact
if: steps.run_result.outputs.run_result != 'success'

View File

@ -91,6 +91,5 @@ ENV PATH /opt/appsmith/utils/node_modules/.bin:$PATH
EXPOSE 80
EXPOSE 443
EXPOSE 9001
ENTRYPOINT [ "/opt/appsmith/entrypoint.sh" ]
CMD ["/usr/bin/supervisord", "-n"]

View File

@ -196,6 +196,7 @@ We love our contributors! We're committed to fostering an open and welcoming env
</tr>
<tr>
<td align="center"><a href="https://github.com/prsidhu"><img src="https://avatars.githubusercontent.com/u/5424788?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Preet Sidhu</b></sub></a><br /><a href="https://github.com/appsmithorg/appsmith/commits?author=prsidhu" title="Code">💻</a> <a href="https://github.com/appsmithorg/appsmith/issues?q=author%3Aprsidhu" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://www.varstack.com"><img src="https://avatars.githubusercontent.com/u/9394044?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Pallav Agarwal</b></sub></a><br /><a href="https://github.com/appsmithorg/appsmith/commits?author=pallavagarwal07" title="Code">💻</a> <a href="https://github.com/appsmithorg/appsmith/issues?q=author%3Apallavagarwal07" title="Bug reports">🐛</a></td>
</tr>
</table>

View File

@ -36,6 +36,10 @@
"APPSMITH_DISABLE_TELEMETRY": {
"description" : "We want to be transparent and request that you share anonymous usage data with us. This data is purely statistical in nature and helps us understand your needs & provide better support to your self-hosted instance. You can read more about what information is collected in our documentation https://docs.appsmith.com/v/v1.2.1/setup/telemetry",
"value": "false"
}
},
"APPSMITH_SUPERVISOR_PASSWORD": {
"description": "Basic authentication password to access Supervisor UI - An web interface, which allow you to manage various process",
"value": ""
}
}
}

View File

@ -20,7 +20,7 @@
"**/Smoke_TestSuite/ClientSideTests/Templates/Fork_Template_spec.js"
],
"chromeWebSecurity": false,
"viewportHeight": 900,
"viewportHeight": 1100,
"viewportWidth": 1400,
"retries": {
"runMode": 2,

View File

@ -0,0 +1,326 @@
{
"dsl": {
"widgetName": "MainContainer",
"backgroundColor": "none",
"rightColumn": 1160,
"snapColumns": 64,
"detachFromLayout": true,
"widgetId": "0",
"topRow": 0,
"bottomRow": 680,
"containerStyle": "none",
"snapRows": 125,
"parentRowSpace": 1,
"type": "CANVAS_WIDGET",
"canExtend": true,
"version": 54,
"minHeight": 690,
"parentColumnSpace": 1,
"dynamicBindingPathList": [],
"leftColumn": 0,
"children": [
{
"widgetName": "ButtonGroup1",
"orientation": "horizontal",
"rightColumn": 50,
"isCanvas": false,
"displayName": "Button Group",
"iconSVG": "/static/media/icon.d6773218.svg",
"widgetId": "t5l24fccio",
"topRow": 15,
"bottomRow": 19,
"parentRowSpace": 10,
"isVisible": true,
"groupButtons": {
"groupButton1": {
"label": "Favorite",
"iconName": "heart",
"id": "groupButton1",
"widgetId": "",
"buttonColor": "#03B365",
"buttonType": "SIMPLE",
"placement": "CENTER",
"isVisible": true,
"isDisabled": false,
"index": 0,
"menuItems": {}
},
"groupButton2": {
"label": "Add",
"iconName": "add",
"id": "groupButton2",
"buttonColor": "#03B365",
"buttonType": "SIMPLE",
"placement": "CENTER",
"widgetId": "",
"isVisible": true,
"isDisabled": false,
"index": 1,
"menuItems": {}
},
"groupButton3": {
"label": "More",
"iconName": "more",
"id": "groupButton3",
"buttonType": "MENU",
"placement": "CENTER",
"buttonColor": "#03B365",
"widgetId": "",
"isVisible": true,
"isDisabled": false,
"index": 2,
"menuItems": {
"menuItem1": {
"label": "First Option",
"backgroundColor": "#FFFFFF",
"id": "menuItem1",
"widgetId": "",
"onClick": "",
"isVisible": true,
"isDisabled": false,
"index": 0
},
"menuItem2": {
"label": "Second Option",
"backgroundColor": "#FFFFFF",
"id": "menuItem2",
"widgetId": "",
"onClick": "",
"isVisible": true,
"isDisabled": false,
"index": 1
},
"menuItem3": {
"label": "Delete",
"iconName": "trash",
"iconColor": "#FFFFFF",
"iconAlign": "right",
"textColor": "#FFFFFF",
"backgroundColor": "#DD4B34",
"id": "menuItem3",
"widgetId": "",
"onClick": "",
"isVisible": true,
"isDisabled": false,
"index": 2
}
}
}
},
"type": "BUTTON_GROUP_WIDGET",
"version": 1,
"hideCard": false,
"parentId": "0",
"renderMode": "CANVAS",
"isLoading": false,
"animateLoading": true,
"parentColumnSpace": 17.9375,
"leftColumn": 1,
"buttonVariant": "PRIMARY",
"key": "qxtmv7r8yb"
},
{
"widgetName": "ButtonGroup2",
"orientation": "horizontal",
"rightColumn": 25,
"isCanvas": false,
"displayName": "Button Group",
"iconSVG": "/static/media/icon.d6773218.svg",
"widgetId": "yxjq5sck7d",
"topRow": 4,
"bottomRow": 8,
"parentRowSpace": 10,
"isVisible": true,
"groupButtons": {
"groupButton1": {
"label": "Favorite",
"iconName": "heart",
"id": "groupButton1",
"widgetId": "",
"buttonColor": "#03B365",
"buttonType": "SIMPLE",
"placement": "CENTER",
"isVisible": true,
"isDisabled": false,
"index": 0,
"menuItems": {}
},
"groupButton2": {
"label": "Add",
"iconName": "add",
"id": "groupButton2",
"buttonColor": "#03B365",
"buttonType": "SIMPLE",
"placement": "CENTER",
"widgetId": "",
"isVisible": true,
"isDisabled": false,
"index": 1,
"menuItems": {}
},
"groupButton3": {
"label": "More",
"iconName": "more",
"id": "groupButton3",
"buttonType": "MENU",
"placement": "CENTER",
"buttonColor": "#03B365",
"widgetId": "",
"isVisible": true,
"isDisabled": false,
"index": 2,
"menuItems": {
"menuItem1": {
"label": "First Option",
"backgroundColor": "#FFFFFF",
"id": "menuItem1",
"widgetId": "",
"onClick": "",
"isVisible": true,
"isDisabled": false,
"index": 0
},
"menuItem2": {
"label": "Second Option",
"backgroundColor": "#FFFFFF",
"id": "menuItem2",
"widgetId": "",
"onClick": "",
"isVisible": true,
"isDisabled": false,
"index": 1
},
"menuItem3": {
"label": "Delete",
"iconName": "trash",
"iconColor": "#FFFFFF",
"iconAlign": "right",
"textColor": "#FFFFFF",
"backgroundColor": "#DD4B34",
"id": "menuItem3",
"widgetId": "",
"onClick": "",
"isVisible": true,
"isDisabled": false,
"index": 2
}
}
}
},
"type": "BUTTON_GROUP_WIDGET",
"version": 1,
"hideCard": false,
"parentId": "0",
"renderMode": "CANVAS",
"isLoading": false,
"animateLoading": true,
"parentColumnSpace": 17.9375,
"leftColumn": 1,
"buttonVariant": "PRIMARY",
"key": "qxtmv7r8yb"
},
{
"widgetName": "ButtonGroup3",
"isCanvas": false,
"displayName": "Button Group",
"iconSVG": "/static/media/icon.d6773218.svg",
"topRow": 29,
"bottomRow": 55,
"parentRowSpace": 10,
"groupButtons": {
"groupButton1": {
"label": "Favorite",
"iconName": "heart",
"id": "groupButton1",
"widgetId": "",
"buttonColor": "#03B365",
"buttonType": "SIMPLE",
"placement": "CENTER",
"isVisible": true,
"isDisabled": false,
"index": 0,
"menuItems": {}
},
"groupButton2": {
"label": "Add",
"iconName": "add",
"id": "groupButton2",
"buttonColor": "#03B365",
"buttonType": "SIMPLE",
"placement": "CENTER",
"widgetId": "",
"isVisible": true,
"isDisabled": false,
"index": 1,
"menuItems": {}
},
"groupButton3": {
"label": "More",
"iconName": "more",
"id": "groupButton3",
"buttonType": "MENU",
"placement": "CENTER",
"buttonColor": "#03B365",
"widgetId": "",
"isVisible": true,
"isDisabled": false,
"index": 2,
"menuItems": {
"menuItem1": {
"label": "First Option",
"backgroundColor": "#FFFFFF",
"id": "menuItem1",
"widgetId": "",
"onClick": "",
"isVisible": true,
"isDisabled": false,
"index": 0
},
"menuItem2": {
"label": "Second Option",
"backgroundColor": "#FFFFFF",
"id": "menuItem2",
"widgetId": "",
"onClick": "",
"isVisible": true,
"isDisabled": false,
"index": 1
},
"menuItem3": {
"label": "Delete",
"iconName": "trash",
"iconColor": "#FFFFFF",
"iconAlign": "right",
"textColor": "#FFFFFF",
"backgroundColor": "#DD4B34",
"id": "menuItem3",
"widgetId": "",
"onClick": "",
"isVisible": true,
"isDisabled": false,
"index": 2
}
}
}
},
"type": "BUTTON_GROUP_WIDGET",
"hideCard": false,
"animateLoading": true,
"parentColumnSpace": 17.9375,
"dynamicTriggerPathList": [],
"leftColumn": 1,
"dynamicBindingPathList": [],
"key": "qxtmv7r8yb",
"orientation": "horizontal",
"rightColumn": 50,
"widgetId": "mr048y04aq",
"isVisible": true,
"version": 1,
"parentId": "0",
"renderMode": "CANVAS",
"isLoading": false,
"buttonVariant": "PRIMARY"
}
]
}
}

View File

@ -0,0 +1,327 @@
{
"dsl":{
"widgetName":"MainContainer",
"backgroundColor":"none",
"rightColumn":816,
"snapColumns":64,
"detachFromLayout":true,
"widgetId":"0",
"topRow":0,
"bottomRow":270,
"containerStyle":"none",
"snapRows":125,
"parentRowSpace":1,
"type":"CANVAS_WIDGET",
"canExtend":true,
"version":53,
"minHeight":280,
"parentColumnSpace":1,
"dynamicBindingPathList":[
],
"leftColumn":0,
"children":[
{
"template":{
"Input1":{
"isVisible":true,
"label":"",
"widgetName":"Input1",
"version":2,
"defaultText":"",
"iconAlign":"left",
"autoFocus":false,
"labelStyle":"",
"resetOnSubmit":true,
"isRequired":false,
"isDisabled":false,
"animateLoading":true,
"inputType":"TEXT",
"type":"INPUT_WIDGET_V2",
"hideCard":false,
"displayName":"Input",
"key":"ccm4k3q41x",
"iconSVG":"/static/media/icon.9f505595.svg",
"widgetId":"u0sc4bf6lg",
"renderMode":"CANVAS",
"isLoading":false,
"parentColumnSpace":7.0859375,
"parentRowSpace":10,
"leftColumn":38,
"rightColumn":58,
"topRow":2,
"bottomRow":6,
"parentId":"31i770948x",
"logBlackList":{
"isVisible":true,
"label":true,
"widgetName":true,
"version":true,
"defaultText":true,
"iconAlign":true,
"autoFocus":true,
"labelStyle":true,
"resetOnSubmit":true,
"isRequired":true,
"isDisabled":true,
"animateLoading":true,
"inputType":true,
"type":true,
"hideCard":true,
"displayName":true,
"key":true,
"iconSVG":true,
"isCanvas":true,
"minHeight":true,
"widgetId":true,
"renderMode":true,
"isLoading":true,
"parentColumnSpace":true,
"parentRowSpace":true,
"leftColumn":true,
"rightColumn":true,
"topRow":true,
"bottomRow":true,
"parentId":true
}
}
},
"widgetName":"List1",
"listData":[
{
"id":"001",
"name":"Blue",
"img":"https://assets.appsmith.com/widgets/default.png"
},
{
"id":"002",
"name":"Green",
"img":"https://assets.appsmith.com/widgets/default.png"
},
{
"id":"003",
"name":"Red",
"img":"https://assets.appsmith.com/widgets/default.png"
}
],
"isCanvas":true,
"displayName":"List",
"iconSVG":"/static/media/icon.9925ee17.svg",
"topRow":3,
"bottomRow":20,
"parentRowSpace":10,
"type":"LIST_WIDGET",
"hideCard":false,
"gridGap":0,
"animateLoading":true,
"parentColumnSpace":20.0625,
"dynamicTriggerPathList":[
],
"leftColumn":3,
"dynamicBindingPathList":[
],
"gridType":"vertical",
"enhancements":true,
"children":[
{
"widgetName":"Canvas1",
"displayName":"Canvas",
"topRow":0,
"bottomRow":400,
"parentRowSpace":1,
"type":"CANVAS_WIDGET",
"canExtend":false,
"hideCard":true,
"dropDisabled":true,
"openParentPropertyPane":true,
"minHeight":400,
"noPad":true,
"parentColumnSpace":1,
"leftColumn":0,
"children":[
{
"boxShadow":"NONE",
"widgetName":"Container1",
"borderColor":"transparent",
"disallowCopy":true,
"isCanvas":true,
"displayName":"Container",
"iconSVG":"/static/media/icon.1977dca3.svg",
"topRow":0,
"bottomRow":12,
"dragDisabled":true,
"type":"CONTAINER_WIDGET",
"hideCard":false,
"openParentPropertyPane":true,
"isDeletable":false,
"animateLoading":true,
"leftColumn":0,
"children":[
{
"widgetName":"Canvas2",
"detachFromLayout":true,
"displayName":"Canvas",
"widgetId":"31i770948x",
"containerStyle":"none",
"topRow":0,
"bottomRow":80,
"parentRowSpace":1,
"isVisible":true,
"type":"CANVAS_WIDGET",
"canExtend":false,
"version":1,
"hideCard":true,
"parentId":"wop20uagxv",
"renderMode":"CANVAS",
"isLoading":false,
"parentColumnSpace":1,
"leftColumn":0,
"children":[
{
"widgetName":"Input1",
"displayName":"Input",
"iconSVG":"/static/media/icon.9f505595.svg",
"topRow":2,
"bottomRow":6,
"parentRowSpace":10,
"autoFocus":false,
"type":"INPUT_WIDGET_V2",
"hideCard":false,
"animateLoading":true,
"parentColumnSpace":7.0859375,
"resetOnSubmit":true,
"leftColumn":4,
"labelStyle":"",
"inputType":"TEXT",
"isDisabled":false,
"key":"ccm4k3q41x",
"isRequired":false,
"rightColumn":60,
"widgetId":"u0sc4bf6lg",
"logBlackList":{
"isVisible":true,
"label":true,
"widgetName":true,
"version":true,
"defaultText":true,
"iconAlign":true,
"autoFocus":true,
"labelStyle":true,
"resetOnSubmit":true,
"isRequired":true,
"isDisabled":true,
"animateLoading":true,
"inputType":true,
"type":true,
"hideCard":true,
"displayName":true,
"key":true,
"iconSVG":true,
"isCanvas":true,
"minHeight":true,
"widgetId":true,
"renderMode":true,
"isLoading":true,
"parentColumnSpace":true,
"parentRowSpace":true,
"leftColumn":true,
"rightColumn":true,
"topRow":true,
"bottomRow":true,
"parentId":true
},
"isVisible":true,
"label":"",
"version":2,
"parentId":"31i770948x",
"renderMode":"CANVAS",
"isLoading":false,
"iconAlign":"left",
"defaultText":""
}
],
"key":"v48l5zt2p7"
}
],
"borderWidth":"0",
"key":"w7zaemmrn8",
"disablePropertyPane":true,
"backgroundColor":"white",
"rightColumn":64,
"widgetId":"wop20uagxv",
"containerStyle":"card",
"isVisible":true,
"version":1,
"parentId":"nzmybzveu8",
"renderMode":"CANVAS",
"isLoading":false,
"borderRadius":"0"
}
],
"key":"v48l5zt2p7",
"rightColumn":481.5,
"detachFromLayout":true,
"widgetId":"nzmybzveu8",
"containerStyle":"none",
"isVisible":true,
"version":1,
"parentId":"78m8pd80bu",
"renderMode":"CANVAS",
"isLoading":false
}
],
"privateWidgets":{
"Input1":true
},
"key":"ns0yjeaevj",
"backgroundColor":"transparent",
"rightColumn":39,
"itemBackgroundColor":"#FFFFFF",
"widgetId":"78m8pd80bu",
"isVisible":true,
"parentId":"0",
"renderMode":"CANVAS",
"isLoading":false
},
{
"widgetName":"Text3",
"displayName":"Text",
"iconSVG":"/static/media/icon.97c59b52.svg",
"topRow":6,
"bottomRow":15,
"parentRowSpace":10,
"type":"TEXT_WIDGET",
"hideCard":false,
"animateLoading":true,
"parentColumnSpace":20.0625,
"dynamicTriggerPathList":[
],
"leftColumn":43,
"dynamicBindingPathList":[
{
"key":"text"
}
],
"shouldTruncate":false,
"truncateButtonColor":"#FFC13D",
"text":"{{List1.items[0].Input1.text}}:{{List1.items[0].Input1.isVisible}}:{{List1.items[0].Input1.isDisabled}}",
"key":"pl30s9buf7",
"rightColumn":59,
"textAlign":"LEFT",
"widgetId":"3ipmljkgo1",
"isVisible":true,
"fontStyle":"BOLD",
"textColor":"#231F20",
"shouldScroll":false,
"version":1,
"parentId":"0",
"renderMode":"CANVAS",
"isLoading":false,
"fontSize":"PARAGRAPH"
}
]
}
}

View File

@ -0,0 +1,87 @@
{
"dsl": {
"widgetName": "MainContainer",
"backgroundColor": "none",
"rightColumn": 1056,
"snapColumns": 64,
"detachFromLayout": true,
"widgetId": "0",
"topRow": 0,
"bottomRow": 800,
"containerStyle": "none",
"snapRows": 125,
"parentRowSpace": 1,
"type": "CANVAS_WIDGET",
"canExtend": true,
"version": 52,
"minHeight": 780,
"parentColumnSpace": 1,
"dynamicBindingPathList": [],
"leftColumn": 0,
"children": [
{
"isVisible": true,
"animateLoading": true,
"text": "Submit",
"buttonColor": "#03B365",
"buttonVariant": "PRIMARY",
"placement": "CENTER",
"widgetName": "Button1",
"isDisabled": false,
"isDefaultClickDisabled": true,
"recaptchaType": "V3",
"version": 1,
"type": "BUTTON_WIDGET",
"hideCard": false,
"displayName": "Button",
"key": "b3xxd5tj9s",
"iconSVG": "/static/media/icon.cca02633.svg",
"widgetId": "56yla62kkw",
"renderMode": "CANVAS",
"isLoading": false,
"parentColumnSpace": 16.3125,
"parentRowSpace": 10,
"leftColumn": 19,
"rightColumn": 35,
"topRow": 10,
"bottomRow": 14,
"parentId": "0"
},
{
"isVisible": true,
"text": "{{Button1.recaptchaToken}}",
"fontSize": "PARAGRAPH",
"fontStyle": "BOLD",
"textAlign": "LEFT",
"textColor": "#231F20",
"truncateButtonColor": "#FFC13D",
"widgetName": "Text1",
"shouldScroll": false,
"shouldTruncate": false,
"version": 1,
"animateLoading": true,
"type": "TEXT_WIDGET",
"hideCard": false,
"displayName": "Text",
"key": "6cg9oqz0if",
"iconSVG": "/static/media/icon.97c59b52.svg",
"widgetId": "iymasdikx5",
"renderMode": "CANVAS",
"isLoading": false,
"parentColumnSpace": 16.3125,
"parentRowSpace": 10,
"leftColumn": 19,
"rightColumn": 35,
"topRow": 26,
"bottomRow": 30,
"parentId": "0",
"dynamicBindingPathList": [
{
"key": "text"
}
],
"dynamicTriggerPathList": []
}
]
}
}

View File

@ -44,5 +44,6 @@
"mockDatabaseName": "fakeapi",
"mockDatabaseUsername": "fakeapi",
"mockDatabasePassword": "LimitedAccess123#",
"readonly":"readonly"
"readonly":"readonly",
"authenticatedApiUrl": "https://fakeapi.com"
}

View File

@ -1,19 +1,15 @@
{
"clientSchemaVersion": 1,
"serverSchemaVersion": 1,
"exportedApplication": {
"userPermissions": [
"canComment:applications",
"manage:applications",
"export:applications",
"read:applications",
"publish:applications",
"makePublic:applications"
],
"name": "2eacca10",
"name": "d85f5e74",
"isPublic": false,
"appIsExample": false,
"unreadCommentThreads": 0,
"color": "#F1DEFF",
"icon": "cat",
"color": "#D9E7FF",
"icon": "cloud",
"slug": "d85f5e74",
"evaluationVersion": 2,
"new": true
},
"datasourceList": [],
@ -23,12 +19,13 @@
"read:pages",
"manage:pages"
],
"gitSyncId": "61602709ae8b022ed53c23c7_2021-10-08T11:10:01.203693Z",
"gitSyncId": "6200c8457d76221d03e360e0_6200c8457d76221d03e360e2",
"unpublishedPage": {
"name": "Page1",
"slug": "page1",
"layouts": [
{
"id": "61602709ae8b022ed53c23c8",
"id": "Page1",
"userPermissions": [],
"dsl": {
"widgetName": "MainContainer",
@ -147,7 +144,7 @@
{
"widgetName": "Chart1",
"rightColumn": 8,
"allowHorizontalScroll": false,
"allowScroll": false,
"widgetId": "hwi9cwhg43",
"topRow": 1,
"bottomRow": 9,
@ -270,9 +267,10 @@
},
"publishedPage": {
"name": "Page1",
"slug": "page1",
"layouts": [
{
"id": "61602709ae8b022ed53c23c8",
"id": "Page1",
"userPermissions": [],
"dsl": {
"widgetName": "MainContainer",
@ -308,6 +306,16 @@
"actionList": [],
"actionCollectionList": [],
"decryptedFields": {},
"editModeTheme": {
"name": "Classic",
"new": true,
"isSystemTheme": true
},
"publishedTheme": {
"name": "Classic",
"new": true,
"isSystemTheme": true
},
"publishedLayoutmongoEscapedWidgets": {},
"unpublishedLayoutmongoEscapedWidgets": {}
}

View File

@ -1,313 +1,675 @@
{
"exportedApplication": {
"clientSchemaVersion": 1,
"serverSchemaVersion": 2,
"exportedApplication": {
"name": "app2896",
"isPublic": false,
"appIsExample": false,
"unreadCommentThreads": 0,
"color": "#F4FFDE",
"icon": "single-person",
"slug": "app2896",
"evaluationVersion": 2,
"applicationVersion": 2,
"new": true
},
"datasourceList": [
{
"userPermissions": [
"canComment:applications",
"manage:applications",
"export:applications",
"read:applications",
"publish:applications",
"makePublic:applications"
"execute:datasources",
"manage:datasources",
"read:datasources"
],
"name": "2eacca10",
"isPublic": false,
"appIsExample": false,
"unreadCommentThreads": 0,
"color": "#F1DEFF",
"icon": "cat",
"gitSyncId": "61c2d94747cda83965fe72b5_61c5822385c0bd4ccf7d171c",
"name": "mockdata",
"pluginId": "postgres-plugin",
"invalids": [
"Missing authentication details."
],
"messages": [],
"isConfigured": false,
"isValid": false,
"new": true
},
"datasourceList": [],
"pageList": [
{
"userPermissions": [
"read:pages",
"manage:pages"
],
"gitSyncId": "61602709ae8b022ed53c23c7_2021-10-08T11:10:01.203693Z",
"unpublishedPage": {
"name": "Page1",
"layouts": [
{
"id": "61602709ae8b022ed53c23c8",
"userPermissions": [],
"dsl": {
"widgetName": "MainContainer",
"backgroundColor": "none",
"rightColumn": 1224,
"snapColumns": 16,
"detachFromLayout": true,
"widgetId": "0",
"topRow": 0,
"bottomRow": 1292,
"containerStyle": "none",
"snapRows": 33,
"parentRowSpace": 1,
"type": "CANVAS_WIDGET",
"canExtend": true,
"minHeight": 1292,
"parentColumnSpace": 1,
"dynamicBindingPathList": [],
"leftColumn": 0,
"children": [
{
"backgroundColor": "#FFFFFF",
"widgetName": "Container1",
"rightColumn": 8,
"orientation": "VERTICAL",
"snapColumns": 16,
"widgetId": "mxbaasg65u",
"containerStyle": "card",
"topRow": 0,
"bottomRow": 9,
"parentRowSpace": 38,
"isVisible": true,
"type": "CONTAINER_WIDGET",
"isLoading": false,
"parentColumnSpace": 75.25,
"dynamicBindingPathList": [],
"leftColumn": 0,
"children": [
{
"backgroundColor": "transparent",
"widgetName": "59gdivzv7s",
"rightColumn": 602,
"orientation": "VERTICAL",
"snapColumns": 16,
"detachFromLayout": true,
"widgetId": "bxekwxgc1i",
"containerStyle": "none",
"topRow": 0,
"bottomRow": 342,
"parentRowSpace": 1,
"isVisible": true,
"type": "CANVAS_WIDGET",
"canExtend": false,
"isLoading": false,
"parentColumnSpace": 1,
"leftColumn": 0,
"children": [
{
"image": "",
"widgetName": "Image1",
"rightColumn": 10,
"widgetId": "glksllew0g",
"topRow": 2,
"bottomRow": 5,
"parentRowSpace": 38,
"isVisible": true,
"type": "IMAGE_WIDGET",
"parentId": "bxekwxgc1i",
"isLoading": false,
"parentColumnSpace": 34.6875,
"imageShape": "RECTANGLE",
"leftColumn": 6,
"defaultImage": "https://res.cloudinary.com/drako999/image/upload/v1589196259/default.png"
}
]
}
]
}
],
"pageList": [
{
"userPermissions": [
"read:pages",
"manage:pages"
],
"gitSyncId": "61c580d685c0bd4ccf7d1716_61c580d685c0bd4ccf7d1718",
"unpublishedPage": {
"name": "Page1",
"slug": "page1",
"layouts": [
{
"id": "Page1",
"userPermissions": [],
"dsl": {
"widgetName": "MainContainer",
"backgroundColor": "none",
"rightColumn": 816,
"snapColumns": 64,
"detachFromLayout": true,
"widgetId": "0",
"topRow": 0,
"bottomRow": 590,
"containerStyle": "none",
"snapRows": 125,
"parentRowSpace": 1,
"type": "CANVAS_WIDGET",
"canExtend": true,
"version": 52,
"minHeight": 600,
"parentColumnSpace": 1,
"dynamicBindingPathList": [],
"leftColumn": 0,
"children": [
{
"widgetName": "Table1",
"defaultPageSize": 0,
"columnOrder": [
"schema_name"
],
"isVisibleDownload": true,
"dynamicPropertyPathList": [],
"displayName": "Table",
"iconSVG": "/static/media/icon.db8a9cbd.svg",
"topRow": 14,
"bottomRow": 38,
"isSortable": true,
"parentRowSpace": 10,
"type": "TABLE_WIDGET",
"defaultSelectedRow": "0",
"hideCard": false,
"animateLoading": true,
"parentColumnSpace": 12.5625,
"dynamicTriggerPathList": [],
"dynamicBindingPathList": [
{
"key": "tableData"
},
{
"key": "primaryColumns.schema_name.computedValue"
}
],
"leftColumn": 4,
"primaryColumns": {
"schema_name": {
"index": 0,
"width": 150,
"id": "schema_name",
"horizontalAlignment": "LEFT",
"verticalAlignment": "CENTER",
"columnType": "text",
"textSize": "PARAGRAPH",
"enableFilter": true,
"enableSort": true,
"isVisible": true,
"isDisabled": false,
"isCellVisible": true,
"isDerived": false,
"label": "schema_name",
"computedValue": "{{Table1.sanitizedTableData.map((currentRow) => ( currentRow.schema_name))}}"
}
},
{
"backgroundColor": "#FFFFFF",
"widgetName": "Container3",
"rightColumn": 16,
"orientation": "VERTICAL",
"snapColumns": 16,
"widgetId": "i331vll2mg",
"containerStyle": "card",
"topRow": 9,
"bottomRow": 23,
"parentRowSpace": 38,
"isVisible": true,
"type": "CONTAINER_WIDGET",
"isLoading": false,
"parentColumnSpace": 75.25,
"dynamicBindingPathList": [],
"leftColumn": 0,
"children": [
{
"backgroundColor": "transparent",
"widgetName": "rhfg2vf1n5",
"rightColumn": 1204,
"orientation": "VERTICAL",
"snapColumns": 16,
"detachFromLayout": true,
"widgetId": "rglduihhzk",
"containerStyle": "none",
"topRow": 0,
"bottomRow": 532,
"parentRowSpace": 1,
"isVisible": true,
"type": "CANVAS_WIDGET",
"canExtend": false,
"isLoading": false,
"parentColumnSpace": 1,
"leftColumn": 0,
"children": [
{
"widgetName": "Chart1",
"rightColumn": 8,
"allowHorizontalScroll": false,
"widgetId": "hwi9cwhg43",
"topRow": 1,
"bottomRow": 9,
"parentRowSpace": 38,
"isVisible": true,
"type": "CHART_WIDGET",
"parentId": "rglduihhzk",
"isLoading": false,
"chartData": [
{
"seriesName": "Sales",
"data": [
{
"x": "Mon",
"y": 10000
},
{
"x": "Tue",
"y": 12000
},
{
"x": "Wed",
"y": 32000
},
{
"x": "Thu",
"y": 28000
},
{
"x": "Fri",
"y": 14000
},
{
"x": "Sat",
"y": 19000
},
{
"x": "Sun",
"y": 36000
}
]
}
],
"yAxisName": "Total Order Revenue $",
"parentColumnSpace": 71.75,
"chartName": "Sales on working days",
"leftColumn": 2,
"dynamicBindingPathList": [],
"xAxisName": "Last Week",
"chartType": "LINE_CHART"
}
]
}
]
},
{
"backgroundColor": "#FFFFFF",
"widgetName": "Container4",
"rightColumn": 16,
"orientation": "VERTICAL",
"snapColumns": 16,
"widgetId": "qznzsquf70",
"containerStyle": "card",
"topRow": 0,
"bottomRow": 9,
"parentRowSpace": 38,
"isVisible": true,
"type": "CONTAINER_WIDGET",
"isLoading": false,
"parentColumnSpace": 75.25,
"dynamicBindingPathList": [],
"leftColumn": 8,
"children": [
{
"backgroundColor": "transparent",
"widgetName": "3bn6uv0vy4",
"rightColumn": 602,
"orientation": "VERTICAL",
"snapColumns": 16,
"detachFromLayout": true,
"widgetId": "7vm5mdu8ey",
"containerStyle": "none",
"topRow": 0,
"bottomRow": 342,
"parentRowSpace": 1,
"isVisible": true,
"type": "CANVAS_WIDGET",
"canExtend": false,
"isLoading": false,
"parentColumnSpace": 1,
"leftColumn": 0,
"children": [
{
"widgetName": "Text1",
"rightColumn": 7,
"textAlign": "LEFT",
"widgetId": "9xcfqahpw2",
"topRow": 3,
"bottomRow": 4,
"parentRowSpace": 38,
"isVisible": true,
"type": "TEXT_WIDGET",
"parentId": "bxekwxgc1i",
"isLoading": false,
"parentColumnSpace": 34.6875,
"leftColumn": 3,
"text": "Label"
}
]
}
]
"delimiter": ",",
"key": "5ejs55im17",
"derivedColumns": {},
"rightColumn": 25,
"textSize": "PARAGRAPH",
"widgetId": "uyyp0qxfdq",
"isVisibleFilters": true,
"tableData": "{{get_schema.data}}",
"isVisible": true,
"label": "Data",
"searchKey": "",
"enableClientSideSearch": true,
"version": 3,
"totalRecordsCount": 0,
"parentId": "0",
"renderMode": "CANVAS",
"isLoading": false,
"horizontalAlignment": "LEFT",
"isVisibleSearch": true,
"isVisiblePagination": true,
"verticalAlignment": "CENTER",
"columnSizeMap": {
"task": 245,
"step": 62,
"status": 75
}
]
},
"layoutOnLoadActions": [],
"new": false
}
],
"userPermissions": []
},
{
"widgetName": "Table2",
"defaultPageSize": 0,
"columnOrder": [
"id",
"title",
"due",
"assignee"
],
"isVisibleDownload": true,
"dynamicPropertyPathList": [],
"displayName": "Table",
"iconSVG": "/static/media/icon.db8a9cbd.svg",
"topRow": 14,
"bottomRow": 38,
"isSortable": true,
"parentRowSpace": 10,
"type": "TABLE_WIDGET",
"defaultSelectedRow": "0",
"hideCard": false,
"animateLoading": true,
"parentColumnSpace": 12.5625,
"dynamicTriggerPathList": [],
"dynamicBindingPathList": [
{
"key": "tableData"
},
{
"key": "primaryColumns.due.computedValue"
},
{
"key": "primaryColumns.assignee.computedValue"
},
{
"key": "primaryColumns.title.computedValue"
},
{
"key": "primaryColumns.id.computedValue"
}
],
"leftColumn": 30,
"primaryColumns": {
"due": {
"index": 0,
"width": 150,
"id": "due",
"horizontalAlignment": "LEFT",
"verticalAlignment": "CENTER",
"columnType": "text",
"textSize": "PARAGRAPH",
"enableFilter": true,
"enableSort": true,
"isVisible": true,
"isDisabled": false,
"isCellVisible": true,
"isDerived": false,
"label": "due",
"computedValue": "{{Table2.sanitizedTableData.map((currentRow) => ( currentRow.due))}}"
},
"assignee": {
"index": 1,
"width": 150,
"id": "assignee",
"horizontalAlignment": "LEFT",
"verticalAlignment": "CENTER",
"columnType": "text",
"textSize": "PARAGRAPH",
"enableFilter": true,
"enableSort": true,
"isVisible": true,
"isDisabled": false,
"isCellVisible": true,
"isDerived": false,
"label": "assignee",
"computedValue": "{{Table2.sanitizedTableData.map((currentRow) => ( currentRow.assignee))}}"
},
"title": {
"index": 2,
"width": 150,
"id": "title",
"horizontalAlignment": "LEFT",
"verticalAlignment": "CENTER",
"columnType": "text",
"textSize": "PARAGRAPH",
"enableFilter": true,
"enableSort": true,
"isVisible": true,
"isDisabled": false,
"isCellVisible": true,
"isDerived": false,
"label": "title",
"computedValue": "{{Table2.sanitizedTableData.map((currentRow) => ( currentRow.title))}}"
},
"id": {
"index": 4,
"width": 150,
"id": "id",
"horizontalAlignment": "LEFT",
"verticalAlignment": "CENTER",
"columnType": "text",
"textSize": "PARAGRAPH",
"enableFilter": true,
"enableSort": true,
"isVisible": true,
"isDisabled": false,
"isCellVisible": true,
"isDerived": false,
"label": "id",
"computedValue": "{{Table2.sanitizedTableData.map((currentRow) => ( currentRow.id))}}"
}
},
"delimiter": ",",
"key": "5ejs55im17",
"derivedColumns": {},
"rightColumn": 61,
"textSize": "PARAGRAPH",
"widgetId": "r1m4lkt7at",
"isVisibleFilters": true,
"tableData": "{{mockApi.data.headers.info}}",
"isVisible": true,
"label": "Data",
"searchKey": "",
"enableClientSideSearch": true,
"version": 3,
"totalRecordsCount": 0,
"parentId": "0",
"renderMode": "CANVAS",
"isLoading": false,
"horizontalAlignment": "LEFT",
"isVisibleSearch": true,
"isVisiblePagination": true,
"verticalAlignment": "CENTER",
"columnSizeMap": {
"task": 245,
"step": 62,
"status": 75,
"id": 60
}
},
{
"widgetName": "Input1",
"displayName": "Input",
"iconSVG": "/static/media/icon.9f505595.svg",
"topRow": 43,
"bottomRow": 47,
"parentRowSpace": 10,
"autoFocus": false,
"type": "INPUT_WIDGET_V2",
"hideCard": false,
"animateLoading": true,
"parentColumnSpace": 12.5625,
"dynamicTriggerPathList": [],
"resetOnSubmit": true,
"leftColumn": 18,
"dynamicBindingPathList": [
{
"key": "defaultText"
}
],
"labelStyle": "",
"inputType": "TEXT",
"isDisabled": false,
"key": "t02w4ix9o5",
"isRequired": false,
"rightColumn": 38,
"widgetId": "9timcor5m5",
"isVisible": true,
"label": "",
"allowCurrencyChange": false,
"version": 1,
"parentId": "0",
"renderMode": "CANVAS",
"isLoading": false,
"iconAlign": "left",
"defaultText": "{{JSObject1.myVar1}}"
}
]
},
"layoutOnLoadActions": [
[
{
"id": "Page1_get_schema",
"name": "get_schema",
"pluginType": "DB",
"jsonPathKeys": [],
"timeoutInMillisecond": 10000
}
],
[
{
"id": "Page1_mockApi",
"name": "mockApi",
"pluginType": "API",
"jsonPathKeys": [],
"timeoutInMillisecond": 10000
}
]
],
"new": false
}
],
"userPermissions": []
},
"publishedPage": {
"name": "Page1",
"slug": "page1",
"layouts": [
{
"id": "Page1",
"userPermissions": [],
"dsl": {
"widgetName": "MainContainer",
"backgroundColor": "none",
"rightColumn": 1224,
"snapColumns": 16,
"detachFromLayout": true,
"widgetId": "0",
"topRow": 0,
"bottomRow": 1254,
"containerStyle": "none",
"snapRows": 33,
"parentRowSpace": 1,
"type": "CANVAS_WIDGET",
"canExtend": true,
"version": 4,
"minHeight": 1292,
"parentColumnSpace": 1,
"dynamicBindingPathList": [],
"leftColumn": 0,
"children": []
},
"new": false
}
],
"userPermissions": []
},
"new": true
}
],
"publishedDefaultPageName": "Page1",
"unpublishedDefaultPageName": "Page1",
"actionList": [
{
"id": "Page1_mockApi",
"userPermissions": [
"read:actions",
"execute:actions",
"manage:actions"
],
"gitSyncId": "61c580d685c0bd4ccf7d1716_61c580e385c0bd4ccf7d171a",
"pluginType": "API",
"pluginId": "restapi-plugin",
"unpublishedAction": {
"name": "mockApi",
"datasource": {
"userPermissions": [],
"name": "DEFAULT_REST_DATASOURCE",
"pluginId": "restapi-plugin",
"datasourceConfiguration": {
"url": "https://mock-api.appsmith.com"
},
"invalids": [],
"messages": [],
"isValid": true,
"new": true
},
"publishedPage": {
"name": "Page1",
"layouts": [
"pageId": "Page1",
"actionConfiguration": {
"timeoutInMillisecond": 10000,
"paginationType": "NONE",
"path": "/echo/get",
"headers": [
{
"id": "61602709ae8b022ed53c23c8",
"userPermissions": [],
"dsl": {
"widgetName": "MainContainer",
"backgroundColor": "none",
"rightColumn": 1224,
"snapColumns": 16,
"detachFromLayout": true,
"widgetId": "0",
"topRow": 0,
"bottomRow": 1254,
"containerStyle": "none",
"snapRows": 33,
"parentRowSpace": 1,
"type": "CANVAS_WIDGET",
"canExtend": true,
"version": 4,
"minHeight": 1292,
"parentColumnSpace": 1,
"dynamicBindingPathList": [],
"leftColumn": 0,
"children": []
},
"new": false
"key": "info",
"value": "[{\"due\":\"2021-11-23\",\"assignee\":\"Dan.Wyman@hotmail.com\",\"title\":\"Recusan\",\"id\":\"1\"},{\"due\":\"2021-11-23\",\"assignee\":\"Dashawn_Maggio30@gmail.com\",\"title\":\"Dignissimos eaque\",\"id\":\"2\"},{\"due\":\"2021-11-24\",\"assignee\":\"Curt50@gmail.com\",\"title\":\"Voluptas explicabo\",\"id\":\"3\"},{\"due\":\"2021-11-23\",\"assignee\":\"Shanna63@hotmail.com\",\"title\":\"Aut omnis.\",\"id\":\"4\"}]"
}
],
"userPermissions": []
"encodeParamsToggle": true,
"queryParameters": [],
"body": "",
"httpMethod": "GET",
"pluginSpecifiedTemplates": [
{
"value": true
}
]
},
"new": true
}
],
"publishedDefaultPageName": "Page1",
"unpublishedDefaultPageName": "Page1",
"actionList": [],
"actionCollectionList": [],
"decryptedFields": {},
"publishedLayoutmongoEscapedWidgets": {},
"unpublishedLayoutmongoEscapedWidgets": {}
}
"executeOnLoad": true,
"dynamicBindingPathList": [],
"isValid": true,
"invalids": [],
"messages": [],
"jsonPathKeys": [],
"confirmBeforeExecute": false,
"userPermissions": [],
"validName": "mockApi"
},
"publishedAction": {
"datasource": {
"userPermissions": [],
"messages": [],
"isValid": true,
"new": true
},
"messages": [],
"confirmBeforeExecute": false,
"userPermissions": []
},
"new": false
},
{
"id": "Page1_myFun1",
"userPermissions": [
"read:actions",
"execute:actions",
"manage:actions"
],
"gitSyncId": "61c580d685c0bd4ccf7d1716_61c58ced85c0bd4ccf7d1722",
"pluginType": "JS",
"pluginId": "js-plugin",
"unpublishedAction": {
"name": "myFun1",
"fullyQualifiedName": "JSObject1.myFun1",
"datasource": {
"userPermissions": [],
"name": "UNUSED_DATASOURCE",
"pluginId": "js-plugin",
"messages": [],
"isValid": true,
"new": true
},
"pageId": "Page1",
"collectionId": "Page1_JSObject1",
"actionConfiguration": {
"timeoutInMillisecond": 10000,
"paginationType": "NONE",
"encodeParamsToggle": true,
"body": "() => {\n\t\t//write code here\n\t\treturn JSObject1.myVar1;\n\t}",
"jsArguments": [],
"isAsync": false
},
"executeOnLoad": false,
"dynamicBindingPathList": [
{
"key": "body"
}
],
"isValid": true,
"invalids": [],
"messages": [],
"jsonPathKeys": [
"() => {\n\t\t//write code here\n\t\treturn JSObject1.myVar1;\n\t}"
],
"confirmBeforeExecute": false,
"userPermissions": [],
"validName": "JSObject1.myFun1"
},
"publishedAction": {
"datasource": {
"userPermissions": [],
"messages": [],
"isValid": true,
"new": true
},
"messages": [],
"confirmBeforeExecute": false,
"userPermissions": []
},
"new": false
},
{
"id": "Page1_get_schema",
"userPermissions": [
"read:actions",
"execute:actions",
"manage:actions"
],
"gitSyncId": "61c580d685c0bd4ccf7d1716_61c5832685c0bd4ccf7d171e",
"pluginType": "DB",
"pluginId": "postgres-plugin",
"unpublishedAction": {
"name": "get_schema",
"datasource": {
"id": "mockdata",
"userPermissions": [],
"pluginId": "postgres-plugin",
"messages": [],
"isValid": true,
"new": false
},
"pageId": "Page1",
"actionConfiguration": {
"timeoutInMillisecond": 10000,
"paginationType": "NONE",
"encodeParamsToggle": true,
"body": "SELECT schema_name FROM information_schema.schemata;",
"pluginSpecifiedTemplates": [
{
"value": true
}
]
},
"executeOnLoad": true,
"dynamicBindingPathList": [],
"isValid": true,
"invalids": [],
"messages": [],
"jsonPathKeys": [],
"confirmBeforeExecute": false,
"userPermissions": [],
"validName": "get_schema"
},
"publishedAction": {
"datasource": {
"userPermissions": [],
"messages": [],
"isValid": true,
"new": true
},
"messages": [],
"confirmBeforeExecute": false,
"userPermissions": []
},
"new": false
},
{
"id": "Page1_myFun2",
"userPermissions": [
"read:actions",
"execute:actions",
"manage:actions"
],
"gitSyncId": "61c580d685c0bd4ccf7d1716_61c58ced85c0bd4ccf7d1724",
"pluginType": "JS",
"pluginId": "js-plugin",
"unpublishedAction": {
"name": "myFun2",
"fullyQualifiedName": "JSObject1.myFun2",
"datasource": {
"userPermissions": [],
"name": "UNUSED_DATASOURCE",
"pluginId": "js-plugin",
"messages": [],
"isValid": true,
"new": true
},
"pageId": "Page1",
"collectionId": "Page1_JSObject1",
"actionConfiguration": {
"timeoutInMillisecond": 10000,
"paginationType": "NONE",
"encodeParamsToggle": true,
"body": "() => {\n\t\t//write code here\n\t}",
"jsArguments": [],
"isAsync": false
},
"executeOnLoad": false,
"dynamicBindingPathList": [
{
"key": "body"
}
],
"isValid": true,
"invalids": [],
"messages": [],
"jsonPathKeys": [
"() => {\n\t\t//write code here\n\t}"
],
"confirmBeforeExecute": false,
"userPermissions": [],
"validName": "JSObject1.myFun2"
},
"publishedAction": {
"datasource": {
"userPermissions": [],
"messages": [],
"isValid": true,
"new": true
},
"messages": [],
"confirmBeforeExecute": false,
"userPermissions": []
},
"new": false
}
],
"actionCollectionList": [
{
"id": "Page1_JSObject1",
"userPermissions": [
"read:actions",
"execute:actions",
"manage:actions"
],
"gitSyncId": "61c580d685c0bd4ccf7d1716_61c58ced85c0bd4ccf7d1726",
"unpublishedCollection": {
"name": "JSObject1",
"pageId": "Page1",
"pluginId": "js-plugin",
"pluginType": "JS",
"actionIds": [],
"archivedActionIds": [],
"actions": [],
"archivedActions": [],
"body": "export default {\n\tmyVar1: \"Submit\",\n\tmyVar2: {},\n\tmyFun1: () => {\n\t\t//write code here\n\t\treturn this.myVar1;\n\t},\n\tmyFun2: () => {\n\t\t//write code here\n\t}\n}",
"variables": [
{
"name": "myVar1",
"value": "Submit"
},
{
"name": "myVar2",
"value": {}
}
]
},
"new": false
}
],
"editModeTheme": {
"name": "Classic",
"new": true,
"isSystemTheme": true
},
"publishedTheme": {
"name": "Classic",
"new": true,
"isSystemTheme": true
},
"publishedLayoutmongoEscapedWidgets": {},
"unpublishedLayoutmongoEscapedWidgets": {}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,393 @@
{
"dsl": {
"widgetName": "MainContainer",
"backgroundColor": "none",
"rightColumn": 1168,
"snapColumns": 64,
"detachFromLayout": true,
"widgetId": "0",
"topRow": 0,
"bottomRow": 680,
"containerStyle": "none",
"snapRows": 125,
"parentRowSpace": 1,
"type": "CANVAS_WIDGET",
"canExtend": true,
"version": 47,
"minHeight": 870,
"parentColumnSpace": 1,
"dynamicTriggerPathList": [],
"dynamicBindingPathList": [],
"leftColumn": 0,
"children": [
{
"widgetName": "Text1",
"displayName": "Text",
"iconSVG": "/static/media/icon.97c59b52.svg",
"topRow": 54,
"bottomRow": 58,
"parentRowSpace": 10,
"type": "TEXT_WIDGET",
"hideCard": false,
"animateLoading": true,
"parentColumnSpace": 18.0625,
"leftColumn": 22,
"text": "Label",
"key": "zgsygilz5a",
"rightColumn": 38,
"textAlign": "LEFT",
"widgetId": "ums2hvawa0",
"isVisible": true,
"fontStyle": "BOLD",
"textColor": "#231F20",
"version": 1,
"parentId": "0",
"renderMode": "CANVAS",
"isLoading": false,
"fontSize": "PARAGRAPH"
},
{
"schema": {
"__root_schema__": {
"children": {
"name": {
"children": {},
"dataType": "string",
"defaultValue": "{{((sourceData, formData, fieldState) => (sourceData.name))(JSONForm1.sourceData, JSONForm1.formData, JSONForm1.fieldState)}}",
"fieldType": "Text Input",
"sourceData": "John",
"isCustomField": false,
"accessor": "name",
"identifier": "name",
"position": 0,
"originalIdentifier": "name",
"isDisabled": false,
"isRequired": false,
"isSpellCheck": false,
"isVisible": true,
"label": "Name"
},
"age": {
"children": {},
"dataType": "number",
"defaultValue": "{{((sourceData, formData, fieldState) => (sourceData.age))(JSONForm1.sourceData, JSONForm1.formData, JSONForm1.fieldState)}}",
"fieldType": "Number Input",
"sourceData": 30,
"isCustomField": false,
"accessor": "age",
"identifier": "age",
"position": 1,
"originalIdentifier": "age",
"isDisabled": false,
"isRequired": false,
"isSpellCheck": false,
"isVisible": true,
"label": "Age"
},
"dob": {
"children": {},
"dataType": "string",
"defaultValue": "{{((sourceData, formData, fieldState) => (moment(sourceData.dob, \"MM/DD/YYYY\").format(\"YYYY-MM-DDTHH:mm:ss.sssZ\")))(JSONForm1.sourceData, JSONForm1.formData, JSONForm1.fieldState)}}",
"fieldType": "Datepicker",
"sourceData": "10/12/1992",
"isCustomField": false,
"accessor": "dob",
"identifier": "dob",
"position": 2,
"originalIdentifier": "dob",
"closeOnSelection": false,
"dateFormat": "MM/DD/YYYY",
"isDisabled": false,
"isRequired": false,
"label": "Dob",
"maxDate": "2121-12-31T18:29:00.000Z",
"minDate": "1920-12-31T18:30:00.000Z",
"convertToISO": false,
"shortcuts": false,
"isVisible": true
},
"migrant": {
"children": {},
"dataType": "boolean",
"defaultValue": "{{((sourceData, formData, fieldState) => (sourceData.migrant))(JSONForm1.sourceData, JSONForm1.formData, JSONForm1.fieldState)}}",
"fieldType": "Switch",
"sourceData": false,
"isCustomField": false,
"accessor": "migrant",
"identifier": "migrant",
"position": 3,
"originalIdentifier": "migrant",
"alignWidget": "LEFT",
"isDisabled": false,
"isRequired": false,
"isVisible": true,
"label": "Migrant"
},
"address": {
"children": {
"street": {
"children": {},
"dataType": "string",
"defaultValue": "{{((sourceData, formData, fieldState) => (sourceData.address.street))(JSONForm1.sourceData, JSONForm1.formData, JSONForm1.fieldState)}}",
"fieldType": "Text Input",
"sourceData": "Koramangala",
"isCustomField": false,
"accessor": "street",
"identifier": "street",
"position": 0,
"originalIdentifier": "street",
"isDisabled": false,
"isRequired": false,
"isSpellCheck": false,
"isVisible": true,
"label": "Street"
},
"city": {
"children": {},
"dataType": "string",
"defaultValue": "{{((sourceData, formData, fieldState) => (sourceData.address.city))(JSONForm1.sourceData, JSONForm1.formData, JSONForm1.fieldState)}}",
"fieldType": "Text Input",
"sourceData": "Bangalore",
"isCustomField": false,
"accessor": "city",
"identifier": "city",
"position": 1,
"originalIdentifier": "city",
"isDisabled": false,
"isRequired": false,
"isSpellCheck": false,
"isVisible": true,
"label": "City"
}
},
"dataType": "object",
"defaultValue": "{{((sourceData, formData, fieldState) => (sourceData.address))(JSONForm1.sourceData, JSONForm1.formData, JSONForm1.fieldState)}}",
"fieldType": "Object",
"sourceData": {
"street": "Koramangala",
"city": "Bangalore"
},
"isCustomField": false,
"accessor": "address",
"identifier": "address",
"position": 4,
"originalIdentifier": "address",
"isDisabled": false,
"isRequired": false,
"isVisible": true,
"label": "Address"
},
"education": {
"children": {
"__array_item__": {
"children": {
"college": {
"children": {},
"dataType": "string",
"fieldType": "Text Input",
"sourceData": "MIT",
"isCustomField": false,
"accessor": "college",
"identifier": "college",
"position": 0,
"originalIdentifier": "college",
"isDisabled": false,
"isRequired": false,
"isSpellCheck": false,
"isVisible": true,
"label": "College"
},
"year": {
"children": {},
"dataType": "string",
"fieldType": "Datepicker",
"sourceData": "20/10/2014",
"isCustomField": false,
"accessor": "year",
"identifier": "year",
"position": 1,
"originalIdentifier": "year",
"closeOnSelection": false,
"dateFormat": "DD/MM/YYYY",
"isDisabled": false,
"isRequired": false,
"label": "Year",
"convertToISO": false,
"maxDate": "2121-12-31T18:29:00.000Z",
"minDate": "1920-12-31T18:30:00.000Z",
"shortcuts": false,
"isVisible": true
}
},
"dataType": "object",
"fieldType": "Object",
"sourceData": {
"college": "MIT",
"year": "20/10/2014"
},
"isCustomField": false,
"accessor": "__array_item__",
"identifier": "__array_item__",
"position": -1,
"originalIdentifier": "__array_item__",
"isDisabled": false,
"isRequired": false,
"isVisible": true,
"label": "Array Item"
}
},
"dataType": "array",
"defaultValue": "{{((sourceData, formData, fieldState) => (sourceData.education))(JSONForm1.sourceData, JSONForm1.formData, JSONForm1.fieldState)}}",
"fieldType": "Array",
"sourceData": [
{
"college": "MIT",
"year": "20/10/2014"
}
],
"isCustomField": false,
"accessor": "education",
"identifier": "education",
"position": 5,
"originalIdentifier": "education",
"backgroundColor": "#FAFAFA",
"isCollapsible": true,
"isDisabled": false,
"isRequired": false,
"isVisible": true,
"label": "Education"
},
"hobbies": {
"children": {},
"dataType": "array",
"defaultValue": "{{((sourceData, formData, fieldState) => (sourceData.hobbies))(JSONForm1.sourceData, JSONForm1.formData, JSONForm1.fieldState)}}",
"fieldType": "Multiselect",
"sourceData": [
"travelling",
"swimming"
],
"isCustomField": false,
"accessor": "hobbies",
"identifier": "hobbies",
"position": 6,
"originalIdentifier": "hobbies",
"isDisabled": false,
"isRequired": false,
"isVisible": true,
"label": "Hobbies",
"serverSideFiltering": false,
"options": [
{
"label": "Blue",
"value": "BLUE"
},
{
"label": "Green",
"value": "GREEN"
},
{
"label": "Red",
"value": "RED"
}
]
}
},
"dataType": "object",
"defaultValue": "{{((sourceData, formData, fieldState) => (sourceData))(JSONForm1.sourceData, JSONForm1.formData, JSONForm1.fieldState)}}",
"fieldType": "Object",
"sourceData": {
"name": "John",
"age": 30,
"dob": "10/12/1992",
"migrant": false,
"address": {
"street": "Koramangala",
"city": "Bangalore"
},
"education": [
{
"college": "MIT",
"year": "20/10/2014"
}
],
"hobbies": [
"travelling",
"swimming"
]
},
"isCustomField": false,
"name": "",
"identifier": "",
"position": -1,
"originalIdentifier": "",
"isDisabled": false,
"isRequired": false,
"isVisible": true,
"label": ""
}
},
"widgetName": "JSONForm1",
"displayName": "JSON Form",
"iconSVG": "/static/media/icon.6bacf7df.svg",
"topRow": 5,
"bottomRow": 45,
"parentRowSpace": 10,
"title": "Form",
"type": "JSON_FORM_WIDGET",
"hideCard": false,
"parentColumnSpace": 18.0625,
"dynamicTriggerPathList": [],
"autoGenerateForm": true,
"leftColumn": 18,
"dynamicBindingPathList": [
{
"key": "schema.__root_schema__.children.name.defaultValue"
},
{
"key": "schema.__root_schema__.children.age.defaultValue"
},
{
"key": "schema.__root_schema__.children.dob.defaultValue"
},
{
"key": "schema.__root_schema__.children.migrant.defaultValue"
},
{
"key": "schema.__root_schema__.children.address.children.street.defaultValue"
},
{
"key": "schema.__root_schema__.children.address.children.city.defaultValue"
},
{
"key": "schema.__root_schema__.children.address.defaultValue"
},
{
"key": "schema.__root_schema__.children.education.defaultValue"
},
{
"key": "schema.__root_schema__.children.hobbies.defaultValue"
},
{
"key": "schema.__root_schema__.defaultValue"
}
],
"sourceData": "{\n \"name\": \"John\",\n \"age\": 30,\n \"dob\": \"10/12/1992\",\n \"migrant\": false,\n \"address\": {\n \"street\": \"Koramangala\",\n \"city\": \"Bangalore\"\n },\n \"education\": [\n {\n \"college\": \"MIT\",\n \"year\": \"20/10/2014\"\n }\n ],\n \"hobbies\": [\"travelling\", \"swimming\"]\n}",
"showReset": true,
"key": "4x3ilx80d3",
"backgroundColor": "#fff",
"rightColumn": 43,
"widgetId": "u77r23ogdl",
"isVisible": true,
"version": 1,
"parentId": "0",
"renderMode": "CANVAS",
"isLoading": false,
"scrollContents": true,
"fixedFooter": true,
"disabledWhenInvalid": true,
"submitButtonLabel": "Submit",
"resetButtonLabel": "Reset"
}
]
}
}

View File

@ -0,0 +1,377 @@
{
"dsl": {
"widgetName": "MainContainer",
"backgroundColor": "none",
"rightColumn": 1168,
"snapColumns": 64,
"detachFromLayout": true,
"widgetId": "0",
"topRow": 0,
"bottomRow": 680,
"containerStyle": "none",
"snapRows": 125,
"parentRowSpace": 1,
"type": "CANVAS_WIDGET",
"canExtend": true,
"version": 47,
"minHeight": 870,
"parentColumnSpace": 1,
"dynamicTriggerPathList": [],
"dynamicBindingPathList": [],
"leftColumn": 0,
"children": [
{
"widgetName": "Text1",
"displayName": "Text",
"iconSVG": "/static/media/icon.97c59b52.svg",
"topRow": 54,
"bottomRow": 58,
"parentRowSpace": 10,
"type": "TEXT_WIDGET",
"hideCard": false,
"animateLoading": true,
"parentColumnSpace": 18.0625,
"leftColumn": 22,
"text": "Label",
"key": "zgsygilz5a",
"rightColumn": 38,
"textAlign": "LEFT",
"widgetId": "ums2hvawa0",
"isVisible": true,
"fontStyle": "BOLD",
"textColor": "#231F20",
"version": 1,
"parentId": "0",
"renderMode": "CANVAS",
"isLoading": false,
"fontSize": "PARAGRAPH"
},
{
"isVisible": true,
"animateLoading": true,
"backgroundColor": "#fff",
"disabledWhenInvalid": true,
"fixedFooter": true,
"autoGenerateForm": true,
"schema": {
"__root_schema__": {
"children": {
"name": {
"children": {},
"dataType": "string",
"defaultValue": "{{((sourceData, formData, fieldState) => (sourceData.name))(JSONForm1.sourceData, JSONForm1.formData, JSONForm1.fieldState)}}",
"fieldType": "Text Input",
"sourceData": "John",
"isCustomField": false,
"accessor": "name",
"identifier": "name",
"position": 0,
"originalIdentifier": "name",
"iconAlign": "left",
"isDisabled": false,
"isRequired": false,
"isSpellCheck": false,
"isVisible": true,
"label": "Name"
},
"age": {
"children": {},
"dataType": "number",
"defaultValue": "{{((sourceData, formData, fieldState) => (sourceData.age))(JSONForm1.sourceData, JSONForm1.formData, JSONForm1.fieldState)}}",
"fieldType": "Number Input",
"sourceData": 30,
"isCustomField": false,
"accessor": "age",
"identifier": "age",
"position": 1,
"originalIdentifier": "age",
"iconAlign": "left",
"isDisabled": false,
"isRequired": false,
"isSpellCheck": false,
"isVisible": true,
"label": "Age"
},
"dob": {
"children": {},
"dataType": "string",
"defaultValue": "{{((sourceData, formData, fieldState) => (sourceData.dob))(JSONForm1.sourceData, JSONForm1.formData, JSONForm1.fieldState)}}",
"fieldType": "Datepicker",
"sourceData": "10/12/1992",
"isCustomField": false,
"accessor": "dob",
"identifier": "dob",
"position": 2,
"originalIdentifier": "dob",
"closeOnSelection": false,
"convertToISO": false,
"dateFormat": "MM/DD/YYYY",
"isDisabled": false,
"isRequired": false,
"isVisible": true,
"label": "Dob",
"maxDate": "2121-12-31T18:29:00.000Z",
"minDate": "1920-12-31T18:30:00.000Z",
"shortcuts": false,
"timePrecision": "minute"
},
"migrant": {
"children": {},
"dataType": "boolean",
"defaultValue": "{{((sourceData, formData, fieldState) => (sourceData.migrant))(JSONForm1.sourceData, JSONForm1.formData, JSONForm1.fieldState)}}",
"fieldType": "Switch",
"sourceData": false,
"isCustomField": false,
"accessor": "migrant",
"identifier": "migrant",
"position": 3,
"originalIdentifier": "migrant",
"alignWidget": "LEFT",
"isDisabled": false,
"isRequired": false,
"isVisible": true,
"label": "Migrant"
},
"address": {
"children": {
"street": {
"children": {},
"dataType": "string",
"defaultValue": "{{((sourceData, formData, fieldState) => (sourceData.address.street))(JSONForm1.sourceData, JSONForm1.formData, JSONForm1.fieldState)}}",
"fieldType": "Text Input",
"sourceData": "Koramangala",
"isCustomField": false,
"accessor": "street",
"identifier": "street",
"position": 0,
"originalIdentifier": "street",
"iconAlign": "left",
"isDisabled": false,
"isRequired": false,
"isSpellCheck": false,
"isVisible": true,
"label": "Street"
},
"city": {
"children": {},
"dataType": "string",
"defaultValue": "{{((sourceData, formData, fieldState) => (sourceData.address.city))(JSONForm1.sourceData, JSONForm1.formData, JSONForm1.fieldState)}}",
"fieldType": "Text Input",
"sourceData": "Bangalore",
"isCustomField": false,
"accessor": "city",
"identifier": "city",
"position": 1,
"originalIdentifier": "city",
"iconAlign": "left",
"isDisabled": false,
"isRequired": false,
"isSpellCheck": false,
"isVisible": true,
"label": "City"
}
},
"dataType": "object",
"defaultValue": "{{((sourceData, formData, fieldState) => (sourceData.address))(JSONForm1.sourceData, JSONForm1.formData, JSONForm1.fieldState)}}",
"fieldType": "Object",
"sourceData": {
"street": "Koramangala",
"city": "Bangalore"
},
"isCustomField": false,
"accessor": "address",
"identifier": "address",
"position": 4,
"originalIdentifier": "address",
"isDisabled": false,
"isRequired": false,
"isVisible": true,
"label": "Address"
},
"education": {
"children": {
"__array_item__": {
"children": {
"college": {
"children": {},
"dataType": "string",
"fieldType": "Text Input",
"sourceData": "MIT",
"isCustomField": false,
"accessor": "college",
"identifier": "college",
"position": 0,
"originalIdentifier": "college",
"iconAlign": "left",
"isDisabled": false,
"isRequired": false,
"isSpellCheck": false,
"isVisible": true,
"label": "College"
},
"year": {
"children": {},
"dataType": "string",
"fieldType": "Datepicker",
"sourceData": "20/10/2014",
"isCustomField": false,
"accessor": "year",
"identifier": "year",
"position": 1,
"originalIdentifier": "year",
"closeOnSelection": false,
"convertToISO": false,
"dateFormat": "DD/MM/YYYY",
"isDisabled": false,
"isRequired": false,
"isVisible": true,
"label": "Year",
"maxDate": "2121-12-31T18:29:00.000Z",
"minDate": "1920-12-31T18:30:00.000Z",
"shortcuts": false,
"timePrecision": "minute"
}
},
"dataType": "object",
"fieldType": "Object",
"sourceData": {
"college": "MIT",
"year": "20/10/2014"
},
"isCustomField": false,
"accessor": "__array_item__",
"identifier": "__array_item__",
"position": -1,
"originalIdentifier": "__array_item__",
"isDisabled": false,
"isRequired": false,
"isVisible": true,
"label": "Array Item"
}
},
"dataType": "array",
"defaultValue": "{{((sourceData, formData, fieldState) => (sourceData.education))(JSONForm1.sourceData, JSONForm1.formData, JSONForm1.fieldState)}}",
"fieldType": "Array",
"sourceData": [
{
"college": "MIT",
"year": "20/10/2014"
}
],
"isCustomField": false,
"accessor": "education",
"identifier": "education",
"position": 5,
"originalIdentifier": "education",
"backgroundColor": "#FAFAFA",
"isCollapsible": true,
"isDisabled": false,
"isRequired": false,
"isVisible": true,
"label": "Education"
}
},
"dataType": "object",
"defaultValue": "{{((sourceData, formData, fieldState) => (sourceData))(JSONForm1.sourceData, JSONForm1.formData, JSONForm1.fieldState)}}",
"fieldType": "Object",
"sourceData": {
"name": "John",
"age": 30,
"dob": "10/12/1992",
"migrant": false,
"address": {
"street": "Koramangala",
"city": "Bangalore"
},
"education": [
{
"college": "MIT",
"year": "20/10/2014"
}
]
},
"isCustomField": false,
"name": "__root_schema__",
"accessor": "__root_schema__",
"identifier": "__root_schema__",
"position": -1,
"originalIdentifier": "__root_schema__",
"isDisabled": false,
"isRequired": false,
"isVisible": true,
"label": ""
}
},
"scrollContents": true,
"showReset": true,
"title": "Form",
"version": 1,
"widgetName": "JSONForm1",
"submitButtonStyles": {
"buttonColor": "#03B365",
"buttonVariant": "PRIMARY"
},
"resetButtonStyles": {
"buttonColor": "#03B365",
"buttonVariant": "SECONDARY"
},
"sourceData": "",
"type": "JSON_FORM_WIDGET",
"hideCard": false,
"displayName": "JSON Form",
"key": "sh61xsjzqi",
"iconSVG": "/static/media/icon.6bacf7df.svg",
"widgetId": "ie1fkmka46",
"renderMode": "CANVAS",
"isLoading": false,
"parentColumnSpace": 42.5625,
"parentRowSpace": 10,
"leftColumn": 29,
"rightColumn": 54,
"topRow": 29,
"bottomRow": 79,
"parentId": "0",
"submitButtonLabel": "Submit",
"resetButtonLabel": "Reset",
"dynamicPropertyPathList": [
{
"key": "schema.__root_schema__.children.dob.defaultValue"
},
{
"key": "schema.__root_schema__.children.migrant.defaultValue"
}
],
"dynamicBindingPathList": [
{
"key": "schema.__root_schema__.children.name.defaultValue"
},
{
"key": "schema.__root_schema__.defaultValue"
},
{
"key": "schema.__root_schema__.children.age.defaultValue"
},
{
"key": "schema.__root_schema__.children.dob.defaultValue"
},
{
"key": "schema.__root_schema__.children.migrant.defaultValue"
},
{
"key": "schema.__root_schema__.children.address.children.street.defaultValue"
},
{
"key": "schema.__root_schema__.children.address.children.city.defaultValue"
},
{
"key": "schema.__root_schema__.children.address.defaultValue"
},
{
"key": "schema.__root_schema__.children.education.defaultValue"
}
],
"dynamicTriggerPathList": []
}
]
}
}

View File

@ -0,0 +1,55 @@
{
"dsl": {
"widgetName": "MainContainer",
"backgroundColor": "none",
"rightColumn": 1168,
"snapColumns": 64,
"detachFromLayout": true,
"widgetId": "0",
"topRow": 0,
"bottomRow": 610,
"containerStyle": "none",
"snapRows": 125,
"parentRowSpace": 1,
"type": "CANVAS_WIDGET",
"canExtend": true,
"version": 47,
"minHeight": 520,
"parentColumnSpace": 1,
"dynamicTriggerPathList": [],
"dynamicBindingPathList": [],
"leftColumn": 0,
"children": [
{
"isVisible": true,
"backgroundColor": "#fff",
"disabledWhenInvalid": true,
"fixedFooter": true,
"schema": {},
"scrollContents": true,
"showReset": true,
"title": "Form",
"version": 1,
"widgetName": "JSONForm1",
"type": "JSON_FORM_WIDGET",
"autoGenerateForm": true,
"hideCard": false,
"displayName": "JSON Form",
"key": "cak4mvjrvr",
"iconSVG": "/static/media/icon.6bacf7df.svg",
"widgetId": "1gnss27afd",
"renderMode": "CANVAS",
"isLoading": false,
"parentColumnSpace": 18.0625,
"parentRowSpace": 10,
"leftColumn": 21,
"rightColumn": 46,
"topRow": 7,
"bottomRow": 47,
"parentId": "0",
"submitButtonLabel": "Submit",
"resetButtonLabel": "Reset"
}
]
}
}

View File

@ -0,0 +1,265 @@
{
"dsl": {
"widgetName": "MainContainer",
"backgroundColor": "none",
"rightColumn": 1168,
"snapColumns": 64,
"detachFromLayout": true,
"widgetId": "0",
"topRow": 0,
"bottomRow": 1340,
"containerStyle": "none",
"snapRows": 125,
"parentRowSpace": 1,
"type": "CANVAS_WIDGET",
"canExtend": true,
"version": 52,
"minHeight": 1320,
"parentColumnSpace": 1,
"dynamicBindingPathList": [],
"leftColumn": 0,
"children": [
{
"widgetName": "Text1",
"displayName": "Text",
"iconSVG": "/static/media/icon.97c59b52.svg",
"topRow": 0,
"bottomRow": 58,
"parentRowSpace": 10,
"type": "TEXT_WIDGET",
"hideCard": false,
"animateLoading": true,
"parentColumnSpace": 26.890625,
"dynamicTriggerPathList": [],
"leftColumn": 0,
"dynamicBindingPathList": [
{
"key": "text"
}
],
"shouldTruncate": false,
"truncateButtonColor": "#FFC13D",
"text": "{{JSONForm1.formData}}",
"key": "fcglufpc9q",
"rightColumn": 20,
"textAlign": "LEFT",
"widgetId": "2cvwkaegxy",
"isVisible": true,
"fontStyle": "BOLD",
"textColor": "#231F20",
"shouldScroll": false,
"version": 1,
"parentId": "0",
"renderMode": "CANVAS",
"isLoading": false,
"fontSize": "PARAGRAPH"
},
{
"schema": {
"__root_schema__": {
"children": {
"xn__80a1afdk69b": {
"children": {
"xn__mgbuhw": {
"children": {},
"dataType": "string",
"defaultValue": "{{((sourceData, formData, fieldState) => (sourceData[\"суроға\"][\"شارع\"]))(JSONForm1.sourceData, JSONForm1.formData, JSONForm1.fieldState)}}",
"fieldType": "Text Input",
"sourceData": "Koramangala",
"isCustomField": false,
"accessor": "شارع",
"identifier": "xn__mgbuhw",
"position": 0,
"originalIdentifier": "شارع",
"iconAlign": "left",
"isDisabled": false,
"isRequired": false,
"isSpellCheck": false,
"isVisible": true,
"label": "شارع"
}
},
"dataType": "object",
"defaultValue": "{{((sourceData, formData, fieldState) => (sourceData[\"суроға\"]))(JSONForm1.sourceData, JSONForm1.formData, JSONForm1.fieldState)}}",
"fieldType": "Object",
"sourceData": {
"شارع": "Koramangala"
},
"isCustomField": false,
"accessor": "суроға",
"identifier": "xn__80a1afdk69b",
"position": 0,
"originalIdentifier": "суроға",
"isDisabled": false,
"isRequired": false,
"isVisible": true,
"label": "Суроға"
},
"xn__12ca5huag4ce3a": {
"children": {
"__array_item__": {
"children": {
"xn__ohco9d4d": {
"children": {},
"dataType": "string",
"fieldType": "Text Input",
"sourceData": "MIT",
"isCustomField": false,
"accessor": "କଲେଜ",
"identifier": "xn__ohco9d4d",
"position": 0,
"originalIdentifier": "କଲେଜ",
"iconAlign": "left",
"isDisabled": false,
"isRequired": false,
"isSpellCheck": false,
"isVisible": true,
"label": "କଲେଜ"
}
},
"dataType": "object",
"fieldType": "Object",
"sourceData": {
"କଲେଜ": "MIT"
},
"isCustomField": false,
"accessor": "__array_item__",
"identifier": "__array_item__",
"position": -1,
"originalIdentifier": "__array_item__",
"isDisabled": false,
"isRequired": false,
"isVisible": true,
"label": "Array Item"
}
},
"dataType": "array",
"defaultValue": "{{((sourceData, formData, fieldState) => (sourceData[\"การศึกษา\"]))(JSONForm1.sourceData, JSONForm1.formData, JSONForm1.fieldState)}}",
"fieldType": "Array",
"sourceData": [
{
"କଲେଜ": "MIT"
}
],
"isCustomField": false,
"accessor": "การศึกษา",
"identifier": "xn__12ca5huag4ce3a",
"position": 1,
"originalIdentifier": "การศึกษา",
"backgroundColor": "#FAFAFA",
"isCollapsible": true,
"isDisabled": false,
"isRequired": false,
"isVisible": true,
"label": "การศึกษา"
},
"xn__l2bm1c": {
"children": {},
"dataType": "string",
"defaultValue": "{{((sourceData, formData, fieldState) => (sourceData[\"नाम\"]))(JSONForm1.sourceData, JSONForm1.formData, JSONForm1.fieldState)}}",
"fieldType": "Text Input",
"sourceData": "John",
"isCustomField": false,
"accessor": "नाम",
"identifier": "xn__l2bm1c",
"position": 3,
"originalIdentifier": "नाम",
"iconAlign": "left",
"isDisabled": false,
"isRequired": false,
"isSpellCheck": false,
"isVisible": true,
"label": "नाम"
}
},
"dataType": "object",
"defaultValue": "{{((sourceData, formData, fieldState) => (sourceData))(JSONForm1.sourceData, JSONForm1.formData, JSONForm1.fieldState)}}",
"fieldType": "Object",
"sourceData": {
"नाम": "John",
"суроға": {
"شارع": "Koramangala"
},
"การศึกษา": [
{
"କଲେଜ": "MIT"
}
]
},
"isCustomField": false,
"accessor": "__root_schema__",
"identifier": "__root_schema__",
"position": -1,
"originalIdentifier": "__root_schema__",
"isDisabled": false,
"isRequired": false,
"isVisible": true,
"label": ""
}
},
"widgetName": "JSONForm1",
"submitButtonStyles": {
"buttonColor": "#03B365",
"buttonVariant": "PRIMARY"
},
"dynamicPropertyPathList": [
{
"key": "schema.__root_schema__.children.date_of_birth.defaultValue"
}
],
"displayName": "JSON Form",
"iconSVG": "/static/media/icon.6bacf7df.svg",
"topRow": 3,
"bottomRow": 53,
"fieldLimitExceeded": false,
"parentRowSpace": 10,
"title": "Form",
"type": "JSON_FORM_WIDGET",
"hideCard": false,
"animateLoading": true,
"parentColumnSpace": 18.0625,
"dynamicTriggerPathList": [],
"leftColumn": 21,
"dynamicBindingPathList": [
{
"key": "schema.__root_schema__.defaultValue"
},
{
"key": "schema.__root_schema__.children.xn__80a1afdk69b.children.xn__mgbuhw.defaultValue"
},
{
"key": "schema.__root_schema__.children.xn__80a1afdk69b.defaultValue"
},
{
"key": "schema.__root_schema__.children.xn__12ca5huag4ce3a.defaultValue"
},
{
"key": "schema.__root_schema__.children.xn__l2bm1c.defaultValue"
}
],
"sourceData": "",
"showReset": true,
"key": "si6k7qupn4",
"backgroundColor": "#fff",
"rightColumn": 46,
"autoGenerateForm": true,
"widgetId": "v5ddirn0i0",
"resetButtonStyles": {
"buttonColor": "#03B365",
"buttonVariant": "SECONDARY"
},
"isVisible": true,
"version": 1,
"parentId": "0",
"renderMode": "CANVAS",
"isLoading": false,
"scrollContents": true,
"fixedFooter": true,
"disabledWhenInvalid": true,
"submitButtonLabel": "Submit",
"resetButtonLabel": "Reset"
}
]
}
}

View File

@ -2,160 +2,323 @@
"dsl": {
"widgetName": "MainContainer",
"backgroundColor": "none",
"rightColumn": 1224,
"snapColumns": 16,
"rightColumn": 778,
"snapColumns": 64,
"detachFromLayout": true,
"widgetId": "0",
"topRow": 0,
"bottomRow": 1280,
"bottomRow": 1120,
"containerStyle": "none",
"snapRows": 33,
"snapRows": 125,
"parentRowSpace": 1,
"type": "CANVAS_WIDGET",
"canExtend": true,
"version": 23,
"minHeight": 1292,
"version": 52,
"minHeight": 1550,
"parentColumnSpace": 1,
"dynamicTriggerPathList": [],
"dynamicBindingPathList": [],
"leftColumn": 0,
"children": [
{
"isVisible": true,
"enhancements": true,
"backgroundColor": "",
"gridType": "vertical",
"gridGap": 0,
"listData": "[\n {\n \"id\": 1,\n \"email\": \"michael.lawson@reqres.in\",\n \"first_name\": \"Michael\",\n \"last_name\": \"Lawson\",\n \"avatar\": \"https://reqres.in/img/faces/7-image.jpg\"\n },\n {\n \"id\": 2,\n \"email\": \"lindsay.ferguson@reqres.in\",\n \"first_name\": \"Lindsay\",\n \"last_name\": \"Ferguson\",\n \"avatar\": \"https://reqres.in/img/faces/8-image.jpg\"\n },\n {\n \"id\": 3,\n \"email\": \"brock.lesnar@reqres.in\",\n \"first_name\": \"Brock\",\n \"last_name\": \"Lesnar\",\n \"avatar\": \"https://reqres.in/img/faces/8-image.jpg\"\n }\n]",
"widgetName": "List1",
"children": [
{
"isVisible": true,
"widgetName": "Canvas1",
"containerStyle": "none",
"canExtend": false,
"detachFromLayout": true,
"dropDisabled": true,
"children": [
{
"isVisible": true,
"backgroundColor": "white",
"widgetName": "Container1",
"containerStyle": "card",
"children": [
{
{
"template": {
"Text1": {
"isVisible": true,
"widgetName": "Canvas2",
"containerStyle": "none",
"canExtend": false,
"detachFromLayout": true,
"children": [
{
"isVisible": true,
"text": "Label",
"textStyle": "LABEL",
"textAlign": "LEFT",
"widgetName": "Text1",
"type": "TEXT_WIDGET",
"isLoading": false,
"parentColumnSpace": 32,
"parentRowSpace": 40,
"leftColumn": 2,
"rightColumn": 24,
"topRow": 0,
"bottomRow": 16,
"parentId": "dinv2tsatk",
"widgetId": "k6ct7dxg4w"
},
{
"isVisible":true,
"text":"Submit",
"buttonStyle":"PRIMARY_BUTTON",
"widgetName":"Button1",
"isDisabled":false,
"isDefaultClickDisabled":true,
"version":26,
"type":"BUTTON_WIDGET",
"isLoading":false,
"parentColumnSpace":29.25,
"parentRowSpace":40,
"leftColumn":24,
"rightColumn": 32,
"topRow":1,
"bottomRow":8,
"parentId":"dinv2tsatk",
"widgetId":"fuw9p7cuek"
}
],
"minHeight": null,
"type": "CANVAS_WIDGET",
"text": "Label",
"fontSize": "PARAGRAPH",
"fontStyle": "BOLD",
"textAlign": "LEFT",
"textColor": "#231F20",
"truncateButtonColor": "#FFC13D",
"widgetName": "Text1",
"shouldScroll": false,
"shouldTruncate": false,
"version": 1,
"animateLoading": true,
"type": "TEXT_WIDGET",
"hideCard": false,
"displayName": "Text",
"key": "e9bpznyucj",
"iconSVG": "/static/media/icon.97c59b52.svg",
"textStyle": "HEADING",
"widgetId": "rz3yq5hf7s",
"renderMode": "CANVAS",
"isLoading": false,
"parentColumnSpace": 1,
"parentRowSpace": 1,
"leftColumn": 0,
"rightColumn": null,
"leftColumn": 16,
"rightColumn": 28,
"topRow": 0,
"bottomRow": null,
"parentId": "4ruj7xl5ri",
"widgetId": "dinv2tsatk"
}
],
"dragDisabled": true,
"isDeletable": false,
"disablePropertyPane": true,
"type": "CONTAINER_WIDGET",
"isLoading": false,
"leftColumn": 0,
"rightColumn": 64,
"topRow": 0,
"bottomRow": 16,
"parentId": "0pvmmqr77m",
"widgetId": "4ruj7xl5ri"
}
"bottomRow": 4,
"parentId": "y4cy49e4l1"
},
"Button1": {
"isVisible": true,
"animateLoading": true,
"text": "Submit",
"buttonColor": "#03B365",
"buttonVariant": "PRIMARY",
"placement": "CENTER",
"widgetName": "Button1",
"isDisabled": false,
"isDefaultClickDisabled": true,
"recaptchaType": "V3",
"version": 1,
"type": "BUTTON_WIDGET",
"hideCard": false,
"displayName": "Button",
"key": "48eoz8tblb",
"iconSVG": "/static/media/icon.cca02633.svg",
"widgetId": "lwdh6n12xy",
"renderMode": "CANVAS",
"isLoading": false,
"parentColumnSpace": 4.05078125,
"parentRowSpace": 10,
"leftColumn": 34,
"rightColumn": 50,
"topRow": 1,
"bottomRow": 5,
"parentId": "y4cy49e4l1"
}
},
"widgetName": "List1",
"listData": "[\n {\n \"id\": 1,\n \"email\": \"michael.lawson@reqres.in\",\n \"first_name\": \"Michael\",\n \"last_name\": \"Lawson\",\n \"avatar\": \"https://reqres.in/img/faces/7-image.jpg\"\n },\n {\n \"id\": 2,\n \"email\": \"lindsay.ferguson@reqres.in\",\n \"first_name\": \"Lindsay\",\n \"last_name\": \"Ferguson\",\n \"avatar\": \"https://reqres.in/img/faces/8-image.jpg\"\n },\n {\n \"id\": 3,\n \"email\": \"brock.lesnar@reqres.in\",\n \"first_name\": \"Brock\",\n \"last_name\": \"Lesnar\",\n \"avatar\": \"https://reqres.in/img/faces/8-image.jpg\"\n },\n {\n \"id\": 4,\n \"email\": \"dwayne.jhonson@reqres.in\",\n \"first_name\": \"Dwayne\",\n \"last_name\": \"Johnson\",\n \"avatar\": \"https://reqres.in/img/faces/8-image.jpg\"\n }\n]",
"isCanvas": true,
"displayName": "List",
"iconSVG": "/static/media/icon.9925ee17.svg",
"topRow": 0,
"bottomRow": 40,
"parentRowSpace": 10,
"type": "LIST_WIDGET",
"hideCard": false,
"gridGap": 0,
"animateLoading": true,
"parentColumnSpace": 11.96875,
"dynamicTriggerPathList": [],
"leftColumn": 20,
"dynamicBindingPathList": [],
"gridType": "vertical",
"enhancements": true,
"children": [
{
"widgetName": "Canvas1",
"displayName": "Canvas",
"topRow": 0,
"bottomRow": 400,
"parentRowSpace": 1,
"type": "CANVAS_WIDGET",
"canExtend": false,
"hideCard": true,
"dropDisabled": true,
"openParentPropertyPane": true,
"minHeight": 400,
"noPad": true,
"parentColumnSpace": 1,
"leftColumn": 0,
"children": [
{
"boxShadow": "NONE",
"widgetName": "Container1",
"borderColor": "transparent",
"disallowCopy": true,
"isCanvas": true,
"displayName": "Container",
"iconSVG": "/static/media/icon.1977dca3.svg",
"topRow": 0,
"bottomRow": 12,
"dragDisabled": true,
"type": "CONTAINER_WIDGET",
"hideCard": false,
"openParentPropertyPane": true,
"isDeletable": false,
"animateLoading": true,
"leftColumn": 0,
"children": [
{
"widgetName": "Canvas2",
"detachFromLayout": true,
"displayName": "Canvas",
"widgetId": "y4cy49e4l1",
"containerStyle": "none",
"topRow": 0,
"bottomRow": 70,
"parentRowSpace": 1,
"isVisible": true,
"type": "CANVAS_WIDGET",
"canExtend": false,
"version": 1,
"hideCard": true,
"parentId": "s4x8lq7c32",
"renderMode": "CANVAS",
"isLoading": false,
"parentColumnSpace": 1,
"leftColumn": 0,
"children": [
{
"widgetName": "Text1",
"displayName": "Text",
"iconSVG": "/static/media/icon.97c59b52.svg",
"topRow": 1,
"bottomRow": 5,
"type": "TEXT_WIDGET",
"hideCard": false,
"animateLoading": true,
"dynamicTriggerPathList": [],
"dynamicBindingPathList": [],
"leftColumn": 2,
"shouldTruncate": false,
"truncateButtonColor": "#FFC13D",
"text": "Label",
"key": "e9bpznyucj",
"rightColumn": 29,
"textAlign": "LEFT",
"widgetId": "rz3yq5hf7s",
"logBlackList": {
"isVisible": true,
"text": true,
"fontSize": true,
"fontStyle": true,
"textAlign": true,
"textColor": true,
"truncateButtonColor": true,
"widgetName": true,
"shouldScroll": true,
"shouldTruncate": true,
"version": true,
"animateLoading": true,
"type": true,
"hideCard": true,
"displayName": true,
"key": true,
"iconSVG": true,
"isCanvas": true,
"textStyle": true,
"dynamicBindingPathList": true,
"dynamicTriggerPathList": true,
"minHeight": true,
"widgetId": true,
"renderMode": true,
"isLoading": true,
"parentColumnSpace": true,
"parentRowSpace": true,
"leftColumn": true,
"rightColumn": true,
"topRow": true,
"bottomRow": true,
"parentId": true
},
"isVisible": true,
"fontStyle": "BOLD",
"textColor": "#231F20",
"shouldScroll": false,
"version": 1,
"parentId": "y4cy49e4l1",
"renderMode": "CANVAS",
"isLoading": false,
"fontSize": "PARAGRAPH",
"textStyle": "HEADING"
},
{
"widgetName": "Button1",
"buttonColor": "#03B365",
"displayName": "Button",
"iconSVG": "/static/media/icon.cca02633.svg",
"topRow": 1,
"bottomRow": 5,
"parentRowSpace": 10,
"type": "BUTTON_WIDGET",
"hideCard": false,
"animateLoading": true,
"parentColumnSpace": 4.05078125,
"leftColumn": 34,
"text": "Submit",
"isDisabled": false,
"key": "48eoz8tblb",
"rightColumn": 53,
"isDefaultClickDisabled": true,
"widgetId": "lwdh6n12xy",
"logBlackList": {
"isVisible": true,
"animateLoading": true,
"text": true,
"buttonColor": true,
"buttonVariant": true,
"placement": true,
"widgetName": true,
"isDisabled": true,
"isDefaultClickDisabled": true,
"recaptchaType": true,
"version": true,
"type": true,
"hideCard": true,
"displayName": true,
"key": true,
"iconSVG": true,
"isCanvas": true,
"minHeight": true,
"widgetId": true,
"renderMode": true,
"isLoading": true,
"parentColumnSpace": true,
"parentRowSpace": true,
"leftColumn": true,
"rightColumn": true,
"topRow": true,
"bottomRow": true,
"parentId": true
},
"isVisible": true,
"recaptchaType": "V3",
"version": 1,
"parentId": "y4cy49e4l1",
"renderMode": "CANVAS",
"isLoading": false,
"buttonVariant": "PRIMARY",
"placement": "CENTER"
}
],
"key": "oiyh0dnja0"
}
],
"borderWidth": "0",
"key": "5veqdwa6js",
"disablePropertyPane": true,
"backgroundColor": "white",
"rightColumn": 64,
"widgetId": "s4x8lq7c32",
"containerStyle": "card",
"isVisible": true,
"version": 1,
"parentId": "9qa052pga4",
"renderMode": "CANVAS",
"isLoading": false,
"borderRadius": "0"
}
],
"key": "oiyh0dnja0",
"rightColumn": 287.25,
"detachFromLayout": true,
"widgetId": "9qa052pga4",
"containerStyle": "none",
"isVisible": true,
"version": 1,
"parentId": "0s7k5dgj77",
"renderMode": "CANVAS",
"isLoading": false
}
],
"minHeight": 400,
"type": "CANVAS_WIDGET",
"isLoading": false,
"parentColumnSpace": 1,
"parentRowSpace": 1,
"leftColumn": 0,
"rightColumn": 592,
"topRow": 0,
"bottomRow": 400,
"parentId": "5bwz8xcvhj",
"widgetId": "0pvmmqr77m"
}
],
"type": "LIST_WIDGET",
"isLoading": false,
"parentColumnSpace": 74,
"parentRowSpace": 40,
"leftColumn": 0,
"rightColumn": 32,
"topRow": 0,
"bottomRow": 40,
"parentId": "0",
"widgetId": "5bwz8xcvhj",
"dynamicBindingPathList": [],
"template": {
"Text1": {
"privateWidgets": {
"Text1": true,
"Button1": true
},
"key": "l1iovfl7pr",
"backgroundColor": "transparent",
"rightColumn": 44,
"itemBackgroundColor": "#FFFFFF",
"widgetId": "0s7k5dgj77",
"isVisible": true,
"text": "Label",
"textStyle": "LABEL",
"textAlign": "LEFT",
"widgetName": "Text1",
"type": "TEXT_WIDGET",
"isLoading": false,
"parentColumnSpace": 32,
"parentRowSpace": 40,
"leftColumn": 0,
"rightColumn": 4,
"topRow": 0,
"bottomRow": 1,
"parentId": "dinv2tsatk",
"widgetId": "k6ct7dxg4w"
}
"parentId": "0",
"renderMode": "CANVAS",
"isLoading": false
}
}
]
}
}
}

View File

@ -1,275 +1,275 @@
{
"dsl": {
"widgetName": "MainContainer",
"backgroundColor": "none",
"rightColumn": 966,
"snapColumns": 16,
"detachFromLayout": true,
"widgetId": "0",
"topRow": 0,
"bottomRow": 800,
"containerStyle": "none",
"snapRows": 33,
"parentRowSpace": 1,
"type": "CANVAS_WIDGET",
"canExtend": true,
"version": 18,
"minHeight": 240,
"parentColumnSpace": 1,
"dynamicTriggerPathList": [],
"dynamicBindingPathList": [],
"leftColumn": 0,
"children": [
{
"isVisible": true,
"backgroundColor": "",
"itemBackgroundColor": "white",
"gridType": "vertical",
"enhancements": true,
"gridGap": 0,
"listData": "",
"widgetName": "List1",
"children": [
{
"isVisible": true,
"widgetName": "Canvas1",
"version": 1,
"containerStyle": "none",
"canExtend": false,
"detachFromLayout": true,
"dropDisabled": true,
"noPad": true,
"children": [
{
"isVisible": true,
"backgroundColor": "white",
"widgetName": "Container1",
"containerStyle": "card",
"children": [
{
"isVisible": true,
"widgetName": "Canvas2",
"version": 1,
"containerStyle": "none",
"canExtend": false,
"detachFromLayout": true,
"children": [
{
"isVisible": true,
"defaultImage": "https://res.cloudinary.com/drako999/image/upload/v1589196259/default.png",
"imageShape": "RECTANGLE",
"maxZoomLevel": 1,
"image": "{{currentItem.img}}",
"widgetName": "Image1",
"version": 1,
"dynamicBindingPathList": [
{
"key": "image"
}
],
"dynamicTriggerPathList": [],
"type": "IMAGE_WIDGET",
"isLoading": false,
"leftColumn": 0,
"rightColumn": 4,
"topRow": 0,
"bottomRow": 3,
"parentId": "muh6tmsm1f",
"widgetId": "vr29m4code"
},
{
"isVisible": true,
"text": "{{currentItem.name}}",
"fontSize": "PARAGRAPH",
"fontStyle": "BOLD",
"textAlign": "LEFT",
"textColor": "#231F20",
"widgetName": "Text1",
"version": 1,
"textStyle": "HEADING",
"dynamicBindingPathList": [
{
"key": "text"
}
],
"dynamicTriggerPathList": [],
"type": "TEXT_WIDGET",
"isLoading": false,
"leftColumn": 4,
"rightColumn": 10,
"topRow": 0,
"bottomRow": 1,
"parentId": "muh6tmsm1f",
"widgetId": "envgv9f2j9"
},
{
"isVisible": true,
"text": "{{currentItem.num}}",
"fontSize": "PARAGRAPH",
"fontStyle": "BOLD",
"textAlign": "LEFT",
"textColor": "#231F20",
"widgetName": "Text2",
"version": 1,
"textStyle": "BODY",
"dynamicBindingPathList": [
{
"key": "text"
}
],
"dynamicTriggerPathList": [],
"type": "TEXT_WIDGET",
"isLoading": false,
"leftColumn": 4,
"rightColumn": 10,
"topRow": 1,
"bottomRow": 2,
"parentId": "muh6tmsm1f",
"widgetId": "37xbmi0bbz"
}
],
"minHeight": null,
"type": "CANVAS_WIDGET",
"isLoading": false,
"parentColumnSpace": 1,
"parentRowSpace": 1,
"leftColumn": 0,
"rightColumn": null,
"topRow": 0,
"bottomRow": null,
"parentId": "5q9jzp3d17",
"widgetId": "muh6tmsm1f"
}
],
"version": 1,
"dragDisabled": true,
"isDeletable": false,
"disallowCopy": true,
"disablePropertyPane": true,
"type": "CONTAINER_WIDGET",
"isLoading": false,
"leftColumn": 0,
"rightColumn": 16,
"topRow": 0,
"bottomRow": 4,
"parentId": "qt3cziyljx",
"widgetId": "5q9jzp3d17"
}
],
"minHeight": 400,
"type": "CANVAS_WIDGET",
"isLoading": false,
"parentColumnSpace": 1,
"parentRowSpace": 1,
"leftColumn": 0,
"rightColumn": 463,
"topRow": 0,
"bottomRow": 400,
"parentId": "wmuvmnfqm0",
"widgetId": "qt3cziyljx"
}
],
"type": "LIST_WIDGET",
"isLoading": false,
"parentColumnSpace": 57.875,
"parentRowSpace": 40,
"leftColumn": 4,
"rightColumn": 12,
"topRow": 2,
"bottomRow": 20,
"parentId": "0",
"widgetId": "wmuvmnfqm0",
"dynamicBindingPathList": [
{
"key": "template.Image1.image"
},
{
"key": "template.Text1.text"
},
{
"key": "template.Text2.text"
}
],
"template": {
"Image1": {
"isVisible": true,
"defaultImage": "https://res.cloudinary.com/drako999/image/upload/v1589196259/default.png",
"imageShape": "RECTANGLE",
"maxZoomLevel": 1,
"image": "{{List1.listData.map((currentItem) => currentItem.img)}}",
"widgetName": "Image1",
"version": 1,
"dynamicBindingPathList": [
{
"key": "image"
}
],
"dynamicTriggerPathList": [],
"type": "IMAGE_WIDGET",
"isLoading": false,
"leftColumn": 0,
"rightColumn": 4,
"topRow": 0,
"bottomRow": 3,
"parentId": "muh6tmsm1f",
"widgetId": "vr29m4code"
},
"Text1": {
"isVisible": true,
"text": "{{List1.listData.map((currentItem) => currentItem.name)}}",
"fontSize": "PARAGRAPH",
"fontStyle": "BOLD",
"textAlign": "LEFT",
"textColor": "#231F20",
"widgetName": "Text1",
"version": 1,
"textStyle": "HEADING",
"dynamicBindingPathList": [
{
"key": "text"
}
],
"dynamicTriggerPathList": [],
"type": "TEXT_WIDGET",
"isLoading": false,
"leftColumn": 4,
"rightColumn": 10,
"topRow": 0,
"bottomRow": 1,
"parentId": "muh6tmsm1f",
"widgetId": "envgv9f2j9"
},
"Text2": {
"isVisible": true,
"text": "{{List1.listData.map((currentItem) => currentItem.num)}}",
"fontSize": "PARAGRAPH",
"fontStyle": "BOLD",
"textAlign": "LEFT",
"textColor": "#231F20",
"widgetName": "Text2",
"version": 1,
"textStyle": "BODY",
"dynamicBindingPathList": [
{
"key": "text"
}
],
"dynamicTriggerPathList": [],
"type": "TEXT_WIDGET",
"isLoading": false,
"leftColumn": 4,
"rightColumn": 10,
"topRow": 1,
"bottomRow": 2,
"parentId": "muh6tmsm1f",
"widgetId": "37xbmi0bbz"
}
},
"childAutoComplete": {
"currentItem": {}
},
"dynamicTriggerPathList": []
}
]
}
"dsl": {
"widgetName": "MainContainer",
"backgroundColor": "none",
"rightColumn": 966,
"snapColumns": 16,
"detachFromLayout": true,
"widgetId": "0",
"topRow": 0,
"bottomRow": 800,
"containerStyle": "none",
"snapRows": 33,
"parentRowSpace": 1,
"type": "CANVAS_WIDGET",
"canExtend": true,
"version": 18,
"minHeight": 240,
"parentColumnSpace": 1,
"dynamicTriggerPathList": [],
"dynamicBindingPathList": [],
"leftColumn": 0,
"children": [
{
"isVisible": true,
"backgroundColor": "",
"itemBackgroundColor": "white",
"gridType": "vertical",
"enhancements": true,
"gridGap": 0,
"listData": "",
"widgetName": "List1",
"children": [
{
"isVisible": true,
"widgetName": "Canvas1",
"version": 1,
"containerStyle": "none",
"canExtend": false,
"detachFromLayout": true,
"dropDisabled": true,
"noPad": true,
"children": [
{
"isVisible": true,
"backgroundColor": "white",
"widgetName": "Container1",
"containerStyle": "card",
"children": [
{
"isVisible": true,
"widgetName": "Canvas2",
"version": 1,
"containerStyle": "none",
"canExtend": false,
"detachFromLayout": true,
"children": [
{
"isVisible": true,
"defaultImage": "https://res.cloudinary.com/drako999/image/upload/v1589196259/default.png",
"imageShape": "RECTANGLE",
"maxZoomLevel": 1,
"image": "{{currentItem.img}}",
"widgetName": "Image1",
"version": 1,
"dynamicBindingPathList": [
{
"key": "image"
}
],
"dynamicTriggerPathList": [],
"type": "IMAGE_WIDGET",
"isLoading": false,
"leftColumn": 0,
"rightColumn": 4,
"topRow": 0,
"bottomRow": 3,
"parentId": "muh6tmsm1f",
"widgetId": "vr29m4code"
},
{
"isVisible": true,
"text": "{{currentItem.name}}",
"fontSize": "PARAGRAPH",
"fontStyle": "BOLD",
"textAlign": "LEFT",
"textColor": "#231F20",
"widgetName": "Text1",
"version": 1,
"textStyle": "HEADING",
"dynamicBindingPathList": [
{
"key": "text"
}
],
"dynamicTriggerPathList": [],
"type": "TEXT_WIDGET",
"isLoading": false,
"leftColumn": 4,
"rightColumn": 10,
"topRow": 0,
"bottomRow": 1,
"parentId": "muh6tmsm1f",
"widgetId": "envgv9f2j9"
},
{
"isVisible": true,
"text": "{{currentItem.email}}",
"fontSize": "PARAGRAPH",
"fontStyle": "BOLD",
"textAlign": "LEFT",
"textColor": "#231F20",
"widgetName": "Text2",
"version": 1,
"textStyle": "BODY",
"dynamicBindingPathList": [
{
"key": "text"
}
],
"dynamicTriggerPathList": [],
"type": "TEXT_WIDGET",
"isLoading": false,
"leftColumn": 4,
"rightColumn": 10,
"topRow": 1,
"bottomRow": 2,
"parentId": "muh6tmsm1f",
"widgetId": "37xbmi0bbz"
}
],
"minHeight": null,
"type": "CANVAS_WIDGET",
"isLoading": false,
"parentColumnSpace": 1,
"parentRowSpace": 1,
"leftColumn": 0,
"rightColumn": null,
"topRow": 0,
"bottomRow": null,
"parentId": "5q9jzp3d17",
"widgetId": "muh6tmsm1f"
}
],
"version": 1,
"dragDisabled": true,
"isDeletable": false,
"disallowCopy": true,
"disablePropertyPane": true,
"type": "CONTAINER_WIDGET",
"isLoading": false,
"leftColumn": 0,
"rightColumn": 16,
"topRow": 0,
"bottomRow": 4,
"parentId": "qt3cziyljx",
"widgetId": "5q9jzp3d17"
}
],
"minHeight": 400,
"type": "CANVAS_WIDGET",
"isLoading": false,
"parentColumnSpace": 1,
"parentRowSpace": 1,
"leftColumn": 0,
"rightColumn": 463,
"topRow": 0,
"bottomRow": 400,
"parentId": "wmuvmnfqm0",
"widgetId": "qt3cziyljx"
}
],
"type": "LIST_WIDGET",
"isLoading": false,
"parentColumnSpace": 57.875,
"parentRowSpace": 10,
"leftColumn": 4,
"rightColumn": 12,
"topRow": 2,
"bottomRow": 20,
"parentId": "0",
"widgetId": "wmuvmnfqm0",
"dynamicBindingPathList": [
{
"key": "template.Image1.image"
},
{
"key": "template.Text1.text"
},
{
"key": "template.Text2.text"
}
],
"template": {
"Image1": {
"isVisible": true,
"defaultImage": "https://res.cloudinary.com/drako999/image/upload/v1589196259/default.png",
"imageShape": "RECTANGLE",
"maxZoomLevel": 1,
"image": "{{List1.listData.map((currentItem) => currentItem.img)}}",
"widgetName": "Image1",
"version": 1,
"dynamicBindingPathList": [
{
"key": "image"
}
],
"dynamicTriggerPathList": [],
"type": "IMAGE_WIDGET",
"isLoading": false,
"leftColumn": 0,
"rightColumn": 4,
"topRow": 0,
"bottomRow": 3,
"parentId": "muh6tmsm1f",
"widgetId": "vr29m4code"
},
"Text1": {
"isVisible": true,
"text": "{{List1.listData.map((currentItem) => currentItem.name)}}",
"fontSize": "PARAGRAPH",
"fontStyle": "BOLD",
"textAlign": "LEFT",
"textColor": "#231F20",
"widgetName": "Text1",
"version": 1,
"textStyle": "HEADING",
"dynamicBindingPathList": [
{
"key": "text"
}
],
"dynamicTriggerPathList": [],
"type": "TEXT_WIDGET",
"isLoading": false,
"leftColumn": 4,
"rightColumn": 10,
"topRow": 0,
"bottomRow": 1,
"parentId": "muh6tmsm1f",
"widgetId": "envgv9f2j9"
},
"Text2": {
"isVisible": true,
"text": "{{List1.listData.map((currentItem) => currentItem.email)}}",
"fontSize": "PARAGRAPH",
"fontStyle": "BOLD",
"textAlign": "LEFT",
"textColor": "#231F20",
"widgetName": "Text2",
"version": 1,
"textStyle": "BODY",
"dynamicBindingPathList": [
{
"key": "text"
}
],
"dynamicTriggerPathList": [],
"type": "TEXT_WIDGET",
"isLoading": false,
"leftColumn": 4,
"rightColumn": 10,
"topRow": 1,
"bottomRow": 2,
"parentId": "muh6tmsm1f",
"widgetId": "37xbmi0bbz"
}
},
"childAutoComplete": {
"currentItem": {}
},
"dynamicTriggerPathList": []
}
]
}
}

View File

@ -29,17 +29,41 @@
"encodeParamsToggle": true,
"formData": {
"updateMany": {
"limit": "SINGLE"
"limit": {
"data": "SINGLE",
"componentData": "SINGLE",
"viewType": "form"
}
},
"insert": {
"documents": "{\n \"genres\": {{insert_col_input1.text}}, \n \"homepage\": {{insert_col_input2.text}}, \n \"imdb_id\": {{insert_col_input3.text}}, \n \"poster_path\": {{insert_col_input4.text}}\n}"
"documents": {
"data": "{\n \"genres\": {{insert_col_input1.text}}, \n \"homepage\": {{insert_col_input2.text}}, \n \"imdb_id\": {{insert_col_input3.text}}, \n \"poster_path\": {{insert_col_input4.text}}\n}",
"componentData": "{\n \"genres\": {{insert_col_input1.text}}, \n \"homepage\": {{insert_col_input2.text}}, \n \"imdb_id\": {{insert_col_input3.text}}, \n \"poster_path\": {{insert_col_input4.text}}\n}",
"viewType": "form"
}
},
"collection": {
"data": "movies",
"componentData": "movies",
"viewType": "form"
},
"collection": "movies",
"delete": {
"limit": "SINGLE"
"limit": {
"data": "SINGLE",
"componentData": "SINGLE",
"viewType": "form"
}
},
"command": "INSERT",
"smartSubstitution": true
"command": {
"data": "INSERT",
"componentData": "INSERT",
"viewType": "form"
},
"smartSubstitution": {
"data": true,
"componentData": true,
"viewType": "form"
}
}
},
"executeOnLoad": false,
@ -83,19 +107,47 @@
"actionConfiguration": {
"timeoutInMillisecond": 10000,
"paginationType": "NONE",
"path": "template_table/{{data_table.selectedRow._ref}}",
"encodeParamsToggle": true,
"formData": {
"path": {
"data": "template_table/{{data_table.selectedRow._ref}}",
"componentData": "template_table/{{data_table.selectedRow._ref}}",
"viewType": "form"
},
"updateMany": {
"limit": "SINGLE"
"limit": {
"data": "SINGLE",
"componentData": "SINGLE",
"viewType": "form"
}
},
"collection": "movies",
"collection": {
"data": "movies",
"componentData": "movies",
"viewType": "form"
},
"delete": {
"query": "{ _id: ObjectId('{{data_table.triggeredRow._id}}') }",
"limit": "SINGLE"
"query": {
"data": "{ _id: ObjectId('{{data_table.triggeredRow._id}}') }",
"componentData": "{ _id: ObjectId('{{data_table.triggeredRow._id}}') }",
"viewType": "form"
},
"limit": {
"data": "SINGLE",
"componentData": "SINGLE",
"viewType": "form"
}
},
"command": "DELETE",
"smartSubstitution": "DELETE_DOCUMENT"
"command": {
"data": "DELETE",
"componentData": "DELETE",
"viewType": "form"
},
"smartSubstitution": {
"data": "DELETE_DOCUMENT",
"componentData": "DELETE_DOCUMENT",
"viewType": "form"
}
}
},
"executeOnLoad": false,
@ -140,20 +192,56 @@
"encodeParamsToggle": true,
"formData": {
"updateMany": {
"limit": "SINGLE"
"limit": {
"data": "SINGLE",
"componentData": "SINGLE",
"viewType": "form"
}
},
"find": {
"query": "{ homepage: /{{data_table.searchText||\"\"}}/i }",
"limit": "{{data_table.pageSize}}",
"skip": "{{(data_table.pageNo - 1) * data_table.pageSize}}",
"sort": "{ \n{{key_select.selectedOptionValue}}: {{order_select.selectedOptionValue}} \n}"
"query": {
"data": "{ homepage: /{{data_table.searchText||\"\"}}/i }",
"componentData": "{ homepage: /{{data_table.searchText||\"\"}}/i }",
"viewType": "form"
},
"limit": {
"data": "{{data_table.pageSize}}",
"componentData": "{{data_table.pageSize}}",
"viewType": "form"
},
"skip": {
"data": "{{(data_table.pageNo - 1) * data_table.pageSize}}",
"componentData": "{{(data_table.pageNo - 1) * data_table.pageSize}}",
"viewType": "form"
},
"sort": {
"data": "{ \n{{key_select.selectedOptionValue}}: {{order_select.selectedOptionValue}} \n}",
"componentData": "{ \n{{key_select.selectedOptionValue}}: {{order_select.selectedOptionValue}} \n}",
"viewType": "form"
}
},
"collection": "movies",
"collection": {
"data": "movies",
"componentData": "movies",
"viewType": "form"
},
"delete": {
"limit": "SINGLE"
"limit": {
"data": "SINGLE",
"componentData": "SINGLE",
"viewType": "form"
}
},
"command": "FIND",
"smartSubstitution": false
"command": {
"data": "FIND",
"componentData": "FIND",
"viewType": "form"
},
"smartSubstitution": {
"data": false,
"componentData": false,
"viewType": "form"
}
}
},
"executeOnLoad": true,
@ -201,16 +289,44 @@
"encodeParamsToggle": true,
"formData": {
"updateMany": {
"query": "{ _id: ObjectId('{{data_table.selectedRow._id}}') }",
"limit": "SINGLE",
"update": "{\n \"genres\" : {{update_col_1.text}},\n\t\"homepage\" : {{update_col_2.text}},\n \"imdb_id\" : {{update_col_3.text}},\n \"poster_path\" : {{update_col_4.text}}\n}"
"query": {
"data": "{ _id: ObjectId('{{data_table.selectedRow._id}}') }",
"componentData": "{ _id: ObjectId('{{data_table.selectedRow._id}}') }",
"viewType": "form"
},
"limit": {
"data": "SINGLE",
"componentData": "SINGLE",
"viewType": "form"
},
"update": {
"data": "{\n \"genres\" : {{update_col_1.text}},\n\t\"homepage\" : {{update_col_2.text}},\n \"imdb_id\" : {{update_col_3.text}},\n \"poster_path\" : {{update_col_4.text}}\n}",
"componentData": "{\n \"genres\" : {{update_col_1.text}},\n\t\"homepage\" : {{update_col_2.text}},\n \"imdb_id\" : {{update_col_3.text}},\n \"poster_path\" : {{update_col_4.text}}\n}",
"viewType": "form"
}
},
"collection": "movies",
"collection": {
"data": "movies",
"componentData": "movies",
"viewType": "form"
},
"delete": {
"limit": "SINGLE"
"limit": {
"data": "SINGLE",
"componentData": "SINGLE",
"viewType": "form"
}
},
"command": "UPDATE",
"smartSubstitution": true
"command": {
"data": "UPDATE",
"componentData": "UPDATE",
"viewType": "form"
},
"smartSubstitution": {
"data": true,
"componentData": true,
"viewType": "form"
}
}
},
"executeOnLoad": false,

View File

@ -0,0 +1,59 @@
{
"dsl": {
"widgetName": "MainContainer",
"backgroundColor": "none",
"rightColumn": 816,
"snapColumns": 64,
"detachFromLayout": true,
"widgetId": "0",
"topRow": 0,
"bottomRow": 360,
"containerStyle": "none",
"snapRows": 125,
"parentRowSpace": 1,
"type": "CANVAS_WIDGET",
"canExtend": true,
"version": 53,
"minHeight": 340,
"parentColumnSpace": 1,
"dynamicTriggerPathList": [],
"dynamicBindingPathList": [],
"leftColumn": 0,
"children": [
{
"isVisible": true,
"animateLoading": true,
"text": "{{appsmith}}",
"buttonColor": "#03B365",
"buttonVariant": "PRIMARY",
"placement": "CENTER",
"widgetName": "Button1",
"isDisabled": false,
"isDefaultClickDisabled": true,
"recaptchaType": "V3",
"version": 1,
"type": "BUTTON_WIDGET",
"hideCard": false,
"displayName": "Button",
"key": "shydybeo1d",
"iconSVG": "/static/media/icon.cca02633.svg",
"widgetId": "llztjclhrm",
"renderMode": "CANVAS",
"isLoading": false,
"parentColumnSpace": 12.5625,
"parentRowSpace": 10,
"leftColumn": 21,
"rightColumn": 37,
"topRow": 18,
"bottomRow": 22,
"parentId": "0",
"dynamicBindingPathList": [
{
"key": "text"
}
],
"dynamicTriggerPathList": []
}
]
}
}

View File

@ -1,14 +1,12 @@
/// <reference types="Cypress" />
import homePage from "../../../locators/HomePage";
//const dsl = require("../../../fixtures/forkedApp.json");
const homePage = require("../../../locators/HomePage");
const reconnectDatasourceModal = require("../../../locators/ReconnectLocators");
describe("Import, Export and Fork application and validate data binding", function() {
let orgid;
let appid;
let newOrganizationName;
it("1. Import application and validate data on pageload", function() {
let appName;
it("Import application from json and validate data on pageload", function() {
// import application
cy.get(homePage.homeIcon).click();
cy.get(homePage.optionsIcon)
@ -16,45 +14,48 @@ describe("Import, Export and Fork application and validate data binding", functi
.click();
cy.get(homePage.orgImportAppOption).click({ force: true });
cy.get(homePage.orgImportAppModal).should("be.visible");
cy.xpath(homePage.uploadLogo)
.attachFile("forkedApp.json")
.wait(500);
cy.get(homePage.orgImportAppButton)
.trigger("click")
.wait(500);
cy.get(homePage.orgImportAppModal).should("not.exist");
cy.xpath(homePage.uploadLogo).attachFile("forkedApp.json");
cy.wait("@importNewApplication").then((interception) => {
let appId = interception.response.body.data.id;
let defaultPage = interception.response.body.data.pages.find(
(eachPage) => !!eachPage.isDefault,
);
cy.get(homePage.toastMessage).should(
"contain",
"Application imported successfully",
);
cy.wait(100);
// should check reconnect modal openning
const { isPartialImport } = interception.response.body.data;
if (isPartialImport) {
// should reconnect button
cy.get(reconnectDatasourceModal.Modal).should("be.visible");
cy.get(reconnectDatasourceModal.SkipToAppBtn).click({ force: true });
cy.wait(2000);
} else {
cy.get(homePage.toastMessage).should(
"contain",
"Application imported successfully",
);
}
const uuid = () => Cypress._.random(0, 1e4);
const name = uuid();
appName = `app${name}`;
cy.get(homePage.applicationName).click({ force: true });
cy.get(`${homePage.applicationEditMenu} li:first-child a`).click({
force: true,
});
cy.wait(2000);
cy.get(homePage.applicationName)
.clear()
.type(`app${name}`);
// .clear()
.type(appName);
cy.wrap(`app${name}`).as("appname");
cy.wait(2000);
// validating data binding for the imported application
cy.xpath("//input[@value='Submit']").should("be.visible");
cy.xpath("//div[text()='schema_name']").should("be.visible");
cy.xpath("//div[text()='pg_toast']").should("be.visible");
cy.xpath("//div[text()='id']").should("be.visible");
cy.xpath("//div[text()='title']").should("be.visible");
cy.xpath("//div[text()='Recusan']").should("be.visible");
cy.xpath("//div[text()='due']").should("be.visible");
});
});
it("2. Fork application and validate data binding for the widgets", function() {
it("Fork application and validate data binding for the widgets", function() {
// fork application
cy.get(homePage.homeIcon).click();
cy.get(homePage.searchInput).type(`${this.appname}`);
cy.get(homePage.searchInput).type(`${appName}`);
cy.wait(2000);
cy.get(homePage.applicationCard)
.first()
@ -68,16 +69,16 @@ describe("Import, Export and Fork application and validate data binding", functi
// validating data binding for the forked application
cy.xpath("//input[@value='Submit']").should("be.visible");
cy.xpath("//div[text()='schema_name']").should("be.visible");
cy.xpath("//div[text()='pg_toast']").should("be.visible");
cy.xpath("//div[text()='id']").should("be.visible");
cy.xpath("//div[text()='title']").should("be.visible");
cy.xpath("//div[text()='Recusan']").should("be.visible");
cy.xpath("//div[text()='due']").should("be.visible");
});
it("3. Export and import application and validate data binding for the widgets", function() {
it("Export and import application and validate data binding for the widgets", function() {
cy.NavigateToHome();
cy.get(homePage.searchInput)
.clear()
.type(`${this.appname}`);
.type(`${appName}`);
cy.wait(2000);
cy.get(homePage.applicationCard)
.first()
@ -94,7 +95,7 @@ describe("Import, Export and Fork application and validate data binding", functi
expect(headers).to.have.property("content-type", "application/json");
expect(headers).to.have.property(
"content-disposition",
`attachment; filename*=UTF-8''${this.appname}.json`,
`attachment; filename*=UTF-8''${appName}.json`,
);
cy.writeFile("cypress/fixtures/exportedApp.json", body, "utf-8");
cy.generateUUID().then((uid) => {
@ -107,29 +108,46 @@ describe("Import, Export and Fork application and validate data binding", functi
cy.get(homePage.orgImportAppOption).click({ force: true });
cy.get(homePage.orgImportAppModal).should("be.visible");
cy.xpath(homePage.uploadLogo).attachFile("exportedApp.json");
cy.get(".t--import-json-card input").attachFile("exportedApp.json");
// import exported application in new organization
cy.get(homePage.orgImportAppButton).click({ force: true });
// cy.get(homePage.orgImportAppButton).click({ force: true });
cy.wait("@importNewApplication").then((interception) => {
let appId = interception.response.body.data.id;
let defaultPage = interception.response.body.data.pages.find(
(eachPage) => !!eachPage.isDefault,
);
cy.get(homePage.toastMessage).should(
"contain",
"Application imported successfully",
);
// validating data binding for imported application
cy.xpath("//input[@value='Submit']").should("be.visible");
cy.xpath("//div[text()='schema_name']").should("be.visible");
cy.xpath("//div[text()='pg_toast']").should("be.visible");
cy.xpath("//div[text()='title']").should("be.visible");
cy.xpath("//div[text()='Recusan']").should("be.visible");
const { isPartialImport } = interception.response.body.data;
if (isPartialImport) {
// should reconnect button
cy.get(reconnectDatasourceModal.Modal).should("be.visible");
cy.get(reconnectDatasourceModal.SkipToAppBtn).click({
force: true,
});
cy.wait(2000);
} else {
cy.get(homePage.toastMessage).should(
"contain",
"Application imported successfully",
);
}
const importedApp = interception.response.body.data.application;
const appSlug = importedApp.slug;
cy.wait("@getPagesForCreateApp").then((interception) => {
const pages = interception.response.body.data.pages;
let defaultPage = pages.find(
(eachPage) => !!eachPage.isDefault,
);
// validating data binding for imported application
cy.xpath("//input[@value='Submit']").should("be.visible");
cy.xpath("//div[text()='schema_name']").should("be.visible");
// cy.xpath("//div[text()='information_schema']").should(
// "be.visible",
// );
cy.xpath("//div[text()='id']").should("be.visible");
cy.xpath("//div[text()='title']").should("be.visible");
cy.xpath("//div[text()='due']").should("be.visible");
cy.url().should(
"include",
`/applications/${appId}/pages/${defaultPage.id}/edit`,
);
cy.url().should(
"include",
`/${appSlug}/${defaultPage.slug}-${defaultPage.id}/edit`,
);
});
});
});
});

View File

@ -16,7 +16,6 @@ describe("Shopping cart App", function() {
it("1. Create MongoDB datasource and add Insert, Find, Update and Delete queries", function() {
cy.NavigateToDatasourceEditor();
cy.get(datasource.MongoDB).click();
cy.getPluginFormsAndCreateDatasource();
cy.fillMongoDatasourceForm();
cy.testSaveDatasource();
cy.get("@createDatasource").then((httpResponse) => {
@ -32,16 +31,14 @@ describe("Shopping cart App", function() {
cy.get(".CodeEditorTarget")
.first()
.type("Productnames");
// cy.get(".CodeEditorTarget")
// .eq(1)
// .type("{}");
cy.assertPageSave();
cy.get(appPage.dropdownChevronLeft).click();
// EditProducts query to update the cart
cy.get(queryLocators.createQuery)
.last()
.click();
cy.get(queryLocators.queryNameField).type("EditProducts");
cy.get("[data-cy='actionConfiguration.formData.command']").click();
cy.get("[data-cy='actionConfiguration.formData.command.data']").click();
cy.get(".t--dropdown-option")
.eq(2)
.click();
@ -56,23 +53,22 @@ describe("Shopping cart App", function() {
cy.get(".CodeEditorTarget")
.eq(2)
.type(
`{
"title" : "{{title.text}}",
`{"title" : "{{title.text}}",
"description" :"{{description.text}}",
"price" : {{price.text}},
"quantity":{{quantity.text}}
`,
"quantity":{{quantity.text}}`,
{
parseSpecialCharSequences: false,
},
);
cy.assertPageSave();
cy.get(appPage.dropdownChevronLeft).click();
// Add product query
cy.get(queryLocators.createQuery)
.last()
.click();
cy.get(queryLocators.queryNameField).type("AddProduct");
cy.get("[data-cy='actionConfiguration.formData.command']").click();
cy.get("[data-cy='actionConfiguration.formData.command.data']").click();
cy.get(".t--dropdown-option")
.eq(1)
.click();
@ -82,21 +78,20 @@ describe("Shopping cart App", function() {
cy.get(".CodeEditorTarget")
.eq(1)
.type(
`[{
"title" : "{{Title.text}}",
`[{"title" : "{{Title.text}}",
"description": "{{Description.text}}",
"price" : {{Price.text}},
"quantity" : {{Quantity.text}}
`,
"quantity" : {{Quantity.text}}`,
{ parseSpecialCharSequences: false },
);
cy.assertPageSave();
cy.get(appPage.dropdownChevronLeft).click();
// delete product
cy.get(queryLocators.createQuery)
.last()
.click();
cy.get(queryLocators.queryNameField).type("DeleteProduct");
cy.get("[data-cy='actionConfiguration.formData.command']").click();
cy.get("[data-cy='actionConfiguration.formData.command.data']").click();
cy.get(".t--dropdown-option")
.eq(3)
.click();
@ -108,6 +103,8 @@ describe("Shopping cart App", function() {
.type('{"title":"{{Table1.selectedRow.title}}"}', {
parseSpecialCharSequences: false,
});
cy.assertPageSave();
cy.get(appPage.dropdownChevronLeft).click();
cy.get(appPage.dropdownChevronLeft).click();
});
@ -161,6 +158,8 @@ describe("Shopping cart App", function() {
.closest("div")
.eq(0)
.click();
cy.assertPageSave();
cy.wait(5000);
// validating updated value in the cart
cy.get(".selected-row")
.children()

View File

@ -1,14 +1,14 @@
const datasourceEditor = require("../../../../locators/DatasourcesEditor.json");
const queryEditor = require("../../../../locators/QueryEditor.json");
let datasourceName, actionName;
describe("Google Sheet datasource test cases", function() {
describe("Mongo Active datasource test cases", function() {
before(() => {
cy.NavigateToDatasourceEditor();
cy.get(datasourceEditor.googleSheets).click();
cy.get(datasourceEditor.MongoDB).click();
cy.getPluginFormsAndCreateDatasource();
cy.fillGoogleSheetsDatasourceForm();
cy.get("@createDatasource").then((httpResponse) => {
cy.fillMongoDatasourceForm();
cy.get(datasourceEditor.saveBtn).click({ force: true });
cy.wait("@createDatasource").then((httpResponse) => {
datasourceName = httpResponse.response.body.data.name;
cy.NavigateToActiveDSQueryPane(datasourceName);
});
@ -21,20 +21,14 @@ describe("Google Sheet datasource test cases", function() {
it("Create a new query from the datasource editor", function() {
cy.NavigateToActiveTab();
cy.get(
`.t--datasource-name:contains('${datasourceName}') .t--queries-for-SAAS`,
`.t--datasource-name:contains('${datasourceName}') .t--queries-for-DB`,
).should("have.text", "1 query on this page");
});
after(() => {
cy.CheckAndUnfoldEntityItem("QUERIES/JS");
cy.get(`.t--entity-name:contains('${actionName}')`).click();
cy.get(queryEditor.queryMoreAction).click();
cy.get(queryEditor.deleteUsingContext).click();
cy.wait("@deleteAction").should(
"have.nested.property",
"response.body.responseMeta.status",
200,
);
cy.deleteQueryUsingContext();
cy.deleteDatasource(datasourceName);
});
});

View File

@ -53,7 +53,7 @@ describe("API Panel Test Functionality", function() {
cy.get(apiwidget.runQueryButton).click();
cy.get(".bp3-dialog")
.find("button")
.contains("Cancel")
.contains("No")
.click();
cy.get(apiwidget.runQueryButton)
.children()

View File

@ -1,6 +1,11 @@
const commonlocators = require("../../../../locators/commonlocators.json");
const testdata = require("../../../../fixtures/testdata.json");
const apiwidget = require("../../../../locators/apiWidgetslocator.json");
const {
AggregateHelper,
} = require("../../../../support/Pages/AggregateHelper");
const helper = new AggregateHelper();
describe("API Panel Test Functionality ", function() {
it("Test API copy/Move/delete feature", function() {
@ -11,23 +16,25 @@ describe("API Panel Test Functionality ", function() {
cy.CreateAPI("FirstAPI");
cy.enterDatasourceAndPath(testdata.baseUrl, "{{ '/random' }}");
cy.log("Creation of FirstAPI Action successful");
//cy.GlobalSearchEntity("FirstAPI");
cy.xpath('//*[local-name()="g" and @id="Icon/Outline/more-vertical"]')
.last()
.should("be.hidden")
.invoke("show")
.click({ force: true });
cy.copyEntityToPage("SecondPage");
helper.ActionContextMenuByEntityName(
"FirstAPI",
"Copy to page",
"SecondPage",
);
// click on learn how link
cy.get(".t--learn-how-apis-link").click();
// this should open in a global search modal
cy.get(commonlocators.globalSearchModal);
cy.get("body").click(0, 0);
cy.MoveAPIToPage("Page1");
helper.ActionContextMenuByEntityName(
"FirstAPICopy",
"Move to page",
"Page1",
);
cy.wait(2000);
cy.get(".t--entity-name")
.contains("FirstAPICopy")
.click({ force: true });
cy.get(apiwidget.resourceUrl).should("contain.text", "{{ '/random' }}");
cy.DeleteAPIFromSideBar();
});
});

View File

@ -0,0 +1,114 @@
import homePage from "../../../../locators/HomePage";
const explorer = require("../../../../locators/explorerlocators.json");
describe("Slug URLs", () => {
let applicationName;
let applicationId;
it("Checks URL redirection from legacy URLs to slug URLs", () => {
applicationId = localStorage.getItem("applicationId");
cy.location("pathname").then((pathname) => {
const pageId = pathname
.split("/")[2]
?.split("-")
.pop();
cy.visit(`/applications/${applicationId}/pages/${pageId}/edit`).then(
() => {
cy.wait(10000);
cy.location("pathname").then((pathname) => {
const pageId = pathname
.split("/")[2]
?.split("-")
.pop();
const appName = localStorage.getItem("AppName");
expect(pathname).to.be.equal(`/${appName}/page1-${pageId}/edit`);
});
},
);
});
});
it("Checks if application slug updates on the URL when application name changes", () => {
cy.generateUUID().then((appName) => {
applicationName = appName;
cy.AppSetupForRename();
cy.get(homePage.applicationName).type(`${appName}` + "{enter}");
cy.wait("@updateApplication").should(
"have.nested.property",
"response.body.responseMeta.status",
200,
);
cy.location("pathname").then((pathname) => {
const pageId = pathname
.split("/")[2]
?.split("-")
.pop();
expect(pathname).to.be.equal(`/${appName}/page1-${pageId}/edit`);
});
});
});
it("Checks if page slug updates on the URL when page name changes", () => {
cy.GlobalSearchEntity("Page1");
// cy.RenameEntity("Page renamed");
cy.get(`.t--entity-item:contains(Page1)`).within(() => {
cy.get(".t--context-menu").click({ force: true });
});
cy.selectAction("Edit Name");
cy.get(explorer.editEntity)
.last()
.type("Page renamed", { force: true });
cy.get("body").click(0, 0);
cy.wait("@updatePage").should(
"have.nested.property",
"response.body.responseMeta.status",
200,
);
cy.location("pathname").then((pathname) => {
const pageId = pathname
.split("/")[2]
?.split("-")
.pop();
expect(pathname).to.be.equal(
`/${applicationName}/page-renamed-${pageId}/edit`,
);
});
});
it("Check the url of old applications and upgrades version", () => {
cy.request("PUT", `/api/v1/applications/${applicationId}`, {
applicationVersion: 1,
}).then((response) => {
const application = response.body.data;
expect(application.applicationVersion).to.equal(1);
cy.NavigateToHome();
cy.reload();
cy.SearchApp(applicationName);
cy.wait("@getPagesForCreateApp").then((intercept) => {
const { application, pages } = intercept.response.body.data;
const defaultPage = pages.find((p) => p.isDefault);
cy.location().should((loc) => {
expect(loc.pathname).includes(
`/applications/${application.id}/pages/${defaultPage.id}`,
);
});
cy.get(".t--upgrade").click({ force: true });
cy.get(".t--upgrade-confirm").click({ force: true });
cy.wait("@getPagesForCreateApp").then((intercept) => {
const { application, pages } = intercept.response.body.data;
const defaultPage = pages.find((p) => p.isDefault);
cy.location().should((loc) => {
expect(loc.pathname).includes(
`/${application.slug}/${defaultPage.slug}-${defaultPage.id}`,
);
});
});
});
});
});
});

View File

@ -33,19 +33,29 @@ describe("Duplicate application", function() {
.click({ force: true });
cy.get(homePage.duplicateApp).click({ force: true });
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(4000);
cy.wait("@getPage").should(
"have.nested.property",
"response.body.responseMeta.status",
200,
);
cy.get("@getPage").then((httpResponse) => {
duplicateApplicationDsl = httpResponse.response.body.data.layouts[0].dsl;
cy.log(JSON.stringify(duplicateApplicationDsl));
cy.log(JSON.stringify(parentApplicationDsl));
expect(JSON.stringify(duplicateApplicationDsl)).to.deep.equal(
JSON.stringify(parentApplicationDsl),
cy.wait("@cloneApp").then((httpResponse) => {
const application = httpResponse.response.body.data;
cy.wait(4000);
cy.wait("@getPage").should(
"have.nested.property",
"response.body.responseMeta.status",
200,
);
cy.get("@getPage").then((httpResponse) => {
const page = httpResponse.response.body.data;
duplicateApplicationDsl =
httpResponse.response.body.data.layouts[0].dsl;
cy.log(JSON.stringify(duplicateApplicationDsl));
cy.log(JSON.stringify(parentApplicationDsl));
expect(JSON.stringify(duplicateApplicationDsl)).to.deep.equal(
JSON.stringify(parentApplicationDsl),
);
cy.url().should(
"include",
`/${application.slug}/${page.slug}-${page.id}`,
);
});
});
});
});

View File

@ -1,7 +1,5 @@
const dsl = require("../../../../fixtures/basicDsl.json");
import homePage from "../../../../locators/HomePage";
const commonlocators = require("../../../../locators/commonlocators.json");
const widgetsPage = require("../../../../locators/Widgets.json");
let forkedApplicationDsl;
let parentApplicationDsl;

View File

@ -0,0 +1,38 @@
const commonlocators = require("../../../../locators/commonlocators.json");
const formWidgetsPage = require("../../../../locators/FormWidgets.json");
const dsl = require("../../../../fixtures/buttonRecaptchaDsl.json");
const pages = require("../../../../locators/Pages.json");
const widgetsPage = require("../../../../locators/Widgets.json");
const publish = require("../../../../locators/publishWidgetspage.json");
const testdata = require("../../../../fixtures/testdata.json");
describe("Binding the Button widget with Text widget using Recpatcha v3", function() {
before(() => {
cy.addDsl(dsl);
});
it("Validate the Button binding with Text Widget with Recaptcha Token", function() {
cy.get("button")
.contains("Submit")
.should("be.visible")
.click({ force: true });
cy.SearchEntityandOpen("Text1");
cy.get(".t--draggable-textwidget .bp3-ui-text").should("be.visible");
cy.get(".t--draggable-textwidget .bp3-ui-text").should("have.value", "");
cy.SearchEntityandOpen("Button1");
cy.get(".t--property-control-googlerecaptchaversion .bp3-popover-target")
.last()
.should("be.visible")
.click({ force: true });
cy.get(".t--dropdown-option:contains('reCAPTCHA v2')").click({
force: true,
});
cy.get("button")
.contains("Submit")
.should("be.visible")
.click({ force: true });
cy.SearchEntityandOpen("Text1");
cy.get(".t--draggable-textwidget .bp3-ui-text").should("be.visible");
cy.get(".t--draggable-textwidget .bp3-ui-text").should("have.value", "");
});
});

View File

@ -32,7 +32,7 @@ describe("Test Create Api and Bind to Table widget", function() {
it("Test_Validate the Api data is updated on List widget", function() {
cy.SearchEntityandOpen("List1");
cy.testJsontext("items", "{{Api1.data.users}}");
cy.get(".t--draggable-textwidget span").should("have.length.gte", 8);
cy.get(".t--draggable-textwidget span").should("have.length", 8);
cy.get(".t--draggable-textwidget span")
.first()
.invoke("text")
@ -50,7 +50,7 @@ describe("Test Create Api and Bind to Table widget", function() {
},
).then(() => cy.wait(500));
cy.get(".t--widget-textwidget span").should("have.length.gte", 8);
cy.get(".t--widget-textwidget span").should("have.length", 8);
cy.get(".t--widget-textwidget span")
.first()
.invoke("text")
@ -63,7 +63,7 @@ describe("Test Create Api and Bind to Table widget", function() {
cy.get(publishPage.backToEditor).click({ force: true });
cy.SearchEntityandOpen("List1");
cy.testJsontext("itemspacing\\(px\\)", "50");
cy.get(".t--draggable-textwidget span").should("have.length.gte", 6);
cy.get(".t--draggable-textwidget span").should("have.length", 6);
cy.get(".t--draggable-textwidget span")
.first()
.invoke("text")
@ -79,7 +79,7 @@ describe("Test Create Api and Bind to Table widget", function() {
interval: 1000,
},
).then(() => cy.wait(500));
cy.get(".t--widget-textwidget span").should("have.length.gte", 6);
cy.get(".t--widget-textwidget span").should("have.length", 6);
cy.get(".t--widget-textwidget span")
.first()
.invoke("text")

View File

@ -15,7 +15,7 @@ describe("Validate Create Api and Bind to Table widget via JSObject", () => {
it("1. Bind Input widget with JSObject", function () {
jsEditor.CreateJSObject('return "Success";', false);
agHelper.SelectEntityByName("WIDGETS")//to expand widgets
agHelper.expandCollapseEntity("WIDGETS")//to expand widgets
agHelper.expandCollapseEntity("Form1")
agHelper.SelectEntityByName("Input2")
cy.get("@jsObjName").then((jsObjName) => {

View File

@ -15,7 +15,7 @@ describe("Validate basic operations on Entity explorer JSEditor structure", () =
cy.fixture('promisesBtnDsl').then((val: any) => {
agHelper.AddDsl(val)
});
agHelper.SelectEntityByName("WIDGETS")//to expand widgets
agHelper.expandCollapseEntity("WIDGETS")//to expand widgets
agHelper.SelectEntityByName("Button1");
jsEditor.EnterJSContext('onclick', "{{storeValue('date', Date()).then(() => showAlert(appsmith.store.date))}}", true, true);
agHelper.ClickButton('Submit')
@ -29,7 +29,7 @@ describe("Validate basic operations on Entity explorer JSEditor structure", () =
cy.fixture("promisesBtnDsl").then((val: any) => {
agHelper.AddDsl(val);
});
agHelper.SelectEntityByName("WIDGETS");
agHelper.expandCollapseEntity("WIDGETS");
agHelper.SelectEntityByName("Button1");
jsEditor.EnterJSContext(
"onclick",
@ -61,7 +61,7 @@ describe("Validate basic operations on Entity explorer JSEditor structure", () =
key: "name",
value: "{{this.params.country}}",
}); // verifies Bug 10055
agHelper.SelectEntityByName("WIDGETS");
agHelper.expandCollapseEntity("WIDGETS");
agHelper.SelectEntityByName("Button1");
jsEditor.EnterJSContext(
"onclick",
@ -93,7 +93,7 @@ describe("Validate basic operations on Entity explorer JSEditor structure", () =
"https://source.unsplash.com/collection/8439505",
"Christmas",
);
agHelper.SelectEntityByName("WIDGETS"); //to expand widgets
agHelper.expandCollapseEntity("WIDGETS"); //to expand widgets
agHelper.SelectEntityByName("Button1");
jsEditor.EnterJSContext(
"onclick",
@ -108,7 +108,7 @@ describe("Validate basic operations on Entity explorer JSEditor structure", () =
true,
);
agHelper.SelectEntityByName("Image1");
jsEditor.EnterJSContext("image", `{{ Christmas.data }}`, true);
jsEditor.EnterJSContext("image", `{{Christmas.data}}`, true);
agHelper.WaitUntilEleDisappear(
locator._toastMsg,
"will be executed automatically on page load",
@ -126,7 +126,7 @@ describe("Validate basic operations on Entity explorer JSEditor structure", () =
apiPage.CreateAndFillApi("https://favqs.com/api/qotd", "InspiringQuotes");
jsEditor.CreateJSObject(`const user = 'You';
return InspiringQuotes.run().then((res) => { showAlert("Today's quote for " + user + " is " + JSON.stringify(res.quote.body), 'success') }).catch(() => showAlert("Unable to fetch quote for " + user, 'warning'))`);
agHelper.SelectEntityByName("WIDGETS"); //to expand widgets
agHelper.expandCollapseEntity("WIDGETS"); //to expand widgets
agHelper.SelectEntityByName("Button1");
cy.get("@jsObjName").then((jsObjName) => {
jsEditor.EnterJSContext('onclick', "{{" + jsObjName + ".myFun1()}}", true, true);
@ -137,35 +137,20 @@ return InspiringQuotes.run().then((res) => { showAlert("Today's quote for " + us
.should("contain.text", "Today's quote for You");
});
//Skipping until this bug is closed!
it.skip("6. Bug 9782: Verify .then & .catch (show alert should trigger) via JS Objects without return keyword", () => {
cy.fixture('promisesBtnDsl').then((val: any) => {
agHelper.AddDsl(val)
});
jsEditor.CreateJSObject(`const user = 'You';
InspiringQuotes.run().then((res) => { showAlert("Today's quote for " + user + " is " + JSON.stringify(res.quote.body), 'success') }).catch(() => showAlert("Unable to fetch quote for " + user, 'warning'))`);
agHelper.SelectEntityByName("Button1");
cy.get("@jsObjName").then((jsObjName) => {
jsEditor.EnterJSContext('onclick', "{{" + jsObjName + ".myFun1()}}", true, true);
});
agHelper.ClickButton('Submit')
cy.get(locator._toastMsg).should("have.length", 1).should("contain.text", "Today's quote for You");
});
it("7. Verify Promise.race via direct Promises", () => {
it("6. Verify Promise.race via direct Promises", () => {
cy.fixture('promisesBtnDsl').then((val: any) => {
agHelper.AddDsl(val)
});
apiPage.CreateAndFillApi("https://api.agify.io?name={{this.params.person}}", "Agify")
apiPage.ValidateQueryParams({ key: "name", value: "{{this.params.person}}" }); // verifies Bug 10055
agHelper.SelectEntityByName("WIDGETS")
agHelper.expandCollapseEntity("WIDGETS")
agHelper.SelectEntityByName("Button1");
jsEditor.EnterJSContext('onclick', `{{ Promise.race([Agify.run({ person: 'Melinda' }), Agify.run({ person: 'Trump' })]).then((res) => { showAlert('Winner is ' + JSON.stringify(res.name), 'success') }) }} `, true, true);
agHelper.ClickButton('Submit')
cy.get(locator._toastMsg).should("have.length", 1).contains(/Melinda|Trump/g)
})
it("8. Verify maintaining context via direct Promises", () => {
it("7. Verify maintaining context via direct Promises", () => {
cy.fixture("promisesBtnListDsl").then((val: any) => {
agHelper.AddDsl(val);
});
@ -173,7 +158,7 @@ InspiringQuotes.run().then((res) => { showAlert("Today's quote for " + user + "
"https://api.jikan.moe/v3/search/anime?q={{this.params.name}}",
"GetAnime",
);
agHelper.SelectEntityByName("WIDGETS"); //to expand widgets
agHelper.expandCollapseEntity("WIDGETS"); //to expand widgets
agHelper.SelectEntityByName("List1");
jsEditor.EnterJSContext(
"items",
@ -218,11 +203,11 @@ InspiringQuotes.run().then((res) => { showAlert("Today's quote for " + user + "
.should("have.text", "Showing results for : fruits basket : the final");
});
it("9: Verify Promise.all via direct Promises", () => {
it("8: Verify Promise.all via direct Promises", () => {
cy.fixture('promisesBtnDsl').then((val: any) => {
agHelper.AddDsl(val)
});
agHelper.SelectEntityByName("WIDGETS")//to expand widgets
agHelper.expandCollapseEntity("WIDGETS")//to expand widgets
agHelper.SelectEntityByName("Button1");
jsEditor.EnterJSContext('onclick', `{{
(function () {
@ -239,60 +224,74 @@ InspiringQuotes.run().then((res) => { showAlert("Today's quote for " + user + "
cy.get(locator._toastMsg).should("have.length", 1).should("have.text", "cat,dog,camel,rabbit,rat")
});
//Skipping until this bug is closed!
it.skip("10. Bug 10150: Verify Promise.all via JSObjects", () => {
it("9. Bug 10150: Verify Promise.all via JSObjects", () => {
let date = new Date().toDateString();
cy.fixture('promisesBtnDsl').then((val: any) => {
agHelper.AddDsl(val)
});
jsEditor.CreateJSObject(`let allFuncs = [Genderize.run({ country: 'India' }),
RandomUser.run(),
GetAnime.run({ name: 'Odd Taxi' }),
GetAnime.run({ name: 'Gintama' }),
InspiringQuotes.run(),
Agify.run({ person: 'Scripty' }),
Christmas.run()
]
return Promise.all(allFuncs).then(() => showAlert("Wonderful! all apis executed", "success")).catch(() => showAlert("Please check your api's again", "error")); `)
showAlert("Running all api's", "warning");
return Promise.all(allFuncs).then(() =>
showAlert("Wonderful! all apis executed", "success")).catch(() => showAlert("Please check your api's again", "error")); `)
// apiPage.CreateAndFillApi("https://api.agify.io?name={{this.params.person}}", "Agify")
// apiPage.ValidateQueryParams({ key: "name", value: "{{this.params.person}}" }); // verifies Bug 10055
agHelper.SelectEntityByName("WIDGETS")
agHelper.expandCollapseEntity("WIDGETS")
agHelper.SelectEntityByName("Button1");
cy.get("@jsObjName").then((jsObjName) => {
jsEditor.EnterJSContext('onclick', "{{storeValue('date', Date()).then(() => { showAlert(appsmith.store.date, 'success'); " + jsObjName + ".myFun1()})}}", true, true);
jsEditor.EnterJSContext('onclick', "{{storeValue('date', Date()).then(() => { showAlert(appsmith.store.date, 'success'); return " + jsObjName + ".myFun1()})}}", true, true);
});
agHelper.ClickButton('Submit')
cy.get(locator._toastMsg).should("have.length", 2)
cy.get(locator._toastMsg).first().should('contain.text', date)
agHelper.WaitUntilEleAppear(locator._toastMsg)
cy.get(locator._toastMsg).should("have.length", 3)
cy.get(locator._toastMsg).eq(0).should('contain.text', date)
cy.get(locator._toastMsg).eq(1).contains("Running all api's")
agHelper.WaitUntilEleAppear(locator._toastMsg)
cy.get(locator._toastMsg).last().contains(/Wonderful|Please check/g)
});
//To skip until clarified
it.skip("11. Verify Promises.any via direct Promises", () => {
it("10. Verify Promises.any via direct JSObjects", () => {
cy.fixture('promisesBtnDsl').then((val: any) => {
agHelper.AddDsl(val)
});
jsEditor.CreateJSObject(`export default {
func2: async () => {
return Promise.reject(new Error('fail')).then(showAlert("Promises reject from func2"));
},
func1: async () => {
showAlert("In func1")
return "func1"
},
func3: async () => {
showAlert("In func3")
return "func3"
},
runAny: async () => {
return Promise.any([this.func2(), this.func3(), this.func1()]).then((value) => showAlert("Resolved promise is:" + value))
}
}`, true, true)
agHelper.expandCollapseEntity('WIDGETS')
agHelper.SelectEntityByName("Button1");
jsEditor.EnterJSContext('onclick', `{{
const promise1 = Promise.reject(0);
const promise2 = new Promise((resolve) => setTimeout(resolve, 100, 'quick'));
const promise3 = new Promise((resolve) => setTimeout(resolve, 500, 'slow'));
const promises = [promise1, promise2, promise3];
Promise.any(promises).then((value) => showAlert("Resolved promise is:" + value));
}} `, true, true);
cy.get("@jsObjName").then((jsObjName) => {
jsEditor.EnterJSContext('onclick', "{{" + jsObjName + ".runAny()}}", true, true);
});
agHelper.ClickButton('Submit')
cy.get(locator._toastMsg)
.should("have.length", 1)
.should("contain.text", "We are on planet Earth");
.should("have.length", 4)
cy.get(locator._toastMsg).eq(0).contains('Promises reject from func2')
cy.get(locator._toastMsg).last().contains('Resolved promise is:func3')
});
it("12. Verify resetWidget via .then direct Promises", () => {
it("11. Bug : 11110 - Verify resetWidget via .then direct Promises", () => {
cy.fixture("promisesBtnDsl").then((dsl: any) => {
agHelper.AddDsl(dsl);
});
agHelper.SelectEntityByName("WIDGETS"); //to expand widgets
agHelper.expandCollapseEntity("WIDGETS"); //to expand widgets
agHelper.SelectEntityByName("Button1");
jsEditor.EnterJSContext(
"onclick",
@ -310,6 +309,21 @@ return Promise.all(allFuncs).then(() => showAlert("Wonderful! all apis executed"
agHelper.NavigateBacktoEditor()
})
//Skipping until this bug this is addressed!
it.skip("12. Bug 9782: Verify .then & .catch (show alert should trigger) via JS Objects without return keyword", () => {
cy.fixture('promisesBtnDsl').then((val: any) => {
agHelper.AddDsl(val)
});
jsEditor.CreateJSObject(`const user = 'You';
InspiringQuotes.run().then((res) => { showAlert("Today's quote for " + user + " is " + JSON.stringify(res.quote.body), 'success') }).catch(() => showAlert("Unable to fetch quote for " + user, 'warning'))`);
agHelper.SelectEntityByName("Button1");
cy.get("@jsObjName").then((jsObjName) => {
jsEditor.EnterJSContext('onclick', "{{" + jsObjName + ".myFun1()}}", true, true);
});
agHelper.ClickButton('Submit')
cy.get(locator._toastMsg).should("have.length", 1).should("contain.text", "Today's quote for You");
});
})

View File

@ -33,7 +33,7 @@ describe("Text-Table Binding Functionality", function() {
.find("span")
.click();
cy.EvaluateDataType("string");
cy.EvaluateCurrentValue(tabValue);
cy.validateEvaluatedValue(tabValue);
cy.PublishtheApp();
cy.isSelectRow(1);
cy.readTabledataPublish("1", "0").then((tabDataP) => {
@ -61,7 +61,7 @@ describe("Text-Table Binding Functionality", function() {
.find("span")
.click();
cy.EvaluateDataType("string");
cy.EvaluateCurrentValue(tabValue);
cy.validateEvaluatedValue(tabValue);
cy.PublishtheApp();
cy.isSelectRow(2);
cy.readTabledataPublish("2", "1").then((tabDataP) => {
@ -86,7 +86,7 @@ describe("Text-Table Binding Functionality", function() {
.find("span")
.click();
cy.EvaluateDataType("string");
cy.EvaluateCurrentValue(listingCount);
cy.validateEvaluatedValue(listingCount);
cy.PublishtheApp();
cy.get(publish.tableLength)
.find(".tr")
@ -139,7 +139,7 @@ describe("Text-Table Binding Functionality", function() {
.find("span")
.click();
cy.EvaluateDataType("string");
cy.EvaluateCurrentValue(tabValue);
cy.validateEvaluatedValue(tabValue);
cy.PublishtheApp();
cy.isSelectRow(1);
cy.readTabledataPublish("1", "2").then((tabDataP) => {

View File

@ -2,7 +2,6 @@ import commentsLocators from "../../../../locators/CommentsLocators";
const commonLocators = require("../../../../locators/commonlocators.json");
import homePage from "../../../../locators/HomePage";
const dsl = require("../../../../fixtures/basicDsl.json");
const { typeIntoDraftEditor } = require("./utils");
const newCommentText1 = "new comment text 1";
let commentThreadId;
@ -59,7 +58,7 @@ describe("Comments", function() {
cy.wait(1000);
cy.get(commonLocators.canvas).click(50, 50);
typeIntoDraftEditor(commentsLocators.mentionsInput, newCommentText1);
cy.typeIntoDraftEditor(commentsLocators.mentionsInput, newCommentText1);
cy.get(commentsLocators.mentionsInput).type("{enter}");
// when user adds first comment, following command will count for the headers of the comment card
// in case of "Skip Tour" this has to be 2.
@ -96,7 +95,7 @@ describe("Comments", function() {
cy.get(commentsLocators.switchToCommentModeBtn).click({ force: true });
cy.get(commonLocators.canvas).click(50, 50);
typeIntoDraftEditor(commentsLocators.mentionsInput, newCommentText1);
cy.typeIntoDraftEditor(commentsLocators.mentionsInput, newCommentText1);
cy.get(commentsLocators.mentionsInput).type("{enter}");
cy.get("[data-cy=comments-card-header]")
.its("length")
@ -110,7 +109,7 @@ describe("Comments", function() {
// wait for transition to be completed
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(300);
typeIntoDraftEditor(commentsLocators.mentionsInput, newCommentText1);
cy.typeIntoDraftEditor(commentsLocators.mentionsInput, newCommentText1);
cy.get(commentsLocators.mentionsInput).type("{enter}");
cy.wait("@createNewThread").then((response) => {
commentThreadId = response.response.body.data.id;

View File

@ -1,12 +0,0 @@
export function typeIntoDraftEditor(selector, text) {
cy.get(selector).then((input) => {
var textarea = input.get(0);
textarea.dispatchEvent(new Event("focus"));
var textEvent = document.createEvent("TextEvent");
textEvent.initTextEvent("textInput", true, true, null, text);
textarea.dispatchEvent(textEvent);
textarea.dispatchEvent(new Event("blur"));
});
}

View File

@ -21,7 +21,7 @@ describe("Input widget test with default value from chart datapoint", () => {
});
it("1. Input widget test with default value from another Input widget", () => {
agHelper.SelectEntityByName("WIDGETS")
agHelper.expandCollapseEntity("WIDGETS")
agHelper.SelectEntityByName("Input1")
jsEditor.EnterJSContext("defaulttext", dataSet.bindChartData + "}}");
agHelper.ValidateNetworkCallRespPut('@updateLayout')

View File

@ -11,7 +11,7 @@ describe("DocumentViewer Widget Functionality", () => {
it("2. Modify visibility & Publish app & verify", () => {
agHelper.NavigateToExplorer();
cy.CheckAndUnfoldEntityItem("WIDGETS"); //to expand widgets
agHelper.expandCollapseEntity("WIDGETS"); //to expand widgets
agHelper.SelectEntityByName("DocumentViewer1");
agHelper.ToggleOrDisable("visible", false);
agHelper.DeployApp();
@ -22,7 +22,7 @@ describe("DocumentViewer Widget Functionality", () => {
});
it("3. Change visibility & Publish app & verify again", () => {
cy.CheckAndUnfoldEntityItem("WIDGETS"); //to expand widgets
agHelper.expandCollapseEntity("WIDGETS"); //to expand widgets
agHelper.SelectEntityByName("DocumentViewer1");
agHelper.ToggleOrDisable("visible");
agHelper.DeployApp();

View File

@ -66,12 +66,11 @@ describe("Dropdown Widget Functionality", function() {
);
});
it.skip("should check that Objects can be added to Select Widget default value", () => {
it("should check that Objects can be added to Select Widget default value", () => {
cy.openPropertyPane("selectwidget");
cy.updateCodeInput(
".t--property-control-options",
`[
{
`[{
"label": "Blue",
"value": "BLUE"
},
@ -82,25 +81,16 @@ describe("Dropdown Widget Functionality", function() {
{
"label": "Red",
"value": "RED"
}
]`,
);
cy.updateCodeInput(
".t--property-control-defaultvalue",
`
{
"label": "Green",
"value": "GREEN"
}
`,
}]`,
);
cy.updateCodeInput(".t--property-control-defaultvalue", "BLUE");
cy.get(".t--property-control-options .t--codemirror-has-error").should(
"not.exist",
);
cy.get(".t--property-control-defaultvalue .t--codemirror-has-error").should(
"not.exist",
);
cy.get(formWidgetsPage.dropdownDefaultButton).should("contain", "Green");
cy.get(formWidgetsPage.dropdownDefaultButton).should("contain", "Blue");
});
it("Dropdown Functionality To Check disabled Widget", function() {

View File

@ -1,23 +1,26 @@
const dsl = require("../../../../fixtures/iconButtonWidgetsDsl.json");
const formWidgetsPage = require("../../../../locators/FormWidgets.json");
const commonlocators = require("../../../../locators/commonlocators.json");
const widgetsPage = require("../../../../locators/Widgets.json");
const publishPage = require("../../../../locators/publishWidgetspage.json");
describe("Icon Button Widget Functionality", function() {
before(() => {
cy.addDsl(dsl);
});
it("check default buttonVariant with isJSConvertible", function() {
it("1. check default buttonVariant with isJSConvertible", function() {
cy.openPropertyPane("iconbuttonwidget");
cy.get(formWidgetsPage.toggleButtonVariant).click();
cy.get(".t--draggable-iconbuttonwidget button").should(
cy.get(widgetsPage.iconWidgetBtn).should(
"have.css",
"background-color",
"rgb(3, 179, 101)",
);
});
it("add space into buttonVariant and validate", function() {
it("2. add space into buttonVariant and validate", function() {
cy.get(".t--property-control-buttonvariant .CodeMirror textarea")
.first()
.focus()
@ -35,10 +38,38 @@ describe("Icon Button Widget Functionality", function() {
"PRIMARY ",
);
cy.get(".t--draggable-iconbuttonwidget button").should(
cy.get(widgetsPage.iconWidgetBtn).should(
"have.css",
"background-color",
"rgb(3, 179, 101)",
);
});
it("3. show alert on button click", function() {
cy.get(".t--property-control-onclick")
.find(".t--js-toggle")
.click({ force: true });
cy.testJsontext(
"onclick",
"{{showAlert('Icon Button Clicked','success')}}",
);
cy.get(widgetsPage.iconWidgetBtn).click({ force: true });
cy.get(commonlocators.toastmsg).contains("Icon Button Clicked");
cy.PublishtheApp();
cy.get(publishPage.iconWidgetBtn).click({ force: true });
cy.get(commonlocators.toastmsg).contains("Icon Button Clicked");
cy.goToEditFromPublish();
});
it("4. should not show alert onclick if button is disabled", function() {
cy.openPropertyPane("iconbuttonwidget");
cy.CheckWidgetProperties(commonlocators.disableCheckbox);
cy.get(widgetsPage.iconWidgetBtn).click({ force: true });
cy.get(commonlocators.toastmsg).should("not.exist");
cy.PublishtheApp();
cy.get(publishPage.iconWidgetBtn).click({ force: true });
cy.get(commonlocators.toastmsg).should("not.exist");
});
});

View File

@ -0,0 +1,189 @@
const explorer = require("../../../../locators/explorerlocators.json");
const dsl = require("../../../../fixtures/InputWidgetV2InsideListDSL.json");
const widgetName = "inputwidgetv2";
const widgetInput = `.t--widget-${widgetName} input`;
describe("Input widget V2 - ", () => {
before(() => {
cy.addDsl(dsl);
});
it("1. Validate input widget resets OnSubmit", () => {
cy.openPropertyPane(widgetName);
cy.get(
".t--property-control-onsubmit .t--open-dropdown-Select-Action",
).click();
cy.selectShowMsg();
cy.addSuccessMessage("Submitted!!");
cy.get(widgetInput).clear({ force: true });
cy.wait(300);
cy.get(widgetInput).type("test{enter}"); //Clicking enter submits the form here
cy.wait(300);
cy.get(widgetInput).should("contain.value", "");
});
it("2. Validate DataType - TEXT can be entered into Input widget", () => {
[
{
input: "test",
expected: "test:true:false",
},
{
input: "test123",
expected: "test123:true:false",
},
{
input: "123",
expected: "123:true:false",
},
{
input: "",
expected: ":true:false",
},
{
input: "$100.22",
expected: "$100.22:true:false",
},
{
input: "test@appsmith.com",
expected: "test@appsmith.com:true:false",
},
].forEach(({ expected, input }) => enterAndTest(input, expected));
});
it("3. Validate DataType - NUMBER can be entered into Input widget", () => {
cy.openPropertyPane(widgetName);
cy.selectDropdownValue(".t--property-control-datatype", "Number");
cy.get(".t--property-control-required label")
.last()
.click({ force: true });
cy.selectDropdownValue(".t--property-control-datatype", "Number");
[
{
input: "invalid",
expected: "null:true:false",
},
{
input: "invalid123",
expected: "123:true:false",
},
{
input: "123",
expected: "123:true:false",
},
{
input: "-",
expected: "null:true:false",
},
{
input: "",
expected: "null:true:false",
},
{
input: "$100.22",
expected: "100.22:true:false",
},
{
input: "invalid@appsmith.com",
expected: "null:true:false",
},
{
input: "1.001",
expected: "1.001:true:false",
},
{
input: "1.1.",
expected: "null:true:false",
},
].forEach(({ expected, input }) => enterAndTest(input, expected));
});
it("4. Validate DataType - PASSWORD can be entered into Input widget", () => {
cy.openPropertyPane(widgetName);
cy.selectDropdownValue(".t--property-control-datatype", "Password");
[
{
input: "test",
expected: "test:true:false",
},
{
input: "test123",
expected: "test123:true:false",
},
{
input: "123",
expected: "123:true:false",
},
{
input: "-",
expected: "-:true:false",
},
{
input: "",
expected: ":true:false",
},
{
input: "$100.22",
expected: "$100.22:true:false",
},
{
input: "test@appsmith.com",
expected: "test@appsmith.com:true:false",
},
].forEach(({ expected, input }) => enterAndTest(input, expected));
});
it("5. Validate DataType - EMAIL can be entered into Input widget", () => {
cy.openPropertyPane(widgetName);
cy.selectDropdownValue(".t--property-control-datatype", "Email");
cy.get(".t--property-control-required label")
.last()
.click({ force: true });
[
{
input: "test",
expected: "test:true:false",
},
{
input: "test123",
expected: "test123:true:false",
},
{
input: "123",
expected: "123:true:false",
},
{
input: "-",
expected: "-:true:false",
},
{
input: "",
expected: ":true:false",
},
{
input: "$100.22",
expected: "$100.22:true:false",
},
{
input: "test@appsmith.com",
expected: "test@appsmith.com:true:false",
},
].forEach(({ expected, input }) => enterAndTest(input, expected));
});
function enterAndTest(text, expected) {
cy.get(`.t--widget-${widgetName} input`).clear({ force: true });
cy.wait(300);
if (text) {
cy.get(`.t--widget-${widgetName} input`)
.click()
.type(text);
}
cy.get(".t--widget-textwidget").should("contain", expected);
}
});

View File

@ -8,7 +8,7 @@ describe("List Widget Functionality", function() {
});
it("should validate that restricted widgets cannot be added to List", () => {
cy.get(explorer.addWidget).click();
cy.get(explorer.widgetSwitchId).click();
const allowed = [
"audiowidget",

View File

@ -15,16 +15,16 @@ describe("Migration Validate", function() {
cy.xpath(homePage.uploadLogo)
.attachFile("TableMigrationAppExported.json")
.wait(500);
cy.get(homePage.orgImportAppButton)
.trigger("click")
.wait(500);
// cy.get(homePage.orgImportAppButton)
// .trigger("click")
// .wait(500);
cy.get(homePage.orgImportAppModal).should("not.exist");
cy.wait("@importNewApplication").then((interception) => {
let appId = interception.response.body.data.id;
let defaultPage = interception.response.body.data.pages.find(
(eachPage) => !!eachPage.isDefault,
);
// let appId = interception.response.body.data.id;
// let defaultPage = interception.response.body.data.pages.find(
// (eachPage) => !!eachPage.isDefault,
// );
cy.get(homePage.toastMessage).should(
"contain",

View File

@ -102,4 +102,42 @@ describe("MultiSelect Widget Functionality", function() {
.first()
.should("have.text", "Green");
});
it("should display the right label", () => {
cy.openPropertyPane("multiselectwidgetv2");
cy.updateCodeInput(
".t--property-control-options",
`[
{
"label": "Blue",
"value": "BLUE"
},
{
"label": "Green",
"value": "GREEN"
},
{
"label": "Red",
"value": "RED"
}
]`,
);
cy.updateCodeInput(
".t--property-control-defaultvalue",
`[
"GREEN",
"RED"
]`,
);
cy.get(".t--property-control-options .t--codemirror-has-error").should(
"not.exist",
);
cy.get(".t--property-control-defaultvalue .t--codemirror-has-error").should(
"not.exist",
);
cy.wait(100);
cy.get(formWidgetsPage.multiselectwidgetv2)
.find(".rc-select-selection-item-content")
.first()
.should("have.text", "Green");
});
});

View File

@ -4,15 +4,24 @@ const explorer = require("../../../../locators/explorerlocators.json");
describe("Switchgroup Widget Functionality", function() {
before(() => {
cy.addDsl(dsl);
cy.wait(5000);
});
it("Add new widget", () => {
it("1. Add a new switch group widget with others", () => {
cy.get(explorer.addWidget).click();
cy.dragAndDropToCanvas("switchgroupwidget", { x: 300, y: 300 });
cy.get(".t--widget-switchgroupwidget").should("exist");
cy.dragAndDropToCanvas("checkboxgroupwidget", { x: 300, y: 500 });
cy.get(".t--widget-checkboxgroupwidget").should("exist");
cy.dragAndDropToCanvas("textwidget", { x: 300, y: 700 });
cy.get(".t--widget-textwidget").should("exist");
cy.updateCodeInput(
".t--property-control-text",
`{{SwitchGroup1.selectedValues}}`,
);
});
it("should check that empty value is allowed in options", () => {
it("2. Should check that empty value is allowed in options", () => {
cy.openPropertyPane("switchgroupwidget");
cy.updateCodeInput(
".t--property-control-options",
@ -36,7 +45,7 @@ describe("Switchgroup Widget Functionality", function() {
);
});
it("should check that more thatn empty value is not allowed in options", () => {
it("3. Should check that more thatn empty value is not allowed in options", () => {
cy.openPropertyPane("switchgroupwidget");
cy.updateCodeInput(
".t--property-control-options",
@ -59,4 +68,49 @@ describe("Switchgroup Widget Functionality", function() {
"exist",
);
});
it("4. Setting selectedValues to undefined does not crash the app", () => {
// Reset options for switch group
cy.openPropertyPane("switchgroupwidget");
cy.updateCodeInput(
".t--property-control-options",
`[
{
"label": "Blue",
"value": "BLUE"
},
{
"label": "Green",
"value": "GREEN"
},
{
"label": "Red",
"value": "RED"
}
]`,
);
// throw a cyclic dependency error from checkbox group
cy.openPropertyPane("checkboxgroupwidget");
cy.get(".t--property-control-options input")
.eq(1)
.click({ force: true })
.type("{{BLUE}}", { parseSpecialCharSequences: false });
cy.get(".t--property-control-options")
.find(".t--js-toggle")
.trigger("click")
.wait(1000);
// wait for a cyclic dependency error to occur
cy.validateToastMessage("Cyclic dependency found while evaluating");
// check if a crash messsge is appeared
cy.get(".t--widget-switchgroupwidget")
.contains("Oops, Something went wrong.")
.should("not.exist");
cy.wait(1000);
// check if the evaluation is disabled
cy.get(".t--widget-textwidget").should(
"contain",
`{{SwitchGroup1.selectedValues}}`,
);
});
});

View File

@ -0,0 +1,78 @@
const widgetsPage = require("../../../../locators/Widgets.json");
const dsl = require("../../../../fixtures/tableNewDsl.json");
const publish = require("../../../../locators/publishWidgetspage.json");
describe("Table Widget property pane feature validation", function() {
before(() => {
cy.addDsl(dsl);
});
it("1. Test to validate text color and text background", function() {
// Open property pane
cy.openPropertyPane("tablewidget");
// Click on text color input field
cy.get(widgetsPage.textColor)
.first()
.click({ force: true });
// Select green color
cy.get(widgetsPage.greenColor)
.last()
.click();
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(500);
cy.wait("@updateLayout");
// Verify the text color is green
cy.readTabledataValidateCSS("1", "0", "color", "rgb(3, 179, 101)");
// Change the text color and enter purple in input field
cy.get(widgetsPage.textColor)
.scrollIntoView()
.clear({ force: true })
.type("purple", { force: true });
cy.wait("@updateLayout");
// Verify the text color is purple
cy.readTabledataValidateCSS("1", "0", "color", "rgb(128, 0, 128)");
// Click on cell background color
cy.get(`${widgetsPage.cellBackground} input`)
.first()
.scrollIntoView()
.click({ force: true });
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(500);
// select the green color
cy.get(widgetsPage.greenColor)
.last()
.click();
cy.wait("@updateLayout");
cy.assertPageSave();
cy.PublishtheApp();
cy.wait(4000);
// Verify the cell background color is green
cy.readTabledataValidateCSS(
"1",
"1",
"background-color",
"rgb(3, 179, 101)",
);
cy.get(publish.backToEditor).click();
cy.openPropertyPane("tablewidget");
// Change the cell background color and enter purple in input field
cy.get(`${widgetsPage.cellBackground} input`)
.clear({ force: true })
.type("purple", { force: true });
cy.wait("@updateLayout");
cy.assertPageSave();
cy.PublishtheApp();
cy.wait(4000);
// Verify the cell background color is purple
cy.readTabledataValidateCSS(
"1",
"1",
"background-color",
"rgb(128, 0, 128)",
);
cy.get(publish.backToEditor).click();
});
});

View File

@ -0,0 +1,58 @@
const widgetsPage = require("../../../../locators/Widgets.json");
const commonlocators = require("../../../../locators/commonlocators.json");
const publish = require("../../../../locators/publishWidgetspage.json");
const dsl = require("../../../../fixtures/tableAndTextDsl.json");
describe("Table Widget Filtered Table Data in autocomplete", function() {
before(() => {
cy.addDsl(dsl);
});
it("Table Widget Functionality", function() {
cy.openPropertyPane("tablewidget");
cy.wait("@updateLayout");
});
it("Table Widget Functionality To Filter and search data", function() {
cy.get(publish.searchInput)
.first()
.type("query");
cy.get(publish.filterBtn).click();
cy.get(publish.attributeDropdown).click();
cy.get(publish.attributeValue)
.contains("task")
.click();
cy.get(publish.conditionDropdown).click();
cy.get(publish.attributeValue)
.contains("contains")
.click();
cy.get(publish.inputValue).type("bind");
cy.wait(500);
cy.get(widgetsPage.filterApplyBtn).click({ force: true });
cy.wait(500);
cy.get(".t--close-filter-btn").click({ force: true });
});
it("Table Widget Functionality to validate filtered table data", function() {
cy.SearchEntityandOpen("Text1");
cy.testJsontext("text", "{{Table1.filteredTableData[0].task}}");
cy.readTabledata("0", "1").then((tabData) => {
const tableData = tabData;
cy.get(commonlocators.labelTextStyle).should("have.text", tableData);
});
});
it("Table Widget Functionality to validate filtered table data with actual table data", function() {
cy.readTabledata("0", "1").then((tabData) => {
const tableData = JSON.parse(dsl.dsl.children[0].tableData);
cy.get(commonlocators.labelTextStyle).should(
"have.text",
tableData[2].task,
);
});
});
afterEach(() => {
// put your clean up code if any
});
});

View File

@ -199,74 +199,4 @@ describe("Table Widget property pane feature validation", function() {
cy.get(publish.backToEditor).click();
cy.wait(2000);
});
it("11. Test to validate text color and text background", function() {
// Open property pane
cy.openPropertyPane("tablewidget");
// Click on text color input field
cy.get(widgetsPage.textColor)
.first()
.click({ force: true });
// Select green color
cy.get(widgetsPage.greenColor)
.last()
.click();
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(500);
cy.wait("@updateLayout");
// Verify the text color is green
cy.readTabledataValidateCSS("1", "0", "color", "rgb(3, 179, 101)");
// Change the text color and enter purple in input field
cy.get(widgetsPage.textColor)
.scrollIntoView()
.clear({ force: true })
.type("purple", { force: true });
cy.wait("@updateLayout");
// Verify the text color is purple
cy.readTabledataValidateCSS("1", "0", "color", "rgb(128, 0, 128)");
// Click on cell background color
cy.get(`${widgetsPage.cellBackground} input`)
.first()
.scrollIntoView()
.click({ force: true });
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(500);
// select the green color
cy.get(widgetsPage.greenColor)
.last()
.click();
cy.wait("@updateLayout");
cy.wait(2000);
cy.PublishtheApp();
cy.wait(4000);
// Verify the cell background color is green
cy.readTabledataValidateCSS(
"1",
"1",
"background",
"rgb(3, 179, 101) none repeat scroll 0% 0% / auto padding-box border-box",
);
cy.get(publish.backToEditor).click();
cy.openPropertyPane("tablewidget");
// Change the cell background color and enter purple in input field
cy.get(`${widgetsPage.cellBackground} input`)
.clear({ force: true })
.type("purple", { force: true });
cy.wait("@updateLayout");
cy.wait(2000);
cy.PublishtheApp();
cy.wait(4000);
// Verify the cell background color is purple
cy.readTabledataValidateCSS(
"1",
"1",
"background",
"rgb(128, 0, 128) none repeat scroll 0% 0% / auto padding-box border-box",
);
cy.get(publish.backToEditor).click();
});
});

View File

@ -208,16 +208,16 @@ describe("Table Widget property pane feature validation", function() {
const color1 = "rgb(255, 255, 0)";
cy.get(widgetsPage.menuColor)
.click({ force: true })
.clear()
.click({ force: true })
.type(color1);
cy.get(widgetsPage.tableBtn).should("have.css", "background-color", color1);
// Changing the color again to reproduce issue #9526
const color2 = "rgb(255, 0, 0)";
cy.get(widgetsPage.menuColor)
.click({ force: true })
.clear()
.click({ force: true })
// following wait is required to reproduce #9526
.wait(500)
.type(color2);

View File

@ -41,7 +41,7 @@ describe("Test Suite to validate copy/paste table Widget", function() {
cy.hoverAndClickParticularIndex(1);
cy.selectAction("Show Bindings");
cy.get(apiwidget.propertyList).then(function($lis) {
expect($lis).to.have.length(12);
expect($lis).to.have.length(13);
expect($lis.eq(0)).to.contain("{{Table1Copy.selectedRow}}");
expect($lis.eq(1)).to.contain("{{Table1Copy.selectedRows}}");
});

View File

@ -1,9 +1,14 @@
const explorer = require("../../../../locators/explorerlocators.json");
const firstApiName = "First";
const secondApiName = "Second";
const {
AggregateHelper,
} = require("../../../../support/Pages/AggregateHelper");
const helper = new AggregateHelper();
describe("Api Naming conflict on a page test", function() {
it.skip("expects actions on the same page cannot have identical names", function() {
it("expects actions on the same page cannot have identical names", function() {
cy.log("Login Successful");
// create an API
cy.NavigateToAPI_Panel();
@ -12,9 +17,11 @@ describe("Api Naming conflict on a page test", function() {
// create another API
cy.NavigateToAPI_Panel();
cy.CreateAPI(secondApiName);
helper.expandCollapseEntity("QUERIES/JS", true);
// try to rename one of the APIs with an existing API name
cy.hoverAndClickParticularIndex(2);
cy.get(`.t--entity-item:contains(${secondApiName})`).within(() => {
cy.get(".t--context-menu").click({ force: true });
});
cy.selectAction("Edit Name");
//cy.RenameEntity(tabname);
cy.get(explorer.editEntity)
@ -23,8 +30,14 @@ describe("Api Naming conflict on a page test", function() {
//cy.RenameEntity(firstApiName);
cy.validateMessage(firstApiName);
cy.ClearSearch();
cy.DeleteAPIFromSideBar();
cy.DeleteAPIFromSideBar();
cy.get(`.t--entity-item:contains(${secondApiName})`).within(() => {
cy.get(".t--context-menu").click({ force: true });
});
cy.deleteActionAndConfirm();
cy.get(`.t--entity-item:contains(${firstApiName})`).within(() => {
cy.get(".t--context-menu").click({ force: true });
});
cy.deleteActionAndConfirm();
});
});
@ -33,45 +46,65 @@ describe("Api Naming conflict on different pages test", function() {
cy.log("Login Successful");
// create a new API
cy.CreateAPI(firstApiName);
helper.expandCollapseEntity("QUERIES/JS", true);
// create a new page and an API on that page
cy.Createpage("Page2");
cy.CreateAPI(firstApiName);
helper.expandCollapseEntity("QUERIES/JS", true);
cy.get(".t--entity-name")
.contains(firstApiName)
.should("exist");
cy.DeleteAPIFromSideBar();
cy.get(".t--entity-name")
.contains("Page2")
.trigger("mouseover");
cy.hoverAndClick();
cy.selectAction("Delete");
cy.get(`.t--entity-item:contains(${firstApiName})`).within(() => {
cy.get(".t--context-menu").click({ force: true });
});
cy.deleteActionAndConfirm();
cy.get(`.t--entity-item:contains(Page2)`).within(() => {
cy.get(".t--context-menu").click({ force: true });
});
cy.deleteActionAndConfirm();
cy.get(`.t--entity-item:contains(${firstApiName})`).within(() => {
cy.get(".t--context-menu").click({ force: true });
});
cy.deleteActionAndConfirm();
cy.wait(1000);
cy.DeleteAPIFromSideBar();
});
});
describe("Entity Naming conflict test", function() {
it("expects JS objects and actions to not have identical names on the same page.", function() {
cy.log("Login Successful");
helper.expandCollapseEntity("QUERIES/JS", true);
// create JS object and name it
cy.createJSObject('return "Hello World";');
cy.RenameEntity(firstApiName);
// create API and rename it, expect error to occur
cy.NavigateToAPI_Panel();
cy.CreateAPI(secondApiName);
cy.hoverAndClickParticularIndex(2);
cy.get(`.t--entity-item:contains('JSObject1')`).within(() => {
cy.get(".t--context-menu").click({ force: true });
});
cy.selectAction("Edit Name");
cy.get(explorer.editEntity)
.last()
.type(secondApiName, { force: true });
cy.VerifyPopOverMessage(secondApiName + " is already being used.", true);
cy.ClearSearch();
.type(firstApiName, { force: true });
cy.deleteJSObject();
cy.DeleteAPIFromSideBar();
cy.NavigateToHome();
cy.CreateAPI(secondApiName);
cy.get(`.t--entity-item:contains(${secondApiName})`).within(() => {
cy.get(".t--context-menu").click({ force: true });
});
cy.selectAction("Edit Name");
cy.get(explorer.editEntity)
.last()
.type(firstApiName, { force: true });
cy.VerifyPopOverMessage(firstApiName + " is already being used.", true);
cy.get("body").click(0, 0);
cy.wait(2000);
cy.get(`.t--entity-item:contains(${firstApiName})`).within(() => {
cy.get(".t--context-menu").click({ force: true });
});
cy.deleteActionAndConfirm();
cy.get(`.t--entity-item:contains(${secondApiName})`).within(() => {
cy.get(".t--context-menu").click({ force: true });
});
cy.deleteActionAndConfirm();
});
});

View File

@ -33,19 +33,20 @@ describe("Entity explorer tests related to widgets and validation", function() {
.last()
.click({ force: true });
cy.get(apiwidget.propertyList).then(function($lis) {
expect($lis).to.have.length(12);
expect($lis).to.have.length(13);
expect($lis.eq(0)).to.contain("{{Table1.selectedRow}}");
expect($lis.eq(1)).to.contain("{{Table1.selectedRows}}");
expect($lis.eq(2)).to.contain("{{Table1.selectedRowIndices}}");
expect($lis.eq(3)).to.contain("{{Table1.triggeredRow}}");
expect($lis.eq(4)).to.contain("{{Table1.selectedRowIndex}}");
expect($lis.eq(5)).to.contain("{{Table1.tableData}}");
expect($lis.eq(6)).to.contain("{{Table1.pageNo}}");
expect($lis.eq(7)).to.contain("{{Table1.pageSize}}");
expect($lis.eq(8)).to.contain("{{Table1.isVisible}}");
expect($lis.eq(9)).to.contain("{{Table1.searchText}}");
expect($lis.eq(10)).to.contain("{{Table1.totalRecordsCount}}");
expect($lis.eq(11)).to.contain("{{Table1.sortOrder}}");
expect($lis.eq(6)).to.contain("{{Table1.filteredTableData}}");
expect($lis.eq(7)).to.contain("{{Table1.pageNo}}");
expect($lis.eq(8)).to.contain("{{Table1.pageSize}}");
expect($lis.eq(9)).to.contain("{{Table1.isVisible}}");
expect($lis.eq(10)).to.contain("{{Table1.searchText}}");
expect($lis.eq(11)).to.contain("{{Table1.totalRecordsCount}}");
expect($lis.eq(12)).to.contain("{{Table1.sortOrder}}");
});
});

View File

@ -121,7 +121,9 @@ describe("Entity explorer tests related to query and datasource", function() {
.click({ force: true });
cy.contains(".t--datasource-name", datasourceName).click();
cy.get(".t--delete-datasource").click();
cy.get("[data-cy=t--confirm-modal-btn]").click();
cy.get(".t--delete-datasource")
.contains("Are you sure?")
.click();
cy.wait("@deleteDatasource").should(
"have.nested.property",
"response.body.responseMeta.status",

View File

@ -44,7 +44,7 @@ describe("Tab widget test", function() {
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(3000);
cy.validateMessage(tabname);
cy.deleteEntity();
cy.deleteEntityWithoutConfirmation();
cy.get(commonlocators.entityExplorersearch)
.clear({ force: true })
.type("Tab2", { force: true });

View File

@ -8,7 +8,6 @@ describe("Entity explorer tests related to widgets and validation", function() {
});
it("Widget edit/delete/copy to clipboard validation", function() {
cy.wait(30000);
cy.CheckAndUnfoldEntityItem("WIDGETS");
cy.selectEntityByName("Container4");
cy.get(".t--entity-collapse-toggle")

View File

@ -0,0 +1,148 @@
const dsl = require("../../../../fixtures/ButtonGroup_MenuButton_Width_dsl.json");
const widgetName = "buttongroupwidget";
describe("In a button group widget, menu button width", function() {
before(() => {
cy.addDsl(dsl);
});
it("If target width is smaller than min-width, The menu button popover width should be set to minimum width", () => {
const minWidth = 12 * 11.9375;
const widgetId = "yxjq5sck7d";
const menuButtonId = "groupButton3";
// Get the default menu button
cy.get(`.appsmith_widget_${widgetId} div.t--buttongroup-widget`)
.children()
.last()
.as("target");
// Open popover
cy.get("@target").click();
// Get the target width
cy.get("@target")
.invoke("outerWidth")
.then((targetWidth) => {
expect(targetWidth).to.be.lessThan(minWidth);
// Check if popover width is set to its target width
cy.get(
`.bp3-popover2.menu-button-width-${widgetId}-${menuButtonId}`,
).should("have.css", "width", `${minWidth}px`);
});
});
it("If target width is bigger than min width, The menu button popover width should always be the same as the target width", () => {
const minWidth = 12 * 11.9375;
const widgetId = "t5l24fccio";
const menuButtonId = "groupButton3";
// Get the default menu button
cy.get(`.appsmith_widget_${widgetId} div.t--buttongroup-widget`)
.children()
.last()
.as("target");
// Open popover
cy.get("@target").click();
// Get the target width
cy.get("@target")
.invoke("outerWidth")
.then((targetWidth) => {
expect(targetWidth).to.be.greaterThan(minWidth);
// Check if popover width is set to its target width
cy.get(
`.bp3-popover2.menu-button-width-${widgetId}-${menuButtonId}`,
).should("have.css", "width", `${targetWidth}px`);
});
});
it("After converting a simple button to a menu button, The menu button popover width should always be the same as the target width", () => {
const minWidth = 12 * 11.9375;
const widgetId = "t5l24fccio";
const menuButtonId = "groupButton1";
// Change the first button type to menu
cy.editColumn(menuButtonId);
cy.selectDropdownValue(".t--property-control-buttontype", "Menu");
cy.get(".t--add-menu-item-btn").click();
// Get the newly converted menu button
cy.get(`.appsmith_widget_${widgetId} div.t--buttongroup-widget`)
.children()
.first()
.as("target");
// Open popover
cy.get("@target").click();
// Get the target width
cy.get("@target")
.invoke("outerWidth")
.then((targetWidth) => {
expect(targetWidth).to.be.greaterThan(minWidth);
// Check if popover width is set to its target width
cy.get(
`.bp3-popover2.menu-button-width-${widgetId}-${menuButtonId}`,
).should("have.css", "width", `${targetWidth}px`);
});
});
it("If an existing menu button width changes, its popover width should always be the same as the changed target width", () => {
const minWidth = 12 * 11.9375;
const widgetId = "t5l24fccio";
const menuButtonId = "groupButton1";
cy.get(".t--property-pane-back-btn").click();
// Change the first button text
cy.get(".t--property-pane-section-buttons input")
.first()
.type("increase width");
cy.wait("@updateLayout").should(
"have.nested.property",
"response.body.responseMeta.status",
200,
);
// Get the menu button with its width changed
cy.get(`.appsmith_widget_${widgetId} div.t--buttongroup-widget`)
.children()
.first()
.as("target");
// Open popover
cy.get("@target").click();
// Get the target width
cy.get("@target")
.invoke("outerWidth")
.then((targetWidth) => {
expect(targetWidth).to.be.greaterThan(minWidth);
// Check if popover width is set to its target width
cy.get(
`.bp3-popover2.menu-button-width-${widgetId}-${menuButtonId}`,
).should("have.css", "width", `${targetWidth}px`);
});
});
it("After changing the orientation to vertical , The menu button popover width should always be the same as the target width", () => {
const widgetId = "mr048y04aq";
const menuButtonId = "groupButton3";
// Open property pane of ButtonGroup3
cy.get(`.appsmith_widget_${widgetId} div.t--buttongroup-widget`)
.children()
.first()
.click();
// Change its orientation to vetical
cy.selectDropdownValue(".t--property-control-orientation", "Vertical");
// Get the default menu button
cy.get(`.appsmith_widget_${widgetId} div.t--buttongroup-widget`)
.children()
.last()
.as("target");
// Open popover
cy.get("@target").click();
// Get the target width
cy.get("@target")
.invoke("outerWidth")
.then((targetWidth) => {
// Check if popover width is set to its target width
cy.get(
`.bp3-popover2.menu-button-width-${widgetId}-${menuButtonId}`,
).should("have.css", "width", `${targetWidth}px`);
});
});
after(() => {
// clean up after done
});
});

View File

@ -1,5 +1,7 @@
const explorer = require("../../../../locators/explorerlocators.json");
const widgetName = "buttongroupwidget";
describe("Button Group Widget Functionality", function() {
before(() => {
// no dsl required

View File

@ -8,6 +8,8 @@ const modalWidgetPage = require("../../../../locators/ModalWidget.json");
const datasource = require("../../../../locators/DatasourcesEditor.json");
const queryLocators = require("../../../../locators/QueryEditor.json");
const iconAlignmentProperty = ".t--property-control-iconalignment";
describe("Button Widget Functionality", function() {
before(() => {
cy.addDsl(dsl);
@ -17,6 +19,52 @@ describe("Button Widget Functionality", function() {
cy.openPropertyPane("buttonwidget");
});
it("Icon alignment should not change when changing the icon", () => {
// Add an icon
cy.get(".t--property-control-icon .bp3-icon-caret-down").click({
force: true,
});
cy.get(".bp3-icon-add")
.first()
.click({
force: true,
});
// Assert if the icon exists
cy.get(`${widgetsPage.buttonWidget} .bp3-icon-add`).should("exist");
// Change icon alignment to right
cy.get(`${iconAlignmentProperty} .t--button-tab-right`)
.last()
.click({
force: true,
});
cy.wait(200);
// Assert if the icon appears on the right hand side of the button text
cy.get(widgetsPage.buttonWidget)
.contains("Submit")
.children("span")
.should("have.length", 2);
cy.get(`${widgetsPage.buttonWidget} span.bp3-button-text`)
.next()
.should("have.class", "bp3-icon-add");
// Change the existing icon
cy.get(".t--property-control-icon .bp3-icon-caret-down").click({
force: true,
});
cy.get(".bp3-icon-airplane")
.first()
.click({
force: true,
});
// Assert if the icon changes
// Assert if the icon still exists on the right side of the text
cy.get(`${widgetsPage.buttonWidget} .bp3-icon-airplane`)
.should("exist")
.prev()
.should("have.text", "Submit");
});
it("Button-Color Validation", function() {
// Change button color
cy.changeButtonColor("rgb(255, 0, 0)");

View File

@ -7,30 +7,51 @@ describe("Button Widget Functionality - Validate tooltip visibility", function()
cy.addDsl(dsl);
});
it("Validate show tooltip on button hover", function() {
it("Validate show/hide tooltip feature on normal button", function() {
cy.openPropertyPane("buttonwidget");
// add tooltip
// Add tooltip
cy.testJsontext(
"tooltip",
"Lorem Ipsum is simply dummy text of the printing and typesetting industry",
);
// Hover in
cy.get(widgetsPage.buttonWidget).trigger("mouseover");
// tooltip should show on hover
// Check if a tooltip is displayed
cy.get(".bp3-popover2-content").should(
"have.text",
"Lorem Ipsum is simply dummy text of the printing and typesetting industry",
);
// Hover out
cy.get(widgetsPage.buttonWidget).trigger("mouseout");
// Check if the tooltip is disappeared
cy.get(".bp3-popover2-content")
.contains(
"Lorem Ipsum is simply dummy text of the printing and typesetting industry",
)
.should("not.exist");
});
it("Validate tooltip hidden for disabled button", function() {
// first disable button
it("Validate show/hide tooltip feature for a disabled button", function() {
// Disable the button
cy.get(".t--property-control-disabled .bp3-switch").click({ force: true });
cy.validateDisableWidget(
widgetsPage.buttonWidget,
commonlocators.disabledField,
);
// hover on button and check tooltip should not show
// Hover in
cy.get(widgetsPage.buttonWidget).trigger("mouseover");
cy.get(".bp3-popover2-content").should("not.exist");
// Check if a tooltip is displayed
cy.get(".bp3-popover2-content").should(
"have.text",
"Lorem Ipsum is simply dummy text of the printing and typesetting industry",
);
// Hover out
cy.get(widgetsPage.buttonWidget).trigger("mouseout");
// Check if the tooltip is disappeared
cy.get(".bp3-popover2-content")
.contains(
"Lorem Ipsum is simply dummy text of the printing and typesetting industry",
)
.should("not.exist");
});
});

View File

@ -28,69 +28,315 @@ describe("Input widget V2 - ", () => {
cy.get(widgetInput).type("test{enter}"); //Clicking enter submits the form here
cy.wait(300);
cy.get(widgetInput).should("contain.value", "");
cy.selectDropdownValue(".t--property-control-datatype", "Number");
cy.get(widgetInput).clear();
cy.get(widgetInput).type("1.0010{enter}"); //Clicking enter submits the form here
cy.wait(300);
cy.get(widgetInput).should("contain.value", "");
});
it("3. Validate DataType - TEXT can be entered into Input widget", () => {
cy.selectDropdownValue(".t--property-control-datatype", "Text");
[
"test:test:true",
"test123:test123:true",
"123:123:true",
"::true",
"$100.22:$100.22:true",
"test@appsmith.com:test@appsmith.com:true",
].forEach((text) => enterAndTest(text.split(":")[0], text));
{
input: "test",
expected: "test:test:true",
},
{
input: "test123",
expected: "test123:test123:true",
},
{
input: "123",
expected: "123:123:true",
},
{
input: "",
expected: "::true",
},
{
input: "$100.22",
expected: "$100.22:$100.22:true",
},
{
input: "test@appsmith.com",
expected: "test@appsmith.com:test@appsmith.com:true",
},
].forEach(({ expected, input }) => enterAndTest(input, expected));
cy.openPropertyPane(widgetName);
//required: on
cy.get(".t--property-control-required label")
.last()
.click({ force: true });
[
"test:test:true",
"test123:test123:true",
"123:123:true",
"-:-:true",
"::false",
"$100.22:$100.22:true",
"test@appsmith.com:test@appsmith.com:true",
].forEach((text) => enterAndTest(text.split(":")[0], text));
{
input: "test",
expected: "test:test:true",
},
{
input: "test123",
expected: "test123:test123:true",
},
{
input: "123",
expected: "123:123:true",
},
{
input: "-",
expected: "-:-:true",
},
{
input: "",
expected: "::false",
},
{
input: "$100.22",
expected: "$100.22:$100.22:true",
},
{
input: "test@appsmith.com",
expected: "test@appsmith.com:test@appsmith.com:true",
},
{
input: "",
expected: "::false",
},
].forEach(({ expected, input }) => enterAndTest(input, expected));
});
it("4. Validate DataType - NUMBER can be entered into Input widget", () => {
cy.openPropertyPane(widgetName);
cy.selectDropdownValue(".t--property-control-datatype", "Number");
[
"test:",
"test123:123",
"123:123",
"-:-",
":",
"$100.22:100.22",
"test@appsmith.com:",
].forEach((text) => {
enterAndTest(text.split(":")[0], text.split(":")[1]);
});
{
input: "invalid",
expected: "null:null:false",
},
{
input: "invalid123",
expected: "123:123:true",
},
{
input: "123",
expected: "123:123:true",
},
{
input: "-",
expected: "null:null:false",
},
{
input: "",
expected: "null:null:false",
},
{
input: "$100.22",
expected: "100.22:100.22:true",
},
{
input: "invalid@appsmith.com",
expected: "null:null:false",
},
{
input: "1.001",
expected: "1.001:1.001:true",
},
{
input: "1.1.",
expected: "null:null:false",
},
].forEach(({ expected, input }) => enterAndTest(input, expected));
//required: off
cy.get(".t--property-control-required label")
.last()
.click({ force: true });
cy.selectDropdownValue(".t--property-control-datatype", "Number");
[
{
input: "invalid",
expected: "null:null:true",
},
{
input: "invalid123",
expected: "123:123:true",
},
{
input: "123",
expected: "123:123:true",
},
{
input: "-",
expected: "null:null:false",
},
{
input: "",
expected: "null:null:true",
},
{
input: "$100.22",
expected: "100.22:100.22:true",
},
{
input: "invalid@appsmith.com",
expected: "null:null:false",
},
{
input: "1.001",
expected: "1.001:1.001:true",
},
{
input: "1.1.",
expected: "null:null:false",
},
].forEach(({ expected, input }) => enterAndTest(input, expected));
});
it("5. Validate DataType - PASSWORD can be entered into Input widget", () => {
cy.openPropertyPane(widgetName);
cy.selectDropdownValue(".t--property-control-datatype", "Password");
["test", "test123", "123", "-", "", "$100.22", "test@appsmith.com"].forEach(
(text) => {
enterAndTest(text, text);
[
{
input: "test",
expected: "test:test:true",
},
);
{
input: "test123",
expected: "test123:test123:true",
},
{
input: "123",
expected: "123:123:true",
},
{
input: "-",
expected: "-:-:true",
},
{
input: "",
expected: "::true",
},
{
input: "$100.22",
expected: "$100.22:$100.22:true",
},
{
input: "test@appsmith.com",
expected: "test@appsmith.com:test@appsmith.com:true",
},
].forEach(({ expected, input }) => enterAndTest(input, expected));
//required: on
cy.get(".t--property-control-required label")
.last()
.click({ force: true });
[
{
input: "test",
expected: "test:test:true",
},
{
input: "test123",
expected: "test123:test123:true",
},
{
input: "123",
expected: "123:123:true",
},
{
input: "-",
expected: "-:-:true",
},
{
input: "",
expected: "::false",
},
{
input: "$100.22",
expected: "$100.22:$100.22:true",
},
{
input: "test@appsmith.com",
expected: "test@appsmith.com:test@appsmith.com:true",
},
].forEach(({ expected, input }) => enterAndTest(input, expected));
});
it("6. Validate DataType - EMAIL can be entered into Input widget", () => {
cy.openPropertyPane(widgetName);
cy.selectDropdownValue(".t--property-control-datatype", "Email");
["test", "test123", "123", "-", "", "$100.22", "test@appsmith.com"].forEach(
(text) => {
enterAndTest(text, text);
[
{
input: "test",
expected: "test:test:false",
},
);
{
input: "test123",
expected: "test123:test123:false",
},
{
input: "123",
expected: "123:123:false",
},
{
input: "-",
expected: "-:-:false",
},
{
input: "",
expected: "::false",
},
{
input: "$100.22",
expected: "$100.22:$100.22:false",
},
{
input: "test@appsmith.com",
expected: "test@appsmith.com:test@appsmith.com:true",
},
].forEach(({ expected, input }) => enterAndTest(input, expected));
//required: off
cy.get(".t--property-control-required label")
.last()
.click({ force: true });
[
{
input: "test",
expected: "test:test:false",
},
{
input: "test123",
expected: "test123:test123:false",
},
{
input: "123",
expected: "123:123:false",
},
{
input: "-",
expected: "-:-:false",
},
{
input: "",
expected: "::true",
},
{
input: "$100.22",
expected: "$100.22:$100.22:false",
},
{
input: "test@appsmith.com",
expected: "test@appsmith.com:test@appsmith.com:true",
},
].forEach(({ expected, input }) => enterAndTest(input, expected));
});
it("7. Validating other properties - Input validity with #valid", () => {
@ -107,13 +353,82 @@ describe("Input widget V2 - ", () => {
});
});
it("8. onSubmit should be triggered with the whole input value", () => {
cy.openPropertyPane(widgetName);
cy.selectDropdownValue(".t--property-control-datatype", "Text");
cy.get(".t--property-control-required label")
.last()
.click({ force: true });
// Set onSubmit action, storing value
cy.get(".t--property-control-onsubmit")
.find(".t--js-toggle")
.click();
cy.updateCodeInput(
".t--property-control-onsubmit",
"{{storeValue('textPayloadOnSubmit',Input1.text)}}",
);
// Bind to stored value above
cy.openPropertyPane("textwidget");
cy.updateCodeInput(
".t--property-control-text",
"{{appsmith.store.textPayloadOnSubmit}}",
);
cy.closePropertyPane();
cy.get(widgetInput).clear();
cy.wait(300);
// Input text and hit enter key
cy.get(widgetInput).type("test{enter}");
// Assert if the Text widget contains the whole value, test
cy.get(".t--widget-textwidget").should("have.text", "test");
});
it("9. changing default text should change text", () => {
cy.openPropertyPane("textwidget");
cy.updateCodeInput(
".t--property-control-text",
`{{Input1.text}}:{{Input1.value}}:{{Input1.isValid}}`,
);
cy.openPropertyPane(widgetName);
cy.updateCodeInput(".t--property-control-defaulttext", `test`);
// wait for evaluations
cy.wait(300);
cy.get(`.t--widget-${widgetName} input`).should("contain.value", "test");
cy.get(".t--widget-textwidget").should("contain", "test:test:true");
cy.updateCodeInput(".t--property-control-defaulttext", `anotherText`);
// wait for evaluations
cy.wait(300);
cy.get(`.t--widget-${widgetName} input`).should(
"contain.value",
"anotherText",
);
cy.get(".t--widget-textwidget").should(
"contain",
"anotherText:anotherText:true",
);
cy.selectDropdownValue(".t--property-control-datatype", "Number");
cy.updateCodeInput(".t--property-control-defaulttext", `{{1}}`);
// wait for evaluations
cy.wait(300);
cy.get(`.t--widget-${widgetName} input`).should("contain.value", "1");
cy.get(".t--widget-textwidget").should("contain", "1:1:true");
cy.updateCodeInput(".t--property-control-defaulttext", `{{1.00010000}}`);
// wait for evaluations
cy.wait(300);
cy.get(`.t--widget-${widgetName} input`).should("contain.value", "1.0001");
cy.get(".t--widget-textwidget").should("contain", "1.0001:1.0001:true");
});
function enterAndTest(text, expected) {
cy.get(`.t--widget-${widgetName} input`).clear();
cy.wait(300);
if (text) {
cy.get(`.t--widget-${widgetName} input`)
.click()
.type(text); //.should('have.value', text);
.type(text);
}
cy.get(".t--widget-textwidget").should("contain", expected);
}

View File

@ -0,0 +1,143 @@
const commonlocators = require("../../../../../locators/commonlocators.json");
const dslWithSchema = require("../../../../../fixtures/jsonFormDslWithSchema.json");
const fieldPrefix = ".t--jsonformfield";
const education = `${fieldPrefix}-education`;
const addButton = ".t--jsonformfield-array-add-btn";
const deleteButton = ".t--jsonformfield-array-delete-btn";
describe("JSON Form Widget Array Field", () => {
before(() => {
cy.addDsl(dslWithSchema);
});
it("can add more items to the field", () => {
cy.openPropertyPane("jsonformwidget");
cy.get(`${education}-item`)
.should("have.length", 1)
.within(() => {
cy.get(`${education}-0--college input`).should("have.value", "MIT");
cy.get(`${education}-0--year input`).should("have.value", "20/10/2014");
});
cy.get(`${education} ${addButton}`).click({ force: true });
cy.get(`${education}-item`)
.should("have.length", 2)
.within(() => {
cy.get(`${education}-0--college input`).should("have.value", "MIT");
cy.get(`${education}-0--year input`).should("have.value", "20/10/2014");
cy.get(`${education}-1--college input`).should("have.value", "");
cy.get(`${education}-1--year input`).should("have.value", "");
});
});
it("can remove items from the field", () => {
cy.get(`${education} ${addButton}`).click({ force: true });
cy.get(`${education}-item`).should("have.length", 3);
cy.get(`${education}-item`).within(() => {
cy.get(`${education}-1--college input`).type("Dummy college");
cy.get(`${education}-1--year input`).type("10/08/2010");
});
cy.get(commonlocators.canvas).click({ force: true });
cy.get(`${education}-item`).within(() => {
cy.get(`${education}-2--college input`).type("Dummy college 2");
cy.get(`${education}-2--year input`).type("01/01/2020");
});
cy.get(commonlocators.canvas).click({ force: true });
cy.get(`${education}-item.t--item-1`)
.find(deleteButton)
.click({ force: true });
cy.get(`${education}-item`).should("have.length", 2);
cy.get(`${education}-item`).within(() => {
cy.get(`${education}-1--college input`).should(
"have.value",
"Dummy college 2",
);
cy.get(`${education}-1--year input`).should("have.value", "01/01/2020");
});
});
it("can change the visibility of the field", () => {
cy.get(education).should("exist");
cy.openPropertyPane("jsonformwidget");
cy.openFieldConfiguration("education");
// Visible -> false
cy.togglebarDisable(".t--property-control-visible input");
cy.get(education).should("not.exist");
// Visible -> true
cy.togglebar(".t--property-control-visible input");
cy.get(education).should("exist");
});
it("disables all underlying field when array field is disabled", () => {
cy.closePropertyPane();
cy.openPropertyPane("jsonformwidget");
cy.openFieldConfiguration("education");
// Disable -> true
cy.togglebar(".t--property-control-disabled input");
cy.get(education).within(() => {
cy.get(`${education}-0--college input`).should("have.attr", "disabled");
cy.get(`${education}-0--year input`).should("have.attr", "disabled");
});
// Disable -> false
cy.togglebarDisable(".t--property-control-disabled input");
cy.get(education).should("exist");
cy.get(education).within(() => {
cy.get(`${education}-0--college input`).should(
"not.have.attr",
"disabled",
);
cy.get(`${education}-0--year input`).should("not.have.attr", "disabled");
});
});
it("should not render field level default value if form level is present", () => {
const collegeFieldDefaultValue = "College default value";
cy.closePropertyPane();
cy.openPropertyPane("jsonformwidget");
cy.openFieldConfiguration("education")
.openFieldConfiguration("__array_item__")
.openFieldConfiguration("college");
// Modify default text of eductation -> college field
cy.testJsontext("defaultvalue", collegeFieldDefaultValue);
cy.closePropertyPane();
cy.get(`${education}-item`)
.should("have.length", 1)
.within(() => {
cy.get(`${education}-0--college input`).should("have.value", "MIT");
cy.get(`${education}-0--year input`).should("have.value", "20/10/2014");
});
// Add new item to education array
cy.get(`${education} ${addButton}`).click({ force: true });
cy.get(`${education}-item`)
.should("have.length", 2)
.within(() => {
cy.get(`${education}-0--college input`).should("have.value", "MIT");
cy.get(`${education}-0--year input`).should("have.value", "20/10/2014");
cy.get(`${education}-1--college input`).should(
"have.value",
collegeFieldDefaultValue,
);
cy.get(`${education}-1--year input`).should("have.value", "");
});
});
});

View File

@ -0,0 +1,220 @@
const jsonFormDslWithSchemaAndWithoutSourceData = require("../../../../../fixtures/jsonFormDslWithSchemaAndWithoutSourceData.json");
const fieldPrefix = ".t--jsonformfield";
describe("JSON Form Widget AutoGenerate Disabled", () => {
it("generates fields with valid source data json", () => {
const formDsl = JSON.parse(
JSON.stringify(jsonFormDslWithSchemaAndWithoutSourceData),
);
cy.addDsl(formDsl);
cy.openPropertyPane("jsonformwidget");
cy.togglebarDisable(`.t--property-control-autogenerateform input`);
const sourceData = {
name: "John",
age: 30,
dob: "10/12/1992",
migrant: false,
gender: "male",
address: {
street: "Koramangala",
city: "Bangalore",
state: "State",
},
education: [
{
college: "MIT",
year: "20/10/2014",
course: "CS",
},
],
};
cy.openPropertyPane("jsonformwidget");
cy.testJsontext("sourcedata", JSON.stringify(sourceData));
cy.closePropertyPane();
// Fields that should exist
cy.get(`${fieldPrefix}-name label`).contains("Name");
cy.get(`${fieldPrefix}-name input`).then((input) => {
cy.wrap(input).should("have.value", "John");
cy.wrap(input)
.invoke("attr", "type")
.should("contain", "text");
});
cy.get(`${fieldPrefix}-age label`).contains("Age");
cy.get(`${fieldPrefix}-age input`).then((input) => {
cy.wrap(input).should("have.value", 30);
cy.wrap(input)
.invoke("attr", "type")
.should("contain", "text");
});
cy.get(`${fieldPrefix}-dob label`).contains("Dob");
cy.get(`${fieldPrefix}-dob input`).then((input) => {
cy.wrap(input).should("have.value", "10/12/1992");
cy.wrap(input)
.invoke("attr", "type")
.should("contain", "text");
});
cy.get(`${fieldPrefix}-migrant label`).contains("Migrant");
cy.get(`${fieldPrefix}-migrant .t--switch-widget-inactive`).should("exist");
cy.get(`${fieldPrefix}-address`)
.find("label")
.should("have.length", 3);
cy.get(`${fieldPrefix}-address-street label`).contains("Street");
cy.get(`${fieldPrefix}-address-street input`).then((input) => {
cy.wrap(input).should("have.value", "Koramangala");
cy.wrap(input)
.invoke("attr", "type")
.should("contain", "text");
});
cy.get(`${fieldPrefix}-address-city label`).contains("City");
cy.get(`${fieldPrefix}-address-city input`).then((input) => {
cy.wrap(input).should("have.value", "Bangalore");
cy.wrap(input)
.invoke("attr", "type")
.should("contain", "text");
});
cy.get(`${fieldPrefix}-education label`).should("have.length", 3);
cy.get(`${fieldPrefix}-education-0--college label`).contains("College");
cy.get(`${fieldPrefix}-education-0--college input`).then((input) => {
cy.wrap(input).should("have.value", "MIT");
cy.wrap(input)
.invoke("attr", "type")
.should("contain", "text");
});
cy.get(`${fieldPrefix}-education-0--year label`).contains("Year");
cy.get(`${fieldPrefix}-education-0--year input`).then((input) => {
cy.wrap(input).should("have.value", "20/10/2014");
cy.wrap(input)
.invoke("attr", "type")
.should("contain", "text");
});
cy.get(
`${fieldPrefix}-education .t--jsonformfield-array-delete-btn .t--text`,
).should("have.text", "Delete");
cy.get(
`${fieldPrefix}-education .t--jsonformfield-array-add-btn .t--text`,
).should("have.text", "Add New");
/**
* Fields that shouldn't exist
* */
cy.get(`${fieldPrefix}-gender label`).should("not.exist");
cy.get(`${fieldPrefix}-gender input`).should("not.exist");
cy.get(`${fieldPrefix}-address-state label`).should("not.exist");
cy.get(`${fieldPrefix}-address-state input`).should("not.exist");
cy.get(`${fieldPrefix}-education-0--course label`).should("not.exist");
cy.get(`${fieldPrefix}-education-0--course input`).should("not.exist");
});
it("modifies field when generate form button is pressed", () => {
const formDsl = JSON.parse(
JSON.stringify(jsonFormDslWithSchemaAndWithoutSourceData),
);
cy.addDsl(formDsl);
cy.openPropertyPane("jsonformwidget");
cy.togglebarDisable(`.t--property-control-autogenerateform input`);
const sourceData = {
name: "John",
age: 30,
dob: "10/12/1992",
migrant: false,
gender: "male",
address: {
street: "Koramangala",
city: "Bangalore",
state: "Karnataka",
},
education: [
{
college: "MIT",
year: "20/10/2014",
course: "CS",
},
],
};
cy.openPropertyPane("jsonformwidget");
cy.testJsontext("sourcedata", JSON.stringify(sourceData));
cy.wait(500);
cy.get(".t--property-pane-section-general button")
.contains("Generate Form")
.click({ force: true });
cy.closePropertyPane();
cy.get(`${fieldPrefix}-name label`).contains("Name");
cy.get(`${fieldPrefix}-name input`).should("have.value", "John");
cy.get(`${fieldPrefix}-age label`).contains("Age");
cy.get(`${fieldPrefix}-age input`).should("have.value", 30);
cy.get(`${fieldPrefix}-dob label`).contains("Dob");
cy.get(`${fieldPrefix}-dob input`).should("have.value", "10/12/1992");
cy.get(`${fieldPrefix}-migrant label`).contains("Migrant");
cy.get(`${fieldPrefix}-migrant .t--switch-widget-inactive`).should("exist");
cy.get(`${fieldPrefix}-address`)
.find("label")
.should("have.length", 4);
cy.get(`${fieldPrefix}-address-street label`).contains("Street");
cy.get(`${fieldPrefix}-address-street input`).should(
"have.value",
"Koramangala",
);
cy.get(`${fieldPrefix}-address-city label`).contains("City");
cy.get(`${fieldPrefix}-address-city input`).should(
"have.value",
"Bangalore",
);
cy.get(`${fieldPrefix}-address-state label`).contains("State");
cy.get(`${fieldPrefix}-address-state input`).should(
"have.value",
"Karnataka",
);
cy.get(`${fieldPrefix}-education label`).should("have.length", 4);
cy.get(`${fieldPrefix}-education-0--college label`).contains("College");
cy.get(`${fieldPrefix}-education-0--college input`).should(
"have.value",
"MIT",
);
cy.get(`${fieldPrefix}-education-0--year label`).contains("Year");
cy.get(`${fieldPrefix}-education-0--year input`).should(
"have.value",
"20/10/2014",
);
cy.get(`${fieldPrefix}-education-0--course label`).contains("Course");
cy.get(`${fieldPrefix}-education-0--course input`).should(
"have.value",
"CS",
);
});
});

View File

@ -0,0 +1,184 @@
const dslWithoutSchema = require("../../../../../fixtures/jsonFormDslWithoutSchema.json");
const jsonFormDslWithSchemaAndWithoutSourceData = require("../../../../../fixtures/jsonFormDslWithSchemaAndWithoutSourceData.json");
const fieldPrefix = ".t--jsonformfield";
describe("JSON Form Widget AutoGenerate Enabled", () => {
it("generates fields with valid source data json", () => {
cy.addDsl(dslWithoutSchema);
const sourceData = {
name: "John",
age: 30,
dob: "10/12/1992",
migrant: false,
address: {
street: "Koramangala",
city: "Bangalore",
},
education: [
{
college: "MIT",
year: "20/10/2014",
},
],
};
cy.openPropertyPane("jsonformwidget");
cy.testJsontext("sourcedata", JSON.stringify(sourceData));
cy.closePropertyPane();
cy.get(`${fieldPrefix}-name label`).contains("Name");
cy.get(`${fieldPrefix}-name input`).then((input) => {
cy.wrap(input).should("have.value", "John");
cy.wrap(input)
.invoke("attr", "type")
.should("contain", "text");
});
cy.get(`${fieldPrefix}-age label`).contains("Age");
cy.get(`${fieldPrefix}-age input`).then((input) => {
cy.wrap(input).should("have.value", 30);
cy.wrap(input)
.invoke("attr", "type")
.should("contain", "text");
});
cy.get(`${fieldPrefix}-dob label`).contains("Dob");
cy.get(`${fieldPrefix}-dob input`).then((input) => {
cy.wrap(input).should("have.value", "10/12/1992");
cy.wrap(input)
.invoke("attr", "type")
.should("contain", "text");
});
cy.get(`${fieldPrefix}-migrant label`).contains("Migrant");
cy.get(`${fieldPrefix}-migrant .t--switch-widget-inactive`).should("exist");
cy.get(`${fieldPrefix}-address`)
.find("label")
.should("have.length", 3);
cy.get(`${fieldPrefix}-address-street label`).contains("Street");
cy.get(`${fieldPrefix}-address-street input`).then((input) => {
cy.wrap(input).should("have.value", "Koramangala");
cy.wrap(input)
.invoke("attr", "type")
.should("contain", "text");
});
cy.get(`${fieldPrefix}-address-city label`).contains("City");
cy.get(`${fieldPrefix}-address-city input`).then((input) => {
cy.wrap(input).should("have.value", "Bangalore");
cy.wrap(input)
.invoke("attr", "type")
.should("contain", "text");
});
cy.get(`${fieldPrefix}-education label`).should("have.length", 3);
cy.get(`${fieldPrefix}-education-0--college label`).contains("College");
cy.get(`${fieldPrefix}-education-0--college input`).then((input) => {
cy.wrap(input).should("have.value", "MIT");
cy.wrap(input)
.invoke("attr", "type")
.should("contain", "text");
});
cy.get(`${fieldPrefix}-education-0--year label`).contains("Year");
cy.get(`${fieldPrefix}-education-0--year input`).then((input) => {
cy.wrap(input).should("have.value", "20/10/2014");
cy.wrap(input)
.invoke("attr", "type")
.should("contain", "text");
});
cy.get(
`${fieldPrefix}-education .t--jsonformfield-array-delete-btn .t--text`,
).should("have.text", "Delete");
cy.get(
`${fieldPrefix}-education .t--jsonformfield-array-add-btn .t--text`,
).should("have.text", "Add New");
});
it("modifies field when source data changes", () => {
cy.addDsl(jsonFormDslWithSchemaAndWithoutSourceData);
const modifiedSourceData = {
name: "John",
age: 30,
dob: "10/12/1992",
migrant: "false",
address: {
street: "Koramangala",
city: "Bangalore",
state: "Karnataka",
},
education: [
{
college: "MIT",
year: "20/10/2014",
degree: "Engg.",
},
],
};
cy.openPropertyPane("jsonformwidget");
cy.testJsontext("sourcedata", JSON.stringify(modifiedSourceData));
cy.closePropertyPane();
cy.get(`${fieldPrefix}-name label`).contains("Name");
cy.get(`${fieldPrefix}-name input`).should("have.value", "John");
cy.get(`${fieldPrefix}-age label`).contains("Age");
cy.get(`${fieldPrefix}-age input`).should("have.value", 30);
cy.get(`${fieldPrefix}-dob label`).contains("Dob");
cy.get(`${fieldPrefix}-dob input`).should("have.value", "10/12/1992");
cy.get(`${fieldPrefix}-migrant label`).contains("Migrant");
cy.get(`${fieldPrefix}-migrant .t--switch-widget-inactive`).should(
"not.exist",
);
cy.get(`${fieldPrefix}-migrant input`).should("exist");
cy.get(`${fieldPrefix}-address`)
.find("label")
.should("have.length", 4);
cy.get(`${fieldPrefix}-address-street label`).contains("Street");
cy.get(`${fieldPrefix}-address-street input`).should(
"have.value",
"Koramangala",
);
cy.get(`${fieldPrefix}-address-city label`).contains("City");
cy.get(`${fieldPrefix}-address-city input`).should(
"have.value",
"Bangalore",
);
cy.get(`${fieldPrefix}-address-state label`).contains("State");
cy.get(`${fieldPrefix}-address-state input`).should(
"have.value",
"Karnataka",
);
cy.get(`${fieldPrefix}-education label`).should("have.length", 4);
cy.get(`${fieldPrefix}-education-0--college label`).contains("College");
cy.get(`${fieldPrefix}-education-0--college input`).should(
"have.value",
"MIT",
);
cy.get(`${fieldPrefix}-education-0--year label`).contains("Year");
cy.get(`${fieldPrefix}-education-0--year input`).should(
"have.value",
"20/10/2014",
);
cy.get(`${fieldPrefix}-education-0--degree label`).contains("Degree");
cy.get(`${fieldPrefix}-education-0--degree input`).should(
"have.value",
"Engg.",
);
});
});

View File

@ -0,0 +1,109 @@
const commonlocators = require("../../../../../locators/commonlocators.json");
const jsonFormDslWithSchemaAndWithoutSourceData = require("../../../../../fixtures/jsonFormDslWithSchemaAndWithoutSourceData.json");
const fieldPrefix = ".t--jsonformfield";
describe("JSON Form Widget Custom Field", () => {
it("uses the custom field when the accessor matches", () => {
const formDsl = JSON.parse(
JSON.stringify(jsonFormDslWithSchemaAndWithoutSourceData),
);
cy.addDsl(formDsl);
cy.openPropertyPane("jsonformwidget");
// Add new custom field
cy.get(".t--property-pane-section-general button")
.contains("Add a new field")
.click({ force: true });
cy.openFieldConfiguration("customField1");
cy.testJsontext("propertyname", "gender");
cy.testJsontext("label", "Gender");
cy.selectDropdownValue(commonlocators.jsonFormFieldType, "Select");
cy.closePropertyPane();
const sourceData = {
name: "John",
age: 30,
dob: "10/12/1992",
migrant: false,
gender: "male",
address: {
street: "Koramangala",
city: "Bangalore",
state: "Karnataka",
},
education: [
{
college: "MIT",
year: "20/10/2014",
course: "CS",
},
],
};
cy.openPropertyPane("jsonformwidget");
cy.testJsontext("sourcedata", JSON.stringify(sourceData));
cy.wait(500);
cy.get(`${fieldPrefix}-name label`).contains("Name");
cy.get(`${fieldPrefix}-name input`).should("have.value", "John");
cy.get(`${fieldPrefix}-age label`).contains("Age");
cy.get(`${fieldPrefix}-age input`).should("have.value", 30);
cy.get(`${fieldPrefix}-dob label`).contains("Dob");
cy.get(`${fieldPrefix}-dob input`).should("have.value", "10/12/1992");
cy.get(`${fieldPrefix}-customField1 label`).contains("Gender");
cy.get(`${fieldPrefix}-customField1 .bp3-popover-wrapper`).should("exist");
cy.get(`${fieldPrefix}-migrant label`).contains("Migrant");
cy.get(`${fieldPrefix}-migrant .t--switch-widget-inactive`).should("exist");
cy.get(`${fieldPrefix}-address`)
.find("label")
.should("have.length", 4);
cy.get(`${fieldPrefix}-address-street label`).contains("Street");
cy.get(`${fieldPrefix}-address-street input`).should(
"have.value",
"Koramangala",
);
cy.get(`${fieldPrefix}-address-city label`).contains("City");
cy.get(`${fieldPrefix}-address-city input`).should(
"have.value",
"Bangalore",
);
cy.get(`${fieldPrefix}-address-state label`).contains("State");
cy.get(`${fieldPrefix}-address-state input`).should(
"have.value",
"Karnataka",
);
cy.get(`${fieldPrefix}-education label`).should("have.length", 4);
cy.get(`${fieldPrefix}-education-0--college label`).contains("College");
cy.get(`${fieldPrefix}-education-0--college input`).should(
"have.value",
"MIT",
);
cy.get(`${fieldPrefix}-education-0--year label`).contains("Year");
cy.get(`${fieldPrefix}-education-0--year input`).should(
"have.value",
"20/10/2014",
);
cy.get(`${fieldPrefix}-education-0--course label`).contains("Course");
cy.get(`${fieldPrefix}-education-0--course input`).should(
"have.value",
"CS",
);
});
});

View File

@ -0,0 +1,191 @@
const commonlocators = require("../../../../../locators/commonlocators.json");
const dslWithSchema = require("../../../../../fixtures/jsonFormDslWithSchema.json");
const fieldPrefix = ".t--jsonformfield";
describe("JSON Form Widget Field Change", () => {
before(() => {
cy.addDsl(dslWithSchema);
});
it("modifies field type text to number", () => {
cy.openPropertyPane("jsonformwidget");
cy.get(`${fieldPrefix}-name`)
.find("button")
.should("not.exist");
cy.openFieldConfiguration("name");
cy.selectDropdownValue(commonlocators.jsonFormFieldType, "Number Input");
cy.get(`${fieldPrefix}-name`)
.find("button")
.should("have.length", 2);
cy.selectDropdownValue(commonlocators.jsonFormFieldType, /^Text Input$/);
cy.closePropertyPane();
});
it("modifies field type text to checkbox", () => {
cy.openPropertyPane("jsonformwidget");
cy.get(`${fieldPrefix}-name`)
.find("input")
.invoke("attr", "type")
.should("contain", "text");
cy.openFieldConfiguration("name");
cy.selectDropdownValue(commonlocators.jsonFormFieldType, "Checkbox");
cy.get(`${fieldPrefix}-name`)
.find("input")
.invoke("attr", "type")
.should("contain", "checkbox");
cy.selectDropdownValue(commonlocators.jsonFormFieldType, /^Text Input$/);
cy.closePropertyPane();
});
it("modifies field type text to date", () => {
cy.openPropertyPane("jsonformwidget");
cy.get(`${fieldPrefix}-name`)
.find("input")
.click({ force: true });
cy.get(".bp3-popover.bp3-dateinput-popover").should("not.exist");
cy.openFieldConfiguration("name");
cy.selectDropdownValue(commonlocators.jsonFormFieldType, "Datepicker");
cy.get(`${fieldPrefix}-name`)
.find("input")
.click({ force: true });
cy.get(".bp3-popover.bp3-dateinput-popover").should("exist");
cy.selectDropdownValue(commonlocators.jsonFormFieldType, /^Text Input$/);
cy.closePropertyPane();
});
it("modifies field type text to switch", () => {
cy.openPropertyPane("jsonformwidget");
cy.get(`${fieldPrefix}-name`)
.find(".bp3-control.bp3-switch")
.should("not.exist");
cy.openFieldConfiguration("name");
cy.selectDropdownValue(commonlocators.jsonFormFieldType, "Switch");
cy.get(`${fieldPrefix}-name`)
.find(".bp3-control.bp3-switch")
.should("exist");
cy.selectDropdownValue(commonlocators.jsonFormFieldType, /^Text Input$/);
cy.closePropertyPane();
});
it("modifies field type text to Select", () => {
cy.openPropertyPane("jsonformwidget");
cy.get(`${fieldPrefix}-name label`).click({ force: true });
cy.get(".bp3-select-popover.select-popover-wrapper").should("not.exist");
cy.openFieldConfiguration("name");
cy.selectDropdownValue(commonlocators.jsonFormFieldType, /^Select$/);
cy.get(`${fieldPrefix}-name label`).click({ force: true });
cy.get(".bp3-select-popover.select-popover-wrapper").should("exist");
cy.selectDropdownValue(commonlocators.jsonFormFieldType, /^Text Input$/);
cy.closePropertyPane();
});
it("modifies field type text to Multi-Select", () => {
cy.openPropertyPane("jsonformwidget");
cy.get(`${fieldPrefix}-name`)
.find(".rc-select-multiple")
.should("not.exist");
cy.openFieldConfiguration("name");
cy.selectDropdownValue(commonlocators.jsonFormFieldType, "Multiselect");
cy.get(`${fieldPrefix}-name`)
.find(".rc-select-multiple")
.should("exist");
cy.selectDropdownValue(commonlocators.jsonFormFieldType, /^Text Input$/);
cy.closePropertyPane();
});
it("modifies field type text to Radio-Group", () => {
cy.openPropertyPane("jsonformwidget");
cy.get(`${fieldPrefix}-name`)
.find(".bp3-control.bp3-radio")
.should("not.exist");
cy.openFieldConfiguration("name");
cy.selectDropdownValue(commonlocators.jsonFormFieldType, "Radio Group");
cy.get(`${fieldPrefix}-name`)
.find(".bp3-control.bp3-radio")
.should("exist")
.should("have.length", 2);
cy.selectDropdownValue(commonlocators.jsonFormFieldType, /^Text Input$/);
cy.closePropertyPane();
});
it("modifies field type text to Array", () => {
cy.openPropertyPane("jsonformwidget");
cy.get(`${fieldPrefix}-name`)
.find(".t--jsonformfield-array-add-btn")
.should("not.exist");
cy.openFieldConfiguration("name");
cy.selectDropdownValue(commonlocators.jsonFormFieldType, "Array");
cy.get(`${fieldPrefix}-name`)
.find(".t--jsonformfield-array-add-btn")
.should("exist");
cy.selectDropdownValue(commonlocators.jsonFormFieldType, /^Text Input$/);
cy.closePropertyPane();
});
it("modifies field type text to Object", () => {
cy.openPropertyPane("jsonformwidget");
cy.openFieldConfiguration("name");
cy.selectDropdownValue(commonlocators.jsonFormFieldType, "Object");
cy.get(`${fieldPrefix}-name`)
.find("input")
.should("not.exist");
cy.get(commonlocators.jsonFormAddNewCustomFieldBtn).click({
force: true,
});
cy.get(`${fieldPrefix}-name`)
.find("input")
.should("exist");
cy.selectDropdownValue(commonlocators.jsonFormFieldType, /^Text Input$/);
cy.closePropertyPane();
});
it("modifies field type Multi-Select to Array", () => {
cy.openPropertyPane("jsonformwidget");
cy.get(`${fieldPrefix}-hobbies`)
.find(".rc-select-multiple")
.should("exist");
cy.openFieldConfiguration("hobbies");
cy.selectDropdownValue(commonlocators.jsonFormFieldType, "Array");
cy.get(`${fieldPrefix}-hobbies`).then((hobbies) => {
cy.wrap(hobbies)
.find(".t--jsonformfield-array-add-btn")
.should("exist");
cy.wrap(hobbies)
.find("input")
.should("have.length", 2);
cy.wrap(hobbies)
.find(".t--jsonformfield-array-delete-btn")
.should("have.length", 2);
});
cy.selectDropdownValue(commonlocators.jsonFormFieldType, /^Text Input$/);
cy.closePropertyPane();
});
});

View File

@ -0,0 +1,283 @@
const commonlocators = require("../../../../../locators/commonlocators.json");
const dslWithoutSchema = require("../../../../../fixtures/jsonFormDslWithoutSchema.json");
const fieldPrefix = ".t--jsonformfield";
describe("Text Field Property Control", () => {
before(() => {
const schema = {
name: "John",
};
cy.addDsl(dslWithoutSchema);
cy.openPropertyPane("jsonformwidget");
cy.testJsontext("sourcedata", JSON.stringify(schema));
});
it("has valid default text", () => {
cy.openFieldConfiguration("name");
cy.get(".t--property-control-defaultvalue").contains("{{sourceData.name}}");
});
it("updated field with change in default text", () => {
const defaultValue = "New default text";
cy.testJsontext("defaultvalue", "New default text").wait(200);
cy.get(`${fieldPrefix}-name input`).should("have.value", defaultValue);
});
it("throws max character error when exceeds maxChar limit", () => {
cy.testJsontext("maxchars", 5);
cy.get(`${fieldPrefix}-name input`).click();
cy.get(".bp3-popover-content").should(($x) => {
expect($x).contain(
"Default Text length must be less than Max Chars allowed",
);
});
cy.testJsontext("maxchars", "");
});
it("sets placeholder", () => {
const placeholderText = "First name";
cy.testJsontext("placeholder", placeholderText);
cy.get(`${fieldPrefix}-name input`)
.invoke("attr", "placeholder")
.should("contain", placeholderText);
});
it("sets valid property with custom error message", () => {
cy.testJsontext("valid", "false");
cy.get(`${fieldPrefix}-name input`)
.clear()
.type("abcd");
cy.get(".bp3-popover-content").contains("Invalid input");
cy.testJsontext("errormessage", "Custom error message");
cy.get(`${fieldPrefix}-name input`).click({ force: true });
cy.get(".bp3-popover-content").contains("Custom error message");
});
it("hides field when visible switched off", () => {
cy.togglebarDisable(`.t--property-control-visible input`);
cy.get(`${fieldPrefix}-name`).should("not.exist");
cy.wait(500);
cy.togglebar(`.t--property-control-visible input`);
cy.get(`${fieldPrefix}-name`).should("exist");
});
it("disables field when disabled switched on", () => {
cy.togglebar(`.t--property-control-disabled input`);
cy.get(`${fieldPrefix}-name input`).each(($el) => {
cy.wrap($el).should("have.attr", "disabled");
});
cy.togglebarDisable(`.t--property-control-disabled input`);
});
});
describe("Checkbox Field Property Control", () => {
before(() => {
const schema = {
check: false,
};
cy.addDsl(dslWithoutSchema);
cy.openPropertyPane("jsonformwidget");
cy.testJsontext("sourcedata", JSON.stringify(schema));
cy.openFieldConfiguration("check");
cy.selectDropdownValue(commonlocators.jsonFormFieldType, "Checkbox");
});
it("has default property", () => {
cy.get(".t--property-control-defaultselected").contains(
"{{sourceData.check}}",
);
});
it("should update field checked state when default selected changed", () => {
cy.testJsontext("defaultselected", "{{true}}");
cy.get(`${fieldPrefix}-check input`).should("be.checked");
});
it("hides field when visible switched off", () => {
cy.togglebarDisable(`.t--property-control-visible input`);
cy.get(`${fieldPrefix}-check`).should("not.exist");
cy.wait(500);
cy.togglebar(`.t--property-control-visible input`);
cy.get(`${fieldPrefix}-check`).should("exist");
});
it("disables field when disabled switched on", () => {
cy.togglebar(`.t--property-control-disabled input`);
cy.get(`${fieldPrefix}-check input`).each(($el) => {
cy.wrap($el).should("have.attr", "disabled");
});
cy.togglebarDisable(`.t--property-control-disabled input`);
});
});
describe("Switch Field Property Control", () => {
before(() => {
const schema = {
switch: true,
};
cy.addDsl(dslWithoutSchema);
cy.openPropertyPane("jsonformwidget");
cy.testJsontext("sourcedata", JSON.stringify(schema));
cy.openFieldConfiguration("switch");
});
it("has default property", () => {
cy.get(".t--property-control-defaultselected").contains(
"{{sourceData.switch}}",
);
});
it("should update field checked state when default selected changed", () => {
cy.testJsontext("defaultselected", "{{false}}");
cy.get(`${fieldPrefix}-switch label.bp3-control.bp3-switch`).should(
"have.class",
"t--switch-widget-inactive",
);
});
it("hides field when visible switched off", () => {
cy.togglebarDisable(`.t--property-control-visible input`);
cy.get(`${fieldPrefix}-switch`).should("not.exist");
cy.wait(500);
cy.togglebar(`.t--property-control-visible input`);
cy.get(`${fieldPrefix}-switch`).should("exist");
});
it("disables field when disabled switched on", () => {
cy.togglebar(`.t--property-control-disabled input`);
cy.get(`${fieldPrefix}-switch input`).each(($el) => {
cy.wrap($el).should("have.attr", "disabled");
});
cy.togglebarDisable(`.t--property-control-disabled input`);
});
});
describe("Select Field Property Control", () => {
before(() => {
const schema = {
state: "Karnataka",
};
cy.addDsl(dslWithoutSchema);
cy.openPropertyPane("jsonformwidget");
cy.testJsontext("sourcedata", JSON.stringify(schema));
cy.openFieldConfiguration("state");
cy.selectDropdownValue(commonlocators.jsonFormFieldType, /^Select$/);
});
it("has valid default value", () => {
cy.get(".t--property-control-defaultvalue").contains(
"{{sourceData.state}}",
);
});
it("makes select filterable", () => {
// click select field and filter input should not exist
cy.get(`${fieldPrefix}-state .bp3-control-group`).click({ force: true });
cy.get(`.bp3-select-popover .bp3-input-group`).should("not.exist");
// toggle filterable -> true in property pane
cy.togglebar(`.t--property-control-filterable input`);
// click select field and filter input should exist
cy.get(`${fieldPrefix}-state .bp3-control-group`).click({ force: true });
cy.get(`.bp3-select-popover .bp3-input-group`).should("exist");
});
it("hides field when visible switched off", () => {
cy.togglebarDisable(`.t--property-control-visible input`);
cy.get(`${fieldPrefix}-state`).should("not.exist");
cy.wait(500);
cy.togglebar(`.t--property-control-visible input`);
cy.get(`${fieldPrefix}-state`).should("exist");
});
it("disables field when disabled switched on", () => {
cy.togglebar(`.t--property-control-disabled input`);
cy.get(`${fieldPrefix}-state button.bp3-button`).should(
"have.class",
"bp3-disabled",
);
cy.togglebarDisable(`.t--property-control-disabled input`);
});
});
describe("Multi-Select Field Property Control", () => {
before(() => {
const schema = {
hobbies: [],
};
cy.addDsl(dslWithoutSchema);
cy.openPropertyPane("jsonformwidget");
cy.testJsontext("sourcedata", JSON.stringify(schema));
cy.openFieldConfiguration("hobbies");
});
it("has valid default value", () => {
cy.get(".t--property-control-defaultvalue").contains(
"{{sourceData.hobbies}}",
);
cy.closePropertyPane();
});
it("adds placeholder text", () => {
cy.openPropertyPane("jsonformwidget");
cy.openFieldConfiguration("hobbies");
cy.testJsontext("placeholder", "Select placeholder");
cy.wait(2000);
cy.get(`.rc-select-selection-placeholder`).contains("Select placeholder");
});
it("hides field when visible switched off", () => {
cy.togglebarDisable(`.t--property-control-visible input`);
cy.get(`${fieldPrefix}-hobbies`).should("not.exist");
cy.wait(500);
cy.togglebar(`.t--property-control-visible input`);
cy.get(`${fieldPrefix}-hobbies`).should("exist");
});
it("disables field when disabled switched on", () => {
cy.togglebar(`.t--property-control-disabled input`);
cy.get(`${fieldPrefix}-hobbies .rc-select-multiple`).should(
"have.class",
"rc-select-disabled",
);
cy.togglebarDisable(`.t--property-control-disabled input`);
});
});
describe("Radio group Field Property Control", () => {
before(() => {
const sourceData = {
radio: "Y",
};
cy.addDsl(dslWithoutSchema);
cy.openPropertyPane("jsonformwidget");
cy.testJsontext("sourcedata", JSON.stringify(sourceData));
cy.openFieldConfiguration("radio");
cy.selectDropdownValue(commonlocators.jsonFormFieldType, "Radio Group");
});
it("has valid default value", () => {
cy.get(".t--property-control-defaultselectedvalue").contains(
"{{sourceData.radio}}",
);
cy.get(`${fieldPrefix}-radio input`).should("have.value", "Y");
});
it("hides field when visible switched off", () => {
cy.togglebarDisable(`.t--property-control-visible input`);
cy.get(`${fieldPrefix}-radio`).should("not.exist");
cy.wait(500);
cy.togglebar(`.t--property-control-visible input`);
cy.get(`${fieldPrefix}-radio`).should("exist");
});
});

View File

@ -0,0 +1,423 @@
const dslWithSchema = require("../../../../../fixtures/jsonFormDslWithSchema.json");
const widgetsPage = require("../../../../../locators/Widgets.json");
const fieldPrefix = ".t--jsonformfield";
const propertyControlPrefix = ".t--property-control";
const backBtn = ".t--property-pane-back-btn";
describe("JSON Form Widget Form Bindings", () => {
beforeEach(() => {
cy.addDsl(dslWithSchema);
});
it("updates formData when field value changes", () => {
const expectedInitialFormData = {
age: 30,
dob: "10/12/1992",
migrant: false,
address: { street: "Koramangala", city: "Bangalore" },
hobbies: ["travelling", "swimming"],
education: [{ college: "MIT", year: "20/10/2014" }],
name: "John",
};
const updatedFormData = {
age: 40,
dob: "10/12/1992",
migrant: false,
address: { street: "Indranagar", city: "Bangalore" },
hobbies: ["travelling"],
education: [{ college: "IIT", year: "20/10/2014" }],
name: "Test",
};
// Bind formData to Text1 widget text property
cy.openPropertyPane("textwidget");
cy.testJsontext("text", "{{JSON.stringify(JSONForm1.formData)}}");
cy.closePropertyPane();
// Validate initial form data
cy.get(`${widgetsPage.textWidget} .bp3-ui-text`).then(($el) => {
const formData = JSON.parse($el.text());
cy.wrap(formData).should("deep.equal", expectedInitialFormData);
});
// Modify form field values
cy.get(`${fieldPrefix}-name input`)
.clear({ force: true })
.type(updatedFormData.name);
cy.get(`${fieldPrefix}-age input`)
.clear({ force: true })
.clear({ force: true })
.type(updatedFormData.age);
cy.get(`${fieldPrefix}-address-street input`)
.clear({ force: true })
.type(updatedFormData.address.street);
cy.get(`${fieldPrefix}-hobbies .rc-select-selection-item`)
.contains("swimming")
.siblings(".rc-select-selection-item-remove")
.click({ force: true });
cy.get(`${fieldPrefix}-education-0--college input`)
.clear({ force: true })
.type(updatedFormData.education[0].college)
.wait(200);
cy.wait(1000);
// Check if modified text updates formData
cy.get(`${widgetsPage.textWidget} .bp3-ui-text`).then(($el) => {
const formData = JSON.parse($el.text());
cy.wrap(formData).should("deep.equal", updatedFormData);
});
});
it("updates fieldState", () => {
const expectedInitialFieldState = {
name: {
isDisabled: false,
isVisible: true,
isRequired: false,
isValid: true,
},
age: {
isDisabled: false,
isVisible: true,
isRequired: false,
isValid: true,
},
dob: {
isDisabled: false,
isVisible: true,
isRequired: false,
isValid: true,
},
migrant: {
isDisabled: false,
isVisible: true,
isRequired: false,
isValid: true,
isValid: true,
},
address: {
street: {
isDisabled: false,
isVisible: true,
isRequired: false,
isValid: true,
},
city: {
isDisabled: false,
isVisible: true,
isRequired: false,
isValid: true,
},
},
education: [
{
college: {
isDisabled: false,
isVisible: true,
isRequired: false,
isValid: true,
},
year: {
isDisabled: false,
isVisible: true,
isRequired: false,
isValid: true,
},
},
],
hobbies: {
isDisabled: false,
isVisible: true,
isRequired: false,
isValid: true,
filterText: "",
},
};
const expectedUpdatedFieldState = {
name: {
isDisabled: false,
isVisible: true,
isRequired: true,
isValid: false,
},
age: {
isDisabled: true,
isVisible: true,
isRequired: false,
isValid: true,
},
dob: {
isDisabled: false,
isVisible: true,
isRequired: false,
isValid: true,
},
migrant: {
isDisabled: false,
isVisible: false,
isRequired: false,
isValid: true,
},
address: {
street: {
isDisabled: false,
isVisible: true,
isRequired: true,
isValid: false,
},
city: {
isDisabled: false,
isVisible: true,
isRequired: false,
isValid: true,
},
},
education: [
{
college: {
isDisabled: false,
isVisible: true,
isRequired: true,
isValid: false,
},
year: {
isDisabled: false,
isVisible: false,
isRequired: false,
isValid: true,
},
},
],
hobbies: {
isDisabled: false,
isVisible: true,
isRequired: false,
isValid: true,
filterText: "",
},
};
cy.openPropertyPane("textwidget");
cy.get(".t--property-control-text .CodeMirror textarea")
.first()
.clear({
force: true,
});
cy.testJsontext("text", "{{JSON.stringify(JSONForm1.fieldState)}}");
cy.closePropertyPane();
cy.wait(3000);
cy.get(`${widgetsPage.textWidget} .bp3-ui-text`).then(($el) => {
const formData = JSON.parse($el.text());
cy.wrap(formData).should("deep.equal", expectedInitialFieldState);
});
cy.openPropertyPane("jsonformwidget");
// name.required -> true
cy.openFieldConfiguration("name");
cy.togglebar(`${propertyControlPrefix}-required input`);
cy.get(backBtn)
.click({ force: true })
.wait(500);
// age.disabled -> true
cy.openFieldConfiguration("age");
cy.togglebar(`${propertyControlPrefix}-disabled input`);
cy.get(backBtn)
.click({ force: true })
.wait(500);
// migrant.visible -> false
cy.openFieldConfiguration("migrant");
cy.togglebarDisable(`${propertyControlPrefix}-visible input`);
cy.get(backBtn)
.click({ force: true })
.wait(500);
// address.street.required -> true
cy.openFieldConfiguration("address");
cy.openFieldConfiguration("street");
cy.togglebar(`${propertyControlPrefix}-required input`);
cy.get(backBtn)
.click({ force: true })
.wait(500);
cy.get(backBtn)
.click({ force: true })
.wait(500);
// education.college.required -> true
// education.year.visible -> false
cy.openFieldConfiguration("education");
cy.openFieldConfiguration("__array_item__");
cy.openFieldConfiguration("college");
cy.togglebar(`${propertyControlPrefix}-required input`);
cy.get(backBtn)
.click({ force: true })
.wait(500);
cy.openFieldConfiguration("year");
cy.togglebarDisable(`${propertyControlPrefix}-visible input`);
cy.get(backBtn)
.click({ force: true })
.wait(500);
cy.closePropertyPane();
cy.get(`${fieldPrefix}-name input`).clear({ force: true });
cy.get(`${fieldPrefix}-address-street input`).clear({ force: true });
cy.get(`${fieldPrefix}-address-city input`).clear({ force: true });
cy.get(`${fieldPrefix}-education-0--college input`)
.clear({ force: true })
.wait(500);
cy.wait(3000);
cy.get(`${widgetsPage.textWidget} .bp3-ui-text`).then(($el) => {
const formState = JSON.parse($el.text());
cy.wrap(formState).should("deep.equal", expectedUpdatedFieldState);
});
});
it("change field accessor should reflect in fieldState", () => {
const expectedFieldStateChange = {
firstName: {
isDisabled: false,
isVisible: true,
isRequired: false,
isValid: true,
},
age: {
isDisabled: false,
isVisible: true,
isRequired: false,
isValid: true,
},
dob: {
isDisabled: false,
isVisible: true,
isRequired: false,
isValid: true,
},
migrant: {
isDisabled: false,
isVisible: true,
isRequired: false,
isValid: true,
},
address: {
street: {
isDisabled: false,
isVisible: true,
isRequired: false,
isValid: true,
},
city: {
isDisabled: false,
isVisible: true,
isRequired: false,
isValid: true,
},
},
education: [
{
graduatingCollege: {
isDisabled: false,
isVisible: true,
isRequired: false,
isValid: true,
},
year: {
isDisabled: false,
isVisible: true,
isRequired: false,
isValid: true,
},
},
],
hobbies: {
isDisabled: false,
isVisible: true,
isRequired: false,
isValid: true,
filterText: "",
},
};
cy.openPropertyPane("textwidget");
cy.get(".t--property-control-text .CodeMirror textarea")
.first()
.clear({
force: true,
});
cy.testJsontext("text", "{{JSON.stringify(JSONForm1.fieldState)}}");
cy.openPropertyPane("jsonformwidget");
// Change accessor name -> firstName
cy.openFieldConfiguration("name");
cy.testJsontext("propertyname", "firstName");
cy.wait(1000);
cy.get(backBtn)
.click({ force: true })
.wait(500);
// Change accessor education -> college to education -> graduatingCollege
cy.openFieldConfiguration("education");
cy.openFieldConfiguration("__array_item__");
cy.openFieldConfiguration("college");
cy.testJsontext("propertyname", "graduatingCollege");
cy.wait(5000);
// Verify if formState reflects accessor change
cy.get(`${widgetsPage.textWidget} .bp3-ui-text`).then(($el) => {
const formState = JSON.parse($el.text());
cy.wrap(formState).should("deep.equal", expectedFieldStateChange);
});
});
it("change field accessor should reflect in formData", () => {
const expectedFormDataChange = {
age: 30,
dob: "10/12/1992",
migrant: false,
address: { street: "Koramangala", city: "Bangalore" },
hobbies: ["travelling", "swimming"],
education: [{ graduatingCollege: "MIT", year: "20/10/2014" }],
firstName: "John",
};
cy.openPropertyPane("jsonformwidget");
// Change accessor name -> firstName
cy.openFieldConfiguration("name");
cy.testJsontext("propertyname", "firstName");
cy.wait(1000);
cy.get(backBtn)
.click({ force: true })
.wait(500);
// Change accessor education -> college to education -> graduatingCollege
cy.openFieldConfiguration("education");
cy.openFieldConfiguration("__array_item__");
cy.openFieldConfiguration("college");
cy.testJsontext("propertyname", "graduatingCollege");
cy.wait(5000);
cy.openPropertyPane("textwidget");
cy.testJsontext("text", "{{JSON.stringify(JSONForm1.formData)}}");
cy.wait(1000);
// Verify if formData reflects accessor change
cy.get(`${widgetsPage.textWidget} .bp3-ui-text`).then(($el) => {
const formData = JSON.parse($el.text());
cy.wrap(formData).should("deep.equal", expectedFormDataChange);
});
});
});

View File

@ -0,0 +1,70 @@
const commonlocators = require("../../../../../locators/commonlocators.json");
const dslWithSchema = require("../../../../../fixtures/jsonFormDslWithSchema.json");
const backBtn = ".t--property-pane-back-btn";
const fieldPrefix = ".t--jsonformfield";
const propertyControlPrefix = ".t--property-control";
describe("JSON Form Widget Form Bindings", () => {
before(() => {
cy.addDsl(dslWithSchema);
});
it("should have all the fields under field configuration", () => {
cy.openPropertyPane("jsonformwidget");
const fieldNames = [
"name",
"age",
"dob",
"migrant",
"address",
"education",
"hobbies",
];
fieldNames.forEach((fieldName) => {
cy.get(`[data-rbd-draggable-id='${fieldName}']`).should("exist");
});
});
it("Field Configuration - adds new custom field", () => {
cy.openPropertyPane("jsonformwidget");
// Add new field
cy.get(commonlocators.jsonFormAddNewCustomFieldBtn).click({
force: true,
});
// Check for the presence of newly added custom field
cy.get(`[data-rbd-draggable-id='customField1']`).should("exist");
});
it("Disabled Invalid Forms - disables the submit button when form has invalid field(s)", () => {
cy.get("button")
.contains("Submit")
.parent("button")
.should("not.have.attr", "disabled");
// make name field required
cy.openFieldConfiguration("name");
cy.togglebar(`${propertyControlPrefix}-required input`);
cy.get(backBtn).click({ force: true });
cy.get(`${fieldPrefix}-name input`)
.clear()
.wait(300);
cy.get("button")
.contains("Submit")
.parent("button")
.should("have.attr", "disabled");
cy.get(`${fieldPrefix}-name input`)
.type("JOHN")
.wait(300);
cy.get("button")
.contains("Submit")
.parent("button")
.should("not.have.attr", "disabled");
});
});

View File

@ -0,0 +1,146 @@
const dslWithSchema = require("../../../../../fixtures/jsonFormDslWithSchema.json");
const fieldPrefix = ".t--jsonformfield";
describe("JSON Form reset", () => {
beforeEach(() => {
cy.addDsl(dslWithSchema);
});
it("updates formData when field value changes", () => {
const initialFormData = {
age: 30,
dob: "10/12/1992",
migrant: false,
address: { street: "Koramangala", city: "Bangalore" },
hobbies: ["travelling", "swimming"],
education: [{ college: "MIT", year: "20/10/2014" }],
name: "John",
};
const updatedFormData = {
age: 40,
dob: "10/12/1992",
migrant: false,
address: { street: "Indranagar", city: "Bangalore" },
hobbies: ["travelling"],
education: [{ college: "IIT", year: "20/10/2014" }],
name: "Test",
};
// Verify current field values
cy.get(`${fieldPrefix}-name input`).should(
"have.value",
initialFormData.name,
);
cy.get(`${fieldPrefix}-age input`).should(
"have.value",
initialFormData.age,
);
cy.get(`${fieldPrefix}-dob input`).should(
"have.value",
initialFormData.dob,
);
cy.get(`${fieldPrefix}-address-street input`).should(
"have.value",
initialFormData.address.street,
);
cy.get(`${fieldPrefix}-address-city input`).should(
"have.value",
initialFormData.address.city,
);
cy.get(`${fieldPrefix}-education-0--college input`).should(
"have.value",
initialFormData.education[0].college,
);
cy.get(`${fieldPrefix}-education-0--year input`).should(
"have.value",
initialFormData.education[0].year,
);
// Modify field values
cy.get(`${fieldPrefix}-name input`)
.clear({ force: true })
.type(updatedFormData.name);
cy.get(`${fieldPrefix}-age input`)
.clear({ force: true })
.clear({ force: true })
.type(updatedFormData.age);
cy.get(`${fieldPrefix}-address-street input`)
.clear({ force: true })
.type(updatedFormData.address.street);
cy.get(`${fieldPrefix}-hobbies .rc-select-selection-item`)
.contains("swimming")
.siblings(".rc-select-selection-item-remove")
.click({ force: true });
cy.get(`${fieldPrefix}-education-0--college input`)
.clear({ force: true })
.type(updatedFormData.education[0].college)
.wait(200);
// Verify new field values
cy.get(`${fieldPrefix}-name input`).should(
"have.value",
updatedFormData.name,
);
cy.get(`${fieldPrefix}-age input`).should(
"have.value",
updatedFormData.age,
);
cy.get(`${fieldPrefix}-dob input`).should(
"have.value",
updatedFormData.dob,
);
cy.get(`${fieldPrefix}-address-street input`).should(
"have.value",
updatedFormData.address.street,
);
cy.get(`${fieldPrefix}-address-city input`).should(
"have.value",
updatedFormData.address.city,
);
cy.get(`${fieldPrefix}-education-0--college input`).should(
"have.value",
updatedFormData.education[0].college,
);
cy.get(`${fieldPrefix}-education-0--year input`).should(
"have.value",
updatedFormData.education[0].year,
);
// Reset form
cy.get("button")
.contains("Reset")
.parent("button")
.click({ force: true });
// Verify initial field values
cy.get(`${fieldPrefix}-name input`).should(
"have.value",
initialFormData.name,
);
cy.get(`${fieldPrefix}-age input`).should(
"have.value",
initialFormData.age,
);
cy.get(`${fieldPrefix}-dob input`).should(
"have.value",
initialFormData.dob,
);
cy.get(`${fieldPrefix}-address-street input`).should(
"have.value",
initialFormData.address.street,
);
cy.get(`${fieldPrefix}-address-city input`).should(
"have.value",
initialFormData.address.city,
);
cy.get(`${fieldPrefix}-education-0--college input`).should(
"have.value",
initialFormData.education[0].college,
);
cy.get(`${fieldPrefix}-education-0--year input`).should(
"have.value",
initialFormData.education[0].year,
);
});
});

View File

@ -0,0 +1,241 @@
const dslWithoutSchema = require("../../../../../fixtures/jsonFormDslWithoutSchema.json");
const jsonFormUnicodeDSLWithoutSourceData = require("../../../../../fixtures/jsonFormUnicodeDSLWithoutSourceData.json");
const widgetsPage = require("../../../../../locators/Widgets.json");
const fieldPrefix = ".t--jsonformfield";
const backBtn = ".t--property-pane-back-btn";
describe("JSON Form Widget Unicode keys", () => {
it("generates fields with valid source data json", () => {
cy.addDsl(dslWithoutSchema);
const sourceData = {
: "John",
суроға: {
شارع: "Koramangala",
},
การศกษา: [
{
କଲ: "MIT",
},
],
};
cy.openPropertyPane("jsonformwidget");
cy.testJsontext("sourcedata", JSON.stringify(sourceData));
cy.closePropertyPane();
cy.get(`${fieldPrefix}-xn__l2bm1c label`).contains("नाम");
cy.get(`${fieldPrefix}-xn__l2bm1c input`).then((input) => {
cy.wrap(input).should("have.value", "John");
cy.wrap(input)
.invoke("attr", "type")
.should("contain", "text");
});
cy.get(`${fieldPrefix}-xn__80a1afdk69b label`).should("have.length", 2);
cy.get(`${fieldPrefix}-xn__80a1afdk69b-xn__mgbuhw label`).contains("شارع");
cy.get(`${fieldPrefix}-xn__80a1afdk69b-xn__mgbuhw input`).then((input) => {
cy.wrap(input).should("have.value", "Koramangala");
cy.wrap(input)
.invoke("attr", "type")
.should("contain", "text");
});
cy.get(`${fieldPrefix}-xn__12ca5huag4ce3a label`).should("have.length", 2);
cy.get(`${fieldPrefix}-xn__12ca5huag4ce3a-0--xn__ohco9d4d label`).contains(
"କଲେଜ",
);
cy.get(`${fieldPrefix}-xn__12ca5huag4ce3a-0--xn__ohco9d4d input`).then(
(input) => {
cy.wrap(input).should("have.value", "MIT");
cy.wrap(input)
.invoke("attr", "type")
.should("contain", "text");
},
);
cy.get(
`${fieldPrefix}-xn__12ca5huag4ce3a .t--jsonformfield-array-delete-btn .t--text`,
).should("have.text", "Delete");
cy.get(
`${fieldPrefix}-xn__12ca5huag4ce3a .t--jsonformfield-array-add-btn .t--text`,
).should("have.text", "Add New");
});
it("modifies field when source data changes", () => {
cy.addDsl(jsonFormUnicodeDSLWithoutSourceData);
const modifiedSourceData = {
"पहला नाम": "John",
"अंतिम नाम": "Doe",
суроға: {
شارع: "Koramangala",
},
การศกษา: [
{
କଲ: "MIT",
卒業の日: "21/03/2010",
},
],
};
cy.openPropertyPane("jsonformwidget");
cy.testJsontext("sourcedata", JSON.stringify(modifiedSourceData));
cy.closePropertyPane();
cy.get(`${fieldPrefix}-xn____xvdesr5bxbc label`).contains("पहला नाम");
cy.get(`${fieldPrefix}-xn____xvdesr5bxbc input`).then((input) => {
cy.wrap(input).should("have.value", "John");
cy.wrap(input)
.invoke("attr", "type")
.should("contain", "text");
});
cy.get(`${fieldPrefix}-xn____qtdi9jva8ac1kf label`).contains("अंतिम नाम");
cy.get(`${fieldPrefix}-xn____qtdi9jva8ac1kf input`).then((input) => {
cy.wrap(input).should("have.value", "Doe");
cy.wrap(input)
.invoke("attr", "type")
.should("contain", "text");
});
cy.get(`${fieldPrefix}-xn__80a1afdk69b label`).should("have.length", 2);
cy.get(`${fieldPrefix}-xn__80a1afdk69b-xn__mgbuhw label`).contains("شارع");
cy.get(`${fieldPrefix}-xn__80a1afdk69b-xn__mgbuhw input`).then((input) => {
cy.wrap(input).should("have.value", "Koramangala");
cy.wrap(input)
.invoke("attr", "type")
.should("contain", "text");
});
cy.get(`${fieldPrefix}-xn__12ca5huag4ce3a label`).should("have.length", 3);
cy.get(`${fieldPrefix}-xn__12ca5huag4ce3a-0--xn__ohco9d4d label`).contains(
"କଲେଜ",
);
cy.get(`${fieldPrefix}-xn__12ca5huag4ce3a-0--xn__ohco9d4d input`).then(
(input) => {
cy.wrap(input).should("have.value", "MIT");
cy.wrap(input)
.invoke("attr", "type")
.should("contain", "text");
},
);
cy.get(
`${fieldPrefix}-xn__12ca5huag4ce3a-0--xn__u9j436hvxmjkd label`,
).contains("卒業の日");
cy.get(`${fieldPrefix}-xn__12ca5huag4ce3a-0--xn__u9j436hvxmjkd input`).then(
(input) => {
cy.wrap(input).should("have.value", "21/03/2010");
cy.wrap(input)
.invoke("attr", "type")
.should("contain", "text");
},
);
cy.get(
`${fieldPrefix}-xn__12ca5huag4ce3a .t--jsonformfield-array-delete-btn .t--text`,
).should("have.text", "Delete");
cy.get(
`${fieldPrefix}-xn__12ca5huag4ce3a .t--jsonformfield-array-add-btn .t--text`,
).should("have.text", "Add New");
});
it("change in accessor updates formData", () => {
cy.addDsl(jsonFormUnicodeDSLWithoutSourceData);
const sourceData = {
: "John",
суроға: {
شارع: "Koramangala",
},
การศกษา: [
{
କଲ: "MIT",
},
],
};
cy.openPropertyPane("jsonformwidget");
cy.testJsontext("sourcedata", JSON.stringify(sourceData));
cy.closePropertyPane();
const expectedInitialFormData = sourceData;
const formDataBeforeArrayAccessorChange = {
"नाम नाम": "John",
суроға: {
ارع1 شارع": "Koramangala",
},
การศกษา: [
{
କଲ: "MIT",
},
],
};
const formDataAfterArrayAccessorChange = {
"नाम नाम": "John",
суроға: {
ارع1 شارع": "Koramangala",
},
การศกษา: [
{
"ସ୍ନାତକ କଲେଜ": "MIT",
},
],
};
// Bind formData to Text1 widget text property
cy.openPropertyPane("textwidget");
cy.testJsontext("text", "{{JSON.stringify(JSONForm1.formData)}}");
cy.closePropertyPane();
// Validate initial form data
cy.get(`${widgetsPage.textWidget} .bp3-ui-text`).then(($el) => {
const formData = JSON.parse($el.text());
cy.wrap(formData).should("deep.equal", expectedInitialFormData);
});
cy.openPropertyPane("jsonformwidget");
// नाम field
cy.openFieldConfiguration("xn__l2bm1c");
cy.testJsontext("propertyname", "नाम नाम");
cy.get(backBtn)
.click({ force: true })
.wait(500);
// open field суроға -> شارع
cy.openFieldConfiguration("xn__80a1afdk69b");
cy.openFieldConfiguration("xn__mgbuhw");
cy.testJsontext("propertyname", ارع1 شارع");
cy.get(backBtn)
.click({ force: true })
.wait(500);
cy.get(backBtn)
.click({ force: true })
.wait(500);
// Validate initial form data
cy.get(`${widgetsPage.textWidget} .bp3-ui-text`).then(($el) => {
const formData = JSON.parse($el.text());
cy.wrap(formData).should("deep.equal", formDataBeforeArrayAccessorChange);
});
// open field การศึกษา -> array item -> କଲେଜ
cy.openFieldConfiguration("xn__12ca5huag4ce3a");
cy.openFieldConfiguration("__array_item__");
cy.openFieldConfiguration("xn__ohco9d4d");
cy.testJsontext("propertyname", "ସ୍ନାତକ କଲେଜ");
cy.wait(5000);
// Validate initial form data
cy.get(`${widgetsPage.textWidget} .bp3-ui-text`).then(($el) => {
const formData = JSON.parse($el.text());
cy.wrap(formData).should("deep.equal", formDataAfterArrayAccessorChange);
});
});
});

View File

@ -81,6 +81,11 @@ describe("Phone input widget - ", () => {
});
it("should check that widget input resets on submit", () => {
cy.openPropertyPane("textwidget");
cy.updateCodeInput(
".t--property-control-text",
`{{PhoneInput1.text}}:{{PhoneInput1.value}}`,
);
cy.openPropertyPane(widgetName);
cy.get(
".t--property-control-onsubmit .t--open-dropdown-Select-Action",
@ -90,8 +95,12 @@ describe("Phone input widget - ", () => {
cy.get(widgetInput).clear();
cy.wait(300);
cy.get(widgetInput).type("1234567890{enter}");
cy.get(widgetInput).type("1234567890");
cy.wait(300);
cy.get(".t--widget-textwidget").should("contain", "1234567890:1234567890");
cy.get(widgetInput).type("{enter}");
cy.wait(300);
cy.get(widgetInput).should("contain.value", "");
cy.get(".t--widget-textwidget").should("contain", ":undefined");
});
});

View File

@ -33,11 +33,11 @@ describe("Generate New CRUD Page Inside from Mongo as Data Source", function() {
//TestData source
cy.get(".t--test-datasource").click();
cy.get(".t--test-datasource").click({ force: true });
cy.wait("@testDatasource");
//Save source
cy.get(".t--save-datasource").click();
cy.get(".t--save-datasource").click({ force: true });
//Verify page after save clicked
cy.get("@createDatasource").then((httpResponse) => {
@ -124,11 +124,11 @@ describe("Generate New CRUD Page Inside from Mongo as Data Source", function() {
});
//TestData source
cy.get(".t--test-datasource").click();
cy.get(".t--test-datasource").click({ force: true });
cy.wait("@testDatasource");
//Save source
cy.get(".t--save-datasource").click();
cy.get(".t--save-datasource").click({ force: true });
//Generate Stub for tables dropdown values also
cy.wait("@getDatasourceStructure").should(

View File

@ -1,5 +1,4 @@
const commonLocators = require("../../../../locators/commonlocators.json");
const { typeIntoDraftEditor } = require("../Comments/utils");
import commentsLocators from "../../../../locators/CommentsLocators";
const newCommentText1 = "new comment text 1";
@ -36,7 +35,7 @@ describe("Git sync:", function() {
cy.createGitBranch("ChildBranch");
// Add a comment on the child branch
cy.get(commonLocators.canvas).click(50, 50);
typeIntoDraftEditor(commentsLocators.mentionsInput, newCommentText1);
cy.typeIntoDraftEditor(commentsLocators.mentionsInput, newCommentText1);
cy.get(commentsLocators.mentionsInput).type("{enter}");
cy.switchGitBranch("master");
cy.get(newCommentText1).should("not.exist");

View File

@ -26,10 +26,6 @@ describe("Git disconnect modal:", function() {
cy.get(gitSyncLocators.gitSyncModal).should("not.exist");
cy.get(gitSyncLocators.disconnectGitModal).should("exist");
// title and info text checking
cy.get(gitSyncLocators.disconnectGitModal).contains(
Cypress.env("MESSAGES").GIT_DISCONNECTION_SUBMENU(),
);
cy.get(gitSyncLocators.disconnectGitModal).contains(
Cypress.env("MESSAGES").NONE_REVERSIBLE_MESSAGE(),
);
@ -49,10 +45,10 @@ describe("Git disconnect modal:", function() {
.then((state) => {
const { name } = state.ui.gitSync.disconnectingGitApp;
cy.get(gitSyncLocators.disconnectGitModal).contains(
Cypress.env("MESSAGES").DISCONNECT_FROM_GIT(name),
Cypress.env("MESSAGES").GIT_REVOKE_ACCESS(name),
);
cy.get(gitSyncLocators.disconnectGitModal).contains(
Cypress.env("MESSAGES").TYPE_PROMO_CODE(name),
Cypress.env("MESSAGES").GIT_TYPE_REPO_NAME_FOR_REVOKING_ACCESS(name),
);
});

View File

@ -0,0 +1,54 @@
import gitSyncLocators from "../../../../locators/gitSyncLocators";
const pagename = "ChildPage";
const tempBranch = "tempBranch";
const tempBranch0 = "tempBranch0";
const mainBranch = "master";
let repoName;
describe("Git sync Bugs", function() {
before(() => {
cy.NavigateToHome();
cy.createOrg();
cy.wait("@createOrg").then((interception) => {
const newOrganizationName = interception.response.body.data.name;
cy.CreateAppForOrg(newOrganizationName, newOrganizationName);
});
cy.generateUUID().then((uid) => {
repoName = uid;
cy.createTestGithubRepo(repoName);
cy.connectToGitRepo(repoName);
});
});
it("Bug:10773 When user delete a resource form the child branch and merge it back to parent branch, still the deleted resource will show up in the newly created branch", () => {
// adding a new page "ChildPage" to master
cy.Createpage(pagename);
cy.get(".t--entity-name:contains('Page1')").click();
cy.commitAndPush();
cy.wait(2000);
cy.createGitBranch(tempBranch);
cy.CheckAndUnfoldEntityItem("PAGES");
// verify tempBranch should contain this page
cy.get(`.t--entity-name:contains("${pagename}")`).should("be.visible");
cy.get(`.t--entity-name:contains("${pagename}")`).click();
// delete page from tempBranch and merge to master
cy.Deletepage(pagename);
cy.commitAndPush();
cy.merge(mainBranch);
cy.get(gitSyncLocators.closeGitSyncModal).click();
cy.wait(8000);
// verify ChildPage is not on master
cy.switchGitBranch(mainBranch);
cy.CheckAndUnfoldEntityItem("PAGES");
cy.get(`.t--entity-name:contains("${pagename}")`).should("not.exist");
// create another branch and verify deleted page doesn't exist on it
cy.createGitBranch(tempBranch0);
cy.CheckAndUnfoldEntityItem("PAGES");
cy.get(`.t--entity-name:contains("${pagename}")`).should("not.exist");
});
after(() => {
cy.deleteTestGithubRepo(repoName);
});
});

View File

@ -60,7 +60,6 @@ describe("Git sync:", function() {
widgetsPage.buttonWidget,
commonlocators.buttonInner,
);
cy.get(homePage.publishButton).click();
cy.get(gitSyncLocators.commitCommentInput).type("Initial Commit");
cy.get(gitSyncLocators.commitButton).click();
@ -118,6 +117,7 @@ describe("Git sync:", function() {
cy.commitAndPush();
cy.merge(mainBranch);
cy.get(gitSyncLocators.closeGitSyncModal).click();
cy.wait(8000);
cy.switchGitBranch(mainBranch);
cy.contains("NewPage");
});
@ -185,9 +185,8 @@ describe("Git sync:", function() {
cy.get(gitSyncLocators.gitPullCount);
cy.get(gitSyncLocators.bottomBarPullButton).click();
cy.contains(Cypress.env("MESSAGES").GIT_CONFLICTING_INFO());
cy.get("body").type("{esc}");
cy.xpath("//span[@name='close-modal']").click({ force: true });
});
it("clicking '+' icon on bottom bar should open deploy popup", function() {
@ -214,7 +213,6 @@ describe("Git sync:", function() {
201,
);
cy.get("#loading").should("not.exist");
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(2000);
cy.AppSetupForRename();

View File

@ -120,6 +120,7 @@ describe("Git sync:", function() {
it("makes branch specific resource updates", function() {
cy.switchGitBranch(childBranchKey);
cy.CheckAndUnfoldEntityItem("QUERIES/JS");
cy.CheckAndUnfoldEntityItem("PAGES");
cy.GlobalSearchEntity("ParentPage1");
cy.RenameEntity("ParentPageRenamed", true);
cy.GlobalSearchEntity("ParentApi1");

View File

@ -1,3 +1,5 @@
/// <reference types="Cypress" />
const commonlocators = require("../../../../locators/commonlocators.json");
const widgetsPage = require("../../../../locators/Widgets.json");
const dsl = require("../../../../fixtures/listdsl.json");
@ -8,11 +10,13 @@ describe("Container Widget Functionality", function() {
before(() => {
cy.addDsl(dsl);
cy.wait(5000);
});
it("List-Unckeck Visible field Validation", function() {
it("1. List-Unckeck Visible field Validation", function() {
// Open Property pane
cy.SearchEntityandOpen("List1");
cy.CheckAndUnfoldEntityItem("WIDGETS");
cy.selectEntityByName("List1");
//Uncheck the disabled checkbox and validate
cy.UncheckWidgetProperties(commonlocators.visibleCheckbox);
cy.PublishtheApp();
@ -20,9 +24,10 @@ describe("Container Widget Functionality", function() {
cy.get(publishPage.backToEditor).click({ force: true });
});
it("List-Check Visible field Validation", function() {
it("2. List-Check Visible field Validation", function() {
// Open Property pane
cy.SearchEntityandOpen("List1");
cy.CheckAndUnfoldEntityItem("WIDGETS");
cy.selectEntityByName("List1");
//Check the disableed checkbox and Validate
cy.CheckWidgetProperties(commonlocators.visibleCheckbox);
cy.PublishtheApp();
@ -30,9 +35,10 @@ describe("Container Widget Functionality", function() {
cy.get(publishPage.backToEditor).click({ force: true });
});
it("Toggle JS - List-Unckeck Visible field Validation", function() {
it("3. Toggle JS - List-Unckeck Visible field Validation", function() {
// Open Property pane
cy.SearchEntityandOpen("List1");
cy.CheckAndUnfoldEntityItem("WIDGETS");
cy.selectEntityByName("List1");
//Uncheck the disabled checkbox using JS and validate
cy.get(widgetsPage.toggleVisible).click({ force: true });
cy.testJsontext("visible", "false");
@ -41,9 +47,10 @@ describe("Container Widget Functionality", function() {
cy.get(publishPage.backToEditor).click({ force: true });
});
it("Toggle JS - List-Check Visible field Validation", function() {
it("4. Toggle JS - List-Check Visible field Validation", function() {
// Open Property pane
cy.SearchEntityandOpen("List1");
cy.CheckAndUnfoldEntityItem("WIDGETS");
cy.selectEntityByName("List1");
//Check the disabled checkbox using JS and Validate
cy.testJsontext("visible", "true");
cy.PublishtheApp();
@ -51,16 +58,20 @@ describe("Container Widget Functionality", function() {
cy.get(publishPage.backToEditor).click({ force: true });
});
it("checks if list shows correct no. of items", function() {
it("5. checks if list shows correct no. of items", function() {
// Verify the length of list
cy.get(commonlocators.containerWidget).then(function($lis) {
expect($lis).to.have.length(2);
});
});
it("checks currentItem binding", function() {
it("6. checks currentItem binding", function() {
// Open property pane
cy.SearchEntityandOpen("Text1");
cy.CheckAndUnfoldEntityItem("WIDGETS");
cy.CheckAndUnfoldEntityItem("List1");
cy.CheckAndUnfoldEntityItem("Container1");
cy.selectEntityByName("Text1");
//cy.SearchEntityandOpen("Text1");
cy.testJsontext("text", `{{currentItem.first_name}}`);
cy.wait(1000);
@ -72,11 +83,36 @@ describe("Container Widget Functionality", function() {
});
});
it("checks button action", function() {
it("7. doesn't alter the no of items present when invalid item spacing is entered", () => {
// Open Property pane
cy.CheckAndUnfoldEntityItem("WIDGETS");
cy.selectEntityByName("List1");
// Update an invalid value to item spacing
cy.testJsontext("itemspacing\\(" + "px" + "\\)", "-");
cy.wait(2000);
// Verify the length of list
cy.get(commonlocators.containerWidget).then(function($lis) {
expect($lis).to.have.length(2);
});
// Clear item spacing
cy.testJsontext("itemspacing\\(" + "px" + "\\)", "");
cy.wait(2000);
// Close property pane
cy.closePropertyPane();
});
it("8. checks button action", function() {
// Open property pane
cy.SearchEntityandOpen("Button1");
cy.testJsontext("label", `{{currentItem.first_name}}`);
cy.addAction("{{currentItem.first_name}}");
cy.CheckAndUnfoldEntityItem("WIDGETS");
cy.CheckAndUnfoldEntityItem("List1");
cy.CheckAndUnfoldEntityItem("Container1");
cy.selectEntityByName("Button1");
//cy.SearchEntityandOpen("Button1");
cy.testJsontext("label", `{{currentItem.last_name}}`);
cy.addAction("{{currentItem.last_name}}");
cy.PublishtheApp();
// Verify Widget Button by clicking on it
@ -84,14 +120,15 @@ describe("Container Widget Functionality", function() {
.first()
.click();
// Verify the click on first button
cy.get(commonlocators.toastmsg).contains(items[0].first_name);
cy.get(commonlocators.toastmsg).contains(items[0].last_name);
});
it("it checks onListItem click action", function() {
it("9. it checks onListItem click action", function() {
// Verify Clicking on list item shows message of first name
cy.get(publishPage.backToEditor).click({ force: true });
// Open property pane
cy.SearchEntityandOpen("List1");
cy.CheckAndUnfoldEntityItem("WIDGETS");
cy.selectEntityByName("List1");
// Verify Action type and Message of List Item
cy.addAction("{{currentItem.first_name}}");
@ -104,39 +141,35 @@ describe("Container Widget Functionality", function() {
cy.get(commonlocators.toastmsg).contains(items[0].first_name);
});
it("it checks pagination", function() {
it("10. it checks pagination", function() {
// clicking on second pagination button
cy.get(`${commonlocators.paginationButton}-2`).click();
// now we are on the second page which shows first the 3rd item in the list
cy.get(commonlocators.TextInside).then(function($lis) {
expect($lis.eq(0)).to.contain(items[2].first_name);
expect($lis.eq(1)).to.contain(items[3].first_name);
});
cy.get(publishPage.backToEditor).click({ force: true });
});
it("Chart-Copy Verification", function() {
it("11. ListWidget-Copy & Delete Verification", function() {
const modifierKey = Cypress.platform === "darwin" ? "meta" : "ctrl";
//Copy Chart and verify all properties
cy.SearchEntityandOpen("List1");
cy.CheckAndUnfoldEntityItem("WIDGETS");
cy.selectEntityByName("List1");
cy.copyWidget("List1Copy", commonlocators.containerWidget);
// cy.PublishtheApp();
});
it("Chart-Delete Verification", function() {
// Delete the Chart widget
cy.SearchEntityandOpen("List1Copy");
cy.deleteWidget();
cy.PublishtheApp();
// Verify the cart is deleted
cy.get(commonlocators.containerWidget).should("not.exist");
// Verify the copied list widget is deleted
cy.get(commonlocators.containerWidget).should("have.length", 2);
cy.get(publishPage.backToEditor).click({ force: true });
});
it("List widget background colour and deploy ", function() {
it("12. List widget background colour and deploy ", function() {
// Open Property pane
cy.SearchEntityandOpen("List1");
cy.CheckAndUnfoldEntityItem("WIDGETS");
cy.selectEntityByName("List1");
// Scroll down to Styles and Add background colour
cy.selectColor("backgroundcolor");
cy.wait(1000);
@ -158,9 +191,10 @@ describe("Container Widget Functionality", function() {
cy.get(publishPage.backToEditor).click({ force: true });
});
it("Toggle JS - List widget background colour and deploy ", function() {
it("13. Toggle JS - List widget background colour and deploy ", function() {
// Open Property pane
cy.SearchEntityandOpen("List1");
cy.CheckAndUnfoldEntityItem("WIDGETS");
cy.selectEntityByName("List1");
// Scroll down to Styles and Add background colour
cy.get(widgetsPage.backgroundColorToggle).click({ force: true });
cy.testJsontext("backgroundcolor", "#FFC13D");
@ -184,9 +218,10 @@ describe("Container Widget Functionality", function() {
cy.get(publishPage.backToEditor).click({ force: true });
});
it("Add new item in the list widget array object", function() {
it("14. Add new item in the list widget array object", function() {
// Open Property pane
cy.SearchEntityandOpen("List1");
cy.CheckAndUnfoldEntityItem("WIDGETS");
cy.selectEntityByName("List1");
//Add the new item in the list
cy.testJsontext("items", JSON.stringify(this.data.ListItems));
cy.wait(2000);
@ -194,9 +229,10 @@ describe("Container Widget Functionality", function() {
cy.get(publishPage.backToEditor).click({ force: true });
});
it("Adding large item Spacing for item card", function() {
it("15. Adding large item Spacing for item card", function() {
// Open Property pane
cy.SearchEntityandOpen("List1");
cy.CheckAndUnfoldEntityItem("WIDGETS");
cy.selectEntityByName("List1");
// Scroll down to Styles and Add item spacing for item card
cy.testJsontext("itemspacing\\(" + "px" + "\\)", 12);
cy.wait(2000);
@ -205,9 +241,10 @@ describe("Container Widget Functionality", function() {
cy.get(publishPage.backToEditor).click({ force: true });
});
it("Renaming the widget from Property pane and Entity explorer ", function() {
it("16. Renaming the widget from Property pane and Entity explorer ", function() {
// Open Property pane
cy.SearchEntityandOpen("List1");
cy.CheckAndUnfoldEntityItem("WIDGETS");
cy.selectEntityByName("List1");
// Change the list widget name from property pane and Verify it
cy.widgetText(
"List2",

View File

@ -0,0 +1,179 @@
const omnibar = require("../../../../locators/Omnibar.json");
const dsl = require("../../../../fixtures/omnibarDsl.json");
const commonlocators = require("../../../../locators/commonlocators.json");
describe("Omnibar functionality test cases", () => {
const apiName = "Omnibar1";
const jsObjectName = "Omnibar2";
before(() => {
cy.addDsl(dsl);
});
it("Verify omnibar is present across all pages and validate its fields", function() {
cy.get(omnibar.globalSearch)
.trigger("mouseover")
.should("have.css", "background-color", "rgb(240, 240, 240)");
cy.get(omnibar.globalSearch).click({ force: true });
// verifying all sections are present in omnibar
cy.get(omnibar.categoryTitle)
.eq(0)
.should("have.text", "Navigate")
.next()
.should(
"have.text",
"Navigate to any page, widget or file across this project.",
);
cy.get(omnibar.categoryTitle)
.eq(1)
.should("have.text", "Create New")
.next()
.should("have.text", "Create a new Query, API or JS Object");
cy.get(omnibar.categoryTitle)
.eq(2)
.should("have.text", "Use Snippets")
.next()
.should(
"have.text",
"Search and insert code snippets to perform complex actions quickly.",
);
cy.get(omnibar.categoryTitle)
.eq(3)
.should("have.text", "Search Documentation")
.next()
.should("have.text", "Find answers through Appsmith documentation.");
});
it("Verify when user clicks on a debugging error, related documentation should open in omnibar", function() {
cy.get(omnibar.globalSearch).click({ force: true });
// click on debugger icon
cy.get(commonlocators.debugger)
.should("be.visible")
.click({ force: true });
cy.get(commonlocators.errorTab)
.should("be.visible")
.click({ force: true });
cy.wait(500);
// click on open documention from error tab
cy.get(commonlocators.debuggerContextMenu).click({ multiple: true });
cy.xpath(commonlocators.openDocumentationfromErrorTab)
.first()
.click({ force: true });
// verify omnibar is opened with relevant documentation
cy.wait(500);
cy.get(omnibar.globalSearchInput).should(
"have.value",
"This value does not evaluate to type string",
);
cy.get(omnibar.globalSearchClose).click();
});
it("Verify Create New section and its data, also create a new api, new js object and new cURL import from omnibar ", function() {
cy.intercept("POST", "/api/v1/actions").as("createNewApi");
cy.intercept("POST", "/api/v1/collections/actions").as(
"createNewJSCollection",
);
cy.get(omnibar.categoryTitle)
.eq(1)
.click();
// create new api, js object and cURL import from omnibar
cy.get(omnibar.createNew)
.eq(0)
.should("have.text", "New Blank API");
cy.get(omnibar.createNew)
.eq(1)
.should("have.text", "New JS Object");
cy.get(omnibar.createNew)
.eq(2)
.should("have.text", "New cURL Import");
cy.get(omnibar.createNew)
.eq(0)
.click();
cy.wait(1000);
cy.wait("@createNewApi");
cy.renameWithInPane(apiName);
cy.get(omnibar.globalSearch).click({ force: true });
cy.get(omnibar.categoryTitle)
.eq(1)
.click();
cy.get(omnibar.createNew)
.eq(1)
.click();
cy.wait(1000);
cy.wait("@createNewJSCollection");
cy.wait(1000);
cy.get(".t--js-action-name-edit-field").type(jsObjectName);
cy.get(omnibar.globalSearch).click({ force: true });
cy.get(omnibar.categoryTitle)
.eq(1)
.click();
cy.get(omnibar.createNew)
.eq(2)
.click();
cy.wait(1000);
cy.xpath("//p[text()='Import from CURL']").should("be.visible");
});
it("Verify on an invalid search, discord link should be displayed and on clicking that link, should open discord in new tab", function() {
// typing a random string in search bar
cy.get(omnibar.globalSearch).click({ force: true });
cy.wait(1000);
cy.get(omnibar.globalSearchInput).type("vnjkv");
cy.wait(2000);
cy.get(omnibar.globalSearchInput).should("have.value", "vnjkv");
// discord link should be visible
cy.get(omnibar.discordLink).should("be.visible");
cy.window().then((win) => {
cy.stub(win, "open", (url) => {
win.location.href = "https://discord.com/invite/rBTTVJp";
}).as("discordLink");
});
// clicking on discord link should open discord in new tab
cy.get(omnibar.discordLink).click();
cy.get("@discordLink").should("be.called");
cy.wait(500);
cy.go(-1);
cy.wait(2000);
});
it("Verify Navigate section shows recently opened widgets and datasources", function() {
cy.get(".bp3-icon-chevron-left").click({ force: true });
cy.openPropertyPane("buttonwidget");
cy.get(omnibar.globalSearch).click({ force: true });
cy.get(omnibar.categoryTitle)
.eq(0)
.click();
// verify recently opened items with their subtext i.e page name
cy.xpath(omnibar.recentlyopenItem)
.eq(0)
.should("have.text", "Button1")
.next()
.should("have.text", "Page1");
cy.xpath(omnibar.recentlyopenItem)
.eq(2)
.should("have.text", "Omnibar2")
.next()
.should("have.text", "Page1");
cy.xpath(omnibar.recentlyopenItem)
.eq(3)
.should("have.text", "Omnibar1")
.next()
.should("have.text", "Page1");
});
// commenting this test until the bug #11953 is fixed
/*it("Verify documentation should open in new tab, on clicking on open documentation", function() {
// commenting this test until the bug #11953 is fixed
cy.window().then((win) => {
cy.stub(win, "open", (url) => {
win.location.href = "https://docs.appsmith.com/";
}).as("documentationLink");
});
cy.get(omnibar.categoryTitle)
.eq(3)
.click({ force: true });
cy.get(omnibar.openDocumentationLink).click();
cy.get("@documentationLink").should("be.called");
cy.go(-1);
}); */
});

View File

@ -10,7 +10,7 @@ describe("Organization Import Application", function() {
cy.addDsl(dsl);
});
it("Can Import Application", function() {
it("Can Import Application from json", function() {
cy.NavigateToHome();
appname = localStorage.getItem("AppName");
cy.get(homePage.searchInput).type(appname);
@ -47,20 +47,24 @@ describe("Organization Import Application", function() {
cy.get(homePage.orgImportAppModal).should("be.visible");
cy.xpath(homePage.uploadLogo).attachFile("exported-app.json");
cy.get(homePage.orgImportAppButton).click({ force: true });
cy.wait("@importNewApplication").then((interception) => {
let appId = interception.response.body.data.id;
let defaultPage = interception.response.body.data.pages.find(
(eachPage) => !!eachPage.isDefault,
);
const importedApp = interception.response.body.data.application;
const { pages } = importedApp;
const appSlug = importedApp.slug;
let defaultPage = pages.find((eachPage) => eachPage.isDefault);
cy.get(homePage.toastMessage).should(
"contain",
"Application imported successfully",
);
cy.url().should(
"include",
`/applications/${appId}/pages/${defaultPage.id}/edit`,
);
cy.wait("@getPagesForCreateApp").then((interception) => {
const pages = interception.response.body.data.pages;
const pageSlug =
pages.find((page) => page.isDefault)?.slug ?? "page";
cy.url().should(
"include",
`/${appSlug}/${pageSlug}-${defaultPage.id}`,
);
});
});
});
});

View File

@ -6,14 +6,14 @@ const pageTwo = "MyPage2";
describe("Hide / Show page test functionality", function() {
it("Hide page test ", function() {
cy.wait(30000);
cy.Createpage(pageOne);
cy.Createpage(pageTwo);
cy.get(".t--entity-name")
.contains("Page1")
.click({ force: true });
cy.get(`.t--entity-name:contains('MyPage2')`).trigger("mouseover");
cy.hoverAndClick();
cy.get(`.t--entity-item:contains('MyPage2')`).within(() => {
cy.get(".t--context-menu").click({ force: true });
});
cy.get(pages.hidePage).click({ force: true });
cy.ClearSearch();
cy.PublishtheApp();

View File

@ -1,6 +1,5 @@
const dsl = require("../../../../fixtures/PageLoadDsl.json");
const commonlocators = require("../../../../locators/commonlocators.json");
const pages = require("../../../../locators/Pages.json");
const publish = require("../../../../locators/publishWidgetspage.json");
const explorerLocators = require("../../../../locators/explorerlocators.json");
@ -15,7 +14,8 @@ describe("Page Load tests", () => {
cy.get("h2").contains("Drag and drop a widget here");
});
it("Published page loads correctly", () => {
it("1. Published page loads correctly", () => {
//add page within page
cy.addDsl(dsl);
// Update the text to be asserted later
@ -30,6 +30,8 @@ describe("Page Load tests", () => {
.parent()
.parent()
.parent()
.parent()
.parent()
.should("have.class", "is-active");
// Assert active page DSL
cy.get(commonlocators.headingTextStyle).should(
@ -45,6 +47,8 @@ describe("Page Load tests", () => {
.parent()
.parent()
.parent()
.parent()
.parent()
.should("have.class", "is-active");
// Assert active page DSL
cy.get(commonlocators.headingTextStyle).should(
@ -62,6 +66,8 @@ describe("Page Load tests", () => {
.parent()
.parent()
.parent()
.parent()
.parent()
.should("have.class", "is-active");
// Assert active page DSL
cy.get(commonlocators.headingTextStyle).should(
@ -70,20 +76,17 @@ describe("Page Load tests", () => {
);
});
it.skip("Hide Page and validate published app", () => {
it("2. Hide Page and validate published app", () => {
cy.get(publish.backToEditor).click();
cy.GlobalSearchEntity("Page1");
cy.xpath(pages.popover)
.last()
.click({ force: true });
cy.get(pages.hidePage).click({ force: true });
cy.ClearSearch();
cy.actionContextMenuByEntityName("Page1", "Hide");
cy.PublishtheApp();
// Assert active page DSL
cy.get(commonlocators.headingTextStyle).should(
"have.text",
"This is Page 1",
);
cy.contains("Page2").should("not.exist");
cy.get(publish.backToEditor).click();
cy.SearchEntityandOpen("Page2");
cy.PublishtheApp();
@ -92,5 +95,6 @@ describe("Page Load tests", () => {
"have.text",
"This is Page 2",
);
cy.contains("Page1").should("not.exist");
});
});

View File

@ -39,13 +39,7 @@ describe("Check datasource doc links", function() {
});
it("3. Delete the query and datasources", function() {
cy.get(queryEditor.queryMoreAction).click();
cy.get(queryEditor.deleteUsingContext).click();
cy.wait("@deleteAction").should(
"have.nested.property",
"response.body.responseMeta.status",
200,
);
cy.deleteQueryUsingContext();
cy.deleteDatasource(postgresDatasourceName);
});

View File

@ -78,13 +78,7 @@ describe("Switch datasource", function() {
});
it("4. Delete the query and datasources", function() {
cy.get(queryEditor.queryMoreAction).click();
cy.get(queryEditor.deleteUsingContext).click();
cy.wait("@deleteAction").should(
"have.nested.property",
"response.body.responseMeta.status",
200,
);
cy.deleteQueryUsingContext();
cy.deleteDatasource(postgresDatasourceName);
cy.deleteDatasource(mongoDatasourceName);

View File

@ -29,7 +29,10 @@ describe("Undo/Redo functionality", function() {
cy.get(datasourceEditor.password).type(
datasourceFormData["postgres-password"],
);
cy.get(datasourceEditor.sectionAuthentication).click();
cy.get(datasourceEditor.sectionAuthentication)
.trigger("click")
.wait(1000);
cy.get("body").type(`{${modifierKey}}z`);
cy.get(
`${datasourceEditor.sectionAuthentication} .bp3-icon-chevron-up`,
@ -40,6 +43,7 @@ describe("Undo/Redo functionality", function() {
.trigger("mouseover");
cy.get("li:contains(Undo)").click({ multiple: true });
cy.get(datasourceEditor.username).should("be.empty");
cy.get(datasourceEditor.saveBtn).click({ force: true });
});
it("Checks undo/redo for Api pane", function() {

View File

@ -25,8 +25,13 @@ describe("Test curl import flow", function() {
cy.RunAPI();
cy.ResponseStatusCheck("200 OK");
cy.get(ApiEditor.formActionButtons).should("be.visible");
cy.get(ApiEditor.ApiActionMenu).click();
cy.get(ApiEditor.ApiActionMenu)
.first()
.click();
cy.get(ApiEditor.ApiDeleteBtn).click();
cy.get(ApiEditor.ApiDeleteBtn)
.contains("Are you sure?")
.click();
cy.wait("@deleteAction");
cy.get("@deleteAction").then((response) => {
cy.expect(response.response.body.responseMeta.success).to.eq(true);

View File

@ -4,8 +4,11 @@ import ApiEditor from "../../../../locators/ApiEditor";
describe("API Panel Test Functionality", function() {
afterEach(function() {
cy.get(ApiEditor.ApiActionMenu).click({ force: true });
cy.get(ApiEditor.ApiActionMenu).click({ multiple: true });
cy.get(apiwidget.deleteAPI).click({ force: true });
cy.get(apiwidget.deleteAPI)
.contains("Are you sure?")
.click({ force: true });
cy.wait("@deleteAction").should(
"have.nested.property",
"response.body.responseMeta.status",

View File

@ -5,14 +5,17 @@ const pages = require("../../../../locators/Pages.json");
const testdata = require("../../../../fixtures/testdata.json");
describe("Rest Bugs tests", function() {
it("Bug 5550: Not able to run APIs in parallel", function() {
//Skipping until api endpoint fixed
it.skip("Bug 5550: Not able to run APIs in parallel", function() {
cy.addDsl(dslParallel);
cy.wait(5000); //settling time for dsl!
cy.get(".bp3-spinner").should("not.exist");
//Api 1
cy.NavigateToAPI_Panel();
cy.CreateAPI("CatImage");
cy.enterDatasource("https://api.thecatapi.com/v1/images/search");
cy.wait(1000);
cy.assertPageSave();
cy.get("body").click(0, 0);
//Api 2
@ -21,14 +24,16 @@ describe("Rest Bugs tests", function() {
cy.enterDatasource(
"https://cat-fact.herokuapp.com/facts/random?animal_type=cat",
);
cy.wait(1000);
cy.assertPageSave();
cy.get("body").click(0, 0);
//Api 3
cy.NavigateToAPI_Panel();
cy.CreateAPI("DogImage");
cy.enterDatasource("https://dog.ceo/api/breeds/image/random");
cy.wait(1000); //important - needed for autosave of API before running
cy.assertPageSave();
//important - needed for autosave of API before running
cy.get("body").click(0, 0);
//Api 4
@ -37,7 +42,7 @@ describe("Rest Bugs tests", function() {
cy.enterDatasource(
"https://cat-fact.herokuapp.com/facts/random?animal_type=dog",
);
cy.wait(1000);
cy.assertPageSave();
cy.get("body").click(0, 0);
cy.contains(commonlocators.entityName, "Page1").click({ force: true });
@ -116,6 +121,8 @@ describe("Rest Bugs tests", function() {
it("Bug 4775: No Cyclical dependency when Api returns an error", function() {
cy.addDsl(dslTable);
cy.wait(5000); //settling time for dsl!
cy.get(".bp3-spinner").should("not.exist");
//Api 1
cy.CreateAPI("Currencies");
cy.enterDatasource("https://api.coinbase.com/v2/currencies");

View File

@ -54,13 +54,7 @@ describe("Arango datasource test cases", function() {
201,
);
cy.get(queryEditor.queryMoreAction).click();
cy.get(queryEditor.deleteUsingContext).click();
cy.wait("@deleteAction").should(
"have.nested.property",
"response.body.responseMeta.status",
200,
);
cy.deleteQueryUsingContext();
cy.deleteDatasource(datasourceName);
});

View File

@ -1,4 +1,5 @@
const apiwidget = require("../../../../locators/apiWidgetslocator.json");
const datasourceFormData = require("../../../../fixtures/datasources.json");
describe("Authenticated API Datasource", function() {
it("Can create New Authentication API datasource", function() {
@ -9,5 +10,9 @@ describe("Authenticated API Datasource", function() {
"response.body.responseMeta.status",
201,
);
cy.fillAuthenticatedAPIForm();
cy.saveDatasource();
const URL = datasourceFormData["authenticatedApiUrl"];
cy.contains(URL);
});
});

View File

@ -28,7 +28,7 @@ describe("Datasource form related tests", function() {
.trigger("mouseover");
cy.hoverAndClickParticularIndex(1);
cy.get('.single-select:contains("Copy to page")').click();
cy.get('.single-select:contains("Page1")').click();
cy.get('.single-select:contains("Page1")').click({ force: true });
cy.validateToastMessage("Testapi action copied to page Page1 successfully");
});
});

View File

@ -54,13 +54,7 @@ describe("MsSQL datasource test cases", function() {
201,
);
cy.get(queryEditor.queryMoreAction).click();
cy.get(queryEditor.deleteUsingContext).click();
cy.wait("@deleteAction").should(
"have.nested.property",
"response.body.responseMeta.status",
200,
);
cy.deleteQueryUsingContext();
cy.deleteDatasource(datasourceName);
});

View File

@ -54,13 +54,7 @@ describe("MySQL datasource test cases", function() {
201,
);
cy.get(queryEditor.queryMoreAction).click();
cy.get(queryEditor.deleteUsingContext).click();
cy.wait("@deleteAction").should(
"have.nested.property",
"response.body.responseMeta.status",
200,
);
cy.deleteQueryUsingContext();
cy.deleteDatasource(datasourceName);
});

View File

@ -42,13 +42,7 @@ describe("MySQL datasource test cases", function() {
201,
);
cy.get(queryEditor.queryMoreAction).click();
cy.get(queryEditor.deleteUsingContext).click();
cy.wait("@deleteAction").should(
"have.nested.property",
"response.body.responseMeta.status",
200,
);
cy.deleteQueryUsingContext();
cy.deleteDatasource(datasourceName);
});

Some files were not shown because too many files have changed in this diff Show More