https://github.com/paulohenr96/opencart
Automated Tests for the OpenCart E-Commerce
https://github.com/paulohenr96/opencart
automated-testing selenium selenium-java
Last synced: about 1 year ago
JSON representation
Automated Tests for the OpenCart E-Commerce
- Host: GitHub
- URL: https://github.com/paulohenr96/opencart
- Owner: paulohenr96
- Created: 2025-01-31T21:40:23.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-03T18:55:48.000Z (about 1 year ago)
- Last Synced: 2025-04-03T19:38:56.552Z (about 1 year ago)
- Topics: automated-testing, selenium, selenium-java
- Language: HTML
- Homepage:
- Size: 1.55 MB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ๐ Automated Testing OpenCart (v4.1.0.0) E-Commerce
## ๐ฏ Objective
- Implement automated tests for the OpenCart E-Commerce platform.
- The OpenCart application is tested locally (a demo is hosted [here](https://demo.opencart.com/)).
## ๐ Technologies Used
- **Eclipse** - IDE for Java development
- **Java** - Programming language
- **Maven** - Build and dependency management tool
- **Selenium** - Web automation framework
- **TestNG** - Testing framework for Java
## ๐ ๏ธ Installing OpenCart
To download and set up OpenCart locally, visit the official [download page](https://www.opencart.com/index.php?route=cms/download).
## โถ๏ธ Running the Project
1. **Install Java**: Download and install [Java](https://www.oracle.com/br/java/technologies/downloads/#java21).
2. **Install Maven**: Download and install [Maven](https://maven.apache.org/download.cgi).
3. **Configure OpenCart URL**:
- Edit the `config.properties` file located at `src/test/resources`.
- Set the `appURL` variable with your OpenCart URL.
4. **Run Tests**:
- Navigate to the project's root folder and execute:
```sh
mvn test
```
5. **View Test Reports**:
- Test reports are generated inside the `reports` folder.
## ๐ง Jenkins Integration
1. Download and install [Jenkins](https://www.jenkins.io/download/).
2. Create a **Multibranch Pipeline** project.
3. Select the `Jenkinsfile` for test execution automation.
## ๐ Selenium Grid Setup
### ๐ Configuration Properties
Before running the Selenium Grid setup, update the following variables:
```properties
appURL=http://host.docker.internal/opencart/upload # Ensure OpenCart is running locally on this URL
host=docker
execution_env=remote
os=linux
```
### โถ๏ธ Running Selenium Grid
The `docker-compose.yml` file includes images for `selenium-hub`, `selenium/chrome`, and `selenium/firefox`.
To start Selenium Grid, run:
```sh
docker-compose up
```
### ๐ Running Tests on Selenium Grid
Once Selenium Grid is running, execute the tests using Maven:
```sh
mvn test
```
## ๐งช Test Cases
| Test Case ID | Description | Steps |
|--------------|----------------------------------------------------------------|-----------------------------------------------------------------------------------------|
| **TC01** | Add product to cart from product list | 1. Create a user
2. Add a product to the cart |
| **TC02** | Add product to wishlist | 1. Create a user
2. Add a product to the wishlist |
| **TC03** | Register a new account | 1. Create a user |
| **TC04** | Attempt registration without accepting privacy policy | 1. Try creating an account without agreeing to the privacy policy |
| **TC05** | Attempt login with empty fields | 1. Try logging in without entering any credentials |
| **TC06** | Attempt login with invalid email | 1. Enter an invalid email and attempt login |
| **TC07** | Successful login | 1. Register a user
2. Logout
3. Log in with the newly created user |
| **TC08** | Complete checkout process | 1. Register a user
2. Add a product to the cart
3. Proceed to checkout
4. Register an address
5. Select the address
6. Choose a payment method
7. Confirm the order |
| **TC09** | Add product to cart from product page | 1. Visit a product page
2. Fill out the required fields
3. Add product to cart |
| **TC10** | Submit contact form | 1. Go to the contact page
2. Fill out and submit the contact form |
| **TC11** | View cart as an unregistered user | 1. Click the cart icon
2. Navigate to the cart page |