https://github.com/salhifayza/jbl_robot_framework_python
๐ง ๐ค ๐
https://github.com/salhifayza/jbl_robot_framework_python
automated-testing python3 robotframework
Last synced: 3 months ago
JSON representation
๐ง ๐ค ๐
- Host: GitHub
- URL: https://github.com/salhifayza/jbl_robot_framework_python
- Owner: SalhiFayza
- Created: 2025-05-31T15:40:33.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-05-31T17:06:42.000Z (8 months ago)
- Last Synced: 2025-06-23T06:45:47.057Z (7 months ago)
- Topics: automated-testing, python3, robotframework
- Language: Python
- Homepage:
- Size: 52.8 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## ๐ง ๐ค ๐ ๐ป โ
## JBL Headset Automation Testing
This project automates testing for a JBL Bluetooth headset using **Python** and **Robot Framework**. It verifies Bluetooth connectivity, plays a YouTube video, and controls system volume dynamically to simulate real-world usage.
---
## ๐ Features
- โ
Check if the headset is connected via Bluetooth
- ๐บ Play a YouTube video automatically
- ๐ Dynamically increase the system volume step-by-step
- ๐ Read and validate current volume level
- ๐ Generate test reports (HTML/XML)
---
## ๐งฉ Project Structure

---
## โ๏ธ Requirements
- Python 3.8+
- Robot Framework
- Playwright
- PulseAudio (for volume control, Linux only)
- A Bluetooth headset (JBL or any compatible)
---
## ๐ฆ Installation
1. **Clone the repo**
```bash
git clone https://github.com/SalhiFayza/JBL_Robot_FrameWork_Python.git
cd JBL_Robot_FrameWork_Python
```
2. **Install dependencies**
```bash
pip install -r requirements.txt
playwright install
```
3. **Turn on and connect your Bluetooth headset (e.g., JBL)**

4. **Update your JBL MAC address**
Open the file ```resources/variables.robot``` and replace the default MAC address with your headset's:
```
${MAC} 37:2B:54:9C:75:C4
```
---
## โถ๏ธ Running the Tests
You can run the tests in two ways:
### 1. Using Python runner:
```bash
python run_tests.py
```
### 2. Using Robot Framework directly:
```bash
robot jbl.robot
or
robot -d ./Results/ ./tests/jbl.robot
```

Test results will be available in:
- `output.xml` โ test execution log
- `log.html` โ detailed log with steps
- `report.html` โ summary report
---
## ๐งช Example Test Case
- Check if headset is connected
- Open YouTube
- Simulate increasing volume from 0% to 100%
- Log the current volume
- Fail if volume is not detected
---
## ๐ฅ Volume Control Logic โ Explained
```
current_volume = 0
set_volume(current_volume)
time.sleep(3)
while current_volume < 100:
current_volume += 10
set_volume(min(current_volume, 100))
time.sleep(4)
time.sleep(3)
browser.close()
```
This code starts by setting the system volume to 0%, then gradually increases it by 10% every 4 seconds until it reaches 100%. It uses small delays to simulate natural volume changes while a YouTube video plays, then closes the browser at the end.
---
## ๐ก Notes
- Works best on Linux (uses `pactl` and `bluetoothctl`)
- You must pair your headset before running tests
- The test will open a Chromium browser window (Playwright)
---
## ๐ฌ Contact
Made by Salhi Fayza
---
## ๐ License
MIT License โ Free to use and modify