Skip to content

Testing Guide

tye101 edited this page Dec 5, 2024 · 1 revision

Testing Guide for Academic Team Management

This guide provides instructions on how to test the Academic Team Management application to ensure the codebase is reliable, efficient, and meets expected standards. The testing process includes backend, frontend, and end-to-end (E2E) tests.


Prerequisites

Before running any tests, ensure you have the following installed and set up:

  1. Node.js
  2. Python
  3. Docker
  4. Cypress
  5. Ensure all dependencies are installed by running npm install or pip install as required.

Types of Tests

1. Backend Unit Tests

Backend unit tests verify the correctness of individual functions and endpoints in the server.

How to Run Backend Tests:

  1. Navigate to the server directory.
  2. Run the following command:
    pipenv run test-unit
  3. Check the console output for test results and ensure all tests pass.

*Ensure that Pipenv environment is set up correctly with command pipenv check. If this fails, ensure a Pipfile exists in the server directory and install dependencies: pipenv install.


2. Frontend Unit Tests

Frontend unit tests validate the behavior of React components and utility functions.

How to Run Frontend Tests:

  1. Navigate to the client directory.
  2. Run the following command:
    npm test
  3. Look for detailed results in the console or generated reports.

3. End-to-End (E2E) Tests

E2E tests simulate user interactions across the entire application to ensure workflows function as intended.

How to Run E2E Tests:

  1. Ensure both the backend and frontend are running:

    • Backend:
      ./gradlew runBackendLocally
    • Frontend:
      ./gradlew runFrontendLocally
  2. Run the E2E test suite with:

    npx cypress run

    or with opening a browser

    npx cypress open
  3. Review test logs for results and troubleshoot any failures.


Linting

Linting checks your code for style and syntax issues to maintain consistency.

Run the Linter:

npm run lint

Fix any reported issues to ensure your code adheres to standards.


Troubleshooting Common Issues

  1. Database Connection Errors:
    Ensure MongoDB is running before executing backend tests. Use the command:

    ./gradlew startMongo
  2. Environment Variable Issues:
    Ensure all required environment variables (like database credentials) are properly configured in the .env file.

  3. Missing Dependencies:
    Reinstall dependencies using the following commands:

    • For Node.js: npm install
    • For Python: pip install -r requirements.txt
    • For Cypress: npm install cypress --save-dev

Documentation and Resources

System Information and Architecture

Project Information from Client

DEVELOPMENT

Follow links for local development and helpful information.

Onboarding Material MUST READ!!! Essential information to get started with the project.

React App How to get started with web application project using Create React App.

Running Server

Testing Guide

Devops

Devops Release

ARCHIVE

Historical documents, do not need to read.

Documentation from 2024 Academic Management Team group.

Project Management

Wiki Home 2024

Meetings Info

First Semester Summary 2024

Second Semester Summary 2024

Documentation from 2023 Academic Management Team group.

Design

Devops

RELEASE

General

How to Create a Class List

Progress

Meetings

Updates

Project Management

Deliverables

Deliverable 1

Andre Pitch (Downloadable PDF)

Caroline Pitch (Downloadable PDF)

Laith Pitch (Downloadable PDF)

Deliverable 2

Changelog

The Bet - Meeting Minutes

Winning Pitch

Deliverable 3

Hill Charts

Scope Maps

Weekly Meetings

Clone this wiki locally