Commit Graph

27 Commits

Author SHA1 Message Date
Valera Melnikov
7ba06c829d
chore: change snapshot package (#35867)
/ok-to-test tags="@tag.All"

## Description
> [!TIP]  
> _Add a TL;DR when the description is longer than 500 words or
extremely technical (helps the content, marketing, and DevRel team)._
>
> _Please also include relevant motivation and context. List any
dependencies that are required for this change. Add links to Notion,
Figma or any other documents that might be relevant to the PR._


Fixes #`Issue Number`  
_or_  
Fixes `Issue URL`
> [!WARNING]  
> _If no issue exists, please create an issue first, and check with the
maintainers if the issue is valid._

## Automation

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/10815637874>
> Commit: 54937a7a64e755959e3420a0a20abcc30ee10d78
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10815637874&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.All`
> Spec:
> <hr>Wed, 11 Sep 2024 17:30:00 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [x] No


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **New Features**
- Added support for visual regression testing through new tagging in
various test suites.
- Integrated a new image snapshot plugin to enhance testing
capabilities.

- **Bug Fixes**
- Removed outdated image snapshot assertions to streamline testing
processes.

- **Documentation**
- Updated tags in multiple test suites to improve organization and
clarity regarding visual testing.

- **Chores**
- Upgraded Node.js version in the Cypress Dockerfile for improved
performance and compatibility.
- Simplified Cypress plugin configuration by removing unnecessary
functions and enhancing browser compatibility.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Pawan Kumar <pawankumar@Pawans-MacBook-Pro-2.local>
2024-09-12 11:09:42 +03:00
Valera Melnikov
08c3ea9b94
chore: cypress snapshot types (#34722)
## Description
1. Add scripts for local e2e testing in the docker container. 
2. Add types for cypress-image-snapshot

In this PR, I also added the following PRS as they affect screenshot
tests as well. I did this to speed up the process and unblock the team.

#34528
#34546
#34676
#34729
#34638
#34639
#34511

To run E2E tests locally in docker, you need to do the following:
1. Run FE locally and prepare the tests for local launch. See the
instructions
[here](https://github.com/appsmithorg/appsmith/blob/release/contributions/ClientSetup.md).
2. Run `yarn cypress:snapshot:docker:build` — this will create a docker
container with the necessary environment.
3. Run `yarn cypress:snapshot:docker
"./cypress/e2e/Regression/ClientSide/Anvil/Widgets/*_spec.ts"
updateSnapshots=false`. Here we can use the path to a specific file, or
set `updateSnapshots=true` flag to update the screenshots.

## Automation

/ok-to-test tags="@tag.Anvil"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/9844579277>
> Commit: 75f26599b149f831051fbd631aaa059084b226dd
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=9844579277&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Anvil`
> Spec:
> <hr>Mon, 08 Jul 2024 18:37:36 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [x] No


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Added support for image snapshot testing with the
`@types/cypress-image-snapshot` dependency.

- **Refactor**
- Updated test specifications by removing unnecessary
`triggerInputInvalidState()` calls.
- Reorganized and improved efficiency of image snapshot methods for
various devices.

- **Chores**
- Updated `Dockerfile` to configure the Cypress environment with
specific versions for dependencies.
  - Changed import paths in `e2e.js` for better module resolution. 

- **Style**
  - Fixed a comment typo in Cypress plugin configuration.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Pawan Kumar <pawankumar@Pawans-MacBook-Pro-2.local>
Co-authored-by: unknown <vadim@appsmith.com>
2024-07-09 12:06:59 +03:00
Saroj
cf53dbfb23
ci: Allow static split of cypress specs (#29653)
## Description
- Allowing static split of cypress specs in CI runs.
- Optimised the spec allocation by considering the duration history for
each spec.
- Updated the affecting workflows to utilise the static split

#### Type of change
- Workflows
- Cypress-split pugin
## Testing
- Workflow run

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Introduced a new environment variable to optimize test resource
allocation during CI/CD processes.
- Enhanced Cypress testing with dynamic and static test splitting
strategies.

- **Refactor**
- Refactored Cypress plugin configuration to support conditional test
splitting based on the environment variable.

- **Chores**
- Updated GitHub Actions workflows to include new environment variables
for test runs.

- **Documentation**
- Updated internal documentation to reflect changes in test setup and
execution strategies.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2023-12-18 17:10:11 +05:30
sharanya-appsmith
a1fb4ba197
test: Cypress - Added cypress grep library (#29259)
Leveraging the library

[cypress-grep](https://github.com/cypress-io/cypress/tree/develop/npm/grep).
Using this we can tag testcases with relevant tags and use it to run
specific testcases.

**Command to run in local:** 
`CYPRESS_grepTags=@tag.Binding,@tag.Git npx cypress run
`
Pass the tags to CYPRESS_grepTags argument and only the test cases which
has the
tags passed will be picked to run. ex `@tag.Binding and @tag.Git` are
the tag names here.

**Tags can be added in the description on the test case like** 
`{ tags: ["@tag.Datasource"] }` for a single tag
`{ tags: ["@tag.Datasource", "@tag.Git"] }` for multiple tags 

**How to run In CI**
Single Tag - `/ok-to-test tags=@tag.Binding`
Multiple tag - `/ok-to-test tags=@tag.Binding,@tag.Git`


**TODOs in the next release:** 
- [ ] Add tags.ts file with all needed tags
- [ ] Add tags to remaining spec files. 
- [ ] Fail the PR run if tags added are not from tag.ts and post the
message on the same

#### Type of change
- Chore (housekeeping or task changes that don't impact user perception)
- This change requires a documentation update

#### How Has This Been Tested?
- [x] Manual
- [ ] JUnit
- [ ] Jest
- [x] Cypress

## 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
- [x] My changes generate no new warnings
- [x] 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:
- [x] [Speedbreak
features](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#speedbreakers-)
have been covered
- [ ] Test plan covers all impacted features and [areas of
interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#areas-of-interest-)
- [ ] Test plan has been peer reviewed by project stakeholders and other
QA members
- [ ] Manually tested functionality on DP
- [ ] We had an implementation alignment call with stakeholders post QA
Round 2
- [ ] Cypress test cases have been added and approved by SDET/manual QA
- [x] Added `Test Plan Approved` label after Cypress tests were reviewed
- [ ] Added `Test Plan Approved` label after JUnit tests were reviewed


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
  - Added a search functionality to the app.

- **Enhancements**
- Integrated search bar at the top of the `Hero` component and a
`Search` component to the `App` component.
  - Added styles for the search bar.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Arpit Mohan <arpit@appsmith.com>
2023-12-07 18:23:27 +05:30
akash-codemonk
3dc1241468
chore: get browser logs from failed cypress tests (#27724)
Fixes https://github.com/appsmithorg/appsmith/issues/26006

Get browser console logs for failed tests. This will help with easier
debugging of flaky tests.

Sample artifact for a test
https://github.com/appsmithorg/appsmith/suites/16856147292/artifacts/962768313
Latest test run of the change:
https://github.com/appsmithorg/appsmith/actions/runs/6405413689

Trimming down the files to a max of 10 files, since the artifact size
can go upto a GB when there are a 1000 or more tests failing.

---------

Co-authored-by: Aishwarya-U-R <91450662+Aishwarya-U-R@users.noreply.github.com>
Co-authored-by: Aishwarya UR <aishwarya@appsmith.com>
2023-10-05 14:42:30 +05:30
Saroj
9895ee217e
ci: Split spec improvements for cypress ci runs (#26774)
> Pull Request Template
>
> Use this template to quickly create a well written pull request.
Delete all quotes before creating the pull request.
>
## Description
> Add a TL;DR when description is extra long (helps content team)
>
> Please include a summary of the changes and which issue has been
fixed. Please also include relevant motivation
> and context. List any dependencies that are required for this change
>
> Links to Notion, Figma or any other documents that might be relevant
to the PR
>
>
#### PR fixes following issue(s)
Fixes # (issue number)
> 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
>
>
>
## Testing
>
#### How Has This Been Tested?
> Please describe the tests that you ran to verify your changes. Also
list any relevant details for your test configuration.
> Delete anything that is not relevant
- [ ] Manual
- [ ] JUnit
- [ ] 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:
- [ ] [Speedbreak
features](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#speedbreakers-)
have been covered
- [ ] Test plan covers all impacted features and [areas of
interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#areas-of-interest-)
- [ ] Test plan has been peer reviewed by project stakeholders and other
QA members
- [ ] Manually tested functionality on DP
- [ ] We had an implementation alignment call with stakeholders post QA
Round 2
- [ ] Cypress test cases have been added and approved by SDET/manual QA
- [ ] Added `Test Plan Approved` label after Cypress tests were reviewed
- [ ] Added `Test Plan Approved` label after JUnit tests were reviewed
2023-09-25 09:49:21 +05:30
Saroj
d6641877ad
test: Fix gsheet tests (#27389)
## Description
-  Fixing the browser issue for gsheet tests

#### Type of change
- Workflow file changes
- plugin/index.js changes
## Testing
>
#### How Has This Been Tested?
- [x] [Cypress
](https://github.com/appsmithorg/appsmith/actions/runs/6248887548)
2023-09-21 10:44:23 +05:30
Saroj
ba9ebf1d6e
ci: Migrate pending workflows to dime defenders (#26968)
## Description
- Updated the logic to use DimeDefenders spec split
- Updated ci-test-hosted, ci-test-limited and ci-test-custom-script
- Changes to handle when there is no spec to run in CI

#### Type of change
- DimeDefender script
- Workflows
## Testing
- Workflow run
2023-09-06 14:40:13 +05:30
Saroj
edbbefd979
chore: Changes to enable internal cypress dashboard (#26626)
> Pull Request Template
>
> Use this template to quickly create a well written pull request.
Delete all quotes before creating the pull request.
>
## Description
> Add a TL;DR when description is extra long (helps content team)
>
> Please include a summary of the changes and which issue has been
fixed. Please also include relevant motivation
> and context. List any dependencies that are required for this change
>
> Links to Notion, Figma or any other documents that might be relevant
to the PR
>
>
#### PR fixes following issue(s)
Fixes # (issue number)
> 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
>
>
>
## Testing
>
#### How Has This Been Tested?
> Please describe the tests that you ran to verify your changes. Also
list any relevant details for your test configuration.
> Delete anything that is not relevant
- [ ] Manual
- [ ] JUnit
- [ ] 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:
- [ ] [Speedbreak
features](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#speedbreakers-)
have been covered
- [ ] Test plan covers all impacted features and [areas of
interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#areas-of-interest-)
- [ ] Test plan has been peer reviewed by project stakeholders and other
QA members
- [ ] Manually tested functionality on DP
- [ ] We had an implementation alignment call with stakeholders post QA
Round 2
- [ ] Cypress test cases have been added and approved by SDET/manual QA
- [ ] Added `Test Plan Approved` label after Cypress tests were reviewed
- [ ] Added `Test Plan Approved` label after JUnit tests were reviewed
2023-08-25 10:21:12 +05:30
Vijetha-Kaja
85cfce3db9
test: Cypress - Camera & Code Scanner Widgets Automation (#26196)
## Description

- Automated Camera (Image & Video) & Code scanner widget testcases

## Type of change

- Automation

## How Has This Been Tested?
- Cypress test runs

## Checklist:
### 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: Aishwarya-U-R <91450662+Aishwarya-U-R@users.noreply.github.com>
Co-authored-by: Aishwarya UR <aishwarya@appsmith.com>
2023-08-11 01:31:18 +05:30
Sangeeth Sivan
bc5a23e8cd
feat: ci changes & cypress tests with cypress tags (#22989)
## Description

This includes

> Building a new image for airgapped instances
> Running ci-tests on airgapped image
> Running cypress tests selectively ignoring non supported features for
airgap like Templates, Custom JS lib and also alternating test
behaviours for some tests like tests using mock db, since it doesn't
work on airgap we have to create a ds. So this selective testing was
done using cypress-tags
> Having a new client build for airgapped images which bundles all the
assets.
> And changes in the workflow files to account for all the above. 

With airgap, we can ignore certain tests and also need to account for
tests using mock datasources and such by creating new datasources
instead of mock datasources. Since those are blocked. So to perform a
selective testing we are using a plugin called `cypress-tags` and to
perform conditional testing when required we use the `AIRGAPPED` cypress
env. This PR introduces both and also modified the codebase to support
this new way of running cypress.

Since we can't trigger `/ok-to-test` on this because ci-test needs the
CYPRESS_EXCLUDE_TAGS and slash command doesn't dispatch from current
branch,

I manually triggered the `TBP` workflow to run ci-test on this branch. 
And the new `TBP airgap` workflow to run ci-test on airgapped docker
image on this branch.

Here is the link to the run 
https://github.com/appsmithorg/appsmith/actions/runs/4882041416

Fixes #22007 
Fixes #22814 


## Type of change

> Please delete options that are not relevant.

- New feature (non-breaking change which adds functionality)
- Chore (housekeeping or task changes that don't impact user perception)


## How Has This Been Tested?

- Manual
- 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
- [x] My code follows the style guidelines of this project
- [x] 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
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] 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
2023-05-12 00:15:06 +05:30
Aishwarya-U-R
820846ce8b
Cypress version upgrade for timeout issue resolution (#15917) 2022-08-16 09:31:16 +05:30
Rimil Dey
9284c5e240
Auto-indent JS code in the editor (#13222)
This pull request:

    introduces a new option to the menu in the JS editor which lets users prettify/auto-indent code.
    introduces a new keyboard shortcut that lets users prettify/auto-indent code
    Fixes bug where pressing CMD + <- in Mac (Home in windows) shifts the cursor to the first indented column. If the cursor is present on the first indented column, the cursor shifts to the 0th column in the editor

Fixes #9268
2022-07-20 12:43:23 +05:30
Aishwarya-U-R
8f4756c1d1
test: Automated tests for AForce Migration scenarios + Improved TableFilter spec script coverage (#12534)
* Aforce spec- DefaultSearchText added

* Bug 12228 scripted

* Remove text added

* Aforce - Client Side Search added

* Aforce - adding new issue from modal

* Aforce spec - add new issue fixed

* Aforce spec - update/Delete issue added

* Aforce - multi widget selection fix

* aforce spec - multi select fix

* Aforce - multi select fix

* Aforce - multi select fix

* Removing Table_Filter_spec from ignore files

* MemberRoles locator fix

* member roles locator update

* Tablefilter spec fix

* Aforce spec type fix

* Aforce - search spec

* TableFilter spec fix

* Chartdatapoint fixed

* desc update

* Aforce - skipping table search again

* Removed duplicate spec

* GetNClick improved

* BindTable_api spec fix

* AForce spec fix

* CHartdatapoint spec fixed

* JSObjToListwidget spec fix

* OnPageLoad spec fix

* updates

* TableFilter.ts added

* TableFilter added more scenarios

* TableFilter added more scenarios

* Table_spec failure fix

* TableFilter spec - scenarios added

* AForce Filter case added

* AForce fix

* Aforce filter fix

* Aforce fix

* SelectFromMultiSelect added fix

* Picking msg from message.ts file

* Aforce spec - Added wait

* Aforce - filter spec fix

* JSONload messages update
2022-04-12 15:31:22 +05:30
Aishwarya-U-R
9bbd671b3f
test: Automated few tests for AForce Migration scenarios + Flaky fixes (#12231) 2022-03-31 17:21:08 +05:30
Parthvi12
b82ea06aa3
test: Adding visual tests for layout validation (#9857)
* Adding visual tests for layout validation

* updating screenshot to match CI's screenshot resolution

* updating screenshot as per CI

* setting failure threshold for the image comparision

Co-authored-by: Parthvi Goswami <parthvigoswami@Parthvis-MacBook-Pro.local>
2021-12-24 17:47:22 +05:30
NandanAnantharamu
425a46f34d
test: updated filter tests (#9448)
* Filter Tests

* Test spec added

* updated import

* added some wait

* updated the dependencies

* Added the dependancy files
2021-11-30 20:56:37 +05:30
Hetu Nandu
b5e8673921
Properly log data tree instrumentation (#2228) 2020-12-29 14:55:56 +05:30
Piyush Mishra
988ebe975b
RPC-like layer with graceful startup and shutdown around a webworker (#2252) 2020-12-28 14:12:43 +05:30
Piyush Mishra
29de447411
Upgrade fusioncharts npm package (#2241) 2020-12-17 17:43:33 +05:30
Piyush Mishra
7376ada1b1
[Documentation] Use env variables in Cypress tests (#1887) 2020-11-24 16:44:38 +05:30
Piyush Mishra
03f97c0323
Fix: Maps widget crash on wrong initial location datatype (#1854) 2020-11-24 14:13:45 +05:30
Arpit Mohan
a9ed054cbb
Adding Github Action workflow to the client code base (#66)
This PR adds the build, test & package workflow to the client code base as well.

In order for us to run the Cypress tests, we also spin up a local server in a Docker container and run all our tests against that server. This ensures that our tests are faster to run as well.

We also introduce the concept of stubbing network requests by stubbing the API that fetches the property pane configuration from the server.

Results for the Cypress tests can be viewed at: https://dashboard.cypress.io/projects/eyxvp8/runs/
2020-07-16 11:20:46 +05:30
Arpit Mohan
aefcf68c80 Adding the docker image for Cypress + Nginx container.
Also modifying the Gitlab CI to use local Nginx for proxying to API backend while running Cypress tests.
2020-05-12 19:59:36 +00:00
Abhinav Jha
a0872b97f2 Generate widgets from blueprint. Close previously open modals when showing a modal. Fix unicode page name issue in pagelist sidebar 2020-03-27 09:02:11 +00:00
Pushpa B
067fdc2dee Feature/cypress test 2020-03-10 09:38:12 +00:00
Satbir Singh
ab0007317e Added cypress for e2e tests. 2019-12-12 07:50:53 +00:00