PromucFlow_constructor/app/client/cypress/support
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
..
Objects fix: Error navigation blockers (#22291) 2023-04-12 22:38:55 +05:30
Pages fix: Table Widget property to specify if prev or next buttons were pressed (#21712) 2023-04-13 15:38:46 +05:30
AdminSettingsCommands.js
ApiCommands.js
commands.js test: handle login success & errors properly (#22524) 2023-04-19 15:20:54 +05:30
Constants.js
dataSourceCommands.js feat: Error Navigation (#21753) 2023-04-10 18:29:14 +05:30
gitSync.js
index.js test: handle login success & errors properly (#22524) 2023-04-19 15:20:54 +05:30
queryCommands.js
themeCommands.js
timeout.js
widgetCommands.js fix: List v2 child widgets event defined with action selector (#22418) 2023-04-17 11:52:01 +05:30
WorkspaceCommands.js