This project enhances a fully functional Tech Quiz web application by integrating comprehensive Cypress testing. The goal is to ensure reliability and robustness through both component and end-to-end (E2E) tests.
The Tech Quiz app is built using the MERN stack, featuring:
- MongoDB for data storage
- Express.js and Node.js for the backend API
- React for the frontend
Users can take a quiz with 10 random tech-related questions and view their final score upon completion.
This project focuses on improving test coverage using Cypress, a powerful JavaScript testing framework.
- Cypress installed and configured as a dev dependency
- Cypress set up for both component and end-to-end testing
- A component test created for the
Quizcomponent - An end-to-end test simulating the full quiz experience
git clone https://github.com/your-username/tech-quiz.git
cd tech-quiznpm installnpm install cypress --save-devCypress has been configured for:
Cypress can directly test React components for rendering and logic behavior.
Cypress simulates a real user journey through the app, from starting the quiz to submitting answers and viewing the score.
To open the Cypress test runner:
npx cypress openUse the Cypress GUI to choose between component or E2E tests.
npm startnpm run servernpx cypress open<Quiz />
- Ensures correct rendering of questions
- Handles answer selection
- Updates and displays score appropriately
Simulates the full quiz-taking process:
- User starts the quiz
- Selects answers
- Submits quiz
- Views final score
tech-quiz/
├── client/
│ ├── src/
│ │ ├── components/
│ │ │ └── Quiz.js
│ │ └── ...
├── server/
│ └── ...
├── cypress/
│ ├── e2e/
│ └── component/
└── ...
This project is licensed under the MIT License.
Tate Sutter
Lawrence, KS
GitHub