## 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/4882041416Fixes#22007Fixes#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
Fixes#22878
This pr adds a flag called 'rapidMode' in cypress index file.
```
cypress/support/index.js
let rapidMode = {
enabled: false, // Set it to true to skip app creation during a test re-run
appName: "4a9b62a0", // Replace it with your app name
pageName: "page1", // Replace it with the page name
pageID: "644f8d6e21506c33a366854b", // Replace it with pageID
url: function () {
return `app/${this.appName}/${this.pageName}-${this.pageID}/edit`;
},
};
```
When rapid mode is enabled, the cypress test will
1. Skip relogin if the test user is already logged in.
2. Skip creation of a new app and use a previously created app, passed
as param.
The flag needs to be disabled when the code needs to be merged to
release, and is meant for debugging/testing while writing tests on local
development setup only.
When enabled, a cypress test saves around 25 sec per rerun.
Future fixes would include skipping multiple workspace page visit if a
developer is using dsl for setting up fixtures. It would save around
another 10-15 seconds per test re-run.
## Description
This adds the ability to select an option from the autocomplete
suggestions list using the `Tab` key while writing code. Earlier, users
could use only the `Enter` key to do so. All code editors support `Tab`
for autocomplete.
Fixes#20448
## Type of change
- New feature (non-breaking change which adds functionality)
## How Has This Been Tested?
- Cypress
### Test Plan
[Test Plan](https://github.com/appsmithorg/TestSmith/issues/2377)
### 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
- [ ] 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
Fixes#22537
- [x] check for test failures in CE & EE
- [ ] check for merge conflicts in EE (index.js)
## Description
cy command : `LoginFromAPI`
We were calling the login API as a XHR call and navigated to
`/applications` manually in cases where login has actually failed.
Login success & errors are now handled properly.
- Now it will behave like submitting a form.
(https://docs.cypress.io/api/commands/visit#Submit-a-form)
- Performs navigation to `/applications` automatically on login success.
- Performs navigation to `/login?error=true` automatically on login
failure.
- Added origin as a header.
## Media
Before: (navigates to /application even when login fails)
https://www.loom.com/share/086ef8c743ab460194b785a4d22e87cf
Now: (stops when login fails)
https://www.loom.com/share/cc78be2ee2944d0ab9f094f8fd709539
## Type of change
- Chore (housekeeping or task changes that don't impact user perception)
## How Has This Been Tested?
- Cypress
## 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
- [ ] 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
## Description
This PR upgrades Prettier to v2 + enforces TypeScript’s [`import
type`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export)
syntax where applicable. It’s submitted as a separate PR so we can merge
it easily.
As a part of this PR, we reformat the codebase heavily:
- add `import type` everywhere where it’s required, and
- re-format the code to account for Prettier 2’s breaking changes:
https://prettier.io/blog/2020/03/21/2.0.0.html#breaking-changes
This PR is submitted against `release` to make sure all new code by team
members will adhere to new formatting standards, and we’ll have fewer
conflicts when merging `bundle-optimizations` into `release`. (I’ll
merge `release` back into `bundle-optimizations` once this PR is
merged.)
### Why is this needed?
This PR is needed because, for the Lodash optimization from
7cbb12af88,
we need to use `import type`. Otherwise, `babel-plugin-lodash` complains
that `LoDashStatic` is not a lodash function.
However, just using `import type` in the current codebase will give you
this:
<img width="962" alt="Screenshot 2023-03-08 at 17 45 59"
src="https://user-images.githubusercontent.com/2953267/223775744-407afa0c-e8b9-44a1-90f9-b879348da57f.png">
That’s because Prettier 1 can’t parse `import type` at all. To parse it,
we need to upgrade to Prettier 2.
### Why enforce `import type`?
Apart from just enabling `import type` support, this PR enforces
specifying `import type` everywhere it’s needed. (Developers will get
immediate TypeScript and ESLint errors when they forget to do so.)
I’m doing this because I believe `import type` improves DX and makes
refactorings easier.
Let’s say you had a few imports like below. Can you tell which of these
imports will increase the bundle size? (Tip: it’s not all of them!)
```ts
// app/client/src/workers/Linting/utils.ts
import { Position } from "codemirror";
import { LintError as JSHintError, LintOptions } from "jshint";
import { get, isEmpty, isNumber, keys, last, set } from "lodash";
```
It’s pretty hard, right?
What about now?
```ts
// app/client/src/workers/Linting/utils.ts
import type { Position } from "codemirror";
import type { LintError as JSHintError, LintOptions } from "jshint";
import { get, isEmpty, isNumber, keys, last, set } from "lodash";
```
Now, it’s clear that only `lodash` will be bundled.
This helps developers to see which imports are problematic, but it
_also_ helps with refactorings. Now, if you want to see where
`codemirror` is bundled, you can just grep for `import \{.*\} from
"codemirror"` – and you won’t get any type-only imports.
This also helps (some) bundlers. Upon transpiling, TypeScript erases
type-only imports completely. In some environment (not ours), this makes
the bundle smaller, as the bundler doesn’t need to bundle type-only
imports anymore.
## Type of change
- Chore (housekeeping or task changes that don't impact user perception)
## How Has This Been Tested?
This was tested to not break the build.
### 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
- [ ] 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
- [ ] 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: Satish Gandham <hello@satishgandham.com>
Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
## Description
- Added test for appsmith upgrade
## Type of change
- Cypress
## How Has This Been Tested?
- Cypress
## 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
* Added test cases for appsmith upgrade
Added test cases for appsmith upgrade
* deleted extra commands
* add new workflow for upgrade scenarios
* updated the s3 details
* update command.js
* updated the work flows
* Removed the conflicting part with TED
* Update commands.js
* TED run command updated
* removed async calls
* added commands to start the v160
* updated few steps
* added debugging updtream step
* changed the paths
* dynamic port numbers
* dynamic port numbers
* removed the port numbers
* removed debug from the workflows
* increased timeout
* changed the path
* fixed the after all hook
* fixed the stop container
* Init commit clean urls
* Changes to builder route
* Refactored URLs
* Remove default params from url builder functions.
* Fixed more urls
* Changed selector name
* Minor url correction
* Type fixes
* Jest fixes
* Fixed routing for old published apps
* Fixed url slug replace
* page-1 -> page1 as default page slug name
* Remove application id from init editor calls
* Use default page slug
* Added comments and placeholder values for slug names
* variable rename
* Removed redirection and added back the old routes
* Prevent page slug name recompute
* Fixed home page load in view mode
* Added null checks
* Fixed jest test
* Fixed jest test
* Update URL slugs when app/page name changes
* Added unit tests and updates types
* Removed unused code
* * Removed duplication fetch page call.
* Fixes#11354
* Fixed sign up flow
* Refactored initializeEditorSaga
* Fixed warnings
* Fixed integrations screen URL bugs
* Cypress fixes
* Fixed slug names in copy/move operations and pages screen
* Minor refactor
* Fixed page highlight bug in published apps
* Added new url factory and middleware to store url params
* Changed store to default export and fix unit tests
* Fixed slugs unit test
* Minor fixes
* Fixes#11379
* Fixed set as home page feature
* Updated types
* app id adjustments for cypress
* Fixed bad merge
* Refactored routes to functional component
* * Fixed EE active entity highlight.
* Remove unused code in editor router.
* jest fix
* Mock history to prevent security errors
* constant rename
* Removed console logs
* Fixed page id regex
* Do not check for /pages in url
* Fixed missing pageId on quick edit/deploy clicks
* Missed files from previous commit
* Fixed warnings
* Fixed jest test
* New api integration
* feat: Add applicationVersion property to Application (#11626)
Added a new property to Application object - applicationVersion. This property can be used to identity when there is a breaking change and can not be solved with migration. FE will use this property to detect such conditions. Another API is added to migrate the applicationVersion to latest version when user migrates the breaking changes.
* Added manual upgrade modal.
* Test fix
* Fixed jest test
* function rename
* Fix deploy error
* Added null check
* Changes to persist URL search params when redirecting
* Added updates tooltip
* More unit test cases
* Fixed git url redirection
* Fix warning
* Fixed evaluation on upgrade
* Fixed warnings
* File rename
* Added cypress for clean urls
* Fixed import/export/fork cypress
* Cypress api server fixes
* Fixed mongo spec
* Fixed replay spec
* Fixed comments spec
* More cypress fixes
* Fixed tooltip in update btn
* Text size changes
* Minor fixes
* Jest test fix
* Fixed type error
* Fixed warnings
* Fixed todo comments
* Moved description to constants file
* Fixed cypress CI run crash
* Fixes git cypress failures
* Import/Export cypress test fixes
* Import export fork cypress fixes
* Explorer test fix
* Switch branch test fix
* Added applicationVersion in export app json
* Calls plugin forms in parallel
* Fixed warnings
* Fixed warning
* Import export CI fixes
* Reverts previous changes
* Fixes import export
* Fixed import export cypress URL verification
* Pass applicationVersion when duplicating application
* Cypress fix
* Dummy commit
Co-authored-by: Nayan <nayan@appsmith.com>
* refactor admin settings feature
* separated save-restart bar to separate component
* created new CE dir to facilitate code split
* created separate ee dir and exporting everything we have in ce file.
* little mod
* minor fix
* splitting settings types config
* using object literals for category types instead of enums
* CE: support use of component for each category
* minor style fix
* authentication page UI changes implemented
* github signup doc url added back
* removed comments
* routing updates
* made subcategories listing in left pane optional
* added muted saml to auth listing
* added breadcrumbs and enabled button
* created separate component for auth page and auth config
* added callout and disconnect components
* updated breadcrumbs component
* minor updates to common components
* updated warning callout and added icon
* ce: test cases fixed
* updated test file name
* warning banner callout added on auth page
* updated callout banner for form login
* CE: Split config files
* CE: moved the window declaration in EE file as its dependency will be updated in EE
* CE: Splitting ApiConstants and SocialLogin constants
* CE: split login page
* CE: moved getSocialLoginButtonProps func to EE file as it's dependencies will be updated in EE
* added key icon
* CE: created a factory class to share social auths list
* Minor style fix for social btns
* Updated the third party auth styles
* Small fixes to styling
* ce: splitting forms constants
* breadcrumbs implemented for all pages in admin settings
* Settings breadcrumbs separated
* splitted settings breadcrumbs between ce and ee
* renamed default import
* minor style fix
* added login form config.
* updated login/signup pages to use form login disabled config
* removed common functionality outside
* implemented breadcrumb component from scratch without using blueprint
* removed unwanted code
* Small style update
* updated breadcrumb categories file name and breadcrumb icon
* added cypress tests for admin settings auth page
* added comments
* update locator for upgrade button
* added link for intercom on upgrade button
* removed unnecessary file
* minor style fix
* style fix for auth option cards
* split messages constant
* fixed imports for message constants splitting.
* added message constants
* updated unit test cases
* fixed messages import in cypress index
* fixed messages import again, cypress fails to read re-exported objs.
* added OIDC auth method on authentication page
* updated import statements from ee to @appsmith
* removed dead code
* updated read more link UI
* PR comments fixes
* some UI fixes
* used color and fonts from theme
* fixed some imports
* fixed some imports
* removed warning imports
* updated OIDC logo and auth method desc copies
* css changes
* css changes
* css changes
* updated cypress test for breadcrumb
* moved callout component to ads as calloutv2
* UI changes for form fields
* updated css for spacing between form fields
* added sub-text on auth pages
* added active class for breadcrumb item
* added config for disable signup toggle and fixed UI issues of restart banner
* fixed admin settings page bugs
* assigned true as default state for signup
* fixed messages import statements
* updated code for PR comments related suggestions
* reverted file path change in cypress support
* updated cypress test
* updated cypress test
Co-authored-by: Ankita Kinger <ankita@appsmith.com>
* Rearrange data tree widget factory
* Remove existing handling of default value override
* Altternate way of meta property override
* Fix tests
Co-authored-by: hetunandu <hetu@appsmith.com>
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/
The current push for fixing tests in the new ACL flow.
1. New way to handle create application.
2. API login
3. Removed redundant tests.
4. Fixed Issues wrt ACL changes
added below tests
* API verb tests added ( POST /PUT/PATCH)
* Query param tests (This is also includes invalid and valid)
* Edit APIs( update of api name and api datasource as well)
* mustache API test
* Market Place API test
* Curl POST test