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

Configure tests for deploy web #162

Open
4 tasks
ygrishajev opened this issue Apr 15, 2024 · 0 comments
Open
4 tasks

Configure tests for deploy web #162

ygrishajev opened this issue Apr 15, 2024 · 0 comments
Labels
P2 priority 2 feature/ enhancement tech-debt Technical debt

Comments

@ygrishajev
Copy link
Collaborator

Objective

Implement a comprehensive testing setup for our Next.js project using Jest for unit tests and a choice between Cypress and Playwright for functional tests. The selected tool for functional testing, along with the Jest unit tests, must be integrated into our Continuous Integration (CI) pipeline to ensure that every push and pull request is verified before merging.

Requirements

  1. Jest Setup

    • Task: Set up Jest to handle unit testing for the project.
    • Details: Configure Jest to work with Next.js, ensuring that it can handle both JavaScript and TypeScript files. Set up Babel if necessary for Jest to properly process ES6 and JSX syntax.
    • Acceptance Criteria:
      • Jest is able to execute tests on all components and utility functions.
      • Ensure Jest configuration handles Next.js peculiarities, such as custom Babel configurations and environment variables.
  2. Choice of Functional Testing Framework

    • Task: Choose between Cypress and Playwright for conducting functional testing.
    • Details:
      • Cypress: Set up Cypress to test the application's end-to-end functionality in a simulated browser environment, covering critical user flows and interactions.
      • Playwright: Configure Playwright to automate browser-based tests, focusing on robust scenario testing across multiple browsers.
    • Acceptance Criteria:
      • The chosen framework thoroughly tests major interactive components and pages.
      • The testing environment is configured to mimic production settings as closely as possible.
    • Decision Factors:
      • Cypress is renowned for its ease of use and rich documentation but is limited to fewer browsers.
      • Playwright offers testing across a wider range of browsers and is known for its speed and reliability in automation.
  3. CI Integration

    • Task: Integrate both Jest and the chosen functional testing framework into the CI pipeline.
    • Details: Ensure that both testing frameworks are run automatically when code is pushed to the repository or when a pull request is made. This might require setting up appropriate actions or scripts in your CI tool (e.g., GitHub Actions).
    • Acceptance Criteria:
      • Jest and the selected functional testing framework are triggered on every push to the main branch and on every pull request.
      • CI pipeline should fail if any test fails, preventing merging of failing code.

Additional Notes

  • Make sure to provide documentation in the repository on how to run tests locally.
  • Consider caching dependencies and test results in the CI to speed up the test runs.
  • Ensure that all test configurations and dependencies are clearly documented in the package.json or respective configuration files.

This task is crucial for maintaining high code quality and ensuring that new features and changes do not break existing functionality. By integrating these tests into our CI pipeline, we can automate the verification of code health with every change.

  • Setup unit test
  • Run unit tests in CI
  • Setup functional browser tests
  • Run functional browser tests in CI
@ygrishajev ygrishajev added the tech-debt Technical debt label Apr 17, 2024
@baktun14 baktun14 added the P2 priority 2 feature/ enhancement label Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 priority 2 feature/ enhancement tech-debt Technical debt
Projects
Status: Backlog (not prioritized)
Development

No branches or pull requests

2 participants