Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Running Tests - Python SDK

Prerequisites

cd sdk-python
pip install -e ".[dev]"
playwright install chromium

Running All Tests

# From sdk-python directory
pytest tests/

# With verbose output
pytest tests/ -v

# With even more detail
pytest tests/ -vv

Running Specific Test Files

# Run only inspector tests
pytest tests/test_inspector.py

# Run only recorder tests
pytest tests/test_recorder.py

# Run only generator tests
pytest tests/test_generator.py

# Run only smart selector tests
pytest tests/test_smart_selector.py

# Run only snapshot tests
pytest tests/test_snapshot.py

# Run only query tests
pytest tests/test_query.py

# Run only action tests
pytest tests/test_actions.py

# Run only wait tests
pytest tests/test_wait.py

# Run only spec validation tests
pytest tests/test_spec_validation.py

Running Specific Test Functions

# Run a specific test function
pytest tests/test_inspector.py::test_inspector_start_stop

# Run multiple specific tests
pytest tests/test_recorder.py::test_recorder_click tests/test_recorder.py::test_recorder_type

Running Tests with Output

# Show print statements
pytest tests/ -s

# Show print statements + verbose
pytest tests/ -sv

# Show local variables on failure
pytest tests/ -l

Running Tests in Parallel

# Install pytest-xdist first: pip install pytest-xdist
pytest tests/ -n auto

Running Tests with Coverage

# Install pytest-cov first: pip install pytest-cov
pytest tests/ --cov=sentience --cov-report=html

# View coverage report
open htmlcov/index.html

Common Options

# Stop on first failure
pytest tests/ -x

# Stop after N failures
pytest tests/ --maxfail=3

# Run only tests matching a pattern
pytest tests/ -k "inspector"

# Run tests and show slowest 10
pytest tests/ --durations=10

# Run tests with markers (if defined)
pytest tests/ -m "not slow"

Example: Full Test Run

cd sdk-python
pytest tests/ -v --tb=short

Example: Quick Smoke Test

cd sdk-python
pytest tests/test_snapshot.py::test_snapshot_basic -v

Troubleshooting

Browser not found

playwright install chromium

Extension not found

Make sure the extension is built:

cd ../sentience-chrome
./build.sh

Import errors

Make sure the package is installed in development mode:

pip install -e ".[dev]"