Skip to main content

easelenium - Selenium-based Test Automation Framework.

Project description

easelenium

Test

Selenium WebDriver wrapper and GUI toolkit for test automation. Provides a high-level Browser API, the PageObject pattern, and an optional wxPython GUI for generating and running tests without writing boilerplate.

Features:

  • Supports Firefox, Chrome, and Edge
  • PageObject pattern with code generation
  • Context manager and decorator APIs for browser lifecycle
  • Optional wxPython GUI (Generator, Editor, Test Runner tabs)
  • CI-friendly CLI wrapper around pytest
  • Python 3.8+

Installation

Pip

pip install easelenium           # library only
pip install "easelenium[gui]"    # with GUI

With uv

uv add easelenium           # library only
uv add "easelenium[gui]"    # with GUI

Usage

Direct API

from easelenium.browser import Browser
from selenium.webdriver.common.by import By

browser = Browser("gc")                          # gc=Chrome, ff=Firefox, edge=Edge
browser.get("https://duckduckgo.com")
browser.type(by_name="q", text="selenium")
browser.click(by_id="search_button_homepage")
print(browser.get_text(by_css="h2.result__title"))
browser.quit()

Most Browser methods accept either a WebElement, by_*= or a (By, selector) tuple:

search_input = (By.NAME, "q")
browser.type(search_input, text="selenium")
browser.click((By.ID, "search_button_homepage"))

Context manager

from easelenium.browser import browser_context

with browser_context("gc", headless=True) as browser:
    browser.get("https://duckduckgo.com")
    print(browser.get_title())
# browser.quit() called automatically; screenshot saved on exception

Decorator

from easelenium.browser import browser_decorator

@browser_decorator(browser_name="gc", headless=True)
def run_search(browser=None):
    browser.get("https://duckduckgo.com")
    browser.type(by_name="q", text="selenium")

PageObject pattern

from selenium.webdriver.common.by import By
from easelenium.base_page_object import BasePageObject

class DuckDuckGo(BasePageObject):
    SEARCH_INPUT = (By.NAME, "q")
    SEARCH_BUTTON = (By.ID, "search_button_homepage")

    def search(self, text):
        self.browser.get("https://duckduckgo.com")
        self.browser.type(self.SEARCH_INPUT, text=text)
        self.browser.click(self.SEARCH_BUTTON)

Test base class

from easelenium.base_test import BaseTest

class MyTest(BaseTest):
    BROWSER_NAME = "gc"

    def test_title(self):
        self.browser.get("https://duckduckgo.com")
        assert "DuckDuckGo" in self.browser.get_title()

BaseTest handles browser setup/teardown and saves a screenshot on failure.


GUI

Requires the [gui] extra. Launch with:

easelenium_ui
# or
python easelenium/scripts/easelenium_ui.py
Tab Purpose
Generator Open a URL, click elements, emit PageObject source
Editor Edit generated PageObject files
Selector Finder Interactively test CSS/XPath selectors
Test Runner Run pytest suites and view results

CLI (CI)

easelenium_cli --browser GC tests/
# or
python easelenium/scripts/easelenium_cli.py --browser GC tests/

Wraps pytest and injects the chosen browser into fixtures via a pytest plugin.


Development

Requires uv and just.

just init        # create .venv and install dependencies
just fmt         # ruff format
just fix         # ruff check --fix + pyright
just test        # run pytest
just bump minor  # bump version and create git tag (major / minor / patch)

On Linux, run tests with a virtual display:

xvfb-run --server-args="-screen 0 1366x768x24" pytest tests/

Dependencies

Package Role
selenium WebDriver core
webdriver-manager Auto-download browser drivers
loguru Logging
pytest / pytest-html Test runner
wxPython GUI (optional — easelenium[gui])

License

MIT — easelenium/licenses/easelenium_license.txt


Tutorial

  1. Introduction
  2. Setup
  3. Test creation
  4. Continuous Integration

More information

Presentation

Thesis which contains description of the framework

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

easelenium-0.8.1.tar.gz (91.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

easelenium-0.8.1-py3-none-any.whl (58.1 kB view details)

Uploaded Python 3

File details

Details for the file easelenium-0.8.1.tar.gz.

File metadata

  • Download URL: easelenium-0.8.1.tar.gz
  • Upload date:
  • Size: 91.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for easelenium-0.8.1.tar.gz
Algorithm Hash digest
SHA256 fef373d23deab467c2ffe739105e1788a43c08c6c05065669551a09858a30aee
MD5 8a5a0a0e277b83f740cebb838248fd6f
BLAKE2b-256 2e5b8e728c8573cb36cef2f91749705e2eeb0dd24a3a4d94b5d10ebd28fe47d7

See more details on using hashes here.

File details

Details for the file easelenium-0.8.1-py3-none-any.whl.

File metadata

  • Download URL: easelenium-0.8.1-py3-none-any.whl
  • Upload date:
  • Size: 58.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for easelenium-0.8.1-py3-none-any.whl
Algorithm Hash digest
SHA256 061cb6821cf93ea6555aa5af5efecabf1fc8948d232dc4a45cb0dabb2756837a
MD5 d2b031d88f23f603b6e31162f784f1e2
BLAKE2b-256 4ace6e7bbbf8c075441df3310dd4263cfc43e25f0339fc9dca0c933f277fe8e4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page