Installation

Requirements

Python Version

Widgetastic.core requires Python 3.10 or higher. We recommend using the latest stable version of Python.

System Requirements
  • Windows, macOS, or Linux

  • Internet connection for browser downloads (first-time setup)

Installation Methods

Development Installation

If you want to contribute to the project or need the latest development features:

# Clone the repository
git clone https://github.com/RedHatQE/widgetastic.core.git
cd widgetastic.core

# Create virtual environment and activate it
python -m venv .venv_wt
source .venv_wt/bin/activate

# Install in editable mode
pip install -e .

# Or with development dependencies
pip install -e ".[dev]"

Playwright Setup

Widgetastic.core uses Playwright as its browser automation engine. After installing widgetastic.core, you need to install browser binaries:

# Install browser binaries (required for first-time setup)
playwright install

# Or install specific browsers only like chromium / firefox
playwright install chromium

Note

Browser installation may take several minutes and requires internet connectivity.

Verifying Installation

Create a simple test script to verify everything is working:

 1# test_installation.py
 2
 3import os
 4from playwright.sync_api import sync_playwright
 5from widgetastic.browser import Browser
 6from widgetastic.widget import View, Text
 7
 8
 9class TestView(View):
10    title = Text("title")
11
12
13def test_widgetastic():
14    # Get headless mode from environment (set by conftest or CI)
15    headless = os.getenv("PLAYWRIGHT_HEADLESS", "false").lower() == "true"
16
17    with sync_playwright() as p:
18        browser = p.chromium.launch(headless=headless)
19        page = browser.new_page()
20        page.goto("https://example.com")
21
22        wt_browser = Browser(page)
23        view = TestView(wt_browser)
24
25        print(f"Page title: {view.title.text}")
26        print("✅ Widgetastic is working correctly!")
27
28        browser.close()
29
30
31if __name__ == "__main__":
32    test_widgetastic()

Run the script:

python test_installation.py

If you see “✅ Widgetastic is working correctly!” along with the page title, your installation is successful.

Optional Dependencies

For additional functionality, you can install optional dependencies:

Development Tools

pip install "widgetastic.core[dev]"

Testing Dependencies

pip install "widgetastic.core[test]"

Documentation Building

pip install "widgetastic.core[docs]"