An open API service indexing awesome lists of open source software.

https://github.com/daud-nisar/ecommerce-automation

Automation suite for signup and login flows using Selenium and PyTest, featuring dynamic email generation and JSON-based data reuse.
https://github.com/daud-nisar/ecommerce-automation

automation e2e-tests pytest python qa-automation selenium selenium-webdriver test-automation testing-framework web-testing

Last synced: about 1 month ago
JSON representation

Automation suite for signup and login flows using Selenium and PyTest, featuring dynamic email generation and JSON-based data reuse.

Awesome Lists containing this project

README

          

# ๐Ÿ›’ Ecommerce Automation

This project automates the **Signup** and **Login** workflows of an ecommerce website using **Python**, **Selenium**, and **PyTest**. It simulates real-user behavior, generates unique credentials during signup, saves them to a JSON file, and uses the same credentials to perform login โ€” ensuring a complete end-to-end test.

---

## ๐Ÿš€ Features

- โœ… Automates user **Signup** flow
- โœ… Saves user credentials to a **JSON file**
- โœ… Uses saved credentials in **Login** flow
- โœ… Uses `webdriver_manager` for easy ChromeDriver management
- โœ… Clean structure using **Page Object Model (POM)** (optional)
- โœ… Configurable via `pytest.ini`

---

## ๐Ÿ›  Tech Stack

- Python 3.x
- Selenium
- PyTest
- WebDriver Manager
- JSON (for data sharing)
- [pytest-order](https://pypi.org/project/pytest-order/) (optional)

---

## ๐Ÿ“ Project Structure
```
ecommerce-automation/
โ”œโ”€โ”€ tests/
โ”‚ โ”œโ”€โ”€ test_signup.py #Signup automation (with data save)
โ”‚ โ”œโ”€โ”€ test_login.py #Login automation (reads data)
โ”‚ โ””โ”€โ”€ init.py
โ”œโ”€โ”€ utils/
โ”‚ โ”œโ”€โ”€ driver_setup.py #get_driver() using Chrome + manager
โ”‚ โ””โ”€โ”€ init.py
โ”œโ”€โ”€ conftest.py #Pytest fixture for browser
โ”œโ”€โ”€ temp_login_data.json #Auto-generated user credentials
โ”œโ”€โ”€ pytest.ini #Pytest config
โ”œโ”€โ”€ requirements.txt # Dependencies
โ”œโ”€โ”€ .gitignore #Ignore venv/.idea/pycache
โ””โ”€โ”€ README.md #You're reading it :)
```

---

## ๐Ÿงพ Setup Instructions

### 1. Clone the repository

```bash
git clone https://github.com/Daud-Nisar/ecommerce-automation
cd ecommerce-automation
```
### 2.Create and activate virtual environment (optional)
**๐Ÿ‘‰ On Windows:**
```
python -m venv venv
venv\Scripts\activate
```
**๐Ÿ‘‰ On macOS / Linux:**
```
source venv/bin/activate
```
### 3. Install dependencies
```bash
pip install -r requirements.txt
```
---
### โ–ถ๏ธ Running the Tests
```bash
pytest
```
## To run individually:
```bash
pytest tests/test_signup.py
pytest tests/test_login.py
```
## Sample Output:

๐Ÿ”ฅ Signup Test Running
โœ… Signup successful

๐Ÿ”ฅ Login Test Running
โœ… Login successful

---

## ๐Ÿ“„ Sample temp_login_data.json
```bash
{
"email": "Adam1720349320@mail.com",
"password": "SecurePass123"
}
```
This file is auto-generated by the Signup test and used in the Login test
---

## โœ… Requirements
```bash
Contents of requirements.txt:
selenium
pytest
webdriver-manager
pytest-order
```

## ๐Ÿงช Pytest Configuration (pytest.ini)
```bash
[pytest]
testpaths = tests
python_files = test_*.py
python_functions = test_*
addopts = -v
```
# ๐Ÿ‘จโ€๐Ÿ’ป Author
**Daud Nisar**
Python Automation Developer

## โญ๏ธ Support

If you liked this project:

- โญ๏ธ Star this repository
- โœ… Follow me on [GitHub](https://github.com/Daud-Nisar)
- ๐Ÿ’ฌ Share your feedback or suggestions