feat: [epic] appsmith design system version 2 deduplication (#22030)

## Description

### Fixes
- [x] https://github.com/appsmithorg/appsmith/issues/19383
- [x] https://github.com/appsmithorg/appsmith/issues/19384
- [x] https://github.com/appsmithorg/appsmith/issues/19385
- [x] https://github.com/appsmithorg/appsmith/issues/19386
- [x] https://github.com/appsmithorg/appsmith/issues/19387
- [x] https://github.com/appsmithorg/appsmith/issues/19388
- [x] https://github.com/appsmithorg/appsmith/issues/19389
- [x] https://github.com/appsmithorg/appsmith/issues/19390
- [x] https://github.com/appsmithorg/appsmith/issues/19391
- [x] https://github.com/appsmithorg/appsmith/issues/19392
- [x] https://github.com/appsmithorg/appsmith/issues/19393
- [x] https://github.com/appsmithorg/appsmith/issues/19394
- [x] https://github.com/appsmithorg/appsmith/issues/19395
- [x] https://github.com/appsmithorg/appsmith/issues/19396
- [x] https://github.com/appsmithorg/appsmith/issues/19397
- [x] https://github.com/appsmithorg/appsmith/issues/19398
- [x] https://github.com/appsmithorg/appsmith/issues/19399
- [x] https://github.com/appsmithorg/appsmith/issues/19400
- [x] https://github.com/appsmithorg/appsmith/issues/19401
- [x] https://github.com/appsmithorg/appsmith/issues/19402
- [x] https://github.com/appsmithorg/appsmith/issues/19403
- [x] https://github.com/appsmithorg/appsmith/issues/19404
- [x] https://github.com/appsmithorg/appsmith/issues/19405
- [x] https://github.com/appsmithorg/appsmith/issues/19406
- [x] https://github.com/appsmithorg/appsmith/issues/19407
- [x] https://github.com/appsmithorg/appsmith/issues/19408
- [x] https://github.com/appsmithorg/appsmith/issues/19409

Fixes # (issue)
> if no issue exists, please create an issue and ask the maintainers
about this first


Media
> A video or a GIF is preferred. when using Loom, don’t embed because it
looks like it’s a GIF. instead, just link to the video


## Type of change

> Please delete options that are not relevant.

- Bug fix (non-breaking change which fixes an issue)
- New feature (non-breaking change which adds functionality)
- Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- Chore (housekeeping or task changes that don't impact user perception)
- This change requires a documentation update


## How Has This Been Tested?
> Please describe the tests that you ran to verify your changes. Provide
instructions, so we can reproduce.
> Please also list any relevant details for your test configuration.
> Delete anything that is not important

- Manual
- Jest
- Cypress

### Test Plan
> Add Testsmith test cases links that relate to this PR

### Issues raised during DP testing
> Link issues raised during DP testing for better visiblity and tracking
(copy link from comments dropped on this PR)


## Checklist:
### Dev activity
- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] PR is being merged under a feature flag


### QA activity:
- [ ] Test plan has been approved by relevant developers
- [ ] Test plan has been peer reviewed by QA
- [ ] Cypress test cases have been added and approved by either SDET or
manual QA
- [ ] Organized project review call with relevant stakeholders after
Round 1/2 of QA
- [ ] Added Test Plan Approved label after reveiwing all Cypress test

---------

Co-authored-by: Ankita Kinger <ankita@appsmith.com>
Co-authored-by: akash-codemonk <67054171+akash-codemonk@users.noreply.github.com>
Co-authored-by: Tanvi Bhakta <tanvi@appsmith.com>
Co-authored-by: Arsalan <arsalanyaldram0211@outlook.com>
Co-authored-by: Aman Agarwal <aman@appsmith.com>
Co-authored-by: Rohit Agarwal <rohit_agarwal@live.in>
Co-authored-by: Nilesh Sarupriya <nilesh@appsmith.com>
Co-authored-by: Nilesh Sarupriya <20905988+nsarupr@users.noreply.github.com>
Co-authored-by: Tanvi Bhakta <tanvibhakta@gmail.com>
Co-authored-by: Aishwarya UR <aishwarya@appsmith.com>
Co-authored-by: Parthvi Goswami <parthvigoswami@Parthvis-MacBook-Pro.local>
Co-authored-by: Vijetha-Kaja <vijetha@appsmith.com>
Co-authored-by: Parthvi <80334441+Parthvi12@users.noreply.github.com>
Co-authored-by: Apple <nandan@thinkify.io>
Co-authored-by: Saroj <43822041+sarojsarab@users.noreply.github.com>
Co-authored-by: Sangeeth Sivan <74818788+berzerkeer@users.noreply.github.com>
Co-authored-by: Ashok Kumar M <35134347+marks0351@users.noreply.github.com>
Co-authored-by: Aishwarya-U-R <91450662+Aishwarya-U-R@users.noreply.github.com>
Co-authored-by: rahulramesha <rahul@appsmith.com>
Co-authored-by: Aswath K <aswath.sana@gmail.com>
Co-authored-by: Preet Sidhu <preetsidhu.bits@gmail.com>
Co-authored-by: Vijetha-Kaja <119562824+Vijetha-Kaja@users.noreply.github.com>
Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com>
This commit is contained in:
albinAppsmith 2023-05-20 00:07:06 +05:30 committed by GitHub
parent c8615a853d
commit 629999f124
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1731 changed files with 40639 additions and 46425 deletions

View File

@ -1,4 +1,4 @@
name: Build client server without running tests
name: Build client server without running Unit tests
on:
# This workflow can be triggered manually from the GitHub Actions page
@ -27,7 +27,7 @@ jobs:
secrets: inherit
with:
pr: 0
build-docker-image:
needs: [ client-build, server-build, rts-build ]
# Only run if the build step is successful

View File

@ -13,6 +13,7 @@ on:
jobs:
ci-test-limited:
runs-on: ubuntu-latest
#timeout-minutes: 50
if: |
github.event.pull_request.head.repo.full_name == github.repository ||
github.event_name == 'push' ||
@ -24,7 +25,7 @@ jobs:
strategy:
fail-fast: false
matrix:
job: [ 0, 1, 2, 3, 4 ]
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, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49]
# Service containers to run with this job. Required for running tests
services:
@ -62,9 +63,44 @@ jobs:
# Timestamp will be used to create cache key
- id: timestamp
run: echo "timestamp=$(date +'%Y-%m-%dT%H:%M:%S')" >> $GITHUB_OUTPUT
# In case this is second attempt try restoring status of the prior attempt from cache
- name: Restore the previous run result
id: cache-appsmith
uses: martijnhols/actions-cache@v3.0.2
with:
path: |
~/run_result
key: ${{ github.run_id }}-${{ github.job }}-${{ matrix.job }}
restore-keys: |
${{ github.run_id }}-${{ github.job }}-${{ matrix.job }}
- name: Get the previous run result
if: steps.cache-appsmith.outputs.cache-hit == 'true'
id: run_result
run: |
run_result_env=$(cat ~/run_result)
echo "run_result=$run_result_env" >> $GITHUB_OUTPUT
# Download failed_spec list for all jobs in case of rerun
- uses: actions/download-artifact@v3
if: steps.run_result.outputs.run_result == 'failedtest'
with:
name: failed-spec-ci
path: ~/failed_spec_ci
# In case of rerun combine all the failed specs and set it in env
- name: combine all specs for CI in case of rerun
if: steps.run_result.outputs.run_result == 'failedtest'
run: |
failed_spec_env=$(cat ~/failed_spec_ci/failed_spec_ci* | sort -u)
echo "failed_spec_env<<EOF" >> $GITHUB_ENV
echo "$failed_spec_env" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
# Get specs to run
- name: Get specs to run
if: steps.run_result.outputs.run_result != 'success'
run: |
specs_to_run=$(cat app/client/cypress/limited-tests.txt)
echo "specs_to_run<<EOF" >> $GITHUB_ENV
@ -82,11 +118,13 @@ jobs:
docker load -i cicontainer.tar
- name: Create folder
if: steps.run_result.outputs.run_result != 'success'
working-directory: "."
run: |
mkdir -p cicontainerlocal/stacks/configuration/
- name: Run Appsmith & TED docker image
if: steps.run_result.outputs.run_result != 'success'
working-directory: "."
run: |
sudo /etc/init.d/ssh stop ;
@ -102,18 +140,18 @@ jobs:
-e APPSMITH_CLOUD_SERVICES_BASE_URL=http://host.docker.internal:5001 \
--add-host=host.docker.internal:host-gateway --add-host=api.segment.io:host-gateway --add-host=t.appsmith.com:host-gateway \
cicontainer
- name: Setup MSSQL & Arango docker & ElasticSearch containers
working-directory : app/client/cypress
run : |
working-directory: app/client/cypress
run: |
docker run --name=mssqldb -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=Root@123" -p 1433:1433 -d mcr.microsoft.com/azure-sql-edge
docker run --name arangodb -e ARANGO_USERNAME=root -e ARANGO_ROOT_PASSWORD=Arango -p 8529:8529 -d arangodb
docker run --name elasticsearch -d -p 9200:9200 -e "discovery.type=single-node" -e "ELASTIC_USERNAME=elastic" -e "ELASTIC_PASSWORD=docker" -e "xpack.security.enabled=true" docker.elastic.co/elasticsearch/elasticsearch:7.16.2
# docker exec -i mssqldb /bin/bash -c "echo -e '[mysqld]\ntcpport=1433\ntcpnodelay=1' >> /var/opt/mssql/mssql.conf"
# docker restart mssqldb
# sudo ufw allow 1433/tcp
# docker cp init-mssql-dump-for-test.sql mssqldb:var/init-mssql-dump-for-test.sql
# docker exec -i mssqldb /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P Root@123 -i /var/init-mssql-dump-for-test.sql
# docker exec -i mssqldb /bin/bash -c "echo -e '[mysqld]\ntcpport=1433\ntcpnodelay=1' >> /var/opt/mssql/mssql.conf"
# docker restart mssqldb
# sudo ufw allow 1433/tcp
# docker cp init-mssql-dump-for-test.sql mssqldb:var/init-mssql-dump-for-test.sql
# docker exec -i mssqldb /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P Root@123 -i /var/init-mssql-dump-for-test.sql
- name: Use Node.js 16.14.0
uses: actions/setup-node@v3
@ -139,6 +177,7 @@ jobs:
yarn install --immutable
- name: Setting up the cypress tests
if: steps.run_result.outputs.run_result != 'success'
shell: bash
env:
APPSMITH_SSL_CERTIFICATE: ${{ secrets.APPSMITH_SSL_CERTIFICATE }}
@ -178,6 +217,8 @@ jobs:
CYPRESS_APPSMITH_OAUTH2_OIDC_TOKEN_URL: ${{ secrets.CYPRESS_APPSMITH_OAUTH2_OIDC_TOKEN_URL }}
CYPRESS_APPSMITH_OAUTH2_OIDC_USER_INFO: ${{ secrets.CYPRESS_APPSMITH_OAUTH2_OIDC_USER_INFO }}
CYPRESS_APPSMITH_OAUTH2_OIDC_JWKS_URL: ${{ secrets.CYPRESS_APPSMITH_OAUTH2_OIDC_JWKS_URL }}
CYPRESS_EXCLUDE_TAGS: "airgap"
CYPRESS_AIRGAPPED: false
APPSMITH_DISABLE_TELEMETRY: true
APPSMITH_GOOGLE_MAPS_API_KEY: ${{ secrets.APPSMITH_GOOGLE_MAPS_API_KEY }}
POSTGRES_PASSWORD: postgres
@ -194,6 +235,7 @@ jobs:
echo "BROWSER_PATH=$(which chrome)" >> $GITHUB_ENV
- 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 }}
@ -233,6 +275,8 @@ jobs:
CYPRESS_APPSMITH_OAUTH2_OIDC_TOKEN_URL: ${{ secrets.CYPRESS_APPSMITH_OAUTH2_OIDC_TOKEN_URL }}
CYPRESS_APPSMITH_OAUTH2_OIDC_USER_INFO: ${{ secrets.CYPRESS_APPSMITH_OAUTH2_OIDC_USER_INFO }}
CYPRESS_APPSMITH_OAUTH2_OIDC_JWKS_URL: ${{ secrets.CYPRESS_APPSMITH_OAUTH2_OIDC_JWKS_URL }}
CYPRESS_EXCLUDE_TAGS: "airgap"
CYPRESS_AIRGAPPED: false
APPSMITH_DISABLE_TELEMETRY: true
APPSMITH_GOOGLE_MAPS_API_KEY: ${{ secrets.APPSMITH_GOOGLE_MAPS_API_KEY }}
COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title }}
@ -243,21 +287,134 @@ jobs:
record: true
install: false
parallel: true
config-file: cypress_ci.json
config-file: cypress_ci.config.ts
group: "Electrons on Github Action Fat Container"
spec: ${{ env.specs_to_run }}
working-directory: app/client
# tag will be either "push" or "pull_request"
tag: ${{ github.event_name }}
env: "NODE_ENV=development"
# In case of second attempt 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_TESTUSERNAME3: ${{ secrets.CYPRESS_TESTUSERNAME3 }}
CYPRESS_TESTPASSWORD3: ${{ secrets.CYPRESS_TESTPASSWORD3 }}
CYPRESS_TESTUSERNAME4: ${{ secrets.CYPRESS_TESTUSERNAME4 }}
CYPRESS_TESTPASSWORD4: ${{ secrets.CYPRESS_TESTPASSWORD4 }}
CYPRESS_S3_ACCESS_KEY: ${{ secrets.CYPRESS_S3_ACCESS_KEY }}
CYPRESS_S3_SECRET_KEY: ${{ secrets.CYPRESS_S3_SECRET_KEY }}
CYPRESS_GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
CYPRESS_AIRTABLE_BEARER: ${{ secrets.AIRTABLE_BEARER }}
CYPRESS_FIRESTORE_PRIVATE_KEY: ${{ secrets.FIRESTORE_PRIVATE_KEY }}
CYPRESS_GITHUB_PERSONAL_ACCESS_TOKEN: ${{ secrets.CYPRESS_GITHUB_PERSONAL_ACCESS_TOKEN }}
CYPRESS_TEST_GITHUB_USER_NAME: ${{ secrets.CYPRESS_TEST_GITHUB_USER_NAME }}
CYPRESS_APPSMITH_OAUTH2_GOOGLE_CLIENT_ID: ${{ secrets.CYPRESS_APPSMITH_OAUTH2_GOOGLE_CLIENT_ID }}
CYPRESS_APPSMITH_OAUTH2_GOOGLE_CLIENT_SECRET: ${{ secrets.CYPRESS_APPSMITH_OAUTH2_GOOGLE_CLIENT_SECRET }}
CYPRESS_APPSMITH_OAUTH2_GITHUB_CLIENT_ID: ${{ secrets.CYPRESS_APPSMITH_OAUTH2_GITHUB_CLIENT_ID }}
CYPRESS_APPSMITH_OAUTH2_GITHUB_CLIENT_SECRET: ${{ secrets.CYPRESS_APPSMITH_OAUTH2_GITHUB_CLIENT_SECRET }}
CYPRESS_OAUTH_SAML_EMAIL: ${{ secrets.CYPRESS_OAUTH_SAML_EMAIL }}
CYPRESS_OAUTH_SAML_ENTITY_ID: ${{ secrets.CYPRESS_OAUTH_SAML_ENTITY_ID }}
CYPRESS_OAUTH_SAML_METADATA_URL: ${{ secrets.CYPRESS_OAUTH_SAML_METADATA_URL }}
CYPRESS_OAUTH_SAML_METADATA_XML: ${{ secrets.CYPRESS_OAUTH_SAML_METADATA_XML }}
CYPRESS_OAUTH_SAML_PUB_CERT: ${{ secrets.CYPRESS_OAUTH_SAML_PUB_CERT }}
CYPRESS_OAUTH_SAML_SSO_URL: ${{ secrets.CYPRESS_OAUTH_SAML_SSO_URL }}
CYPRESS_OAUTH_SAML_REDIRECT_URL: ${{ secrets.CYPRESS_OAUTH_SAML_REDIRECT_URL }}
CYPRESS_APPSMITH_OAUTH2_OIDC_CLIENT_ID: ${{ secrets.CYPRESS_APPSMITH_OAUTH2_OIDC_CLIENT_ID }}
CYPRESS_APPSMITH_OAUTH2_OIDC_CLIENT_SECRET: ${{ secrets.CYPRESS_APPSMITH_OAUTH2_OIDC_CLIENT_SECRET }}
CYPRESS_APPSMITH_OAUTH2_OIDC_AUTH_URL: ${{ secrets.CYPRESS_APPSMITH_OAUTH2_OIDC_AUTH_URL }}
CYPRESS_APPSMITH_OAUTH2_OIDC_TOKEN_URL: ${{ secrets.CYPRESS_APPSMITH_OAUTH2_OIDC_TOKEN_URL }}
CYPRESS_APPSMITH_OAUTH2_OIDC_USER_INFO: ${{ secrets.CYPRESS_APPSMITH_OAUTH2_OIDC_USER_INFO }}
CYPRESS_APPSMITH_OAUTH2_OIDC_JWKS_URL: ${{ secrets.CYPRESS_APPSMITH_OAUTH2_OIDC_JWKS_URL }}
CYPRESS_EXCLUDE_TAGS: "airgap"
CYPRESS_AIRGAPPED: false
APPSMITH_DISABLE_TELEMETRY: true
APPSMITH_GOOGLE_MAPS_API_KEY: ${{ secrets.APPSMITH_GOOGLE_MAPS_API_KEY }}
COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title }}
CYPRESS_VERIFY_TIMEOUT: 100000
with:
browser: ${{ env.BROWSER_PATH }}
headless: true
record: true
install: false
parallel: true
config-file: cypress_ci.config.ts
group: "Electrons on Github Action Fat Container"
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"
- name: Collect CI container logs
if: always()
working-directory: "."
run: |
docker logs appsmith 2>&1 > ~/dockerlogs.txt
# Upload docker logs
- name: Upload docker logs on failure
if: failure()
if: always()
uses: actions/upload-artifact@v3
with:
name: dockerlogs-${{ matrix.job }}
path: ~/dockerlogs.txt
# Set status = failedtest
- name: Set fail if there are test failures
if: failure()
run: echo "failedtest" >> $GITHUB_OUTPUT > ~/run_result
# Create a directory ~/failed_spec_ci and add a dummy file
# This will ensure upload and download steps are successful
- name: Create directory for failed tests
if: always()
run: |
mkdir -p ~/failed_spec_ci
# add list failed tests to a file
- name: In case of test failures copy them to a file
if: failure()
run: |
cd ${{ github.workspace }}/app/client/cypress/
find screenshots -type f \( -iname "*\(attempt 2\).png" -o -iname "*before all hook*" -o -iname "*after all hook*" \) | sed 's/screenshots/cypress\/e2e/g'| sed 's:/[^/]*$::' | sort -u > ~/failed_spec_ci/failed_spec_ci-${{ matrix.job }}
# reset the failed_spec_ci file in case of success
- name: In case of test success reset the failed_spec_ci file
if: success()
run: |
rm -f ~/failed_spec_ci/failed_spec_ci-${{ matrix.job }}
touch ~/failed_spec_ci/failed_spec_ci-${{ 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@v3
with:
name: failed-spec-ci
path: ~/failed_spec_ci
# 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 }}-${{ matrix.job }}
restore-keys: |
${{ github.run_id }}-${{ github.job }}-${{ matrix.job }}
# Upload the screenshots as artifacts if there's a failure
- name: Upload screenshots on failure
@ -267,7 +424,6 @@ jobs:
name: cypress-screenshots-${{ matrix.job }}
path: app/client/cypress/screenshots/
# Upload the snapshots as artifacts for layout validation
- name: Upload snapshots
uses: actions/upload-artifact@v3

View File

@ -16,6 +16,6 @@
"sagas": "./src/sagas/",
"@appsmith": "./src/ee"
}
}]
}, "babel-plugin-styled-components"]
]
}

