Skip to main content

Framework to build UI test automation in Page Transactions pattern

Project description

Guará

PyPI Downloads

Guará is a Python framework for business logic expression. It allows you to write production code and tests as executable domain language, combining:

  • Business Logic Language → expresses domain behavior using Ubiquitous Language (DDD)
  • Test Framework → orchestrates scenarios using Given / When / Then

Instead of focusing only on technical assertions, Guará enables you to describe business scenarios as code, making production code and tests readable by developers and domain experts.

Core Idea

Guará turns code into business narratives:

  • Transactions → represent actions (use cases)
  • Assertions (it) → represent business expectations
  • Application DSL → orchestrates flows in domain language

Syntax

Application.when(DoSomething [,with_parameter=value, ...]).expects(it.Matches, a_condition)

Example in Action

Modeling

from guara.transaction import Application
from guara import it
from transactions import HasBalance, BuyAsset, UpdatePortfolio

def main():
    finance_app = Application()
    (
        finance_app
        .given(HasBalance)
        .when(BuyAsset, symbol="AAPL", amount=2000)
        .and_(UpdatePortfolio).expects(it.IsEqualTo, 20)
    )

UI Testing

from guara.transaction import Application
from guara import it
from selenium import webdriver
from transactions import OpenApp, ChangeToPortuguese, NavigateToInfoPage, CloseApp

def test_sample_web_page():
    app = Application(webdriver.Chrome())
    app.given(OpenApp, url="https://anyhost.com/")
    app.when(ChangeToPortuguese).expects(it.IsEqualTo, CONTENT_IN_PORTUGUESE)
    app.when(NavigateToInfoPage).then(it.Contains, "This project was born")
    app.execute(CloseApp)

Documentation

For more information, check: https://guara.readthedocs.io/en/latest/

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

guara-0.0.19.tar.gz (869.7 kB view details)

Uploaded Source

Built Distribution

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

guara-0.0.19-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

Details for the file guara-0.0.19.tar.gz.

File metadata

  • Download URL: guara-0.0.19.tar.gz
  • Upload date:
  • Size: 869.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for guara-0.0.19.tar.gz
Algorithm Hash digest
SHA256 4d0d993b37febe4f7375cd70c73d2ac97916aeae4ee37e3c8d740d8872a6cf69
MD5 10d65c0b26dbb4c2d3671fe9625d98b5
BLAKE2b-256 07f57a7f0bbc84f179f59115cd3de70a696df552820235b791ebaac7593b0872

See more details on using hashes here.

File details

Details for the file guara-0.0.19-py3-none-any.whl.

File metadata

  • Download URL: guara-0.0.19-py3-none-any.whl
  • Upload date:
  • Size: 14.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for guara-0.0.19-py3-none-any.whl
Algorithm Hash digest
SHA256 43d7fd0c23ca2a3d1bf68de9ec62ff0e156f416d543d677ca0fc9e6e879f3136
MD5 10949a081425a67cc7f37f7d91c8f5e5
BLAKE2b-256 ff7afb6f6c0afa6afb065f5c04f6297bf1442c39cfdfcaba9e68312f44aef592

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