pyplaykit 1.7.1__tar.gz → 1.8.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/MANIFEST.in +2 -0
- pyplaykit-1.8.2/PIP_INSTALL_GUIDE.md +493 -0
- {pyplaykit-1.7.1/pyplaykit.egg-info → pyplaykit-1.8.2}/PKG-INFO +64 -8
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/pyplaykit/cli.py +46 -0
- pyplaykit-1.8.2/pyplaykit/show_docs.py +57 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2/pyplaykit.egg-info}/PKG-INFO +64 -8
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/pyplaykit.egg-info/SOURCES.txt +3 -0
- pyplaykit-1.8.2/pyplaykit.egg-info/requires.txt +89 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/pyproject.toml +83 -7
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/utils/api_client.py +15 -4
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/utils/auth_manager.py +10 -2
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/utils/data_loader.py +9 -1
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/utils/database_clients.py +157 -43
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/utils/db_client.py +14 -3
- pyplaykit-1.8.2/utils/db_drivers/informix.py +185 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/utils/db_factory.py +15 -1
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/utils/db_pool.py +14 -4
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/utils/response_validator.py +9 -2
- pyplaykit-1.7.1/pyplaykit.egg-info/requires.txt +0 -18
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/README.md +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/components/__init__.py +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/components/base_component.py +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/components/data_table.py +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/components/form_field.py +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/components/modal.py +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/config/config.yaml +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/config/environments.yaml +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/config/projects/customs_modernization.yaml +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/config/projects/dispatcho.yaml +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/config/projects/timelyquote.yaml +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/core/__init__.py +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/core/base_page.py +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/core/base_test.py +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/core/browser_factory.py +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/core/playwright_manager.py +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/dist_pkg/__init__.py +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/dist_pkg/distribution.py +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/integrations/__init__.py +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/integrations/adapters.py +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/orchestration/__init__.py +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/orchestration/enforcer.py +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/orchestration/planner.py +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/pages/__init__.py +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/pages/dashboard_page.py +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/pages/login_page.py +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/pages/orangehrm_login_page.py +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/pages/saucedemo_inventory_page.py +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/pages/saucedemo_login_page.py +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/plugins/__init__.py +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/plugins/api_plugin.py +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/plugins/base.py +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/plugins/data_plugin.py +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/plugins/registry.py +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/plugins/security_plugin.py +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/pyplaykit/__init__.py +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/pyplaykit/plugin.py +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/pyplaykit.egg-info/dependency_links.txt +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/pyplaykit.egg-info/entry_points.txt +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/pyplaykit.egg-info/top_level.txt +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/resilience/__init__.py +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/resilience/locator_recovery.py +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/setup.cfg +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/test_data/api/ecom/auth_payloads.json +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/test_data/api/ecom/product_payloads.json +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/test_data/api_test_data.json +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/test_data/data_validation_test_data.json +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/test_data/login_test_data.json +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/test_data/orangehrm_login_data.json +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/test_data/ui_test_data.json +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/utils/__init__.py +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/utils/api_test_helper.py +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/utils/assertion_helper.py +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/utils/data_comparison_report.py +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/utils/data_comparison_utils.py +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/utils/data_source.py +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/utils/data_validator.py +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/utils/db_drivers/__init__.py +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/utils/db_drivers/db2.py +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/utils/db_drivers/mysql.py +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/utils/db_drivers/oracle.py +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/utils/db_drivers/snowflake.py +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/utils/db_drivers/sqlite.py +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/utils/db_drivers/sqlserver.py +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/utils/db_fixtures.py +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/utils/db_validation_helper.py +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/utils/environment_validator.py +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/utils/file_reader.py +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/utils/graphql_client.py +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/utils/logger.py +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/utils/observability.py +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/utils/screenshot_helper.py +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/utils/soap_client.py +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/utils/tdm.py +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/utils/transformation_validator.py +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/utils/ui_db_validator.py +0 -0
- {pyplaykit-1.7.1 → pyplaykit-1.8.2}/utils/yaml_config_reader.py +0 -0
|
@@ -0,0 +1,493 @@
|
|
|
1
|
+
# PyPlayKit Installation Guide
|
|
2
|
+
|
|
3
|
+
Welcome to **PyPlayKit** - Enterprise Python + Playwright Test Automation Framework!
|
|
4
|
+
|
|
5
|
+
## 🚀 Quick Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# Install PyPlayKit
|
|
9
|
+
pip install pyplaykit
|
|
10
|
+
|
|
11
|
+
# Install Playwright browsers
|
|
12
|
+
playwright install
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## 📋 System Requirements
|
|
16
|
+
|
|
17
|
+
- **Python:** 3.11 or higher
|
|
18
|
+
- **Operating System:** Windows, macOS, Linux
|
|
19
|
+
- **RAM:** 4GB minimum (8GB recommended)
|
|
20
|
+
- **Disk Space:** 2GB for browsers
|
|
21
|
+
|
|
22
|
+
## 🔧 Complete Setup
|
|
23
|
+
|
|
24
|
+
### 1. Create Virtual Environment
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
# Windows PowerShell
|
|
28
|
+
python -m venv .venv
|
|
29
|
+
.\.venv\Scripts\Activate.ps1
|
|
30
|
+
|
|
31
|
+
# Linux/macOS
|
|
32
|
+
python -m venv .venv
|
|
33
|
+
source .venv/bin/activate
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### 2. Install PyPlayKit
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
pip install pyplaykit
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### 3. Install Playwright Browsers
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
# Install all browsers (Chromium, Firefox, WebKit)
|
|
46
|
+
playwright install
|
|
47
|
+
|
|
48
|
+
# Or install specific browser
|
|
49
|
+
playwright install chromium
|
|
50
|
+
playwright install firefox
|
|
51
|
+
playwright install webkit
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### 4. Verify Installation
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
python -c "import pyplaykit; print(f'PyPlayKit {pyplaykit.__version__} installed successfully!')"
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## 🗄️ Database Driver Installation (Optional)
|
|
61
|
+
|
|
62
|
+
PyPlayKit supports multiple enterprise databases. **Database drivers are optional** - install only what you need:
|
|
63
|
+
|
|
64
|
+
### Quick Install with Optional Dependencies
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
# Install PyPlayKit with specific database support
|
|
68
|
+
pip install pyplaykit[postgresql] # PostgreSQL
|
|
69
|
+
pip install pyplaykit[sqlserver] # SQL Server
|
|
70
|
+
pip install pyplaykit[oracle] # Oracle
|
|
71
|
+
pip install pyplaykit[db2] # IBM DB2
|
|
72
|
+
pip install pyplaykit[informix] # IBM Informix
|
|
73
|
+
pip install pyplaykit[mysql] # MySQL
|
|
74
|
+
pip install pyplaykit[snowflake] # Snowflake
|
|
75
|
+
|
|
76
|
+
# Install multiple databases
|
|
77
|
+
pip install pyplaykit[postgresql,sqlserver,oracle]
|
|
78
|
+
|
|
79
|
+
# Install ALL database drivers at once
|
|
80
|
+
pip install pyplaykit[all-databases]
|
|
81
|
+
|
|
82
|
+
# Install with data comparison tools (Excel, CSV)
|
|
83
|
+
pip install pyplaykit[data-comparison]
|
|
84
|
+
|
|
85
|
+
# Install everything
|
|
86
|
+
pip install pyplaykit[all-databases,data-comparison]
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Manual Driver Installation
|
|
90
|
+
|
|
91
|
+
If you prefer to install drivers manually:
|
|
92
|
+
|
|
93
|
+
#### PostgreSQL
|
|
94
|
+
```bash
|
|
95
|
+
pip install psycopg2-binary
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
#### SQL Server
|
|
99
|
+
```bash
|
|
100
|
+
pip install pyodbc
|
|
101
|
+
|
|
102
|
+
# Also install ODBC Driver:
|
|
103
|
+
# Windows: Download from Microsoft
|
|
104
|
+
# Linux: sudo apt-get install msodbcsql17
|
|
105
|
+
# macOS: brew install msodbcsql17
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
#### Oracle
|
|
109
|
+
```bash
|
|
110
|
+
pip install oracledb
|
|
111
|
+
# No additional Oracle Client required (uses thin mode)
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
#### DB2
|
|
115
|
+
```bash
|
|
116
|
+
pip install ibm_db ibm_db_dbi
|
|
117
|
+
# May require IBM Data Server Driver
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
#### Informix
|
|
121
|
+
```bash
|
|
122
|
+
pip install IfxPy IfxPyDbi
|
|
123
|
+
# Requires IBM Informix Client SDK
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
#### MySQL
|
|
127
|
+
```bash
|
|
128
|
+
pip install mysql-connector-python
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
#### Snowflake
|
|
132
|
+
```bash
|
|
133
|
+
pip install snowflake-connector-python
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## 🎯 Quick Start Example
|
|
137
|
+
|
|
138
|
+
### 1. Create Test Directory Structure
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
mkdir my-test-project
|
|
142
|
+
cd my-test-project
|
|
143
|
+
mkdir -p tests/functional/ui
|
|
144
|
+
mkdir -p pages
|
|
145
|
+
mkdir -p config
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### 2. Create Configuration
|
|
149
|
+
|
|
150
|
+
**config/config.yaml:**
|
|
151
|
+
```yaml
|
|
152
|
+
browser:
|
|
153
|
+
type: chromium
|
|
154
|
+
headless: true
|
|
155
|
+
viewport:
|
|
156
|
+
width: 1920
|
|
157
|
+
height: 1080
|
|
158
|
+
|
|
159
|
+
timeouts:
|
|
160
|
+
page_load: 30
|
|
161
|
+
element_wait: 10
|
|
162
|
+
|
|
163
|
+
logging:
|
|
164
|
+
level: INFO
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
**config/environments.yaml:**
|
|
168
|
+
```yaml
|
|
169
|
+
environments:
|
|
170
|
+
qa:
|
|
171
|
+
base_url: https://qa.example.com
|
|
172
|
+
api_base_url: https://api-qa.example.com
|
|
173
|
+
|
|
174
|
+
prod:
|
|
175
|
+
base_url: https://example.com
|
|
176
|
+
api_base_url: https://api.example.com
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### 3. Create Your First Page Object
|
|
180
|
+
|
|
181
|
+
**pages/login_page.py:**
|
|
182
|
+
```python
|
|
183
|
+
from pyplaykit import BasePage
|
|
184
|
+
|
|
185
|
+
class LoginPage(BasePage):
|
|
186
|
+
# Locators
|
|
187
|
+
USERNAME_INPUT = "#username"
|
|
188
|
+
PASSWORD_INPUT = "#password"
|
|
189
|
+
LOGIN_BUTTON = "button[type='submit']"
|
|
190
|
+
|
|
191
|
+
def login(self, username: str, password: str):
|
|
192
|
+
"""Perform login action."""
|
|
193
|
+
self.fill(self.USERNAME_INPUT, username)
|
|
194
|
+
self.fill(self.PASSWORD_INPUT, password)
|
|
195
|
+
self.click(self.LOGIN_BUTTON)
|
|
196
|
+
|
|
197
|
+
def is_login_successful(self) -> bool:
|
|
198
|
+
"""Check if login was successful."""
|
|
199
|
+
return self.page.url.endswith("/dashboard")
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### 4. Create Your First Test
|
|
203
|
+
|
|
204
|
+
**tests/functional/ui/test_login.py:**
|
|
205
|
+
```python
|
|
206
|
+
import pytest
|
|
207
|
+
from pages.login_page import LoginPage
|
|
208
|
+
|
|
209
|
+
@pytest.mark.smoke
|
|
210
|
+
def test_successful_login(page, base_url, runtime_options):
|
|
211
|
+
"""Test successful user login."""
|
|
212
|
+
# Navigate to login page
|
|
213
|
+
page.goto(base_url)
|
|
214
|
+
|
|
215
|
+
# Create page object
|
|
216
|
+
login_page = LoginPage(page, runtime_options["resilience_policy"])
|
|
217
|
+
|
|
218
|
+
# Perform login
|
|
219
|
+
login_page.login("test_user", "test_password")
|
|
220
|
+
|
|
221
|
+
# Verify success
|
|
222
|
+
assert login_page.is_login_successful()
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
### 5. Run Your Tests
|
|
226
|
+
|
|
227
|
+
```bash
|
|
228
|
+
# Run all tests
|
|
229
|
+
pytest
|
|
230
|
+
|
|
231
|
+
# Run specific marker
|
|
232
|
+
pytest -m smoke
|
|
233
|
+
|
|
234
|
+
# Run with specific browser
|
|
235
|
+
pytest --pyplaykit-browser firefox
|
|
236
|
+
|
|
237
|
+
# Run in headed mode
|
|
238
|
+
pytest --pyplaykit-headed
|
|
239
|
+
|
|
240
|
+
# Run with environment
|
|
241
|
+
pytest --pyplaykit-env qa
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
## 📚 Essential Commands
|
|
245
|
+
|
|
246
|
+
### Test Execution
|
|
247
|
+
```bash
|
|
248
|
+
# Basic execution
|
|
249
|
+
pytest
|
|
250
|
+
|
|
251
|
+
# With environment
|
|
252
|
+
pytest --pyplaykit-env qa
|
|
253
|
+
|
|
254
|
+
# With browser override
|
|
255
|
+
pytest --pyplaykit-browser chromium
|
|
256
|
+
pytest --pyplaykit-browser firefox
|
|
257
|
+
pytest --pyplaykit-browser webkit
|
|
258
|
+
|
|
259
|
+
# Headed mode (see browser)
|
|
260
|
+
pytest --pyplaykit-headed
|
|
261
|
+
|
|
262
|
+
# Parallel execution
|
|
263
|
+
pytest -n 4
|
|
264
|
+
|
|
265
|
+
# Specific markers
|
|
266
|
+
pytest -m smoke
|
|
267
|
+
pytest -m regression
|
|
268
|
+
pytest -m "smoke and login"
|
|
269
|
+
|
|
270
|
+
# With readiness checks
|
|
271
|
+
pytest --pyplaykit-readiness-check
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
### Coverage and Reports
|
|
275
|
+
```bash
|
|
276
|
+
# Run tests with coverage
|
|
277
|
+
pytest --cov=. --cov-report=html
|
|
278
|
+
|
|
279
|
+
# View coverage report
|
|
280
|
+
# Open reports/coverage-html/index.html in browser
|
|
281
|
+
|
|
282
|
+
# Generate HTML report
|
|
283
|
+
pytest --html=reports/report.html
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
### Database Testing
|
|
287
|
+
```bash
|
|
288
|
+
# Example test with database
|
|
289
|
+
pytest tests/functional/database/
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
## 🌐 Environment Variables
|
|
293
|
+
|
|
294
|
+
Create a `.env` file in your project root:
|
|
295
|
+
|
|
296
|
+
```bash
|
|
297
|
+
# Database credentials
|
|
298
|
+
DB_HOST=localhost
|
|
299
|
+
DB_PORT=5432
|
|
300
|
+
DB_NAME=testdb
|
|
301
|
+
DB_USER=testuser
|
|
302
|
+
DB_PASSWORD=testpass
|
|
303
|
+
|
|
304
|
+
# Test credentials
|
|
305
|
+
PYPLAYKIT_TEST_USERNAME=test_user
|
|
306
|
+
PYPLAYKIT_TEST_PASSWORD=test_password
|
|
307
|
+
|
|
308
|
+
# API credentials
|
|
309
|
+
API_KEY=your-api-key-here
|
|
310
|
+
API_SECRET=your-api-secret-here
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
## 📖 Available Fixtures
|
|
314
|
+
|
|
315
|
+
PyPlayKit provides these pytest fixtures out of the box:
|
|
316
|
+
|
|
317
|
+
| Fixture | Scope | Description |
|
|
318
|
+
|---------|-------|-------------|
|
|
319
|
+
| `page` | function | Playwright page object |
|
|
320
|
+
| `context` | function | Browser context |
|
|
321
|
+
| `browser` | function | Browser instance |
|
|
322
|
+
| `base_url` | session | Base URL from config |
|
|
323
|
+
| `runtime_options` | session | Resolved configuration |
|
|
324
|
+
| `config_reader` | session | Config reader utility |
|
|
325
|
+
| `logger` | session | Framework logger |
|
|
326
|
+
| `db_client` | function | Database client (PostgreSQL) |
|
|
327
|
+
| `api_client` | function | HTTP API client |
|
|
328
|
+
|
|
329
|
+
## 🎨 Test Markers
|
|
330
|
+
|
|
331
|
+
Available test markers (define in `pytest.ini`):
|
|
332
|
+
|
|
333
|
+
```python
|
|
334
|
+
@pytest.mark.smoke # Smoke tests
|
|
335
|
+
@pytest.mark.sanity # Sanity tests
|
|
336
|
+
@pytest.mark.regression # Regression tests
|
|
337
|
+
@pytest.mark.flaky # Flaky tests with retries
|
|
338
|
+
@pytest.mark.login # Login-specific tests
|
|
339
|
+
@pytest.mark.negative # Negative test cases
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
## 🔍 Troubleshooting
|
|
343
|
+
|
|
344
|
+
### Issue: "playwright not found"
|
|
345
|
+
```bash
|
|
346
|
+
# Solution: Install Playwright browsers
|
|
347
|
+
playwright install
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
### Issue: "Module 'pyplaykit' has no attribute 'X'"
|
|
351
|
+
```bash
|
|
352
|
+
# Solution: Verify installation
|
|
353
|
+
pip show pyplaykit
|
|
354
|
+
pip install --upgrade pyplaykit
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
### Issue: Database connection fails
|
|
358
|
+
```bash
|
|
359
|
+
# Solution: Check credentials and install driver
|
|
360
|
+
pip install psycopg2-binary # PostgreSQL
|
|
361
|
+
pip install pyodbc # SQL Server
|
|
362
|
+
pip install oracledb # Oracle
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
### Issue: Tests fail with timeout
|
|
366
|
+
```bash
|
|
367
|
+
# Solution: Increase timeout in config.yaml
|
|
368
|
+
timeouts:
|
|
369
|
+
page_load: 60
|
|
370
|
+
element_wait: 30
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
### Issue: Browser doesn't open in headed mode
|
|
374
|
+
```bash
|
|
375
|
+
# Solution: Verify browser installation
|
|
376
|
+
playwright install chromium --force
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
## 📂 Project Structure
|
|
380
|
+
|
|
381
|
+
Recommended project structure:
|
|
382
|
+
|
|
383
|
+
```
|
|
384
|
+
my-test-project/
|
|
385
|
+
├── .env # Environment variables (gitignore this!)
|
|
386
|
+
├── pytest.ini # Pytest configuration
|
|
387
|
+
├── config/
|
|
388
|
+
│ ├── config.yaml # Framework configuration
|
|
389
|
+
│ └── environments.yaml # Environment-specific settings
|
|
390
|
+
├── pages/ # Page object models
|
|
391
|
+
│ ├── __init__.py
|
|
392
|
+
│ ├── login_page.py
|
|
393
|
+
│ └── dashboard_page.py
|
|
394
|
+
├── tests/
|
|
395
|
+
│ ├── functional/
|
|
396
|
+
│ │ ├── ui/ # UI tests
|
|
397
|
+
│ │ ├── api/ # API tests
|
|
398
|
+
│ │ └── database/ # Database tests
|
|
399
|
+
│ └── integration/ # Integration tests
|
|
400
|
+
├── test_data/ # Test data files
|
|
401
|
+
│ └── users.json
|
|
402
|
+
└── reports/ # Test reports (auto-generated)
|
|
403
|
+
├── screenshots/
|
|
404
|
+
├── videos/
|
|
405
|
+
└── report.html
|
|
406
|
+
```
|
|
407
|
+
|
|
408
|
+
## 🛠️ Advanced Features
|
|
409
|
+
|
|
410
|
+
### Cross-Database Testing
|
|
411
|
+
```python
|
|
412
|
+
from pyplaykit import DbClientFactory
|
|
413
|
+
|
|
414
|
+
# Create SQL Server client
|
|
415
|
+
sqlserver = DbClientFactory.create(
|
|
416
|
+
db_type="sqlserver",
|
|
417
|
+
host="server.com",
|
|
418
|
+
database="mydb",
|
|
419
|
+
user="user",
|
|
420
|
+
password="pass"
|
|
421
|
+
)
|
|
422
|
+
|
|
423
|
+
# Create Oracle client
|
|
424
|
+
oracle = DbClientFactory.create(
|
|
425
|
+
db_type="oracle",
|
|
426
|
+
host="oracle.com",
|
|
427
|
+
database="PROD",
|
|
428
|
+
user="user",
|
|
429
|
+
password="pass"
|
|
430
|
+
)
|
|
431
|
+
|
|
432
|
+
# Compare data
|
|
433
|
+
from pyplaykit import compare_query_results
|
|
434
|
+
comparison = compare_query_results(
|
|
435
|
+
source_client=sqlserver,
|
|
436
|
+
target_client=oracle,
|
|
437
|
+
source_query="SELECT * FROM customers",
|
|
438
|
+
target_query="SELECT * FROM customers",
|
|
439
|
+
key_columns=["id"]
|
|
440
|
+
)
|
|
441
|
+
```
|
|
442
|
+
|
|
443
|
+
### API Testing
|
|
444
|
+
```python
|
|
445
|
+
from pyplaykit import ApiClient
|
|
446
|
+
|
|
447
|
+
api = ApiClient(base_url="https://api.example.com", timeout_seconds=10)
|
|
448
|
+
response = api.get("/users/123")
|
|
449
|
+
|
|
450
|
+
assert response.status_code == 200
|
|
451
|
+
assert response.json()["name"] == "John Doe"
|
|
452
|
+
```
|
|
453
|
+
|
|
454
|
+
### Data Validation
|
|
455
|
+
```python
|
|
456
|
+
from pyplaykit import validate_required_fields, validate_datetime_format
|
|
457
|
+
|
|
458
|
+
# Validate data structure
|
|
459
|
+
validate_required_fields(
|
|
460
|
+
record={"id": 1, "name": "Alice"},
|
|
461
|
+
required=["id", "name", "email"] # Will fail - missing email
|
|
462
|
+
)
|
|
463
|
+
|
|
464
|
+
# Validate datetime format
|
|
465
|
+
validate_datetime_format(
|
|
466
|
+
value="2024-01-15 10:30:00",
|
|
467
|
+
expected_format="%Y-%m-%d %H:%M:%S"
|
|
468
|
+
)
|
|
469
|
+
```
|
|
470
|
+
|
|
471
|
+
## 📞 Support and Resources
|
|
472
|
+
|
|
473
|
+
- **Documentation:** [https://github.com/ShanKonduru/pyplaykit](https://github.com/ShanKonduru/pyplaykit)
|
|
474
|
+
- **Issues:** [https://github.com/ShanKonduru/pyplaykit/issues](https://github.com/ShanKonduru/pyplaykit/issues)
|
|
475
|
+
- **PyPI:** [https://pypi.org/project/pyplaykit/](https://pypi.org/project/pyplaykit/)
|
|
476
|
+
|
|
477
|
+
## 🎓 Next Steps
|
|
478
|
+
|
|
479
|
+
1. ✅ Read `QUICK_START_QE.md` for QE engineer onboarding
|
|
480
|
+
2. ✅ Check `CONTRIBUTING.md` for contribution guidelines
|
|
481
|
+
3. ✅ Review `docs/DATABASE_SUPPORT.md` for database testing
|
|
482
|
+
4. ✅ Explore `examples/` directory for code samples
|
|
483
|
+
5. ✅ Join our community and contribute!
|
|
484
|
+
|
|
485
|
+
## 📄 License
|
|
486
|
+
|
|
487
|
+
PyPlayKit is released under the MIT License.
|
|
488
|
+
|
|
489
|
+
---
|
|
490
|
+
|
|
491
|
+
**Happy Testing with PyPlayKit!** 🎉
|
|
492
|
+
|
|
493
|
+
For detailed documentation, visit: https://github.com/ShanKonduru/pyplaykit
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pyplaykit
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.8.2
|
|
4
4
|
Summary: Enterprise Python + Playwright automation framework
|
|
5
5
|
Author-email: Shan Konduru <shankonduru@gmail.com>
|
|
6
6
|
License: MIT
|
|
@@ -24,18 +24,74 @@ Requires-Dist: pytest==9.1.1
|
|
|
24
24
|
Requires-Dist: pytest-cov==7.1.0
|
|
25
25
|
Requires-Dist: pytest-xdist==3.8.0
|
|
26
26
|
Requires-Dist: pytest-rerunfailures==16.4
|
|
27
|
-
Requires-Dist: pytest-html==4.2.0
|
|
28
|
-
Requires-Dist: allure-pytest==2.16.0
|
|
29
27
|
Requires-Dist: PyYAML==6.0.2
|
|
30
28
|
Requires-Dist: python-dotenv>=1.0.0
|
|
31
|
-
|
|
32
|
-
Requires-Dist:
|
|
33
|
-
Requires-Dist:
|
|
34
|
-
|
|
35
|
-
Requires-Dist: gql[httpx]>=3.5.0
|
|
29
|
+
Provides-Extra: api-client
|
|
30
|
+
Requires-Dist: httpx>=0.27.0; extra == "api-client"
|
|
31
|
+
Requires-Dist: jmespath>=1.0.0; extra == "api-client"
|
|
32
|
+
Provides-Extra: graphql-client
|
|
33
|
+
Requires-Dist: gql[httpx]>=3.5.0; extra == "graphql-client"
|
|
34
|
+
Requires-Dist: httpx>=0.27.0; extra == "graphql-client"
|
|
35
|
+
Provides-Extra: soap-client
|
|
36
|
+
Requires-Dist: zeep>=4.2.1; extra == "soap-client"
|
|
36
37
|
Provides-Extra: data-comparison
|
|
37
38
|
Requires-Dist: pandas>=2.0.0; extra == "data-comparison"
|
|
38
39
|
Requires-Dist: openpyxl>=3.1.0; extra == "data-comparison"
|
|
40
|
+
Requires-Dist: xlrd>=2.0.1; extra == "data-comparison"
|
|
41
|
+
Provides-Extra: postgresql
|
|
42
|
+
Requires-Dist: psycopg2-binary>=2.9.0; extra == "postgresql"
|
|
43
|
+
Provides-Extra: sqlserver
|
|
44
|
+
Requires-Dist: pyodbc>=4.0.0; extra == "sqlserver"
|
|
45
|
+
Provides-Extra: oracle
|
|
46
|
+
Requires-Dist: oracledb>=1.0.0; extra == "oracle"
|
|
47
|
+
Provides-Extra: db2
|
|
48
|
+
Requires-Dist: ibm_db>=3.0.0; extra == "db2"
|
|
49
|
+
Requires-Dist: ibm_db_dbi>=3.0.0; extra == "db2"
|
|
50
|
+
Provides-Extra: informix
|
|
51
|
+
Requires-Dist: IfxPy>=3.0.0; extra == "informix"
|
|
52
|
+
Requires-Dist: IfxPyDbi>=3.0.0; extra == "informix"
|
|
53
|
+
Provides-Extra: mysql
|
|
54
|
+
Requires-Dist: mysql-connector-python>=8.0.0; extra == "mysql"
|
|
55
|
+
Provides-Extra: snowflake
|
|
56
|
+
Requires-Dist: snowflake-connector-python>=3.0.0; extra == "snowflake"
|
|
57
|
+
Provides-Extra: allure-reporting
|
|
58
|
+
Requires-Dist: allure-pytest==2.16.0; extra == "allure-reporting"
|
|
59
|
+
Provides-Extra: html-reporting
|
|
60
|
+
Requires-Dist: pytest-html==4.2.0; extra == "html-reporting"
|
|
61
|
+
Provides-Extra: all-databases
|
|
62
|
+
Requires-Dist: psycopg2-binary>=2.9.0; extra == "all-databases"
|
|
63
|
+
Requires-Dist: pyodbc>=4.0.0; extra == "all-databases"
|
|
64
|
+
Requires-Dist: oracledb>=1.0.0; extra == "all-databases"
|
|
65
|
+
Requires-Dist: ibm_db>=3.0.0; extra == "all-databases"
|
|
66
|
+
Requires-Dist: ibm_db_dbi>=3.0.0; extra == "all-databases"
|
|
67
|
+
Requires-Dist: IfxPy>=3.0.0; extra == "all-databases"
|
|
68
|
+
Requires-Dist: IfxPyDbi>=3.0.0; extra == "all-databases"
|
|
69
|
+
Requires-Dist: mysql-connector-python>=8.0.0; extra == "all-databases"
|
|
70
|
+
Requires-Dist: snowflake-connector-python>=3.0.0; extra == "all-databases"
|
|
71
|
+
Provides-Extra: all-api-clients
|
|
72
|
+
Requires-Dist: httpx>=0.27.0; extra == "all-api-clients"
|
|
73
|
+
Requires-Dist: jmespath>=1.0.0; extra == "all-api-clients"
|
|
74
|
+
Requires-Dist: gql[httpx]>=3.5.0; extra == "all-api-clients"
|
|
75
|
+
Requires-Dist: zeep>=4.2.1; extra == "all-api-clients"
|
|
76
|
+
Provides-Extra: all
|
|
77
|
+
Requires-Dist: httpx>=0.27.0; extra == "all"
|
|
78
|
+
Requires-Dist: jmespath>=1.0.0; extra == "all"
|
|
79
|
+
Requires-Dist: gql[httpx]>=3.5.0; extra == "all"
|
|
80
|
+
Requires-Dist: zeep>=4.2.1; extra == "all"
|
|
81
|
+
Requires-Dist: pandas>=2.0.0; extra == "all"
|
|
82
|
+
Requires-Dist: openpyxl>=3.1.0; extra == "all"
|
|
83
|
+
Requires-Dist: xlrd>=2.0.1; extra == "all"
|
|
84
|
+
Requires-Dist: psycopg2-binary>=2.9.0; extra == "all"
|
|
85
|
+
Requires-Dist: pyodbc>=4.0.0; extra == "all"
|
|
86
|
+
Requires-Dist: oracledb>=1.0.0; extra == "all"
|
|
87
|
+
Requires-Dist: ibm_db>=3.0.0; extra == "all"
|
|
88
|
+
Requires-Dist: ibm_db_dbi>=3.0.0; extra == "all"
|
|
89
|
+
Requires-Dist: IfxPy>=3.0.0; extra == "all"
|
|
90
|
+
Requires-Dist: IfxPyDbi>=3.0.0; extra == "all"
|
|
91
|
+
Requires-Dist: mysql-connector-python>=8.0.0; extra == "all"
|
|
92
|
+
Requires-Dist: snowflake-connector-python>=3.0.0; extra == "all"
|
|
93
|
+
Requires-Dist: allure-pytest==2.16.0; extra == "all"
|
|
94
|
+
Requires-Dist: pytest-html==4.2.0; extra == "all"
|
|
39
95
|
|
|
40
96
|
# PyPlayKit - Enterprise Test Automation Framework
|
|
41
97
|
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Usage:
|
|
4
4
|
pyplaykit init [PROJECT_DIR]
|
|
5
|
+
pyplaykit docs
|
|
5
6
|
"""
|
|
6
7
|
|
|
7
8
|
from __future__ import annotations
|
|
@@ -78,12 +79,50 @@ def _init(project_dir: Path) -> None:
|
|
|
78
79
|
print(" 3. Run: pytest --pyplaykit-env qa")
|
|
79
80
|
|
|
80
81
|
|
|
82
|
+
def _docs() -> None:
|
|
83
|
+
"""Show location of PyPlayKit documentation."""
|
|
84
|
+
package_dir = Path(__file__).parent.parent
|
|
85
|
+
|
|
86
|
+
print()
|
|
87
|
+
print("=" * 70)
|
|
88
|
+
print("📚 PyPlayKit Documentation")
|
|
89
|
+
print("=" * 70)
|
|
90
|
+
print()
|
|
91
|
+
|
|
92
|
+
# Check for PIP_INSTALL_GUIDE.md
|
|
93
|
+
guide_path = package_dir / "PIP_INSTALL_GUIDE.md"
|
|
94
|
+
if guide_path.exists():
|
|
95
|
+
print(f"✅ Installation Guide: {guide_path}")
|
|
96
|
+
print(f" View: cat {guide_path}")
|
|
97
|
+
else:
|
|
98
|
+
print(f"⚠️ Installation Guide not found at: {guide_path}")
|
|
99
|
+
|
|
100
|
+
print()
|
|
101
|
+
|
|
102
|
+
# Check for README.md
|
|
103
|
+
readme_path = package_dir / "README.md"
|
|
104
|
+
if readme_path.exists():
|
|
105
|
+
print(f"✅ README: {readme_path}")
|
|
106
|
+
print(f" View: cat {readme_path}")
|
|
107
|
+
else:
|
|
108
|
+
print(f"⚠️ README not found at: {readme_path}")
|
|
109
|
+
|
|
110
|
+
print()
|
|
111
|
+
print("📖 Online Documentation:")
|
|
112
|
+
print(" https://github.com/ShanKonduru/pyplaykit")
|
|
113
|
+
print()
|
|
114
|
+
print("=" * 70)
|
|
115
|
+
print()
|
|
116
|
+
|
|
117
|
+
|
|
81
118
|
def main(argv: list[str] | None = None) -> int:
|
|
82
119
|
parser = argparse.ArgumentParser(
|
|
83
120
|
prog="pyplaykit",
|
|
84
121
|
description="PyPlayKit project scaffolding CLI",
|
|
85
122
|
)
|
|
86
123
|
sub = parser.add_subparsers(dest="command")
|
|
124
|
+
|
|
125
|
+
# init command
|
|
87
126
|
init_p = sub.add_parser("init", help="Scaffold a new pyplaykit project")
|
|
88
127
|
init_p.add_argument(
|
|
89
128
|
"project_dir",
|
|
@@ -92,12 +131,19 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
92
131
|
help="Directory to scaffold into (default: current directory)",
|
|
93
132
|
)
|
|
94
133
|
|
|
134
|
+
# docs command
|
|
135
|
+
sub.add_parser("docs", help="Show location of installed documentation")
|
|
136
|
+
|
|
95
137
|
args = parser.parse_args(argv)
|
|
96
138
|
|
|
97
139
|
if args.command == "init":
|
|
98
140
|
_init(Path(args.project_dir).resolve())
|
|
99
141
|
return 0
|
|
100
142
|
|
|
143
|
+
if args.command == "docs":
|
|
144
|
+
_docs()
|
|
145
|
+
return 0
|
|
146
|
+
|
|
101
147
|
parser.print_help()
|
|
102
148
|
return 1
|
|
103
149
|
|