PromucFlow_constructor/app/client/cypress/integration/Regression_TestSuite/ClientSideTests
Anand Srinivasan 9af64f7310
test: handle login success & errors properly (#22524)
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
2023-04-19 15:20:54 +05:30
..
ActionExecution feat: Action selector (#21582) 2023-04-06 22:19:12 +05:30
AdminSettings test: handle login success & errors properly (#22524) 2023-04-19 15:20:54 +05:30
AppNavigation fix: Combine app navigation tests where possible to reduce Cypress cloud costs (#21868) 2023-03-29 18:37:07 +05:30
AuditLogs test: handle login success & errors properly (#22524) 2023-04-19 15:20:54 +05:30
Autocomplete fix: Autocomplete doesn't show up in square brackets when the identifier has invalid characters (#22134) 2023-04-17 13:43:45 +05:30
Binding test: Cypress - Flaky test fix (#22130) 2023-04-18 14:43:28 +05:30
Branding test: handle login success & errors properly (#22524) 2023-04-19 15:20:54 +05:30
BugTests fix: Error navigation blockers (#22291) 2023-04-12 22:38:55 +05:30
CodeComment chore: upgrade to prettier v2 + enforce import types (#21013)Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com> 2023-03-16 17:11:47 +05:30
DynamicHeight feat: Action selector (#21582) 2023-04-06 22:19:12 +05:30
EmbedSettings feat: Improved App Navigation (#19312) 2023-03-23 17:11:58 +05:30
ExplorerTests test: handle login success & errors properly (#22524) 2023-04-19 15:20:54 +05:30
FormNativeToRawTests chore: upgrade to prettier v2 + enforce import types (#21013)Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com> 2023-03-16 17:11:47 +05:30
Git fix: [Git] Avoid 404 when checking out a branch (#21894) 2023-04-04 10:29:00 +05:30
Github test: handle login success & errors properly (#22524) 2023-04-19 15:20:54 +05:30
Google test: handle login success & errors properly (#22524) 2023-04-19 15:20:54 +05:30
IDE fix: Maintain focus on editor when Escape is pressed with autocomplete menu open (#22164) 2023-04-14 12:11:47 +05:30
JSLibrary fix: JSPDF output API crash (#20544) 2023-02-10 13:13:22 +05:30
JSObject feat: JSObject variable as a state (JSObject variable mutation) (#19926) 2023-04-07 13:11:36 +05:30
Linting test: Cypress - Flaky fix (#22263) 2023-04-12 00:34:32 +05:30
MobileResponsiveTests test: Tests for auto conversion and mobile viewport (#21931) 2023-04-14 17:03:50 +05:30
Onboarding feat: Error Navigation (#21753) 2023-04-10 18:29:14 +05:30
OtherUIFeatures feat: Error Navigation (#21753) 2023-04-10 18:29:14 +05:30
PeekOverlay chore: upgrade to prettier v2 + enforce import types (#21013)Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com> 2023-03-16 17:11:47 +05:30
PropertyPane test: Cypress - Updating to TED Random api (#21615) 2023-03-22 01:22:39 +05:30
Refactoring test: Cypress - Automated basic tests for MsSQL DS (#21446) 2023-03-16 23:58:32 +05:30
SettingsPane test: Flaky test fix (#21120) 2023-03-05 08:52:42 +05:30
Templates feat: Adds tooltip to reconnect datasources list. (#22083) 2023-04-18 19:06:38 +05:30
ThemingTests feat: self host google fonts (#22129) 2023-04-13 18:48:37 +05:30
VisualTests feat: Auto indent and save code on pressing Ctrl/Cmd + S (#22176) 2023-04-16 18:21:32 +05:30
Widgets fix: JSONForm multiselect field with invalid option crash (#22510) 2023-04-19 15:11:03 +05:30
Workspace test: handle login success & errors properly (#22524) 2023-04-19 15:20:54 +05:30