Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: remove cli util, update cypress to v12 & small conceptual adjustments #393

Merged
merged 32 commits into from
Apr 27, 2023

Conversation

Mohammer5
Copy link
Contributor

@Mohammer5 Mohammer5 commented Mar 27, 2023

  • No more cy.login (now there's a cy.fillInLoginForm command which can be used together with cy.session)
  • The d2-cli-cypress tool is gone, it's not needed anymore (it is actually still there (the install command), but does nothing; as discussed with @HendrikThePendric)
  • The commands & plugins libraries now have updated/correct peer dependencies
  • Example apps now use cypress@12 & the latest versions of the commands / plugins
  • Docs have been updated

How to review this PR

There are several things that should be checked:

  • Read the docs and ensure they're correct & understandable. I've changed quite a bit and I'd like the docs to be as good as possible. If there's something unclear, e.g. some context is missing, please let me know. In this case, too much is better than too little information.
  • Ideally you use an app that has cypress test and follow the upgrade guide of the docs. That should ensure that the docs are complete & correct as well as that the libraries work as intended
  • Repeat the steps I've listed below, under "How to test"
  • Check if the d2-utils-cypress install command does nothing, just informing the user that the command is not supported anymore

How to test

Example apps

  • Check out this branch and install dependencies
  • Run yarn test:examples (will start the example apps & run cypress tests, which includes both capturing and stubbing in the example app that uses the network shim)

Real app

  • Check out this branch and install dependencies
  • Build the commands library (yarn workspace @dhis2/cypress-commands build)
  • Link the commands & plugins libraries (yarn workspace @dhis2/cypress-commands link && yarn workspace @dhis2/cypress-plugins link)
  • Check out the upgrade-cypress-to-v12 branch of the aggregate data entry app (related PR: chore: update cypress to v12 and upgrade related configs & code aggregate-data-entry-app#319)
  • Add the linked dependencies (yarn link @dhis2/cypress-plugins @dhis2/cypress-commands)
  • Start the aggregate data entry app (yarn cypress:start)
  • Play around with the UI (yarn cypress:open:live) and/or capturing/stubbing network requests (yarn cypress:run:capture && yarn cypress:run:stub)

HendrikThePendric and others added 19 commits December 7, 2022 14:26
BREAKING CHANGE: cypress 12 uses a different naming scheme for folders, files and extensions
BREAKING CHANGE: This removes the `d2-utils-cypress` cli tool!

Reason for this being a fix, see: https://stackoverflow.com/a/55213921/1319140
I'd agree that this is actually removing something we could consider a
"conceptual bug", because this kind of stuff shouldn't really be there
in the first place.

Removing the code that's been deleted allows us to better educate
developers how to use cypress the way we thing it works best within our
environment without hiding/wrapping any of cypress' functionality and
instead making developers learn how to use vanilla cypress.
Copy link
Contributor

@HendrikThePendric HendrikThePendric left a comment

Choose a reason for hiding this comment

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

This is great stuff! There are a few points we need to discuss in the comments. And I also wonder how we should deal with removing a package. Probably we need to make sure we mention on NPM that it is deprecated.

@Mohammer5 Mohammer5 merged commit 855e259 into master Apr 27, 2023
@Mohammer5 Mohammer5 deleted the chore/update-cypress-jgs branch April 27, 2023 08:04
dhis2-bot added a commit that referenced this pull request Apr 27, 2023
# [10.0.0](v9.0.2...v10.0.0) (2023-04-27)

### Features

* remove cli util, update cypress to v12 & small conceptual adjustments ([#393](#393)) ([855e259](855e259))

### BREAKING CHANGES

* cypress 12 uses a different naming scheme for folders, files and extensions
* This removes the `d2-utils-cypress` cli tool!

Co-authored-by: Hendrik de Graaf <hendrik@dhis2.org>
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 10.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@Mohammer5 Mohammer5 mentioned this pull request May 3, 2023
3 tasks
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants