Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Implement e2e Test for Frontend Coverage #1734

Open
craigyu opened this issue Jan 21, 2025 · 0 comments
Open

Implement e2e Test for Frontend Coverage #1734

craigyu opened this issue Jan 21, 2025 · 0 comments

Comments

@craigyu
Copy link
Collaborator

craigyu commented Jan 21, 2025

Description:

The FAM frontend unit tests were removed during a major refactoring. The team decided to transition to e2e tests for their efficiency and maintainability, as they provide broader coverage with less code.

This issue aims to restore automated frontend testing to integrate it into the CI/CD pipeline and align with organizational standards.

Tools to Consider:

  • Cypress
    Currently used by Team Evergreen and Team Alliance, Cypress is a familiar choice but has known issues with flakiness and slower test execution.
  • Playwright
    According to the internet, on average, teams using Playwright reportedly experience fewer flaky tests. It is worth exploring, given the importance of reliable tests. A comparison article is available here.
  • Others
    Tools like Selenium or other alternatives could also be considered but may require further evaluation to fit team needs.

e2e Testing setup:

Another important consideration is the need for an e2e testing environment. Since e2e tests interact with the endpoint directly, they will perform CRUD operations on the database. This can result in an accumulation of test data over time, leading to maintenance challenges.

While we could delete test data at the end of each run, this approach is harder to manage and does not scale well. A more robust solution is to start backend servers connected to a newly created test database, which we already have available. Tools like start-server-and-test can help facilitate this setup, though other options may also be worth exploring.

Alternatively, we could intercept endpoint calls and return mock data to prevent CRUD operations on the database. However, I personally believe this defeats the purpose of e2e testing, as it requires more coding effort and doesn't fully test the "end-to-end" process. Team Evergreen attempted this approach but reverted to directly interacting with the backend due to similar concerns.


Acceptance Criteria:

  • Research the advantages and disadvantages of Cypress and Playwright (or other tools) for e2e testing, considering our team's context.
  • Investigate the feasibility of setting up a dedicated e2e testing environment, including backend servers and test database usage.
  • Explore the implications of intercepting endpoint calls versus directly interacting with the backend during tests.
  • Deliver a plan for implementing e2e tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant