Skip to content

Conversation

chriscollins3456
Copy link
Collaborator

This is a POC of updating our cypress project to use typescript. This updates all of the scaffolding we need to change and creates a duplicate v2_home test but in typescript using a new method for keeping test functions clean and reusable - the class based approach.

Upgrading to typescript has a bunch of benefits:

  • type safety (obviously) will prevent us from writing bad or broken tests. Previously we could easily break things without knowing
  • type and definition hints when writing to more easily discover and understand what reusable commands we have
  • matches our expected coding with our frontend project

On top of this upgrade I mention adding new ways to modularize and organize our reusable cypress methods. check out HomePage.ts which exports a class we use for our v2_home.ts test. This method can be adapted and reused all over the place. We can consolidate methods into classes like Dataset.ts which includes all of the common dataset utilities (ie. go to dataset page, go to different tabs on a dataset, add tags in the sidebar etc.). With this we will be able to remove functions from our overly bloated commands.ts file which should only include high level system commands.

This is not changing anything more than what I mentioned. We will need to continue and iterate on making things easier to reuse and more understandable. This is a good start though.

@github-actions github-actions bot added the smoke_test Contains changes related to smoke tests label Apr 24, 2025
@datahub-cyborg datahub-cyborg bot added the needs-review Label for PRs that need review from a maintainer. label Apr 24, 2025
Copy link

codecov bot commented Apr 24, 2025

❌ We are unable to process any of the uploaded JUnit XML files. Please ensure your files are in the right format.

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

Labels

needs-review Label for PRs that need review from a maintainer. smoke_test Contains changes related to smoke tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant