Files
MSE-SoftwEng/web-app/test.md
fastium e436eb354b test(webapp): provide tests in CI
- add url and page as env variables to choice where to test and update the others
- To pass a variable to a job's service, they have to be declared in the "variables" global -> doesn't work (see: [#37])
- use of the deployed image to do E2E test instead of services of gitlab
2025-06-24 17:33:41 +02:00

44 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# End-to-End and Unit Testing Documentation for Home Monitor
## Test Description
The Home Monitor project uses Cypress to automate both End-to-End (E2E) and unit tests. These tests ensure that the main features of the application work correctly, both from the users and the developers perspectives.
### Types of Tests
- **End-to-End (E2E) Tests**: Simulate real user behavior on the web interface. They check critical user flows, data display, error handling, and the responsiveness of the application.
- **Unit Tests**: Verify the correct functioning of JavaScript/TypeScript components and functions in isolation.
### Test Structure
- E2E tests are located in `web-app/cypress/e2e/`
- Unit tests are located in `web-app/cypress/unit/`
- Custom commands and global setup are in `web-app/cypress/support/`
- Cypress configuration is in `web-app/cypress.config.ts`
### Example Scenarios Covered
- Application loading and display of main sections
- Control panel functionality (buttons, filters)
- User, room, and device selection
- Display and update of measurement charts
- Handling of error or empty data states
- Responsive layout for mobile and desktop
## How to Run the Tests
### Prerequisites
- Node.js (v14+)
- npm or yarn
- Chrome browser
### Install Dependencies
```bash
cd project-softweng/web-app
npm install
```
### Run unit Tests