Skip to content

feat: autoregister commands & add enableAutoLogin setup - #101

Merged
Mohammer5 merged 5 commits into
masterfrom
CLI-14_Autoregister_commands
Nov 25, 2020
Merged

feat: autoregister commands & add enableAutoLogin setup#101
Mohammer5 merged 5 commits into
masterfrom
CLI-14_Autoregister_commands

Conversation

@Mohammer5

@Mohammer5 Mohammer5 commented Nov 19, 2020

Copy link
Copy Markdown
Contributor

Fixes CLI-14

  • Autoregister all commands
  • Add enableAutoLogin setup helper
  • ~~Commit 33d7a6d (feat(login): add command to fill login form) is a bit questionable
    • REMOVED
    • Right now I'd prefer to not add a command for this at all
    • But I can see that some apps will have to fill in form data
    • We could either drop this command (by removing the commit) or keep it

@Mohammer5
Mohammer5 force-pushed the CLI-14_Autoregister_commands branch from 33d7a6d to 5b226ed Compare November 19, 2020 11:39
@Mohammer5
Mohammer5 marked this pull request as ready for review November 19, 2020 11:42
@Mohammer5
Mohammer5 force-pushed the CLI-14_Autoregister_commands branch from 5b226ed to d784580 Compare November 19, 2020 11:43
@Mohammer5
Mohammer5 requested a review from varl November 19, 2020 11:43
@Mohammer5 Mohammer5 changed the title refactor: autoregister commands feat: autoregister commands & add enableAutoLogin setup Nov 19, 2020
Comment thread packages/cypress-commands/src/commands/fillAndSubmitLoginForm.js Outdated
@Mohammer5
Mohammer5 force-pushed the CLI-14_Autoregister_commands branch from d784580 to ac373b0 Compare November 19, 2020 12:53
@Mohammer5
Mohammer5 requested review from a user and HendrikThePendric November 20, 2020 09:24
Comment thread packages/cypress-commands/src/index.js Outdated

@HendrikThePendric HendrikThePendric left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be very handy, great work! I've left a few comments in the code, most relate to the same thing so I'll also try to explain my general ideas below:

  • In my opinion, if possible, we should only have one login command and ideally this should be doing what is now loginBasicAuth, since that is independent of the app-platform login modal.
  • And besides that login command we should have the enableAutoLogin setup, which calls cy.login() in the before hook and in the beforeEach it preserves the cookie and localStorage item. Probably I would prefer a slightly different name, i.e. enablePersistedSession or sth.

Comment thread packages/cypress-commands/src/setups/enableAutoLogin.js Outdated
Comment thread packages/cypress-commands/src/index.js Outdated
Comment thread packages/cypress-commands/src/commands/fillAndSubmitLoginForm.js Outdated
Comment thread packages/cypress-commands/src/commands/login.js Outdated
Comment thread packages/cypress-commands/src/commands/login.js Outdated
@Mohammer5

Copy link
Copy Markdown
Contributor Author

@HendrikThePendric I've updated the login command, the setup file and the deprecation warning

@Mohammer5
Mohammer5 force-pushed the CLI-14_Autoregister_commands branch from d85e954 to 60cd25b Compare November 25, 2020 12:01

@HendrikThePendric HendrikThePendric left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing the points we discussed. Great work!

@Mohammer5
Mohammer5 force-pushed the CLI-14_Autoregister_commands branch from 09bdb04 to 0bbb8e9 Compare November 25, 2020 12:55
@Mohammer5
Mohammer5 merged commit bfd79c1 into master Nov 25, 2020
@Mohammer5
Mohammer5 deleted the CLI-14_Autoregister_commands branch November 25, 2020 13:00
@dhis2-bot

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 3.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants