Skip to content

Latest commit

 

History

History
148 lines (117 loc) · 4.46 KB

File metadata and controls

148 lines (117 loc) · 4.46 KB

HelpDesk API test plan

Document version 1.0.6

Introduction

The HelpDesk API test plan contains information on tests, which are run during the development phase of the project.

In Scope

The project's tests are unit and integration tests. Completed tests are noted with ✔, while the pending ones are noted with ⌛.

Unit tests

Focus is placed on the validation rules of the Mongoose schemas. The tests include both positive and negative scenarios. In the case of the negative scenarios, the tests aim to break the validation rules and trigger specific validation messages. They involve the following directories and files:

└── src
    ├── models
    │   ├── employee.model.js
    │   ├── role.model.js
    │   ├── ticket.model.js
    │   └── user.model.js
    └── resources
        ├── employeeValidationMessages.js
        ├── responseMessages.js
        ├── roleValidationMessages.js
        ├── ticketValidationMessages.js
        ├── userValidationMessages.js
        └── validationRegExp.js

Tests are conducted per model:

  • User model [✔],
  • Employee model [✔],
  • Ticket model [✔],
  • Role model [✔]

Integration tests

Backend integration test(s)

The tests are meant to check the integration of backend directories and files. Focus is placed on the Express middleware and the responses generated by the controllers. They involve the following directories and files:

└── src
    ├── controllers
    │   ├── employee.controller.js
    │   ├── role.controller.js
    │   ├── ticket.controller.js
    │   └── user.controller.js
    ├── middleware
    │   ├── employeeValidationRules.js
    │   ├── roleValidationRules.js
    │   ├── ticketValidationRules.js
    │   └── userValidationRules.js
    ├── models
    │   ├── employee.model.js
    │   ├── role.model.js
    │   ├── ticket.model.js
    │   └── user.model.js
    └── resources
        ├── employeeValidationMessages.js
        ├── responseMessages.js
        ├── roleValidationMessages.js
        ├── ticketValidationMessages.js
        ├── userValidationMessages.js
        └── validationRegExp.js

The tests are conducted per operation:

  • User registration [✔],
  • Employee registration [✔],
  • Employee info update [✔],
  • Employee info deletion [✔]
  • Employee retrieval by email [✔],
  • Employee retrieval by SSN [✔],
  • Retrieval of employees by city [✔]
  • Retrieval of employees by department [✔]
  • Retrieval of employees by title [✔]
  • Ticket retrieval by ID [✔],
  • Retrieval of tickets by username [✔],
  • Ticket addition [✔],
  • Ticket update [✔],
  • Ticket deletion [✔]
  • Role creation [✔],
  • Role update [✔],
  • Role deletion [✔]

Auth logic integration test(s)

In authentication-related tests, focus is placed in the auth directory and the files it contains:

└── src
    └── auth
        ├── authController.js
        ├── authResponseMessages.js
        └── authValidationRules.js

The tests are executed per login outcome. Separate tests are also included for web token verification:

  • Successful user login [✔],
  • Failed user login [✔],
  • Web token verification for admin users [✔],
  • Web token verification for assistant users [✔],
  • Web token verification for general users [✔].

Database integration test(s)

The integration between the backend (middleware + controllers) and the MongoDB database is the main theme for these tests. Since middleware and controller behavior has already been tested to a large extend, focus will be placed on limited operations per collection.

  • users collection
    • auth processing:
      • user log in [✔]
  • employees collection
    • employee processing:
      • employee added [✔],
      • employee info updated [✔],
      • employee info deleted [✔]
  • tickets collection
    • ticket processing:
      • ticket added [✔],
      • ticket updated [✔],
      • ticket deleted [✔]
  • roles collection
    • role processing:
      • role added [✔],
      • role updated [✔],
      • role deleted [✔]

Out of scope

The HelpDesk API is a backend project, therefore any tests referring to the frontend are excluded.

Assumptions

The backend implementation is ongoing.

Environments + Tools

  • Mongoose,
  • express-validator,
  • Jasmine.