Initial commit - Selenium automation framework

This commit is contained in:
2026-09-08 09:24:02 +05:30
commit e84b7e9950
76 changed files with 7484 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
import os
from datetime import datetime
def log_step(driver, request, step_name):
screenshots_dir = "reports/screenshots"
os.makedirs(screenshots_dir, exist_ok=True)
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
filename = f"{step_name}_{timestamp}.png"
filepath = os.path.join(screenshots_dir, filename)
driver.save_screenshot(filepath)
if hasattr(request.node, "extra"):
import pytest_html
request.node.extra.append(pytest_html.extras.image(filepath))
print(f"STEP: {step_name}")