This project implements a Page Object Model (POM) structure for automated testing of the GUVI.
Website Link: https://www.guvi.in/
The objective of this project is to implement an automated testing framework for the GUVI web application using Python Selenium. The primary goals are to:
- Validate Functionalities: Ensure the core functionalities of the GUVI platform (such as navigation, login, and sign-up processes) work as expected.
- Improve Test Maintenance: Utilize a structured approach to separate web page interaction logic from test scripts, making it easier to maintain and extend as the application evolves.
- Enhance Test Reusability: Promote reusability of code for interactions with page elements, reducing duplication across test scripts.
- Support Data-Driven Testing: Leverage test data (stored in TestData/data.py) to run multiple test scenarios with different input sets to verify robustness and edge case handling.
- Increase Test Coverage: Automate critical paths such as user authentication, button functionality, and error handling to ensure high test coverage across essential user flows.
- Ensure Browser Compatibility: Run tests across multiple browsers (e.g., Chrome, Firefox, Edge, Safari) to validate cross-browser compatibility and identify potential issues.
- Enable Continuous Testing: Integrate with continuous integration (CI) tools to run tests automatically, ensuring that new changes do not introduce regressions or break existing functionality.
By achieving these objectives, this project aims to create a robust, maintainable, and scalable test automation framework for the GUVI platform.
- Validate whether the URL
https://www.guvi.in
is accessible.
- Verify whether the title of the webpage is
Guvi | Learn to code in your native language
.
- Check whether the Login button is visible.
- Verify whether the Login button is clickable.
- Check whether the Sign-Up button is visible.
- Verify whether the Sign-Up button is clickable.
- Click on the Sign-Up button and navigate to the URL
https://www.guvi.in/sign-in/
to confirm the page exists.
- Log in to your Guvi account using valid email and password credentials to verify successful login.
- Log out from your Guvi account and verify the operation.
- Attempt to log in to your Guvi account using invalid email and password credentials and capture the error message.
- Page Object Model (POM): Separation of test logic and UI interactions. Each web page has its own corresponding class that defines methods for interacting with the elements on that page.
- Pytest Framework: Used to manage test cases, execute tests, and generate detailed reports.
- Reusable Components: Common actions like login, navigating to sections, and performing shutdown operations are encapsulated in reusable methods, improving maintainability.
- Cross-Platform Compatibility: The framework can be run across different environments, supporting different operating systems and web browsers.
- Automation and Reporting: Automation of repetitive tests with detailed reports on test results, making it easier to monitor and debug test executions.
- Programming Language: Python
- Test Framework: pytest
- Automation Tool: Selenium WebDriver
- Reporting: pytest-html
- Browser Compatibility: Microsoft Edge, Google Chrome, Mozilla Firefox, Safari
- CI/CD Integration: GitHub Actions
To set up and run this project locally, follow these steps:
-
Clone the Repository:
git clone https://github.com/imranc07/Mini_Project_1.git cd Mini_Project_1
-
Create a Virtual Environment (optional but recommended):
python3 -m venv env source env/bin/activate # For Windows, use `env\Scripts\activate`
-
Install Dependencies:
pip install -r requirements.txt
-
Set Up Environment Variables:
- Create a
.env
file in the root directory to store sensitive information such as login credentials and URLs. Example:BASE_URL=https://example.com USER_EMAIL=test@example.com USER_PASSWORD=yourpassword
- Create a
To execute tests, use the following commands:
-
Run All Tests:
pytest
-
Generate HTML Report:
pytest --html=Reports/test_report.html
-
Run Tests by Marker (e.g., only "login" tests):
pytest TestScripts/test_HomePage.py::test_guvi_url
-
Headless Browser Execution:
- You can set up tests to run in Headless mode directly in your test script.
Mini_Project_1/
│
├── PageObjects/ # Contains Page Object Models GUVI Web applications
│ ├── HomePage.py # Handles methods and elements
│
├── Reports/ # Contains HTML reports
│ ├── test_report.html # HTML reports generated by pytest
│
├── TestData/ # Stores test data for the test cases
│ ├── data.py # Contains reusable test data
│
├── TestLocators/ # Stores locators for web elements
│ ├── locators.py # Contains locators for all web elements used in the tests
│
├── TestScripts/ # Contains all test cases
│ ├── test_HomePage.py # Test cases for GUVI Web application
│
├── requirements.txt # Lists project dependencies
│
└── README.md # Project documentation
This project is open-source and available under the "MIT License".
```
Feel free to adjust the content based on your specific project setup!
```