Skip to content

Latest commit

 

History

History
107 lines (85 loc) · 3.43 KB

File metadata and controls

107 lines (85 loc) · 3.43 KB

Test Plan

This document outlines the test strategy, tools, and execution flow for the express-react-fullstack application.

📌 Test Types & Coverage

1️⃣ Unit Tests

  • Scope: Test isolated utility functions, specifically assembleUserState logic.

  • Tooling: mocha, chai

  • Location: test/BackendTestingFolder/unit.test.js

  • Focus:

    • User session state assembly.
    • Correct retrieval of user tasks, groups, users, and comments.
  • Run Command:

    npm run test-backend
  • Success Criteria:

    • All utility functions produce correct output.
    • Data integrity in user state assembly is verified.

2️⃣ Integration Tests

  • Scope: Verify API routes and DB interactions.

  • Tooling: mocha, chai, supertest

  • Location:

    • test/BackendTestingFolder/integrate.test.js
    • test/BackendTestingFolder/mongoMemory.test.js
  • Focus:

    • Create and authenticate users.
    • Create, update tasks.
    • DB consistency between real MongoDB and in-memory DB.
  • Run Command:

    npm run test-backend
  • Success Criteria:

    • API endpoints return correct HTTP status and response payloads.
    • Database reflects expected changes.

3️⃣ Frontend Selenium Tests

  • Scope: Browser automation simulating user actions.

  • Tooling: selenium-webdriver, mocha, chai

  • Location: test/FrontendTestingFolder/selenium.test.mjs

  • Focus:

    • Sign up new user.
    • Login user.
    • Verify redirection to dashboard.
    • Capture screenshots during each step.
  • Run Command:

    npm run test-frontend
  • Success Criteria:

    • Navigation flow succeeds without errors.
    • Screenshots captured at key milestones.
    • URLs match expected paths.

4️⃣ Load Testing

  • Scope: Validate system performance under load.

  • Tooling: k6

  • Location: test/PerformanceTestingFolder/load_test.js

  • Focus:

    • Load test user creation, authentication, task/comment operations.
    • Assess response codes and basic response validation.
  • Run Command:

    k6 run test/PerformanceTestingFolder/load_test.js
  • Success Criteria:

    • APIs handle increasing load without failure.
    • Response times stay within acceptable limits.

Test Execution Flow

1️⃣ Run backend unit and integration tests - npm run test-backend

2️⃣ Run frontend Selenium E2E tests - npm run test-frontend

3️⃣ Run load tests - k6 run test/PerformanceTestingFolder/load_test.js

🌍 Environment Notes

  • Real DB Integration: Run npm run server
  • Memory DB Integration: Run npm run server-memory
  • Dev mode (for Selenium): Run npm run start-dev

📂 File Locations

Test Type File Path
Unit test/BackendTestingFolder/unit.test.js
Integration test/BackendTestingFolder/integrate.test.js
Integration (Memory) test/BackendTestingFolder/mongoMemory.test.js
Frontend E2E test/FrontendTestingFolder/selenium.test.mjs
Load Test test/PerformanceTestingFolder/load_test.js

Summary

This test plan ensures the correctness, resilience, and performance of express-react-fullstack through comprehensive unit, integration, E2E, and load tests using a modern JS testing stack.