View File

@ -0,0 +1,36 @@
import { defineConfig } from "cypress";
export default defineConfig({
// watchForFileChanges: false,
defaultCommandTimeout: 20000,
requestTimeout: 21000,
responseTimeout: 20000,
pageLoadTimeout: 30000,
videoUploadOnPasses: false,
videoCompression: false,
numTestsKeptInMemory: 10,
reporterOptions: {
reportDir: "results",
overwrite: false,
html: true,
json: false,
},
chromeWebSecurity: false,
viewportHeight: 1200,
viewportWidth: 1600,
retries: {
runMode: 1,
openMode: 0,
},
e2e: {
setupNodeEvents(on, config) {
return require("./cypress/plugins/index.js")(on, config);
},
env: {
USERNAME: "xxxx",
PASSWORD: "xxx",
},
baseUrl: "https://dev.appsmith.com/",
specPattern: "cypress/e2e/**/*.{js,ts}",
},
});

View File

@ -1,24 +0,0 @@
{
"baseUrl": "https://dev.appsmith.com/",
"watchForFileChanges" : false,
"defaultCommandTimeout": 20000,
"requestTimeout": 21000,
"responseTimeout": 20000,
"pageLoadTimeout": 30000,
"videoUploadOnPasses": false,
"videoCompression": false,
"numTestsKeptInMemory": 10,
"reporterOptions": {
"reportDir": "results",
"overwrite": false,
"html": true,
"json": false
},
"chromeWebSecurity": false,
"viewportHeight": 1100,
"viewportWidth": 1400,
"retries": {
"runMode": 1,
"openMode": 0
}
}

View File

@ -1,4 +1,4 @@
const { getVersionDir } = require("cypress/lib/tasks/state");
const { getVersionDir } = require("../../node_modules/cypress/lib/tasks/state");
const chalk = require("chalk");
const Diff = require("diff");
const fs = require("fs/promises");

View File

