https://github.com/basilahamed/behave_json_integration
⚙️ Automating SauceDemo login using Python BDD with JSON-driven test cases. Clean structure with result-writing back to JSON.
https://github.com/basilahamed/behave_json_integration
automation-testing bdd behave behave-framework python selenium
Last synced: about 1 month ago
JSON representation
⚙️ Automating SauceDemo login using Python BDD with JSON-driven test cases. Clean structure with result-writing back to JSON.
- Host: GitHub
- URL: https://github.com/basilahamed/behave_json_integration
- Owner: BASILAHAMED
- Created: 2025-05-23T13:57:48.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-23T13:59:28.000Z (about 1 year ago)
- Last Synced: 2025-06-19T02:38:07.351Z (about 1 year ago)
- Topics: automation-testing, bdd, behave, behave-framework, python, selenium
- Language: Python
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Behave_JSON_Integration
**Python Behave BDD project using JSON data-driven testing** for [https://www.saucedemo.com](https://www.saucedemo.com):
```markdown
# 🧪 Python BDD JSON DDTF - SauceDemo Login Automation
This project showcases a **Data-Driven Testing Framework (DDTF)** using **Python Behave (BDD)** and **JSON** to manage test data. It automates login tests for [SauceDemo](https://www.saucedemo.com/), runs multiple credentials from a JSON file, and updates test results back into the same file.
---
## 🚀 Features
- 📁 Test data stored and updated in JSON
- ✅ BDD with **Behave**
- 🧪 Automated testing with **Selenium WebDriver**
- 🔁 Clean, reusable **Page Object Model**
- 🧼 Lightweight and readable test configuration
---
## 🔧 Installation
1. Clone the repository:
```bash
git clone https://github.com/your-username/behave-json-saucedemo.git
cd behave-json-saucedemo
````
2. Set up a virtual environment and install dependencies:
```bash
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
```
3. Ensure your Chrome version matches the ChromeDriver version.
---
## 🧪 Run the Tests
```bash
behave
```
---
## 📁 Sample JSON Structure
```json
[
{
"username": "standard_user",
"password": "secret_sauce",
"expected": "success",
"result": ""
},
{
"username": "locked_out_user",
"password": "secret_sauce",
"expected": "failure",
"result": ""
}
]
```
> 🟢 `result` is updated post-test execution.
---
## 📜 License
MIT License
---
## 🙌 Acknowledgments
* [Behave](https://github.com/behave/behave)
* [Selenium](https://selenium.dev/)
* [SauceDemo](https://www.saucedemo.com/)
---