The OrangeHRM Employee Photo Management System is a web-based application designed to manage employee photos, allowing users to add, edit, and delete photos. The system provides functionality for both employees and Human Resources (HR) teams to manage employee photos, as well as personal information like name, address, and social security details. The photos are stored in a configurable file structure and can be accessed by other systems within the company. This release includes only the photo management features and does not cover other HR data.
- Employee Login: Employees can log into the system using their credentials.
- HR Photo Management: HR staff can manage employee photos for all users in the system.
- Employee Photo Lists: Photos can be listed based on specific selection criteria.
- File System Integration: Photos are stored in a configurable file structure that can be accessed by other systems within the company.
- Python: Backend and test automation scripting.
- Selenium: WebDriver for automating interactions with the OrangeHRM web interface.
- pytest: Testing framework to run automated test cases.
- Pandas: For reading CSV data for login credentials.
- CSV: For storing login test data.
- Git: Version control for source code management.
- ChromeDriver: For automated browser interactions during testing.
AT-Project-1/
│
├── data/
│ └── login_data.csv # Login credentials data file for tests
│
├── pages/
│ ├── base_page.py # Base page object class with common methods
│ ├── login_page.py # Page object for login functionality
│ └── pim_page.py # Page object for PIM (Personal Information Management) module
│
├── tests/
│ ├── conftest.py # Pytest setup and screenshot capture logic
│ ├── test_login.py # Test cases for login functionality
│ └── test_pim.py # Test cases for PIM functionality (Add, Edit, Delete Employee)
│
└── utils/
└── result_writer.py # Utility to update test results in CSV files
To run the tests for the OrangeHRM Employee Photo Management System, use the following commands:
-
Login Test Cases:
- Valid and invalid login scenarios are defined in
test_login.py
. - The login credentials are fetched from the CSV file
data/login_data.csv
.
Run the login tests with:
pytest tests/test_login.py
- Valid and invalid login scenarios are defined in
-
PIM (Personal Information Management) Test Cases:
- Tests for adding, editing, and deleting employee records are in
test_pim.py
.
Run the PIM tests with:
pytest tests/test_pim.py
- Tests for adding, editing, and deleting employee records are in
Test results are updated in a CSV file using the update_test_result()
function defined in utils/result_writer.py
. The results are logged for each test case ID.
- Test Objective: Verify that an employee can successfully log into the OrangeHRM portal.
- Preconditions:
- Valid ESS-User account available.
- OrangeHRM site is launched in a compatible browser.
- Steps:
- Enter the username "Admin".
- Enter the password "admin123".
- Click the "Login" button.
- Expected Result: User is logged in successfully, and redirected to the dashboard.
- Test Objective: Verify that invalid login attempts show an appropriate error message.
- Preconditions:
- Valid ESS-User account available.
- OrangeHRM site is launched in a compatible browser.
- Steps:
- Enter the username "Admin".
- Enter an incorrect password "Invalid password".
- Click the "Login" button.
- Expected Result: An error message "Invalid credentials" is displayed.
- Test Objective: Verify that an HR can add a new employee to the system.
- Preconditions:
- Valid ESS-User account available.
- OrangeHRM site is launched in a compatible browser.
- Steps:
- Navigate to the PIM module.
- Click "Add" and enter employee details.
- Click "Save".
- Expected Result: The new employee is added successfully, and a success message is displayed.
- Test Objective: Verify that an HR can edit an existing employee's information.
- Preconditions:
- Valid ESS-User account available.
- OrangeHRM site is launched in a compatible browser.
- Steps:
- Navigate to the PIM module.
- Edit the employee's information.
- Save the changes.
- Expected Result: The employee details are updated, and a success message is displayed.
- Test Objective: Verify that an HR can delete an existing employee.
- Preconditions:
- Valid ESS-User account available.
- OrangeHRM site is launched in a compatible browser.
- Steps:
- Navigate to the PIM module.
- Select an employee to delete.
- Click "Delete" and confirm.
- Expected Result: The employee is deleted successfully, and a success message is displayed.
This repository provides a comprehensive implementation of the OrangeHRM Employee Photo Management System. It includes test cases for login functionality and employee management (PIM). Automation scripts using Selenium and pytest ensure the system works as expected.