@ -64,10 +64,10 @@ describe("AForce - Community Issues page validations", function () {
it("2. Validate table navigation with Server Side pagination enabled with Default selected row", () => {
ee.SelectEntityByName("Table1", "Widgets");
agHelper.AssertExistingToggleState("serversidepagination", "checked");
agHelper.AssertExistingToggleState("serversidepagination", "true");
propPane
.ValidatePropertyFieldValue("Default Selected Row", "0")
.ValidatePropertyFieldValue("Default selected row", "0")
.then(($selectedRow: any) => {
selectedRow = Number($selectedRow);
table.AssertSelectedRow(selectedRow);
@ -120,7 +120,7 @@ describe("AForce - Community Issues page validations", function () {
});
it("4. Change Default selected row in table and verify", () => {
propPane.UpdatePropertyFieldValue("Default Selected Row", "1");
propPane.UpdatePropertyFieldValue("Default selected row", "1");
deployMode.DeployApp();
table.WaitUntilTableLoad(0, 0, "v2");
table.AssertPageNumber(1, "On", "v2");
@ -132,10 +132,10 @@ describe("AForce - Community Issues page validations", function () {
table.WaitUntilTableLoad(0, 0, "v2");
});
it.skip("5. Verify Default search text in table as per 'Default Search Text' property set + Bug 12228", () => {
it.skip("5. Verify Default search text in table as per 'Default search text' property set + Bug 12228", () => {
ee.SelectEntityByName("Table1", "Widgets");
//propPane.EnterJSContext("Default Search Text", "Bug", false);
propPane.TypeTextIntoField("Default Search Text", "Bug");
//propPane.EnterJSContext("Default search text", "Bug", false);
propPane.TypeTextIntoField("Default search text", "Bug");
deployMode.DeployApp();
table.AssertSearchText("Bug");
table.WaitUntilTableLoad(0, 0, "v2");
@ -143,8 +143,8 @@ describe("AForce - Community Issues page validations", function () {
deployMode.NavigateBacktoEditor();
ee.SelectEntityByName("Table1", "Widgets");
//propPane.EnterJSContext("Default Search Text", "Question", false);
propPane.TypeTextIntoField("Default Search Text", "Question");
//propPane.EnterJSContext("Default search text", "Question", false);
propPane.TypeTextIntoField("Default search text", "Question");
deployMode.DeployApp();
table.AssertSearchText("Question");
@ -153,8 +153,8 @@ describe("AForce - Community Issues page validations", function () {
table.WaitUntilTableLoad(0, 0, "v2");
ee.SelectEntityByName("Table1", "Widgets");
//propPane.EnterJSContext("Default Search Text", "Epic", false);
propPane.TypeTextIntoField("Default Search Text", "Epic"); //Bug 12228 - Searching based on hidden column value should not be allowed
//propPane.EnterJSContext("Default search text", "Epic", false);
propPane.TypeTextIntoField("Default search text", "Epic"); //Bug 12228 - Searching based on hidden column value should not be allowed
deployMode.DeployApp();
table.AssertSearchText("Epic");
table.WaitForTableEmpty("v2");
@ -168,7 +168,7 @@ describe("AForce - Community Issues page validations", function () {
it.skip("6. Validate Search table with Client Side Search enabled & disabled", () => {
ee.SelectEntityByName("Table1", "Widgets");
agHelper.AssertExistingToggleState("enableclientsidesearch", "checked");
agHelper.AssertExistingToggleState("enableclientsidesearch", "true");
deployMode.DeployApp();
table.WaitUntilTableLoad(0, 0, "v2");

View File

@ -1,6 +1,6 @@
import homePage from "../../../locators/HomePage";
import reconnectDatasourceModal from "../../../locators/ReconnectLocators";
import * as _ from "../../../support/Objects/ObjectsCore";
describe("Import, Export and Fork application and validate data binding", function () {
let workspaceId;
let newWorkspaceName;
@ -32,7 +32,7 @@ describe("Import, Export and Fork application and validate data binding", functi
const name = uuid();
appName = `app${name}`;
cy.get(homePage.applicationName).click({ force: true });
cy.get(`${homePage.applicationEditMenu} li:nth-child(3) a`).click({
cy.get(homePage.applicationEditMenu).eq(1).click({
force: true,
});
cy.wait(2000);
@ -60,7 +60,7 @@ describe("Import, Export and Fork application and validate data binding", functi
cy.get(homePage.homeIcon).click();
cy.get(homePage.searchInput).type(`${appName}`);
cy.wait(3000);
cy.get(homePage.applicationCard).first().trigger("mouseover");
// cy.get(homePage.applicationCard).first().trigger("mouseover");
cy.get(homePage.appMoreIcon).first().click({ force: true });
cy.get(homePage.forkAppFromMenu).click({ force: true });
cy.get(homePage.forkAppWorkspaceButton).click({ force: true });
@ -77,7 +77,7 @@ describe("Import, Export and Fork application and validate data binding", functi
cy.NavigateToHome();
cy.get(homePage.searchInput).clear().type(`${appName}`);
cy.wait(2000);
cy.get(homePage.applicationCard).first().trigger("mouseover");
//cy.get(homePage.applicationCard).first().trigger("mouseover");
cy.get(homePage.appMoreIcon).first().click({ force: true });
// export application
cy.get(homePage.exportAppFromMenu).click({ force: true });
@ -91,58 +91,51 @@ describe("Import, Export and Fork application and validate data binding", functi
.that.includes("attachment;")
.and.includes(`filename*=UTF-8''${appName}.json`);
cy.writeFile("cypress/fixtures/exportedApp.json", body, "utf-8");
cy.generateUUID().then((uid) => {
workspaceId = uid;
localStorage.setItem("WorkspaceName", workspaceId);
cy.createWorkspace();
cy.wait("@createWorkspace").then((createWorkspaceInterception) => {
newWorkspaceName =
createWorkspaceInterception.response.body.data.name;
cy.renameWorkspace(newWorkspaceName, workspaceId);
cy.get(homePage.workspaceImportAppOption).click({ force: true });
_.agHelper.GenerateUUID();
cy.get("@guid").then((uid) => {
newWorkspaceName = uid;
_.homePage.CreateNewWorkspace(newWorkspaceName);
cy.get(homePage.workspaceImportAppOption).click({ force: true });
cy.get(homePage.workspaceImportAppModal).should("be.visible");
// cy.get(".t--import-json-card input").attachFile("exportedApp.json");
cy.xpath(homePage.uploadLogo).attachFile("exportedApp.json");
// import exported application in new workspace
// cy.get(homePage.workspaceImportAppButton).click({ force: true });
cy.wait("@importNewApplication").then((interception) => {
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("//span[text()='schema_name']").should("be.visible");
// cy.xpath("//span[text()='information_schema']").should(
// "be.visible",
// );
cy.xpath("//span[text()='id']").should("be.visible");
cy.xpath("//span[text()='title']").should("be.visible");
cy.xpath("//span[text()='due']").should("be.visible");
cy.url().should(
"include",
`/${appSlug}/${defaultPage.slug}-${defaultPage.id}/edit`,
);
cy.get(homePage.workspaceImportAppModal).should("be.visible");
// cy.get(".t--import-json-card input").attachFile("exportedApp.json");
cy.xpath(homePage.uploadLogo).attachFile("exportedApp.json");
// import exported application in new workspace
// cy.get(homePage.workspaceImportAppButton).click({ force: true });
cy.wait("@importNewApplication").then((interception) => {
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("//span[text()='schema_name']").should("be.visible");
// cy.xpath("//span[text()='information_schema']").should(
// "be.visible",
// );
cy.xpath("//span[text()='id']").should("be.visible");
cy.xpath("//span[text()='title']").should("be.visible");
cy.xpath("//span[text()='due']").should("be.visible");
cy.url().should(
"include",
`/${appSlug}/${defaultPage.slug}-${defaultPage.id}/edit`,
);
});
});
});

View File

@ -45,7 +45,7 @@ describe("Shopping cart App", function () {
cy.get("body").click(0, 0);
cy.TargetDropdownAndSelectOption(
formControls.commandDropdown,
"Update Document(s)",
"Update document(s)",
);
cy.get(".CodeEditorTarget").first().type("Productnames");
cy.get(".CodeEditorTarget")
@ -74,9 +74,9 @@ describe("Shopping cart App", function () {
cy.get("body").click(0, 0);
cy.TargetDropdownAndSelectOption(
formControls.commandDropdown,
"Insert Document(s)",
"Insert document(s)",
);
// cy.get("[data-cy='actionConfiguration.formData.command.data']").click();
// cy.get("[data-testid='actionConfiguration.formData.command.data']").click();
// cy.get(".t--dropdown-option")
// .eq(1)
// .click();
@ -104,9 +104,9 @@ describe("Shopping cart App", function () {
cy.get("body").click(0, 0);
cy.TargetDropdownAndSelectOption(
formControls.commandDropdown,
"Delete Document(s)",
"Delete document(s)",
);
// cy.get("[data-cy='actionConfiguration.formData.command.data']").click();
// cy.get("[data-testid='actionConfiguration.formData.command.data']").click();
// cy.get(".t--dropdown-option")
// .eq(3)
// .click();
@ -121,7 +121,7 @@ describe("Shopping cart App", function () {
cy.assertPageSave();
cy.get(appPage.dropdownChevronLeft).click();
cy.get(appPage.dropdownChevronLeft).click();
cy.get(".t--back-button").click();
});
it("2. Perform CRUD operations and validate data", function () {
@ -163,6 +163,7 @@ describe("Shopping cart App", function () {
});
it("3. Connect the appplication to git and validate data in deploy mode and edit mode", function () {
cy.get(".t--back-to-editor").click();
_.gitSync.CreateNConnectToGit(repoName);
cy.get("@gitRepoName").then((repName) => {
repoName = repName;

View File

@ -61,7 +61,7 @@ describe("JS to non-JS mode in Action Selector", () => {
);
_.agHelper.GetNAssertElementText(
_.propPane._actionCard,
"Show AlertAdd message",
"Show alertAdd message",
"have.text",
1,
);
@ -102,7 +102,7 @@ describe("JS to non-JS mode in Action Selector", () => {
);
_.agHelper.GetNAssertElementText(
_.propPane._actionCard,
"Show AlertHello world!",
"Show alertHello world!",
"have.text",
1,
);
@ -559,12 +559,7 @@ describe("JS to non-JS mode in Action Selector", () => {
);
_.agHelper.GetNClick(_.propPane._actionCard, 0);
_.agHelper.GetNAssertElementText(
_.propPane._pageNameSwitcher,
"Page Name",
"have.text",
0,
);
_.agHelper.AssertElementVisible(_.propPane._navigateToType("Page Name"));
_.agHelper.GetNAssertElementText(
_.propPane._actionOpenDropdownSelectPage,
@ -603,12 +598,7 @@ describe("JS to non-JS mode in Action Selector", () => {
);
_.agHelper.GetNClick(_.propPane._actionCard, 0);
_.agHelper.GetNAssertElementText(
_.propPane._pageNameSwitcher,
"Page Name",
"have.text",
0,
);
_.agHelper.AssertElementVisible(_.propPane._navigateToType("Page Name"));
_.agHelper.GetNAssertElementText(
_.propPane._actionOpenDropdownSelectPage,
@ -647,12 +637,7 @@ describe("JS to non-JS mode in Action Selector", () => {
);
_.agHelper.GetNClick(_.propPane._actionCard, 0);
_.agHelper.GetNAssertElementText(
_.propPane._urlSwitcher,
"URL",
"have.text",
0,
);
_.agHelper.AssertElementVisible(_.propPane._navigateToType("URL"));
_.agHelper.GetNAssertElementText(
_.propPane._actionPopupTextLabel,
@ -685,7 +670,7 @@ describe("JS to non-JS mode in Action Selector", () => {
_.agHelper.GetNAssertElementText(
_.propPane._actionCard,
"Show AlertAdd message",
"Show alertAdd message",
"have.text",
0,
);
@ -715,7 +700,7 @@ describe("JS to non-JS mode in Action Selector", () => {
_.agHelper.GetNAssertElementText(
_.propPane._actionCard,
"Show Alerthello",
"Show alerthello",
"have.text",
0,
);
@ -1359,7 +1344,7 @@ describe("JS to non-JS mode in Action Selector", () => {
_.agHelper.GetNAssertElementText(
_.propPane._actionCard,
"Watch Geolocation",
"Watch geolocation",
"have.text",
0,
);
@ -1383,7 +1368,7 @@ describe("JS to non-JS mode in Action Selector", () => {
_.agHelper.GetNAssertElementText(
_.propPane._actionCard,
"Stop watching Geolocation",
"Stop watching geolocation",
"have.text",
0,
);
@ -1407,7 +1392,7 @@ describe("JS to non-JS mode in Action Selector", () => {
_.agHelper.GetNAssertElementText(
_.propPane._actionCard,
"Get GeolocationAdd callback",
"Get geolocationAdd callback",
"have.text",
0,
);

View File

@ -3,7 +3,7 @@ import * as _ from "../../../../support/Objects/ObjectsCore";
describe("clearStore Action test", () => {
before(() => {
_.entityExplorer.DragDropWidgetNVerify("buttonwidget", 100, 100);
_.entityExplorer.NavigateToSwitcher("explorer");
_.entityExplorer.NavigateToSwitcher("Explorer");
});
it("1. Feature 11639 : Clear all store value", function () {

View File

@ -3,19 +3,20 @@ const dsl = require("../../../../fixtures/buttonApiDsl.json");
const widgetsPage = require("../../../../locators/Widgets.json");
const publishPage = require("../../../../locators/publishWidgetspage.json");
let dataSet;
import * as _ from "../../../../support/Objects/ObjectsCore";
describe("Test Create Api and Bind to Button widget", function () {
before("Test_Add users api and execute api", () => {
cy.addDsl(dsl);
cy.fixture("example").then(function (data) {
dataSet = data;
cy.createAndFillApi(dataSet.userApi, "/random");
_.apiPage.CreateAndFillApi(dataSet.userApi + "/random");
cy.RunAPI();
});
});
it("1. Call the api with & without error handling", () => {
cy.SearchEntityandOpen("Button1");
_.entityExplorer.SelectEntityByName("Button1");
cy.get(widgetsPage.toggleOnClick)
.invoke("attr", "class")
.then((classes) => {
@ -47,7 +48,7 @@ describe("Test Create Api and Bind to Button widget", function () {
cy.get(publishPage.backToEditor).click({ force: true });
//With Error handling
cy.SearchEntityandOpen("Button1");
_.entityExplorer.SelectEntityByName("Button1");
cy.get(".t--property-control-onclick").then(($el) => {
cy.updateCodeInput($el, "{{Api1.run(() => {}, () => {})}}");

View File

@ -11,7 +11,7 @@ describe("Field value evaluation", () => {
});
it("1. Evaluation works for fields", () => {
propPane.SelectPlatformFunction("onClick", "Show Alert");
propPane.SelectPlatformFunction("onClick", "Show alert");
agHelper.TypeText(
propPane._actionSelectorFieldByLabel("Message"),
"{{Button1.text}}",

View File

@ -54,7 +54,7 @@ describe("Navigate To feature", () => {
});
ee.SelectEntityByName("Button1", "Widgets");
propPane.SelectPlatformFunction("onClick", "Navigate to");
cy.get("#switcher--url").click();
agHelper.GetNClick(propPane._navigateToType("URL"));
cy.get("label")
.contains("Enter URL")
.siblings("div")
@ -73,7 +73,7 @@ describe("Navigate To feature", () => {
});
ee.SelectEntityByName("Button1", "Widgets");
propPane.SelectPlatformFunction("onClick", "Navigate to");
cy.get("#switcher--url").click();
agHelper.GetNClick(propPane._navigateToType("URL"));
cy.get("label")
.contains("Enter URL")
.siblings("div")

View File

@ -41,7 +41,7 @@ describe("Post window message", () => {
</body>
</html>`,
);
propPane.SelectPlatformFunction("onMessageReceived", "Show Alert");
propPane.SelectPlatformFunction("onMessageReceived", "Show alert");
agHelper.EnterActionValue("Message", "I got a message from iframe");
deployMode.DeployApp();

View File

@ -11,7 +11,7 @@ const {
describe("removeValue Action test", () => {
before(() => {
ee.DragDropWidgetNVerify("buttonwidget", 100, 100);
ee.NavigateToSwitcher("explorer");
ee.NavigateToSwitcher("Explorer");
});
it("1. Feature 11639 : Remove store value", function () {

View File

@ -12,7 +12,7 @@ const {
describe("storeValue Action test", () => {
before(() => {
ee.DragDropWidgetNVerify("buttonwidget", 100, 100);
ee.NavigateToSwitcher("explorer");
ee.NavigateToSwitcher("Explorer");
});
it("1. Bug 14653: Running consecutive storeValue actions and await", function () {

View File

@ -1,12 +1,7 @@
const commonlocators = require("../../../../locators/commonlocators.json");
const dsl = require("../../../../fixtures/buttonApiDsl.json");
const widgetsPage = require("../../../../locators/Widgets.json");
const publishPage = require("../../../../locators/publishWidgetspage.json");
import { ObjectsRegistry } from "../../../../support/Objects/Registry";
const propPane = ObjectsRegistry.PropertyPane;
const agHelper = ObjectsRegistry.AggregateHelper;
const jsEditor = ObjectsRegistry.JSEditor;
import * as _ from "../../../../support/Objects/ObjectsCore";
describe("Test Create Api and Bind to Button widget", function () {
let dataSet;
@ -21,11 +16,14 @@ describe("Test Create Api and Bind to Button widget", function () {
});
it("1. Selects set interval function, Fill setInterval action creator and test code generated ", () => {
cy.SearchEntityandOpen("Button1");
propPane.SelectPlatformFunction("onClick", "Set interval");
agHelper.EnterActionValue("Callback function", "{{() => { Api1.run() }}}");
agHelper.EnterActionValue("Id", "myInterval");
propPane.EnterJSContext(
_.entityExplorer.SelectEntityByName("Button1");
_.propPane.SelectPlatformFunction("onClick", "Set interval");
_.agHelper.EnterActionValue(
"Callback function",
"{{() => { Api1.run() }}}",
);
_.agHelper.EnterActionValue("Id", "myInterval");
_.propPane.EnterJSContext(
"onClick",
"{{setInterval(() => { Api1.run();}, 5000, 'myInterval');}}",
);
@ -50,15 +48,15 @@ describe("Test Create Api and Bind to Button widget", function () {
});
it("2. Selects clear interval function, Fill clearInterval action creator and test code generated", () => {
cy.SearchEntityandOpen("Button1");
jsEditor.DisableJSContext("onClick");
_.entityExplorer.SelectEntityByName("Button1", "Widgets");
_.jsEditor.DisableJSContext("onClick");
cy.get(".action-block-tree").click({ force: true });
cy.get(".t--action-selector-popup .t--delete").click({ force: true });
propPane.SelectPlatformFunction("onClick", "Clear interval");
agHelper.EnterActionValue("Id", "myInterval");
_.propPane.SelectPlatformFunction("onClick", "Clear interval");
_.agHelper.EnterActionValue("Id", "myInterval");
jsEditor.EnableJSContext("onClick");
propPane.ValidatePropertyFieldValue(
_.jsEditor.EnableJSContext("onClick");
_.propPane.ValidatePropertyFieldValue(
"onClick",
`{{clearInterval('myInterval');}}`,
);

View File

@ -18,7 +18,7 @@ describe("UI to Code", () => {
});
it("1. adds an action", () => {
propPane.SelectPlatformFunction("onClick", "Show Alert");
propPane.SelectPlatformFunction("onClick", "Show alert");
agHelper.TypeText(
propPane._actionSelectorFieldByLabel("Message"),
"Hello!",
@ -29,7 +29,7 @@ describe("UI to Code", () => {
it("2. adds multiple actions", () => {
// Add first action
propPane.SelectPlatformFunction("onClick", "Show Alert");
propPane.SelectPlatformFunction("onClick", "Show alert");
agHelper.TypeText(
propPane._actionSelectorFieldByLabel("Message"),
"Hello!",
@ -39,7 +39,7 @@ describe("UI to Code", () => {
// Add second action
propPane.SelectPlatformFunction("onClick", "Navigate to");
propPane.SelectActionByTitleAndValue("Navigate to", "Select page");
agHelper.GetNClick(locators._openNavigationTab("url"));
agHelper.GetNClick(_.propPane._navigateToType("URL"));
agHelper.TypeText(
propPane._actionSelectorFieldByLabel("Enter URL"),
"https://google.com",
@ -81,7 +81,7 @@ describe("UI to Code", () => {
agHelper.GetNClick(propPane._actionSelectorDelete);
// Assert that cards 1, 2 and 4 are present
agHelper.AssertElementExist(propPane._actionCardByTitle("Show Alert"));
agHelper.AssertElementExist(propPane._actionCardByTitle("Show alert"));
agHelper.AssertElementExist(propPane._actionCardByTitle("Navigate to"));
agHelper.AssertElementExist(
propPane._actionCardByTitle("Copy to clipboard"),
@ -94,7 +94,7 @@ describe("UI to Code", () => {
);
// Delete the first action
agHelper.GetNClick(propPane._actionCardByTitle("Show Alert"));
agHelper.GetNClick(propPane._actionCardByTitle("Show alert"));
agHelper.GetNClick(propPane._actionSelectorDelete);
// Assert that cards 2 and 4 are present
@ -112,7 +112,7 @@ describe("UI to Code", () => {
it("3. works with undo using cmd+z", () => {
// Add first action
propPane.SelectPlatformFunction("onClick", "Show Alert");
propPane.SelectPlatformFunction("onClick", "Show alert");
agHelper.TypeText(
propPane._actionSelectorFieldByLabel("Message"),
"Hello!",
@ -122,7 +122,7 @@ describe("UI to Code", () => {
// Add second action
propPane.SelectPlatformFunction("onClick", "Navigate to");
propPane.SelectActionByTitleAndValue("Navigate to", "Select page");
agHelper.GetNClick(locators._openNavigationTab("url"));
agHelper.GetNClick(_.propPane._navigateToType("URL"));
agHelper.TypeText(
propPane._actionSelectorFieldByLabel("Enter URL"),
"https://google.com",
@ -166,11 +166,11 @@ describe("UI to Code", () => {
agHelper.GetNClick(propPane._actionSelectorDelete);
// Delete the first action
agHelper.GetNClick(propPane._actionCardByTitle("Show Alert"));
agHelper.GetNClick(propPane._actionCardByTitle("Show alert"));
agHelper.GetNClick(propPane._actionSelectorDelete);
// Assert that first and third action are not present
agHelper.AssertElementAbsence(propPane._actionCardByTitle("Show Alert"));
agHelper.AssertElementAbsence(propPane._actionCardByTitle("Show alert"));
agHelper.AssertElementAbsence(propPane._actionCardByTitle("Store value"));
// Undo the last two actions
@ -179,7 +179,7 @@ describe("UI to Code", () => {
cy.get("body").type(agHelper.isMac ? "{meta}Z" : "{ctrl}Z");
// Assert that all the cards are present
agHelper.AssertElementExist(propPane._actionCardByTitle("Show Alert"));
agHelper.AssertElementExist(propPane._actionCardByTitle("Show alert"));
agHelper.AssertElementExist(propPane._actionCardByTitle("Navigate to"));
agHelper.AssertElementExist(propPane._actionCardByTitle("Store value"));
agHelper.AssertElementExist(
@ -196,7 +196,7 @@ describe("UI to Code", () => {
it("4. works with redo using cmd+y", () => {
// Add first action
propPane.SelectPlatformFunction("onClick", "Show Alert");
propPane.SelectPlatformFunction("onClick", "Show alert");
agHelper.TypeText(
propPane._actionSelectorFieldByLabel("Message"),
"Hello!",
@ -206,7 +206,7 @@ describe("UI to Code", () => {
// Add second action
propPane.SelectPlatformFunction("onClick", "Navigate to");
propPane.SelectActionByTitleAndValue("Navigate to", "Select page");
agHelper.GetNClick(locators._openNavigationTab("url"));
agHelper.GetNClick(_.propPane._navigateToType("URL"));
agHelper.TypeText(
propPane._actionSelectorFieldByLabel("Enter URL"),
"https://google.com",
@ -250,11 +250,11 @@ describe("UI to Code", () => {
agHelper.GetNClick(propPane._actionSelectorDelete);
// Delete the first action
agHelper.GetNClick(propPane._actionCardByTitle("Show Alert"));
agHelper.GetNClick(propPane._actionCardByTitle("Show alert"));
agHelper.GetNClick(propPane._actionSelectorDelete);
// Assert that first and third action are not present
agHelper.AssertElementAbsence(propPane._actionCardByTitle("Show Alert"));
agHelper.AssertElementAbsence(propPane._actionCardByTitle("Show alert"));
agHelper.AssertElementAbsence(propPane._actionCardByTitle("Store value"));
// Undo the last two actions
@ -263,7 +263,7 @@ describe("UI to Code", () => {
cy.get("body").type(agHelper.isMac ? "{meta}Z" : "{ctrl}Z");
// Assert that all the cards are present
agHelper.AssertElementExist(propPane._actionCardByTitle("Show Alert"));
agHelper.AssertElementExist(propPane._actionCardByTitle("Show alert"));
agHelper.AssertElementExist(propPane._actionCardByTitle("Navigate to"));
agHelper.AssertElementExist(propPane._actionCardByTitle("Store value"));
agHelper.AssertElementExist(
@ -284,14 +284,14 @@ describe("UI to Code", () => {
});
it("5. can add success and error callbacks", () => {
propPane.SelectPlatformFunction("onClick", "Show Alert");
propPane.SelectPlatformFunction("onClick", "Show alert");
agHelper.TypeText(
propPane._actionSelectorFieldByLabel("Message"),
"Hello!",
);
agHelper.GetNClick(propPane._actionSelectorPopupClose);
agHelper.GetNClick(propPane._actionCardByTitle("Show Alert"));
agHelper.GetNClick(propPane._actionCardByTitle("Show alert"));
agHelper.GetNClick(propPane._actionCallbacks);

View File

@ -5,6 +5,7 @@ import { ObjectsRegistry } from "../../../../support/Objects/Registry";
const deployMode = ObjectsRegistry.DeployMode;
const agHelper = ObjectsRegistry.AggregateHelper;
const homePage = ObjectsRegistry.HomePage;
const ee = ObjectsRegistry.EntityExplorer;
describe("General checks for app navigation", function () {
it("1. App header should appear when there is a single page in the application, and navigation should appear alongside app header when there are two pages", () => {
@ -14,7 +15,7 @@ describe("General checks for app navigation", function () {
deployMode.NavigateBacktoEditor();
// Navigation should appear alongside app header when there are two pages
cy.Createpage("Page 2");
ee.AddNewPage();
deployMode.DeployApp();
cy.get(appNavigationLocators.topStacked).should("exist");
});

View File

@ -3,6 +3,7 @@ import { ObjectsRegistry } from "../../../../support/Objects/Registry";
const deployMode = ObjectsRegistry.DeployMode;
const agHelper = ObjectsRegistry.AggregateHelper;
const entityExplorer = ObjectsRegistry.EntityExplorer;
describe("Test app's navigation settings", function () {
it("1. Open app settings and navigation tab should be there and when the navigation tab is selected, navigation preview should be visible", () => {
@ -50,7 +51,7 @@ describe("Test app's navigation settings", function () {
});
it("4. Change 'Orientation' back to 'Top', and 'Nav style' to 'Inline', page navigation items should appear inline", () => {
cy.Createpage("Page 2");
entityExplorer.AddNewPage();
cy.get(appNavigationLocators.appSettingsButton).click();
cy.get(appNavigationLocators.navigationSettingsTab).click();
cy.get(

View File

@ -63,7 +63,7 @@ describe("Test Top + Inline navigation style", function () {
});
it("3. Page change from inside this dropdown should work", () => {
const pageName = "Page5 - with long long name";
const pageName = "Page6 - with long long name";
cy.get(appNavigationLocators.topInlineMoreDropdownItem)
.contains(pageName)

View File

@ -14,20 +14,17 @@ describe("Test Top + Stacked navigation style", function () {
cy.wait("@importNewApplication").then((interception) => {
agHelper.Sleep();
const { isPartialImport } = interception.response.body.data;
if (isPartialImport) {
homePage.AssertNCloseImport();
} else {
homePage.AssertImportToast();
homePage.AssertImportToast(0);
}
});
});
it("1. In an app with 15 pages, the navbar should be scrollable", () => {
const pageName = "Page9 - with long long name";
deployMode.DeployApp();
cy.get(appNavigationLocators.scrollArrows).should("have.length", 2);
cy.get(appNavigationLocators.scrollArrows).last().should("be.visible");
@ -75,7 +72,7 @@ describe("Test Top + Stacked navigation style", function () {
.contains(pageName)
.should("be.visible");
cy.get(appNavigationLocators.scrollArrows).last().trigger("mousedown");
cy.wait(2000);
cy.wait(3000);
cy.get(appNavigationLocators.scrollArrows).last().trigger("mouseup");
cy.get(appNavigationLocators.navigationMenuItem)
.contains(pageName)
@ -86,7 +83,7 @@ describe("Test Top + Stacked navigation style", function () {
.contains(pageName)
.should("not.be.visible");
cy.get(appNavigationLocators.scrollArrows).first().trigger("mousedown");
cy.wait(2000);
cy.wait(3000);
cy.get(appNavigationLocators.scrollArrows).first().trigger("mouseup");
cy.get(appNavigationLocators.navigationMenuItem)
.contains(pageName)
@ -144,8 +141,5 @@ describe("Test Top + Stacked navigation style", function () {
deployMode.DeployApp();
cy.get(appNavigationLocators.userProfileDropdownButton).click();
cy.get(appNavigationLocators.userProfileDropdownMenu).should("exist");
// Back to editor
deployMode.NavigateBacktoEditor();
});
});

View File

@ -45,7 +45,7 @@ describe("Audit logs", () => {
cy.get(locators.Heading)
.should("be.visible")
.should("have.text", "Introducing Audit Logs");
.should("have.text", "Introducing audit logs");
cy.get(locators.SubHeadings)
.should("be.visible")
.should(

View File

@ -257,8 +257,8 @@ describe("Autocomplete tests", () => {
_.dataSources.ValidateNSelectDropdown(
"Commands",
"Find Document(s)",
"Insert Document(s)",
"Find document(s)",
"Insert document(s)",
);
const documentInputSelector = _.locators._inputFieldByName("Documents");

View File

@ -16,7 +16,7 @@ describe("Autocomplete bug fixes", function () {
ee.SelectEntityByName("Text1");
propPane.TypeTextIntoField("Text", "{{Table1.");
agHelper.AssertElementExist(locator._hints);
agHelper.GetNAssertElementText(locator._hints, "Best Match");
agHelper.GetNAssertElementText(locator._hints, "Best match");
agHelper.GetNAssertElementText(
locator._hints,
"selectedRow",
@ -51,7 +51,7 @@ describe("Autocomplete bug fixes", function () {
propPane.UpdatePropertyFieldValue("Text", "");
propPane.TypeTextIntoField("Text", "{{Te");
agHelper.AssertElementExist(locator._hints);
agHelper.GetNAssertElementText(locator._hints, "Best Match");
agHelper.GetNAssertElementText(locator._hints, "Best match");
agHelper.GetNAssertElementText(
locator._hints,
"Text1Copy.text",

View File

@ -8,15 +8,15 @@ let datasourceName;
describe("SQL Autocompletion", function () {
it("Shows autocompletion hints", function () {
cy.NavigateToDatasourceEditor();
cy.get(datasource.PostgreSQL).click();
cy.get(datasource.PostgreSQL).click({ force: true });
cy.fillPostgresDatasourceForm();
cy.generateUUID().then((uid) => {
datasourceName = `Postgres CRUD ds ${uid}`;
cy.renameDatasource(datasourceName);
cy.testSaveDatasource();
cy.NavigateToActiveDSQueryPane(datasourceName);
});
cy.testSaveDatasource();
cy.NavigateToActiveDSQueryPane(datasourceName);
cy.get(queryLocators.templateMenu).click({ force: true });
cy.get(".CodeMirror textarea").focus().type("S");
cy.get(locator._hints).should("exist");

View File

@ -18,14 +18,14 @@ describe("Property Pane Suggestions", () => {
it("1. Should show Property Pane Suggestions on / command & when typing {{}}", () => {
EntityExplorer.SelectEntityByName("Button1", "Widgets");
PropertyPane.TypeTextIntoField("Label", "/");
AggregateHelper.GetNAssertElementText(CommonLocators._hints, "Bind Data");
AggregateHelper.GetNAssertElementText(CommonLocators._hints, "Bind data");
AggregateHelper.GetNAssertElementText(
CommonLocators._hints,
"New Binding",
"New binding",
"have.text",
1,
);
AggregateHelper.GetNClickByContains(CommonLocators._hints, "New Binding");
AggregateHelper.GetNClickByContains(CommonLocators._hints, "New binding");
PropertyPane.ValidatePropertyFieldValue("Label", "{{}}");
//typing {{}}

View File

@ -1,11 +1,6 @@
const dsl = require("../../../../fixtures/buttonRecaptchaDsl.json");
const testdata = require("../../../../fixtures/testdata.json");
import { ObjectsRegistry } from "../../../../support/Objects/Registry";
const locator = ObjectsRegistry.CommonLocators,
ee = ObjectsRegistry.EntityExplorer,
agHelper = ObjectsRegistry.AggregateHelper,
propPane = ObjectsRegistry.PropertyPane;
import * as _ from "../../../../support/Objects/ObjectsCore";
describe(
"excludeForAirgap",
@ -16,17 +11,17 @@ describe(
});
it.only("1. Validate the Button binding with Text Widget with Recaptcha token with empty key", function () {
agHelper.ClickButton("Submit");
agHelper
.GetText(locator._widgetInCanvas("textwidget") + " span")
_.agHelper.ClickButton("Submit");
_.agHelper
.GetText(_.locators._widgetInCanvas("textwidget") + " span")
.should("be.empty");
ee.SelectEntityByName("Button1");
agHelper.SelectDropdownList("Google reCAPTCHA Version", "reCAPTCHA v2");
agHelper.ClickButton("Submit");
agHelper
.GetText(locator._widgetInCanvas("textwidget") + " span")
_.entityExplorer.SelectEntityByName("Button1");
_.agHelper.SelectDropdownList("Google reCAPTCHA version", "reCAPTCHA v2");
_.agHelper.ClickButton("Submit");
_.agHelper
.GetText(_.locators._widgetInCanvas("textwidget") + " span")
.should("be.empty");
agHelper.SelectDropdownList("Google reCAPTCHA Version", "reCAPTCHA v3");
_.agHelper.SelectDropdownList("Google reCAPTCHA version", "reCAPTCHA v3");
});
//This test to be enabled once the product bug is fixed
@ -36,7 +31,8 @@ describe(
.should("be.visible")
.click({ force: true });
cy.testCodeMirrorLast(testdata.invalidKey);
cy.SearchEntityandOpen("Text1");
_.entityExplorer.SelectEntityByName("Text1");
cy.get(".t--draggable-textwidget span")
.last()
.invoke("text")
@ -44,7 +40,8 @@ describe(
cy.log(x);
expect(x).to.be.empty;
});
cy.SearchEntityandOpen("Button1");
_.entityExplorer.SelectEntityByName("Button1");
cy.get(".t--property-control-googlerecaptchaversion .bp3-popover-target")
.last()
.should("be.visible")
@ -57,7 +54,8 @@ describe(
.should("be.visible")
.click({ force: true });
cy.get(".t--toast-action span").should("have.text", testdata.errorMsg);
cy.SearchEntityandOpen("Text1");
_.entityExplorer.SelectEntityByName("Text1");
cy.wait(3000);
cy.get(".t--draggable-textwidget span")
.last()
@ -69,42 +67,48 @@ describe(
});
it.only("2. Validate the Button binding with Text Widget with Recaptcha Token with v2Key & upward compatibilty doesnt work", function () {
ee.SelectEntityByName("Button1");
propPane.UpdatePropertyFieldValue("Google reCAPTCHA Key", testdata.v2Key);
agHelper.ClickButton("Submit");
agHelper.Sleep();
agHelper
.GetText(locator._widgetInCanvas("textwidget") + " span")
_.entityExplorer.SelectEntityByName("Button1");
_.propPane.UpdatePropertyFieldValue(
"Google reCAPTCHA key",
testdata.v2Key,
);
_.agHelper.ClickButton("Submit");
_.agHelper.Sleep();
_.agHelper
.GetText(_.locators._widgetInCanvas("textwidget") + " span")
.should("be.empty");
ee.SelectEntityByName("Button1");
agHelper.SelectDropdownList("Google reCAPTCHA Version", "reCAPTCHA v2");
agHelper.ClickButton("Submit");
agHelper.Sleep();
agHelper
.GetText(locator._widgetInCanvas("textwidget") + " span")
_.entityExplorer.SelectEntityByName("Button1");
_.agHelper.SelectDropdownList("Google reCAPTCHA version", "reCAPTCHA v2");
_.agHelper.ClickButton("Submit");
_.agHelper.Sleep();
_.agHelper
.GetText(_.locators._widgetInCanvas("textwidget") + " span")
.should("not.be.empty");
agHelper.SelectDropdownList("Google reCAPTCHA Version", "reCAPTCHA v3");
agHelper.ClickButton("Submit");
agHelper.Sleep();
_.agHelper.SelectDropdownList("Google reCAPTCHA version", "reCAPTCHA v3");
_.agHelper.ClickButton("Submit");
_.agHelper.Sleep();
});
it.only("3. Validate the Button binding with Text Widget with Recaptcha Token with v3Key & v2key for backward compatible", function () {
ee.SelectEntityByName("Button1");
propPane.UpdatePropertyFieldValue("Google reCAPTCHA Key", testdata.v3Key);
agHelper.SelectDropdownList("Google reCAPTCHA Version", "reCAPTCHA v3");
agHelper.ClickButton("Submit");
agHelper.Sleep();
agHelper.AssertElementAbsence(
locator._specificToast("Google Re-Captcha token generation failed!"),
_.entityExplorer.SelectEntityByName("Button1");
_.propPane.UpdatePropertyFieldValue(
"Google reCAPTCHA key",
testdata.v3Key,
);
_.agHelper.SelectDropdownList("Google reCAPTCHA version", "reCAPTCHA v3");
_.agHelper.ClickButton("Submit");
_.agHelper.Sleep();
_.agHelper.AssertElementAbsence(
_.locators._specificToast("Google Re-Captcha token generation failed!"),
5000,
);
agHelper
.GetText(locator._widgetInCanvas("textwidget") + " span")
_.agHelper
.GetText(_.locators._widgetInCanvas("textwidget") + " span")
.should("not.be.empty");
ee.SelectEntityByName("Button1");
agHelper.SelectDropdownList("Google reCAPTCHA Version", "reCAPTCHA v2");
agHelper.ClickButton("Submit");
agHelper.AssertContains("Google Re-Captcha token generation failed!"); //toast doesnt come when run in CI!
_.entityExplorer.SelectEntityByName("Button1");
_.agHelper.SelectDropdownList("Google reCAPTCHA version", "reCAPTCHA v2");
_.agHelper.ClickButton("Submit");
_.agHelper.AssertContains("Google Re-Captcha token generation failed!"); //toast doesnt come when run in CI!
});
//This test to be enabled once the product bug is fixed
@ -114,7 +118,8 @@ describe(
.should("be.visible")
.click({ force: true });
cy.testCodeMirrorLast(testdata.invalidKey);
cy.SearchEntityandOpen("Text1");
_.entityExplorer.SelectEntityByName("Text1");
cy.get(".t--draggable-textwidget span")
.last()
.invoke("text")
@ -122,7 +127,8 @@ describe(
cy.log(x);
expect(x).not.to.be.empty;
});
cy.SearchEntityandOpen("Button1");
_.entityExplorer.SelectEntityByName("Button1");
cy.get(".t--property-control-googlerecaptchaversion .bp3-popover-target")
.last()
.should("be.visible")
@ -134,7 +140,8 @@ describe(
.contains("Submit")
.should("be.visible")
.click({ force: true });
cy.SearchEntityandOpen("Text1");
_.entityExplorer.SelectEntityByName("Text1");
cy.wait(3000);
cy.get(".t--draggable-textwidget span")
.last()

View File

@ -2,7 +2,9 @@
const dsl = require("../../../../fixtures/listwidgetdsl.json");
const publishPage = require("../../../../locators/publishWidgetspage.json");
import apiPage from "../../../../locators/ApiEditor";
import apiLocators from "../../../../locators/ApiEditor";
import * as _ from "../../../../support/Objects/ObjectsCore";
describe("Test Create Api and Bind to List widget", function () {
let valueToTest;
@ -11,10 +13,10 @@ describe("Test Create Api and Bind to List widget", function () {
});
it("1. Test_Add users api and execute api", function () {
cy.createAndFillApi(this.data.userApi, "/mock-api?records=10");
_.apiPage.CreateAndFillApi(this.data.userApi + "/mock-api?records=10");
cy.RunAPI();
cy.get(apiPage.jsonResponseTab).click();
cy.get(apiPage.responseBody)
cy.get(apiLocators.jsonResponseTab).click();
cy.get(apiLocators.responseBody)
.contains("name")
.siblings("span")
.invoke("text")
@ -29,7 +31,8 @@ describe("Test Create Api and Bind to List widget", function () {
});
it("2. Test_Validate the Api data is updated on List widget", function () {
cy.SearchEntityandOpen("List1");
_.entityExplorer.SelectEntityByName("List1");
cy.testJsontext("items", "{{Api1.data}}");
cy.get(".t--draggable-textwidget span").should("have.length", 8);
cy.get(".t--draggable-textwidget span")
@ -69,7 +72,7 @@ describe("Test Create Api and Bind to List widget", function () {
interception.response.body.data.body[0].name,
).replace(/['"]+/g, "");
});
cy.SearchEntityandOpen("List1");
_.entityExplorer.SelectEntityByName("List1", "Widgets");
cy.moveToStyleTab();
cy.testJsontext("itemspacing\\(px\\)", "50");
cy.get(".t--draggable-textwidget span").should("have.length", 6);

View File

@ -3,7 +3,8 @@ const dsl = require("../../../../fixtures/buttonApiDsl.json");
const apiwidget = require("../../../../locators/apiWidgetslocator.json");
const widgetsPage = require("../../../../locators/Widgets.json");
const testdata = require("../../../../fixtures/testdata.json");
import apiPage from "../../../../locators/ApiEditor";
import apiLocators from "../../../../locators/ApiEditor";
import * as _ from "../../../../support/Objects/ObjectsCore";
describe("Bind a button and Api usecase", function () {
let apiData;
@ -13,7 +14,7 @@ describe("Bind a button and Api usecase", function () {
});
it("1. Add an API by binding a button in its header", function () {
cy.createAndFillApi(this.data.userApi, "/mock-api?records=10");
_.apiPage.CreateAndFillApi(this.data.userApi + "/mock-api?records=10");
cy.get(apiwidget.headerKey)
.first()
.click({ force: true })
@ -23,8 +24,8 @@ describe("Bind a button and Api usecase", function () {
.click({ force: true })
.type("{{Button1.text", { parseSpecialCharSequences: true });
cy.RunAPI();
cy.get(apiPage.jsonResponseTab).click();
cy.get(apiPage.responseBody)
cy.get(apiLocators.jsonResponseTab).click();
cy.get(apiLocators.responseBody)
.contains("name")
.siblings("span")
.invoke("text")
@ -39,19 +40,17 @@ describe("Bind a button and Api usecase", function () {
});
});
it("2. Button-Name updation", function () {
cy.SearchEntityandOpen("Button1");
it("2. Button-Name updation & API datasource binding with button name validation", function () {
_.entityExplorer.SelectEntityByName("Button1");
//changing the Button Name
cy.widgetText(
testdata.buttonName,
widgetsPage.buttonWidget,
widgetsPage.widgetNameSpan,
);
});
it("3. API datasource binding with button name validation", function () {
cy.CheckAndUnfoldEntityItem("Queries/JS");
cy.SearchEntityandOpen("Api1");
//API datasource binding with button name validation
_.entityExplorer.SelectEntityByName("Api1", "Queries/JS");
cy.get(apiwidget.headerValue)
.first()
.invoke("text")

View File

@ -10,8 +10,8 @@ describe("Binding the Datepicker and Text Widget", function () {
before(() => {
cy.addDsl(dsl);
});
it("1. DatePicker-Text, Validate selectedDate functionality", function () {
// Skipping tests due to issue - https://www.notion.so/appsmith/f353d8c6bd664f79ad858a42010cdfc8?v=f04cde23f6424aeb9d5a6e389cd172bd&p=0717892d43684c40bae4e2c87b8308cb&pm=s
it.skip("1. DatePicker-Text, Validate selectedDate functionality", function () {
/**
* Bind DatePicker1 to Text for "selectedDate"
*/
@ -48,7 +48,7 @@ describe("Binding the Datepicker and Text Widget", function () {
cy.get(commonlocators.backToEditor).click();
});
it("2. DatePicker1-text: Change the date in DatePicker1 and Validate the same in text widget", function () {
it.skip("2. DatePicker1-text: Change the date in DatePicker1 and Validate the same in text widget", function () {
cy.openPropertyPane("textwidget");
/**
@ -86,7 +86,7 @@ describe("Binding the Datepicker and Text Widget", function () {
});
});
it("3. Validate the Date is not changed in DatePicker2", function () {
it.skip("3. Validate the Date is not changed in DatePicker2", function () {
cy.log("dateDp2:" + dateDp2);
cy.get(formWidgetsPage.datepickerWidget + commonlocators.inputField)
.eq(1)
@ -115,7 +115,7 @@ describe("Binding the Datepicker and Text Widget", function () {
cy.get(publishPage.backToEditor).click({ force: true });
});
it("5. Checks if on deselection of date triggers the onDateSelected action or not.", function () {
it.skip("5. Checks if on deselection of date triggers the onDateSelected action or not.", function () {
/**
* bind datepicker to show a message "Hello" on date selected
*/

View File

@ -1,6 +1,7 @@
const dsl = require("../../../../fixtures/formInputTableV2Dsl.json");
const publish = require("../../../../locators/publishWidgetspage.json");
const testdata = require("../../../../fixtures/testdata.json");
import * as _ from "../../../../support/Objects/ObjectsCore";
describe("Binding the Table and input Widget", function () {
before(() => {
@ -8,7 +9,8 @@ describe("Binding the Table and input Widget", function () {
});
it("1. Input widget test with default value from table widget", function () {
cy.SearchEntityandOpen("Input1");
_.entityExplorer.ExpandCollapseEntity("Form1");
_.entityExplorer.SelectEntityByName("Input1", "Widgets");
cy.testJsontext("defaultvalue", testdata.defaultInputWidget + "}}");
cy.wait("@updateLayout").should(
@ -19,7 +21,8 @@ describe("Binding the Table and input Widget", function () {
});
it("2. validation of data displayed in input widgets based on sorting", function () {
cy.SearchEntityandOpen("Table1");
_.entityExplorer.SelectEntityByName("Table1");
cy.testJsontext("defaultselectedrow", "0");
cy.get(".draggable-header").contains("id").click({ force: true });
cy.wait(1000);
@ -46,7 +49,8 @@ describe("Binding the Table and input Widget", function () {
});
it("3. validation of column id displayed in input widgets based on sorted column", function () {
cy.SearchEntityandOpen("Input1");
_.entityExplorer.SelectEntityByName("Input1");
cy.testJsontext("defaultvalue", testdata.sortedColumn + "}}");
cy.wait("@updateLayout").should(
"have.nested.property",

View File

@ -1,6 +1,7 @@
const dsl = require("../../../../fixtures/formInputTableDsl.json");
const publish = require("../../../../locators/publishWidgetspage.json");
const testdata = require("../../../../fixtures/testdata.json");
import * as _ from "../../../../support/Objects/ObjectsCore";
describe("Binding the Table and input Widget", function () {
before(() => {
@ -8,7 +9,8 @@ describe("Binding the Table and input Widget", function () {
});
it("1. Input widget test with default value from table widget", function () {
cy.SearchEntityandOpen("Input1");
_.entityExplorer.ExpandCollapseEntity("Widgets");
_.entityExplorer.SelectEntityByName("Input1", "Form1");
cy.testJsontext("defaultvalue", testdata.defaultInputWidget + "}}");
cy.wait("@updateLayout").should(
@ -19,7 +21,8 @@ describe("Binding the Table and input Widget", function () {
});
it("2. Validation of data displayed in input widgets based on sorting", function () {
cy.SearchEntityandOpen("Table1");
_.entityExplorer.SelectEntityByName("Table1");
cy.testJsontext("defaultselectedrow", "0");
cy.get(".draggable-header").contains("id").click({ force: true });
cy.wait(1000);
@ -46,7 +49,7 @@ describe("Binding the Table and input Widget", function () {
});
it("3. Validation of column id displayed in input widgets based on sorted column", function () {
cy.SearchEntityandOpen("Input1");
_.entityExplorer.SelectEntityByName("Input1");
cy.testJsontext("defaultvalue", testdata.sortedColumn + "}}");
cy.wait("@updateLayout").should(
"have.nested.property",

View File

@ -4,6 +4,8 @@ const dsl = require("../../../../fixtures/inputdsl.json");
import homePage from "../../../../locators/HomePage";
const publish = require("../../../../locators/publishWidgetspage.json");
import * as _ from "../../../../support/Objects/ObjectsCore";
let datasourceName;
let currentUrl;
@ -32,7 +34,7 @@ describe("Addwidget from Query and bind with other widgets", function () {
});
cy.onlyQueryRun();
cy.get(queryEditor.suggestedTableWidget).click();
cy.createJSObject("return Query1.data;");
_.jsEditor.CreateJSObject("return Query1.data;");
cy.CheckAndUnfoldEntityItem("Widgets");
cy.get(".t--entity-name").contains("Table1").click({ force: true });
cy.testJsontext("tabledata", "{{JSObject1.myFun1()}}");

View File

@ -86,7 +86,7 @@ Object.entries(widgetsToTest).forEach(([widgetSelector, testConfig]) => {
cy.get(".t--text-widget-container").each((item, index, list) => {
cy.wrap(item).should("not.contain.text", "BLUE");
});
cy.get(".t--toast-action span").contains("success");
cy.get("div.Toastify__toast").contains("success");
});
});

View File

@ -1,14 +1,16 @@
const dsl = require("../../../../fixtures/tabInputDsl.json");
const publish = require("../../../../locators/publishWidgetspage.json");
const testdata = require("../../../../fixtures/testdata.json");
import * as _ from "../../../../support/Objects/ObjectsCore";
describe("Binding the input Widget with tab Widget", function () {
before(() => {
cy.addDsl(dsl);
});
it("Input widget test with default value from tab widget", function () {
cy.SearchEntityandOpen("Input1");
it("1. Input widget test with default value from tab widget", function () {
_.entityExplorer.SelectEntityByName("Input1");
cy.testJsontext("defaultvalue", testdata.tabBinding + "}}");
cy.wait("@updateLayout").should(
@ -18,7 +20,7 @@ describe("Binding the input Widget with tab Widget", function () {
);
});
it("validation of data displayed in input widgets based on tab selected", function () {
it("2. validation of data displayed in input widgets based on tab selected", function () {
cy.PublishtheApp();
cy.get(publish.tabWidget)
.contains("Tab 2")

View File

@ -3,6 +3,7 @@ const dsl = require("../../../../fixtures/tableTextPaginationDsl.json");
const publishPage = require("../../../../locators/publishWidgetspage.json");
const testdata = require("../../../../fixtures/testdata.json");
import apiPage from "../../../../locators/ApiEditor";
import * as _ from "../../../../support/Objects/ObjectsCore";
describe("Test Create Api and Bind to Table widget", function () {
before(() => {
@ -16,15 +17,18 @@ describe("Test Create Api and Bind to Table widget", function () {
});
it("2. Table-Text, Validate Server Side Pagination of Paginate with Table Page No", function () {
cy.SearchEntityandOpen("Table1");
_.entityExplorer.SelectEntityByName("Table1");
cy.EnableAllCodeEditors();
/**Bind Api1 with Table widget */
cy.testJsontext("tabledata", "{{Api1.data}}");
cy.CheckWidgetProperties(commonlocators.serverSidePaginationCheckbox);
/**Bind Table with Textwidget with selected row */
cy.SearchEntityandOpen("Text1");
_.entityExplorer.SelectEntityByName("Text1");
cy.testJsontext("text", "{{Table1.selectedRow.avatar}}");
cy.SearchEntityandOpen("Table1");
_.entityExplorer.SelectEntityByName("Table1");
/**Validate Table data on current page(page1) */
cy.readTabledata("0", "4").then((tabData) => {
const tableData = tabData;
@ -94,7 +98,8 @@ describe("Test Create Api and Bind to Table widget", function () {
/** Create Api2 of Paginate with Response URL*/
cy.createAndFillApi(this.data.paginationUrl, this.data.paginationParam);
cy.RunAPI();
cy.NavigateToPaginationTab();
_.apiPage.SelectPaneTab("Pagination");
_.agHelper.GetNClick(apiPage.apiPaginationTab);
cy.get(apiPage.apiPaginationNextText).type(
this.data.paginationUrl + testdata.nextUrl,
{
@ -120,7 +125,8 @@ describe("Test Create Api and Bind to Table widget", function () {
it("6. Table-Text, Validate Server Side Pagination of Paginate with Response URL", function () {
/**Validate Response data with Table data in Text Widget */
cy.SearchEntityandOpen("Table1");
_.entityExplorer.SelectEntityByName("Table1");
cy.ValidatePaginateResponseUrlData(apiPage.apiPaginationPrevTest, false);
cy.PublishtheApp();
cy.wait("@postExecute").then((interception) => {
@ -131,7 +137,8 @@ describe("Test Create Api and Bind to Table widget", function () {
});
cy.get(publishPage.backToEditor).click({ force: true });
cy.wait(3000);
cy.SearchEntityandOpen("Table1");
_.entityExplorer.SelectEntityByName("Table1", "Widgets");
cy.ValidatePaginateResponseUrlData(apiPage.apiPaginationNextTest, true);
});
});

View File

@ -3,6 +3,7 @@ const dsl = require("../../../../fixtures/tableV2TextPaginationDsl.json");
const publishPage = require("../../../../locators/publishWidgetspage.json");
const testdata = require("../../../../fixtures/testdata.json");
import apiPage from "../../../../locators/ApiEditor";
import * as _ from "../../../../support/Objects/ObjectsCore";
describe("Test Create Api and Bind to Table widget", function () {
before(() => {
@ -17,14 +18,16 @@ describe("Test Create Api and Bind to Table widget", function () {
});
it("2. Table-Text, Validate Server Side Pagination of Paginate with Table v2 Page No", function () {
cy.SearchEntityandOpen("Table1");
_.entityExplorer.SelectEntityByName("Table1");
/**Bind Api1 with Table widget */
cy.testJsontext("tabledata", "{{Api1.data}}");
cy.CheckWidgetProperties(commonlocators.serverSidePaginationCheckbox);
/**Bind Table with Textwidget with selected row */
cy.SearchEntityandOpen("Text1");
_.entityExplorer.SelectEntityByName("Text1");
cy.testJsontext("text", "{{Table1.selectedRow.avatar}}");
cy.SearchEntityandOpen("Table1");
_.entityExplorer.SelectEntityByName("Table1");
cy.readTableV2data("0", "0").then((tabData) => {
const tableData = tabData;
localStorage.setItem("tableDataPage1", tableData);
@ -124,7 +127,8 @@ describe("Test Create Api and Bind to Table widget", function () {
it("6. Table-Text, Validate Server Side Pagination of Paginate with Response URL", function () {
/**Validate Response data with Table data in Text Widget */
cy.SearchEntityandOpen("Table1");
_.entityExplorer.SelectEntityByName("Table1");
cy.ValidatePaginateResponseUrlDataV2(apiPage.apiPaginationPrevTest, false);
cy.PublishtheApp();
cy.wait("@postExecute").then((interception) => {
@ -135,7 +139,8 @@ describe("Test Create Api and Bind to Table widget", function () {
});
cy.get(publishPage.backToEditor).click({ force: true });
cy.wait(3000);
cy.SearchEntityandOpen("Table1");
cy.CheckAndUnfoldEntityItem("Widgets");
_.entityExplorer.SelectEntityByName("Table1");
cy.ValidatePaginateResponseUrlDataV2(apiPage.apiPaginationNextTest, true);
});
});

View File

@ -3,6 +3,7 @@
const dsl = require("../../../../fixtures/formInputTableV2Dsl.json");
const publish = require("../../../../locators/publishWidgetspage.json");
const testdata = require("../../../../fixtures/testdata.json");
import * as _ from "../../../../support/Objects/ObjectsCore";
describe("Binding the table widget and input Widget", function () {
before(() => {
@ -10,7 +11,9 @@ describe("Binding the table widget and input Widget", function () {
});
it("1. Input widget test with default value from table widget v2", function () {
cy.SearchEntityandOpen("Input1");
_.entityExplorer.ExpandCollapseEntity("Form1");
_.entityExplorer.SelectEntityByName("Input1");
cy.testJsontext("defaultvalue", testdata.defaultInputWidget + "}}");
cy.wait("@updateLayout").should(
"have.nested.property",
@ -20,7 +23,7 @@ describe("Binding the table widget and input Widget", function () {
});
it("2. validation of data displayed in input widgets based on selected row", function () {
cy.SearchEntityandOpen("Table1");
_.entityExplorer.SelectEntityByName("Table1");
cy.testJsontext("defaultselectedrow", "2");
cy.readTableV2dataPublish("2", "0").then((tabData) => {
const tabValue = tabData;

View File

@ -2,23 +2,25 @@ const commonlocators = require("../../../../locators/commonlocators.json");
const dsl = require("../../../../fixtures/tableV2TextPaginationDsl.json");
const testdata = require("../../../../fixtures/testdata.json");
const widgetsPage = require("../../../../locators/Widgets.json");
import * as _ from "../../../../support/Objects/ObjectsCore";
describe("Test Create Api and Bind to Table widget", function () {
before(() => {
cy.addDsl(dsl);
});
it("1. Create an API and Execute the API and bind with TableV2", function () {
it("1. Validate TableV2 with API data and then add a column", function () {
cy.createAndFillApi(this.data.paginationUrl, this.data.paginationParam);
cy.RunAPI();
});
_.entityExplorer.SelectEntityByName("Table1");
it("2. Validate TableV2 with API data and then add a column", function () {
cy.SearchEntityandOpen("Table1");
cy.testJsontext("tabledata", "{{Api1.data}}");
cy.CheckWidgetProperties(commonlocators.serverSidePaginationCheckbox);
cy.SearchEntityandOpen("Text1");
_.entityExplorer.SelectEntityByName("Text1");
cy.testJsontext("text", "{{Table1.selectedRow.url}}");
cy.SearchEntityandOpen("Table1");
_.entityExplorer.SelectEntityByName("Table1");
cy.readTableV2data("0", "0").then((tabData) => {
const tableData = tabData;
localStorage.setItem("tableDataPage1", tableData);
@ -41,37 +43,38 @@ describe("Test Create Api and Bind to Table widget", function () {
cy.closePropertyPane();
});
it("3. Check Image alignment is working as expected", function () {
cy.SearchEntityandOpen("Table1");
it("2. Check Image alignment is working as expected", function () {
_.entityExplorer.SelectEntityByName("Table1");
cy.editColumn("avatar");
cy.changeColumnType("Image");
cy.closePropertyPane();
cy.SearchEntityandOpen("Table1");
_.entityExplorer.SelectEntityByName("Table1");
cy.backFromPropertyPanel();
cy.moveToStyleTab();
cy.get(widgetsPage.centerAlign).first().click({ force: true });
cy.xpath(widgetsPage.textCenterAlign).first().click({ force: true });
cy.closePropertyPane();
cy.get(`.t--widget-tablewidgetv2 .tbody .image-cell-wrapper`)
.first()
.should("have.css", "justify-content", "center");
cy.SearchEntityandOpen("Table1");
_.entityExplorer.SelectEntityByName("Table1");
cy.moveToStyleTab();
cy.get(widgetsPage.rightAlign).first().click({ force: true });
cy.xpath(widgetsPage.rightAlign).first().click({ force: true });
cy.closePropertyPane();
cy.get(`.t--widget-tablewidgetv2 .tbody .image-cell-wrapper`)
.first()
.should("have.css", "justify-content", "flex-end");
cy.SearchEntityandOpen("Table1");
_.entityExplorer.SelectEntityByName("Table1");
cy.moveToStyleTab();
cy.get(widgetsPage.leftAlign).first().click({ force: true });
cy.xpath(widgetsPage.leftAlign).first().click({ force: true });
cy.closePropertyPane();
cy.get(`.t--widget-tablewidgetv2 .tbody .image-cell-wrapper`)
.first()
.should("have.css", "justify-content", "flex-start");
});
it("4. Update table json data and check the derived column values after update", function () {
cy.SearchEntityandOpen("Table1");
it("3. Update table json data and check the derived column values after update", function () {
_.entityExplorer.SelectEntityByName("Table1");
cy.moveToContentTab();
cy.tableV2ColumnDataValidation("id");
cy.tableV2ColumnDataValidation("name");

View File

@ -1,5 +1,6 @@
const commonlocators = require("../../../../locators/commonlocators.json");
const dsl = require("../../../../fixtures/tableV2TextPaginationDsl.json");
import * as _ from "../../../../support/Objects/ObjectsCore";
describe("Test Create Api and Bind to Table widget V2", function () {
before(() => {
@ -8,10 +9,9 @@ describe("Test Create Api and Bind to Table widget V2", function () {
it("1. Create an API and Execute the API and bind with Table", function () {
cy.createAndFillApi(this.data.paginationUrl, this.data.paginationParam);
cy.RunAPI();
});
//Validate Table V2 with API data and then add a column
_.entityExplorer.SelectEntityByName("Table1");
it("2. Validate Table V2 with API data and then add a column", function () {
cy.SearchEntityandOpen("Table1");
cy.testJsontext("tabledata", "{{Api1.data}}");
cy.CheckWidgetProperties(commonlocators.serverSidePaginationCheckbox);
cy.get(`.t--widget-tablewidgetv2 .page-item`)

View File

@ -3,24 +3,25 @@
const dsl = require("../../../../fixtures/formInputTableDsl.json");
const publish = require("../../../../locators/publishWidgetspage.json");
const testdata = require("../../../../fixtures/testdata.json");
import * as _ from "../../../../support/Objects/ObjectsCore";
describe("Binding the table widget and input Widget", function () {
before(() => {
cy.addDsl(dsl);
});
it("Input widget test with default value from table widget", function () {
cy.SearchEntityandOpen("Input1");
it("1. Input widget test with default value from table widget", function () {
_.entityExplorer.ExpandCollapseEntity("Form1");
_.entityExplorer.SelectEntityByName("Input1");
cy.testJsontext("defaultvalue", testdata.defaultInputWidget + "}}");
cy.wait("@updateLayout").should(
"have.nested.property",
"response.body.responseMeta.status",
200,
);
});
//validation of data displayed in input widgets based on selected row
_.entityExplorer.SelectEntityByName("Table1");
it("validation of data displayed in input widgets based on selected row", function () {
cy.SearchEntityandOpen("Table1");
cy.testJsontext("defaultselectedrow", "2");
cy.readTabledataPublish("2", "0").then((tabData) => {
const tabValue = tabData;

View File

@ -2,6 +2,7 @@ const commonlocators = require("../../../../locators/commonlocators.json");
const dsl = require("../../../../fixtures/tableTextPaginationDsl.json");
const testdata = require("../../../../fixtures/testdata.json");
const widgetsPage = require("../../../../locators/Widgets.json");
import * as _ from "../../../../support/Objects/ObjectsCore";
describe("Test Create Api and Bind to Table widget", function () {
before(() => {
@ -11,15 +12,15 @@ describe("Test Create Api and Bind to Table widget", function () {
it("1. Create an API and Execute the API and bind with Table", function () {
cy.createAndFillApi(this.data.paginationUrl, this.data.paginationParam);
cy.RunAPI();
});
it("2. Validate Table with API data and then add a column", function () {
cy.SearchEntityandOpen("Table1");
//Validate Table with API data and then add a column
_.entityExplorer.SelectEntityByName("Table1", "Widgets");
cy.testJsontext("tabledata", "{{Api1.data}}");
cy.CheckWidgetProperties(commonlocators.serverSidePaginationCheckbox);
cy.SearchEntityandOpen("Text1");
_.entityExplorer.SelectEntityByName("Text1");
cy.testJsontext("text", "{{Table1.selectedRow.url}}");
cy.SearchEntityandOpen("Table1");
_.entityExplorer.SelectEntityByName("Table1");
cy.readTabledata("0", "4").then((tabData) => {
const tableData = tabData;
localStorage.setItem("tableDataPage1", tableData);
@ -42,33 +43,33 @@ describe("Test Create Api and Bind to Table widget", function () {
cy.closePropertyPane();
});
it("3. Check Image alignment is working as expected", function () {
cy.SearchEntityandOpen("Table1");
it("2. Check Image alignment is working as expected", function () {
_.entityExplorer.SelectEntityByName("Table1", "Widgets");
cy.editColumn("avatar");
cy.changeColumnType("Image", false);
cy.closePropertyPane();
cy.SearchEntityandOpen("Table1");
cy.get(widgetsPage.centerAlign).first().click({ force: true });
_.entityExplorer.SelectEntityByName("Table1");
cy.xpath(widgetsPage.textCenterAlign).first().click({ force: true });
cy.closePropertyPane();
cy.get(`.t--widget-tablewidget .tbody .image-cell`)
.first()
.should("have.css", "background-position", "50% 50%");
cy.SearchEntityandOpen("Table1");
cy.get(widgetsPage.rightAlign).first().click({ force: true });
_.entityExplorer.SelectEntityByName("Table1");
cy.xpath(widgetsPage.rightAlign).first().click({ force: true });
cy.closePropertyPane();
cy.get(`.t--widget-tablewidget .tbody .image-cell`)
.first()
.should("have.css", "background-position", "100% 50%");
cy.SearchEntityandOpen("Table1");
cy.get(widgetsPage.leftAlign).first().click({ force: true });
_.entityExplorer.SelectEntityByName("Table1");
cy.xpath(widgetsPage.leftAlign).first().click({ force: true });
cy.closePropertyPane();
cy.get(`.t--widget-tablewidget .tbody .image-cell`)
.first()
.should("have.css", "background-position", "0% 50%");
});
it("4. Update table json data and check the derived column values after update", function () {
cy.SearchEntityandOpen("Table1");
it("3. Update table json data and check the derived column values after update", function () {
_.entityExplorer.SelectEntityByName("Table1", "Widgets");
cy.backFromPropertyPanel();
cy.tableColumnDataValidation("id");
cy.tableColumnDataValidation("name");

View File

@ -1,18 +1,19 @@
const commonlocators = require("../../../../locators/commonlocators.json");
const dsl = require("../../../../fixtures/tableTextPaginationDsl.json");
import * as _ from "../../../../support/Objects/ObjectsCore";
describe("Test Create Api and Bind to Table widget", function () {
before(() => {
cy.addDsl(dsl);
});
it("1. Create an API and Execute the API and bind with Table", function () {
cy.createAndFillApi(this.data.paginationUrl, this.data.paginationParam);
it("1. Create an API and Execute the API and bind with Table & Validate Table with API data and then add a column", function () {
_.apiPage.CreateAndFillApi(
this.data.paginationUrl + this.data.paginationParam,
);
cy.RunAPI();
});
it("2. Validate Table with API data and then add a column", function () {
cy.SearchEntityandOpen("Table1");
_.entityExplorer.SelectEntityByName("Table1");
cy.testJsontext("tabledata", "{{Api1.data.users}}");
cy.CheckWidgetProperties(commonlocators.serverSidePaginationCheckbox);
cy.get(`.t--widget-tablewidget .page-item`).first().should("contain", "1");

View File

@ -10,9 +10,7 @@ describe("Test Create Api and Bind to Table widget V2", function () {
cy.RunAPI();
cy.get(".t--select-in-canvas").click();
cy.get(".t--sniping-mode-banner").should("be.visible");
});
it("2. Click on table name controller to bind the data and exit sniping mode", function () {
//Click on table name controller to bind the data and exit sniping mode
cy.get(".t--draggable-tablewidgetv2").trigger("mouseover");
cy.get(".t--settings-sniping-control").click();
cy.get(".t--property-control-tabledata .CodeMirror").contains(

View File

@ -5,14 +5,12 @@ describe("Test Create Api and Bind to Table widget", function () {
cy.addDsl(dsl);
});
it("Test_Add users api, execute it and go to sniping mode.", function () {
it("1. Test_Add users api, execute it and go to sniping mode.", function () {
cy.createAndFillApi(this.data.userApi, "/mock-api?records=10");
cy.RunAPI();
cy.get(".t--select-in-canvas").click();
cy.get(".t--sniping-mode-banner").should("be.visible");
});
it("Click on table name controller to bind the data and exit sniping mode", function () {
//Click on table name controller to bind the data and exit sniping mode
cy.get(".t--draggable-tablewidget").trigger("mouseover");
cy.get(".t--settings-sniping-control").click();
cy.get(".t--property-control-tabledata .CodeMirror").contains(
@ -20,8 +18,4 @@ describe("Test Create Api and Bind to Table widget", function () {
);
cy.get(".t--sniping-mode-banner").should("not.exist");
});
afterEach(() => {
// put your clean up code if any
});
});

View File

@ -1,6 +1,8 @@
const commonlocators = require("../../../../locators/commonlocators.json");
const dsl = require("../../../../fixtures/tableWidgetDsl.json");
import apiPage from "../../../../locators/ApiEditor";
import apiLocators from "../../../../locators/ApiEditor";
import * as _ from "../../../../support/Objects/ObjectsCore";
describe("Test Create Api and Bind to Table widget", function () {
let apiData;
@ -9,10 +11,10 @@ describe("Test Create Api and Bind to Table widget", function () {
});
it("1. Test_Add users api and execute api", function () {
cy.createAndFillApi(this.data.userApi, "/mock-api?records=10");
_.apiPage.CreateAndFillApi(this.data.userApi + "/mock-api?records=10");
cy.RunAPI();
cy.get(apiPage.jsonResponseTab).click();
cy.get(apiPage.responseBody)
cy.get(apiLocators.jsonResponseTab).click();
cy.get(apiLocators.responseBody)
.contains("name")
.siblings("span")
.invoke("text")
@ -26,7 +28,9 @@ describe("Test Create Api and Bind to Table widget", function () {
});
it("2. Test_Validate the Api data is updated on Table widget", function () {
cy.SearchEntityandOpen("Table1");
_.entityExplorer.ExpandCollapseEntity("Widgets");
_.entityExplorer.ExpandCollapseEntity("Container3");
_.entityExplorer.SelectEntityByName("Table1");
//cy.openPropertyPane("tablewidget");
cy.testJsontext("tabledata", "{{ Api1.data}}");
@ -45,18 +49,30 @@ describe("Test Create Api and Bind to Table widget", function () {
expect(apiData).to.eq(`\"${tabData}\"`);
});
cy.get(commonlocators.backToEditor).click();
});
it("3. Validate onSearchTextChanged function is called when configured for search text", function () {
cy.SearchEntityandOpen("Table1");
cy.togglebarDisable(
".t--property-control-enableclientsidesearch input[type='checkbox']",
);
cy.get(".t--widget-tablewidget .t--search-input").first().type("Currey");
cy.wait("@postExecute").then((interception) => {
apiData = JSON.stringify(interception.response.body.data.body[0].name);
});
cy.wait(5000);
cy.readTabledataPublish("0", "5").then((tabData) => {
expect(apiData).to.eq(`\"${tabData}\"`);
});
});
it("3. Validate onSearchTextChanged function is called when configured for search text", function () {
_.entityExplorer.ExpandCollapseEntity("Widgets");
_.entityExplorer.ExpandCollapseEntity("Container3");
_.entityExplorer.SelectEntityByName("Table1");
cy.togglebarDisable(
".t--property-control-enableclientsidesearch input[type='checkbox']",
);
cy.get(".t--widget-tablewidget .t--search-input").first().type("Currey");
cy.wait(1000);
// Captures the API call made on search
cy.wait("@postExecute").then((interception) => {
apiData = JSON.stringify(interception.response.body.data.body[0].name);
});
cy.readTabledataPublish("0", "5").then((tabData) => {
expect(apiData).to.eq(`\"${tabData}\"`);
});

View File

@ -2,6 +2,8 @@ const commonlocators = require("../../../../locators/commonlocators.json");
const dsl = require("../../../../fixtures/tableV2WidgetDsl.json");
import apiPage from "../../../../locators/ApiEditor";
import * as _ from "../../../../support/Objects/ObjectsCore";
describe("Test Create Api and Bind to Table widget V2", function () {
let apiData;
before(() => {
@ -25,7 +27,9 @@ describe("Test Create Api and Bind to Table widget V2", function () {
});
it("2. Test_Validate the Api data is updated on Table widget", function () {
cy.SearchEntityandOpen("Table1");
_.entityExplorer.ExpandCollapseEntity("Widgets");
_.entityExplorer.ExpandCollapseEntity("Container3");
_.entityExplorer.SelectEntityByName("Table1");
cy.openPropertyPane("tablewidgetv2");
cy.testJsontext("tabledata", "{{Api1.data}}");
@ -44,19 +48,31 @@ describe("Test Create Api and Bind to Table widget V2", function () {
expect(apiData).to.eq(`\"${tabData}\"`);
});
cy.get(commonlocators.backToEditor).click();
cy.wait("@postExecute").then((interception) => {
apiData = JSON.stringify(interception.response.body.data.body[0].name);
});
cy.readTableV2dataPublish("0", "5").then((tabData) => {
expect(apiData).to.eq(`\"${tabData}\"`);
});
});
it("3. Validate onSearchTextChanged function is called when configured for search text", function () {
cy.SearchEntityandOpen("Table1");
_.entityExplorer.ExpandCollapseEntity("Widgets");
_.entityExplorer.ExpandCollapseEntity("Container3");
_.entityExplorer.SelectEntityByName("Table1");
cy.openPropertyPane("tablewidgetv2");
cy.togglebarDisable(
".t--property-control-clientsidesearch input[type='checkbox']",
);
cy.get(".t--widget-tablewidgetv2 .t--search-input").first().type("Currey");
cy.wait(1000);
// Captures the API call made on search
cy.wait("@postExecute").then((interception) => {
apiData = JSON.stringify(interception.response.body.data.body[0].name);
});
cy.wait(5000);
cy.readTableV2dataPublish("0", "5").then((tabData) => {
expect(apiData).to.eq(`\"${tabData}\"`);
});

View File

@ -1,6 +1,7 @@
const dsl = require("../../../../fixtures/formInputTableV2Dsl.json");
const publish = require("../../../../locators/publishWidgetspage.json");
const testdata = require("../../../../fixtures/testdata.json");
import * as _ from "../../../../support/Objects/ObjectsCore";
describe("Binding the Table and input Widget", function () {
before(() => {
@ -8,7 +9,8 @@ describe("Binding the Table and input Widget", function () {
});
it("1. Input widget test with default value from table widget", function () {
cy.SearchEntityandOpen("Input1");
_.entityExplorer.ExpandCollapseEntity("Form1");
_.entityExplorer.SelectEntityByName("Input1");
cy.testJsontext("defaultvalue", testdata.defaultInputWidget + "}}");
cy.wait("@updateLayout").should(
@ -16,10 +18,8 @@ describe("Binding the Table and input Widget", function () {
"response.body.responseMeta.status",
200,
);
});
it("2. validation of data displayed in input widgets based on search value set", function () {
cy.SearchEntityandOpen("Table1");
// validation of data displayed in input widgets based on search value set
_.entityExplorer.SelectEntityByName("Table1");
cy.get(".t--property-control-allowsearching input").click({ force: true });
cy.testJsontext("defaultsearchtext", "2736212");
cy.wait("@updateLayout").isSelectRow(0);

View File

@ -1,14 +1,16 @@
const dsl = require("../../../../fixtures/formInputTableDsl.json");
const publish = require("../../../../locators/publishWidgetspage.json");
const testdata = require("../../../../fixtures/testdata.json");
import * as _ from "../../../../support/Objects/ObjectsCore";
describe("Binding the Table and input Widget", function () {
before(() => {
cy.addDsl(dsl);
});
it("Input widget test with default value from table widget", function () {
cy.SearchEntityandOpen("Input1");
it("1. Input widget test with default value from table widget", function () {
_.entityExplorer.ExpandCollapseEntity("Form1");
_.entityExplorer.SelectEntityByName("Input1");
cy.testJsontext("defaultvalue", testdata.defaultInputWidget + "}}");
cy.wait("@updateLayout").should(
@ -16,10 +18,8 @@ describe("Binding the Table and input Widget", function () {
"response.body.responseMeta.status",
200,
);
});
it("validation of data displayed in input widgets based on search value set", function () {
cy.SearchEntityandOpen("Table1");
//validation of data displayed in input widgets based on search value set
_.entityExplorer.SelectEntityByName("Table1");
cy.testJsontext("defaultsearchtext", "2736212");
cy.wait("@updateLayout").isSelectRow(0);

View File

@ -5,7 +5,7 @@ describe("Widget Grouping", function () {
before(() => {
cy.addDsl(dsl);
});
it("Button widgets widget on click info message valdiation with font family", function () {
it("1. Button widgets widget on click info message valdiation with font family", function () {
cy.get(".t--buttongroup-widget button")
.contains("Add")
.click({ force: true });

View File

@ -10,10 +10,10 @@ describe("Binding the button Widgets and validating NavigateTo Page functionalit
cy.addDsl(dsl);
});
it("Button widget with action navigate to page", function () {
it("1. Button widget with action navigate to page", function () {
cy.openPropertyPane("buttonwidget");
_.propPane.SelectPlatformFunction("onClick", "Navigate to");
cy.get("#switcher--url").click();
_.agHelper.GetNClick(_.propPane._navigateToType("URL"));
cy.get("label")
.contains("Enter URL")
.siblings("div")
@ -25,7 +25,7 @@ describe("Binding the button Widgets and validating NavigateTo Page functionalit
cy.wait(300);
});
it("Button click should take the control to page link validation", function () {
it("2. Button click should take the control to page link validation", function () {
cy.PublishtheApp();
cy.wait(2000);
cy.get(publish.buttonWidget).click();

View File

@ -7,7 +7,8 @@ describe("Text-Chart Binding Functionality", function () {
before(() => {
cy.addDsl(dsl);
});
it("Text-Chart Binding Functionality View", function () {
it("1. Text-Chart Binding Functionality View", function () {
cy.openPropertyPane("textwidget");
cy.testJsontext("text", JSON.stringify(this.data.chartInputValidate));
cy.get(commonlocators.TextInside).should(
@ -17,10 +18,10 @@ describe("Text-Chart Binding Functionality", function () {
cy.closePropertyPane();
cy.openPropertyPane("chartwidget");
cy.get(viewWidgetsPage.chartType).last().click({ force: true });
cy.get(".t--dropdown-option").children().contains("Column Chart").click();
cy.get(" .t--property-control-charttype .bp3-popover-target")
cy.get(".t--dropdown-option").children().contains("Column chart").click();
cy.get(".t--property-control-charttype span.rc-select-selection-item span")
.last()
.should("have.text", "Column Chart");
.should("have.text", "Column chart");
cy.testJsontext("chart-series-data-control", "{{Text1.text}}");
cy.closePropertyPane();
const labels = [
@ -36,7 +37,8 @@ describe("Text-Chart Binding Functionality", function () {
});
cy.PublishtheApp();
});
it("Text-Chart Binding Functionality Publish", function () {
it("2. Text-Chart Binding Functionality Publish", function () {
cy.get(publish.chartCanvasVal).should("be.visible");
cy.get(publish.chartWidget).should("have.css", "opacity", "1");
const labels = [

View File

@ -6,7 +6,7 @@ describe("Binding the multiple widgets and validating default data", function ()
cy.addDsl(dsl);
});
it("Checks if delete will remove bindings", function () {
it("1. Checks if delete will remove bindings", function () {
cy.get(widgetsPage.textWidget).first().click({ force: true });
cy.get("body").type("{del}", { force: true });

View File

@ -6,13 +6,11 @@ describe("Binding the multiple widgets and validating default data", function ()
cy.addDsl(dsl);
});
it("Dropdown widget test with invalid binding value", function () {
it("1. Dropdown widget test with invalid binding value", function () {
cy.openPropertyPane("selectwidget");
cy.testJsontext("options", JSON.stringify(testdata.defaultdataBinding));
cy.evaluateErrorMessage(testdata.dropdownErrorMsg);
});
it("Table widget test with invalid binding value", function () {
//Table widget test with invalid binding value
cy.openPropertyPane("tablewidget");
cy.testJsontext("tabledata", JSON.stringify(testdata.defaultdataBinding));
cy.evaluateErrorMessage(testdata.tableWidgetErrorMsg);

View File

@ -45,7 +45,7 @@ describe("Validate JSObjects binding to Input widget", () => {
cy.get("@jsObjName").then((jsObjName) => {
jsOjbNameReceived = jsObjName;
propPane.UpdatePropertyFieldValue(
"Default Value",
"Default value",
"{{" + jsObjName + ".myFun1()}}",
);
});

View File

@ -75,7 +75,7 @@ describe("Validate JSObj binding to Table widget", () => {
it("3. Validate the List widget + Bug 12438 ", function () {
_.entityExplorer.SelectEntityByName("List1", "Widgets");
_.propPane.MoveToTab("STYLE");
_.propPane.MoveToTab("Style");
_.propPane.UpdatePropertyFieldValue("Item Spacing (px)", "50");
cy.get(_.locators._textWidget).should("have.length", 6);
_.deployMode.DeployApp(_.locators._textWidgetInDeployed);

View File

@ -5,7 +5,7 @@ describe("JS Toggle tests", () => {
cy.addDsl(dsl);
});
it("switches the toggle to Button widget", () => {
it("1. switches the toggle to Button widget", () => {
cy.openPropertyPane("buttonwidget");
cy.get(".t--property-control-visible").find(".t--js-toggle").click();

View File

@ -21,22 +21,18 @@ describe("Loadash basic test with input Widget", () => {
it("1. Input widget test with default value for atob method", () => {
ee.SelectEntityByName("Input1", "Widgets");
propPane.UpdatePropertyFieldValue(
"Default Value",
"Default value",
dataSet.defaultInputBinding + "}}",
);
agHelper.ValidateNetworkStatus("@updateLayout");
});
it("2. Input widget test with default value for btoa method", function () {
//Input widget test with default value for btoa method
ee.SelectEntityByName("Input2");
propPane.UpdatePropertyFieldValue(
"Default Value",
"Default value",
dataSet.loadashInput + "}}",
);
agHelper.ValidateNetworkStatus("@updateLayout");
});
it("3. Publish and validate the data displayed in input widgets value for aToB and bToa", function () {
//Publish and validate the data displayed in input widgets value for aToB and bToa
deployMode.DeployApp(locator._widgetInputSelector("inputwidgetv2"));
cy.get(locator._widgetInputSelector("inputwidgetv2"))
.first()

View File

@ -21,22 +21,18 @@ describe("Validate basic binding of Input widget to Input widget", () => {
it("1. Input widget test with default value from another Input widget", () => {
ee.SelectEntityByName("Input1", "Widgets");
propPane.UpdatePropertyFieldValue(
"Default Value",
"Default value",
dataSet.defaultInputBinding + "}}",
);
agHelper.ValidateNetworkStatus("@updateLayout");
});
it("2. Binding second input widget with first input widget and validating", function () {
//Binding second input widget with first input widget and validating
ee.SelectEntityByName("Input2");
propPane.UpdatePropertyFieldValue(
"Default Value",
"Default value",
dataSet.momentInput + "}}",
);
agHelper.ValidateNetworkStatus("@updateLayout");
});
it("3. Publish widget and validate the data displayed in input widgets", function () {
//Publish widget and validate the data displayed in input widgets
let currentTime = new Date();
deployMode.DeployApp(locator._widgetInputSelector("inputwidgetv2"));
cy.get(locator._widgetInputSelector("inputwidgetv2"))

View File

@ -1,27 +1,16 @@
const widgetsPage = require("../../../../locators/Widgets.json");
const commonlocators = require("../../../../locators/commonlocators.json");
const publish = require("../../../../locators/publishWidgetspage.json");
const dsl = require("../../../../fixtures/navigateTotabledsl.json");
const testdata = require("../../../../fixtures/testdata.json");
const dsl2 = require("../../../../fixtures/navigateToInputDsl.json");
const pageid = "MyPage";
import { ObjectsRegistry } from "../../../../support/Objects/Registry";
let agHelper = ObjectsRegistry.AggregateHelper;
describe("Table Widget with Input Widget and Navigate to functionality validation", function () {
beforeEach(() => {
agHelper.RestoreLocalStorageCache();
});
afterEach(() => {
agHelper.SaveLocalStorageCache();
});
before(() => {
cy.addDsl(dsl);
});
it("Table Widget Functionality with multiple page", function () {
it("1. Table Widget Functionality with multiple page", function () {
cy.openPropertyPane("tablewidget");
cy.widgetText(
"Table1",
@ -29,9 +18,7 @@ describe("Table Widget with Input Widget and Navigate to functionality validatio
widgetsPage.widgetNameSpan,
);
cy.testJsontext("tabledata", JSON.stringify(testdata.TablePagination));
});
it("Create MyPage and valdiate if its successfully created", function () {
//Create MyPage and valdiate if its successfully created
cy.Createpage(pageid);
cy.addDsl(dsl2);
// eslint-disable-next-line cypress/no-unnecessary-waiting
@ -40,7 +27,7 @@ describe("Table Widget with Input Widget and Navigate to functionality validatio
cy.get(`.t--entity-name:contains("${pageid}")`).should("be.visible");
});
it("Validate NavigateTo Page functionality ", function () {
it("2. Validate NavigateTo Page functionality ", function () {
cy.get(`.t--entity-name:contains("Page1")`)
.should("be.visible")
.click({ force: true });

View File

@ -7,7 +7,7 @@ describe("Binding prompt", function () {
cy.addDsl(dsl);
});
it("Show binding prompt when there are no bindings in the editor", () => {
it("1. Show binding prompt when there are no bindings in the editor", () => {
cy.openPropertyPane("inputwidgetv2");
cy.testJsontext("defaultvalue", " ");
cy.get(dynamicInput.bindingPrompt).should("be.visible");

View File

@ -30,9 +30,7 @@ describe("Text-Table Binding Functionality", function () {
cy.wrap(cellData).should("equal", "Product2");
});
});
});
it("2. Update chart data and assert", function () {
//Update chart data and assert
cy.openPropertyPane("chartwidget");
cy.get(".t--property-control-chart-series-data-control").then(($el) => {
cy.updateCodeInput($el, updateData);
@ -48,7 +46,7 @@ describe("Text-Table Binding Functionality", function () {
});
});
it("3. Publish and assert", function () {
it("2. Publish and assert", function () {
cy.PublishtheApp(false);
cy.readTabledata("1", "0").then((cellData) => {
cy.wrap(cellData).should("equal", "Product2");

View File

@ -30,9 +30,7 @@ describe("Table Widget V2 and Navigate to functionality validation", function ()
cy.wait(500);
cy.CheckAndUnfoldEntityItem("Pages");
cy.get(`.t--entity-name:contains("${pageid}")`).should("be.visible");
});
it("2. Table Widget V2 Functionality with multiple page", function () {
//Table Widget V2 Functionality with multiple page
cy.get(`.t--entity-name:contains("Page1")`)
.should("be.visible")
.click({ force: true });
@ -52,7 +50,7 @@ describe("Table Widget V2 and Navigate to functionality validation", function ()
cy.assertPageSave();
});
it("3. Validate NavigateTo Page functionality ", function () {
it("2. Validate NavigateTo Page functionality ", function () {
cy.wait(2000);
cy.PublishtheApp();
cy.get(widgetsPage.chartWidget).should("not.exist");

View File

@ -3,20 +3,22 @@
const widgetsPage = require("../../../../locators/Widgets.json");
const dsl = require("../../../../fixtures/tableV2NewDsl.json");
const testdata = require("../../../../fixtures/testdata.json");
import * as _ from "../../../../support/Objects/ObjectsCore";
describe("Table Widget V2 property pane feature validation", function () {
before(() => {
cy.addDsl(dsl);
});
let propPaneBack = "[data-testid='t--property-pane-back-btn']";
it("1. Table widget V2 toggle test for text alignment", function () {
cy.openPropertyPane("tablewidgetv2");
cy.editColumn("id");
cy.moveToStyleTab();
cy.get(widgetsPage.toggleTextAlign).first().click({ force: true });
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(1000);
cy.toggleJsAndUpdate("tabledata", testdata.bindingAlign);
cy.wait(500);
_.propPane.EnterJSContext("Text align", testdata.bindingAlign);
cy.readTableV2dataValidateCSS("0", "0", "justify-content", "flex-start");
cy.readTableV2dataValidateCSS("1", "0", "justify-content", "flex-end");
@ -25,11 +27,10 @@ describe("Table Widget V2 property pane feature validation", function () {
it("2. Table widget V2 change text size and validate", function () {
cy.readTableV2dataValidateCSS("0", "0", "font-size", "14px");
cy.openPropertyPane("tablewidgetv2");
cy.get(".t--property-pane-back-btn").click({ force: true });
cy.get(propPaneBack).click({ force: true });
cy.editColumn("id");
cy.moveToStyleTab();
cy.get(widgetsPage.toggleTextAlign).first().click({ force: true });
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(500);
cy.wait(1000);
cy.get(widgetsPage.textSize).last().click({ force: true });
// eslint-disable-next-line cypress/no-unnecessary-waiting
@ -41,38 +42,33 @@ describe("Table Widget V2 property pane feature validation", function () {
it("3. Table widget toggle test for text size", function () {
cy.openPropertyPane("tablewidgetv2");
cy.get(".t--property-pane-back-btn").click({ force: true });
cy.get(propPaneBack).click({ force: true });
cy.editColumn("id");
cy.moveToStyleTab();
cy.get(widgetsPage.toggleTextSize).first().click({ force: true });
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(1000);
cy.toggleJsAndUpdateWithIndex("tabledata", testdata.bindingNewSize, 0);
cy.wait(500);
_.propPane.EnterJSContext("Text size", testdata.bindingNewSize);
cy.readTableV2dataValidateCSS("0", "0", "font-size", "14px");
cy.readTableV2dataValidateCSS("1", "0", "font-size", "24px");
});
it("4. Table widget toggle test for vertical Alignment", function () {
cy.openPropertyPane("tablewidgetv2");
cy.get(".t--property-pane-back-btn").click({ force: true });
cy.get(propPaneBack).click({ force: true });
cy.editColumn("id");
cy.moveToStyleTab();
cy.get(widgetsPage.toggleTextSize).first().click({ force: true });
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(1000);
cy.get(widgetsPage.toggleVerticalAlig).first().click({ force: true });
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(1000);
cy.toggleJsAndUpdateWithIndex("tabledata", testdata.bindingVerticalAlig, 2);
_.propPane.EnterJSContext(
"Vertical alignment",
testdata.bindingVerticalAlig,
);
cy.readTableV2dataValidateCSS("0", "0", "align-items", "flex-start");
cy.readTableV2dataValidateCSS("1", "0", "align-items", "flex-end");
});
it("5. Table widget V2 toggle test for style Alignment", function () {
cy.openPropertyPane("tablewidgetv2");
cy.get(".t--property-pane-back-btn").click({ force: true });
cy.get(propPaneBack).click({ force: true });
cy.editColumn("id");
cy.moveToStyleTab();
/*
@ -82,28 +78,20 @@ describe("Table Widget V2 property pane feature validation", function () {
*/
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(1000);
cy.get(widgetsPage.toggleTextStyle).first().click({ force: true });
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(1000);
cy.toggleJsAndUpdateWithIndex("tabledata", testdata.bindingStyle, 1);
_.propPane.EnterJSContext("Emphasis", testdata.bindingStyle);
cy.readTableV2dataValidateCSS("0", "0", "font-style", "normal");
cy.readTableV2dataValidateCSS("1", "0", "font-style", "italic");
});
it("6. Table widget toggle test for text color", function () {
cy.openPropertyPane("tablewidgetv2");
cy.get(".t--property-pane-back-btn").click({ force: true });
cy.get(propPaneBack).click({ force: true });
cy.editColumn("id");
cy.moveToStyleTab();
cy.get(widgetsPage.toggleVerticalAlig).first().click({ force: true });
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(1000);
cy.get(widgetsPage.toggleJsColor).first().click({ force: true });
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(1000);
cy.toggleJsAndUpdate("tabledata", testdata.bindingTextColor);
_.propPane.EnterJSContext("Text color", testdata.bindingTextColor);
cy.wait("@updateLayout");
cy.readTableV2dataValidateCSS("0", "0", "color", "rgb(0, 128, 0)");
cy.readTableV2dataValidateCSS("1", "0", "color", "rgb(255, 0, 0)");
@ -111,17 +99,11 @@ describe("Table Widget V2 property pane feature validation", function () {
it("7. Table widget toggle test for background color", function () {
cy.openPropertyPane("tablewidgetv2");
cy.get(".t--property-pane-back-btn").click({ force: true });
cy.get(propPaneBack).click({ force: true });
cy.editColumn("id");
cy.moveToStyleTab();
cy.get(widgetsPage.toggleJsColor).first().click({ force: true });
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(1000);
cy.get(widgetsPage.toggleJsBcgColor).first().click({ force: true });
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(1000);
cy.toggleJsAndUpdateWithIndex("tabledata", testdata.bindingTextColor, 4);
_.propPane.EnterJSContext("Cell Background", testdata.bindingTextColor);
cy.wait("@updateLayout");
cy.readTableV2dataValidateCSS(
"0",

View File

@ -19,7 +19,7 @@ describe("Table Widget V2 property pane feature validation", function () {
cy.editColumn("id");
cy.moveToStyleTab();
agHelper.Sleep();
propPane.EnterJSContext("Text Align", testdata.bindingAlign);
propPane.EnterJSContext("Text align", testdata.bindingAlign);
cy.wait("@updateLayout");
cy.readTableV2dataValidateCSS("0", "0", "justify-content", "flex-start");
cy.readTableV2dataValidateCSS("1", "0", "justify-content", "flex-end");
@ -37,7 +37,7 @@ describe("Table Widget V2 property pane feature validation", function () {
it("3. Table widget toggle test for vertical Alignment", function () {
//cy.movetoStyleTab();
agHelper.Sleep();
propPane.EnterJSContext("Vertical Alignment", testdata.bindingVerticalAlig);
propPane.EnterJSContext("Vertical alignment", testdata.bindingVerticalAlig);
cy.wait("@updateLayout");
cy.readTableV2dataValidateCSS("0", "0", "align-items", "flex-start");
cy.readTableV2dataValidateCSS("1", "0", "align-items", "flex-end");
@ -46,7 +46,7 @@ describe("Table Widget V2 property pane feature validation", function () {
it("4. Table widget toggle test for text size", function () {
//cy.movetoStyleTab();
agHelper.Sleep();
propPane.EnterJSContext("Text Size", testdata.bindingNewSize);
propPane.EnterJSContext("Text size", testdata.bindingNewSize);
cy.wait("@updateLayout");
cy.readTableV2dataValidateCSS("0", "0", "font-size", "14px");
cy.readTableV2dataValidateCSS("1", "0", "font-size", "24px");
@ -61,16 +61,16 @@ describe("Table Widget V2 property pane feature validation", function () {
});
it("6. Table widget toggle test for text color", function () {
//cy.movetoStyleTab();
cy.moveToStyleTab();
agHelper.Sleep();
propPane.EnterJSContext("Text Color", testdata.bindingTextColor);
propPane.EnterJSContext("Text color", testdata.bindingTextColor);
cy.wait("@updateLayout");
cy.readTableV2dataValidateCSS("0", "0", "color", "rgb(0, 128, 0)");
cy.readTableV2dataValidateCSS("1", "0", "color", "rgb(255, 0, 0)");
});
it("7. Table widget toggle test for background color", function () {
//cy.movetoStyleTab();
cy.moveToStyleTab();
agHelper.Sleep();
propPane.EnterJSContext("Cell Background", testdata.bindingTextColor);
cy.wait("@updateLayout");

View File

@ -22,16 +22,14 @@ describe("Table Widget and Navigate to functionality validation", function () {
cy.wait(2000); //dsl to settle!
});
it("Create MyPage and valdiate if its successfully created", function () {
it("1. Create MyPage and valdiate if its successfully created", function () {
cy.Createpage(pageid);
cy.addDsl(dsl2);
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(500);
cy.CheckAndUnfoldEntityItem("Pages");
cy.get(`.t--entity-name:contains("${pageid}")`).should("be.visible");
});
it("Table Widget Functionality with multiple page", function () {
//Table Widget Functionality with multiple page
cy.get(`.t--entity-name:contains("Page1")`)
.should("be.visible")
.click({ force: true });
@ -49,9 +47,7 @@ describe("Table Widget and Navigate to functionality validation", function () {
.contains(pageid)
.click({ force: true });
cy.assertPageSave();
});
it("Validate NavigateTo Page functionality ", function () {
//Validate NavigateTo Page functionality
cy.wait(2000);
cy.PublishtheApp();
cy.get(widgetsPage.chartWidget).should("not.exist");

View File

@ -8,8 +8,11 @@ describe("Test Create Api and Bind to Table widget", function () {
it("Validate onSearchTextChanged function is called when configured for search text", function () {
cy.wait(5000);
// input text in search bar
cy.get(".t--widget-tablewidget .t--search-input input").first().type("2");
cy.wait(5000);
cy.get(".t--widget-tablewidget .t--search-input input")
.first()
.click()
.type("2");
cy.wait(2000);
// Verify it filtered the table
cy.readTabledataPublish("0", "0").then((tabData) => {
expect(tabData).to.eq("#2");

View File

@ -19,7 +19,7 @@ describe("Table Widget property pane feature validation", function () {
cy.editColumn("id");
//cy.movetoStyleTab();
agHelper.Sleep();
propPane.EnterJSContext("Text Align", testdata.bindingAlign);
propPane.EnterJSContext("Text align", testdata.bindingAlign);
cy.wait("@updateLayout");
cy.readTabledataValidateCSS("0", "0", "justify-content", "flex-start");
cy.readTabledataValidateCSS("1", "0", "justify-content", "flex-end");
@ -37,7 +37,7 @@ describe("Table Widget property pane feature validation", function () {
it("3. Table widget toggle test for vertical Alignment", function () {
//cy.movetoStyleTab();
agHelper.Sleep();
propPane.EnterJSContext("Vertical Alignment", testdata.bindingVerticalAlig);
propPane.EnterJSContext("Vertical alignment", testdata.bindingVerticalAlig);
cy.wait("@updateLayout");
cy.readTabledataValidateCSS("0", "0", "align-items", "flex-start");
cy.readTabledataValidateCSS("1", "0", "align-items", "flex-end");
@ -46,7 +46,8 @@ describe("Table Widget property pane feature validation", function () {
it("4. Table widget toggle test for text size", function () {
//cy.movetoStyleTab();
agHelper.Sleep();
propPane.EnterJSContext("Text Size", testdata.bindingSize);
propPane.EnterJSContext("Text size", testdata.bindingSize);
cy.wait(2000);
cy.wait("@updateLayout");
cy.readTabledataValidateCSS("0", "0", "font-size", "14px");
cy.readTabledataValidateCSS("1", "0", "font-size", "24px");
@ -64,7 +65,7 @@ describe("Table Widget property pane feature validation", function () {
it("6. Table widget toggle test for text color", function () {
//cy.movetoStyleTab();
agHelper.Sleep();
propPane.EnterJSContext("Text Color", testdata.bindingTextColor);
propPane.EnterJSContext("Text color", testdata.bindingTextColor);
cy.wait("@updateLayout");
cy.readTabledataValidateCSS("0", "0", "color", "rgb(0, 128, 0)");
cy.readTabledataValidateCSS("1", "0", "color", "rgb(255, 0, 0)");

View File

@ -12,7 +12,7 @@ describe("Text-Table Binding Functionality", function () {
before(() => {
cy.addDsl(dsl);
});
it("Text-Table Binding Functionality For Id", function () {
it("1. Text-Table Binding Functionality For Id", function () {
cy.openPropertyPane("tablewidget");
/**
* @param(Index) Provide index value to select the row.
@ -38,7 +38,7 @@ describe("Text-Table Binding Functionality", function () {
});
});
});
it("Text-Table Binding Functionality For Email", function () {
it("2. Text-Table Binding Functionality For Email", function () {
cy.get(publish.backToEditor).click();
cy.isSelectRow(2);
cy.openPropertyPane("textwidget");
@ -61,7 +61,7 @@ describe("Text-Table Binding Functionality", function () {
});
});
});
it("Text-Table Binding Functionality For Total Length", function () {
it("3. Text-Table Binding Functionality For Total Length", function () {
cy.get(publish.backToEditor).click();
cy.openPropertyPane("textwidget");
cy.testJsontext("text", "{{Table1.pageSize}}");
@ -82,7 +82,7 @@ describe("Text-Table Binding Functionality", function () {
});
});
});
it("Table Widget Functionality To Verify Default Row Selection is working", function () {
it("4. Table Widget Functionality To Verify Default Row Selection is working", function () {
cy.get(publish.backToEditor).click();
cy.openPropertyPane("tablewidget");
cy.testJsontext("defaultselectedrow", "2");
@ -101,7 +101,7 @@ describe("Text-Table Binding Functionality", function () {
cy.get(commonlocators.TextInside).should("have.text", tabValueP);
});
});
it("Text-Table Binding Functionality For Username", function () {
it("5. Text-Table Binding Functionality For Username", function () {
cy.get(publish.backToEditor).click();
/**
* @param(Index) Provide index value to select the row.

View File

@ -4,9 +4,8 @@ const publish = require("../../../../locators/publishWidgetspage.json");
const queryLocators = require("../../../../locators/QueryEditor.json");
const datasource = require("../../../../locators/DatasourcesEditor.json");
const testdata = require("../../../../fixtures/testdata.json");
import { ObjectsRegistry } from "../../../../support/Objects/Registry";
import * as _ from "../../../../support/Objects/ObjectsCore";
const dataSources = ObjectsRegistry.DataSources;
let datasourceName;
describe("Binding the multiple widgets and validating default data", function () {
@ -21,31 +20,29 @@ describe("Binding the multiple widgets and validating default data", function ()
cy.testSaveDatasource();
cy.get("@saveDatasource").then((httpResponse) => {
datasourceName = httpResponse.response.body.data.name;
//Create and runs query
cy.NavigateToActiveDSQueryPane(datasourceName);
cy.get(queryLocators.templateMenu).click();
_.dataSources.EnterQuery("select * from users limit 10");
cy.EvaluateCurrentValue("select * from users limit 10");
_.dataSources.RunQuery();
});
});
it("2. Create and runs query", () => {
cy.NavigateToActiveDSQueryPane(datasourceName);
cy.get(queryLocators.templateMenu).click();
dataSources.EnterQuery("select * from users limit 10");
it("2. Button widget test with on action query run", function () {
_.entityExplorer.SelectEntityByName("Button1");
cy.EvaluateCurrentValue("select * from users limit 10");
dataSources.RunQuery();
});
it("3. Button widget test with on action query run", function () {
cy.SearchEntityandOpen("Button1");
cy.executeDbQuery("Query1", "onClick");
cy.wait("@updateLayout").should(
"have.nested.property",
"response.body.responseMeta.status",
200,
);
});
//Input widget test with default value update with query data
_.entityExplorer.SelectEntityByName("Input1");
it("4. Input widget test with default value update with query data", function () {
cy.SearchEntityandOpen("Input1");
cy.get(widgetsPage.defaultInput).type(testdata.defaultInputQuery);
cy.wait("@updateLayout").should(
"have.nested.property",
@ -54,7 +51,7 @@ describe("Binding the multiple widgets and validating default data", function ()
);
});
it("5. Publish App and validate loading functionalty", function () {
it("3. Publish App and validate loading functionalty", function () {
cy.PublishtheApp();
//eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(2000);

View File

@ -8,7 +8,7 @@ describe("Binding the multiple widgets and validating default data", function ()
cy.addDsl(dsl);
});
it("Input widget test with default value from table widget", function () {
it("1. Input widget test with default value from table widget", function () {
cy.openPropertyPane("inputwidgetv2");
cy.testJsontext("defaultvalue", testdata.defaultInputWidget + "}}");
@ -17,10 +17,7 @@ describe("Binding the multiple widgets and validating default data", function ()
"response.body.responseMeta.status",
200,
);
});
//To be enabled once the single select multi select issues are resolved
it("Dropdown widget test with default value from table widget", function () {
//Dropdown widget test with default value from table widget
cy.openPropertyPane("selectwidget");
cy.testJsontext("options", JSON.stringify(testdata.deafultDropDownWidget));
@ -31,7 +28,7 @@ describe("Binding the multiple widgets and validating default data", function ()
);
});
it("validation of default data displayed in all widgets based on row selected", function () {
it("2. validation of default data displayed in all widgets based on row selected", function () {
cy.isSelectRow(1);
cy.readTabledataPublish("1", "0").then((tabData) => {
const tabValue = tabData;

View File

@ -1,6 +1,7 @@
const dsl = require("../../../../fixtures/formInputTableV2Dsl.json");
const publish = require("../../../../locators/publishWidgetspage.json");
const testdata = require("../../../../fixtures/testdata.json");
import * as _ from "../../../../support/Objects/ObjectsCore";
describe("Binding the multiple input Widget", function () {
before(() => {
@ -8,7 +9,8 @@ describe("Binding the multiple input Widget", function () {
});
it("1. Input widget test with default value from table widget v2", function () {
cy.SearchEntityandOpen("Input1");
_.entityExplorer.ExpandCollapseEntity("Form1");
_.entityExplorer.SelectEntityByName("Input1");
cy.testJsontext("defaultvalue", testdata.defaultInputWidget + "}}");
cy.wait(2000);
@ -17,9 +19,7 @@ describe("Binding the multiple input Widget", function () {
"response.body.responseMeta.status",
200,
);
});
it("2. Validation of data displayed in all widgets based on row selected", function () {
// Validation of data displayed in all widgets based on row selected
cy.isSelectRow(1);
cy.readTableV2dataPublish("1", "0").then((tabData) => {
const tabValue = tabData;

View File

@ -1,6 +1,7 @@
const dsl = require("../../../../fixtures/formInputTableDsl.json");
const publish = require("../../../../locators/publishWidgetspage.json");
const testdata = require("../../../../fixtures/testdata.json");
import * as _ from "../../../../support/Objects/ObjectsCore";
describe("Binding the multiple input Widget", function () {
before(() => {
@ -8,7 +9,9 @@ describe("Binding the multiple input Widget", function () {
});
it("1. Input widget test with default value from table widget", function () {
cy.SearchEntityandOpen("Input1");
_.entityExplorer.ExpandCollapseEntity("Form1");
_.entityExplorer.SelectEntityByName("Input1");
cy.testJsontext("defaultvalue", testdata.defaultInputWidget + "}}");
cy.wait(2000);
@ -17,9 +20,7 @@ describe("Binding the multiple input Widget", function () {
"response.body.responseMeta.status",
200,
);
});
it("2. Validation of data displayed in all widgets based on row selected", function () {
// Validation of data displayed in all widgets based on row selected
cy.isSelectRow(1);
cy.readTabledataPublish("1", "0").then((tabData) => {
const tabValue = tabData;

View File

@ -21,7 +21,7 @@ describe("Validate basic binding of Input widget to Input widget", () => {
it("1. Input widget test with default value for atob method", () => {
ee.SelectEntityByName("Input1", "Widgets");
propPane.UpdatePropertyFieldValue(
"Default Value",
"Default value",
dataSet.atobInput + "}}",
);
agHelper.ValidateNetworkStatus("@updateLayout");
@ -29,12 +29,10 @@ describe("Validate basic binding of Input widget to Input widget", () => {
.first()
.invoke("attr", "value")
.should("equal", "A"); //Before mapping JSObject value of input
});
it("2. Input widget test with default value for btoa method", function () {
//Input widget test with default value for btoa method"
ee.SelectEntityByName("Input2");
propPane.UpdatePropertyFieldValue(
"Default Value",
"Default value",
dataSet.btoaInput + "}}",
);
agHelper.ValidateNetworkStatus("@updateLayout");
@ -44,7 +42,7 @@ describe("Validate basic binding of Input widget to Input widget", () => {
.should("equal", "QQ=="); //Before mapping JSObject value of input
});
it("3. Publish and validate the data displayed in input widgets value for aToB and bToa", function () {
it("2. Publish and validate the data displayed in input widgets value for aToB and bToa", function () {
deployMode.DeployApp(locator._widgetInputSelector("inputwidgetv2"));
cy.get(locator._widgetInputSelector("inputwidgetv2"))
.first()

View File

@ -5,7 +5,7 @@ describe("xml2json text", function () {
before(() => {
cy.addDsl(dsl);
});
it("publish widget and validate the data displayed in text widget from xmlParser function", function () {
it("1. publish widget and validate the data displayed in text widget from xmlParser function", function () {
cy.PublishtheApp();
cy.get(publish.textWidget)
.first()

View File

@ -9,7 +9,7 @@ const largeResponseApiUrl = "https://api.publicapis.org/entries";
//"https://jsonplaceholder.typicode.com/photos";//Commenting since this is faster sometimes & case is failing
describe("Abort Action Execution", function () {
it("1. Bug #14006, #16093 - Cancel Request button should abort API action execution", function () {
it("1. Bug #14006, #16093 - Cancel request button should abort API action execution", function () {
_.apiPage.CreateAndFillApi(largeResponseApiUrl, "AbortApi", 0);
_.apiPage.RunAPI(false, 0);
_.agHelper.GetNClick(_.locators._cancelActionExecution, 0, true);
@ -23,7 +23,7 @@ describe("Abort Action Execution", function () {
// Queries were resolving quicker than we could cancel them
// Commenting this out till we can find a query that resolves slow enough for us to cancel its execution.
it("2. Bug #14006, #16093 Cancel Request button should abort Query action execution", function () {
it("2. Bug #14006, #16093 Cancel request button should abort Query action execution", function () {
_.dataSources.CreateDataSource("MySql");
cy.get("@dsName").then(($dsName) => {
_.dataSources.CreateQueryAfterDSSaved(

View File

@ -327,7 +327,7 @@ function ratingwidgetAndReset() {
function checkboxGroupAndReset() {
cy.wait(2000);
cy.get("[data-cy=checkbox-group-container] > :nth-child(3)")
cy.get("[data-testid=checkbox-group-container] > :nth-child(3)")
.last()
.should("be.visible")
.click({ force: true });

View File

@ -1,7 +1,7 @@
import * as _ from "../../../../support/Objects/ObjectsCore";
describe("Invalid JSObject export statement", function () {
it("Shows error toast for invalid js object export statement", function () {
it("1. Shows error toast for invalid js object export statement", function () {
const JSObjectWithInvalidExport = `{
myFun1: ()=>{
return (name)=>name

View File

@ -17,7 +17,7 @@ describe("Verify setting tab form controls not to have tooltip and tooltip (unde
it("1. We make sure the label in the settings tab does not have any underline styles", function () {
cy.NavigateToActiveDSQueryPane(datasourceName);
cy.get(queryLocators.querySettingsTab).click();
cy.xpath(queryLocators.querySettingsTab).click();
cy.get(".label-icon-wrapper")
.contains("Run query on page load")

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