Metadata-Version: 2.4
Name: ansys-saf-testing
Version: 0.12.dev1
Summary: Collection of test utilities for the Solution Application Framework.
License: Apache-2.0
License-File: AUTHORS
License-File: LICENSE
Author: ANSYS, Inc.
Author-email: pyansys.core@ansys.com
Maintainer: ANSYS, Inc.
Maintainer-email: pyansys.core@ansys.com
Requires-Python: >=3.11,<4
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Other Audience
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering
Provides-Extra: all
Provides-Extra: docker
Provides-Extra: hps
Provides-Extra: pim
Provides-Extra: selenium
Requires-Dist: ansys-hps-client (>=0.12,<1.0) ; extra == "hps" or extra == "all"
Requires-Dist: ansys-saf-product-configuration (>=0.20,<1.0) ; extra == "hps" or extra == "pim" or extra == "all"
Requires-Dist: click (>=8.1.7,<9.0.0)
Requires-Dist: cryptography (>=49.0.0,<50.0.0)
Requires-Dist: docker (>=7.1.0,<8.0.0) ; extra == "hps" or extra == "docker" or extra == "all"
Requires-Dist: grpcio (>=1.47.0,<2.0.0) ; extra == "pim" or extra == "all"
Requires-Dist: grpcio-health-checking (>=1.24.0,<2.0.0) ; extra == "pim" or extra == "all"
Requires-Dist: httpx2 (>=2.5.0,<3.0.0)
Requires-Dist: psutil (>=7.0,<8.0)
Requires-Dist: pydantic (>=2.7,<3.0)
Requires-Dist: pytest (>=9.1.0,<10.0.0)
Requires-Dist: pytest-mock (>=3.15.0,<4.0.0)
Requires-Dist: pyyaml (>=6.0.0,<7.0.0)
Requires-Dist: selenium (>=4.0,<5.0) ; extra == "selenium" or extra == "all"
Requires-Dist: tenacity (>=8.2.3,<9.0.0)
Requires-Dist: typing-extensions (>=4.14.0,<5.0.0)
Description-Content-Type: text/x-rst

######################################################
Solution Application Framework - Testing
######################################################

|python| |pypi| |GH-CI| |codecov| |Apache| |ruff|

.. |python| image:: https://img.shields.io/pypi/pyversions/ansys-saf-testing?logo=python&logoColor=white&label=Python
   :target: https://pypi.org/project/ansys-saf-testing/
   :alt: Python

.. |pypi| image:: https://img.shields.io/pypi/v/ansys-saf-testing.svg?logo=pypi&logoColor=white&label=PyPI
   :target: https://pypi.org/project/ansys-saf-testing/
   :alt: PyPI

.. |GH-CI| image:: https://github.com/ansys/saf-sdk-testing/actions/workflows/ci_cd_release.yml/badge.svg?label=CI
   :target: https://github.com/ansys/saf-sdk-testing/actions/workflows/ci_cd_release.yml
   :alt: GH-CI

.. |codecov| image:: https://img.shields.io/codecov/c/github/ansys/saf-sdk-testing
   :target: https://app.codecov.io/gh/ansys/saf-sdk-testing
   :alt: Codecov

.. |Apache| image:: https://img.shields.io/badge/License-Apache2.0-white.svg?labelColor=black
   :target: https://www.apache.org/licenses/
   :alt: Apache

.. |ruff| image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json
   :target: https://github.com/astral-sh/ruff
   :alt: Ruff


Overview
========

**SAF SDK Testing** provides a suite of reusable testing utilities, fixtures, and helper methods designed to standardize and streamline testing across the SAF landscape.

This package centralizes testing utilities for SAF-SDK development. It provides a unified testing infrastructure shared across all SAF-SDK repositories, ensuring consistency and reducing duplication in the development of SAF platform components such as the Desktop Orchestrator, Web Portal, Data Management services, and other core modules.

Core Capabilities
-----------------

The package is organized into modular components, each addressing specific testing needs:

- **Common Utilities**: Shared helper functions for general-purpose testing tasks, including network utilities, directory management, and gRPC certificate handling.
- **Database Testing**: Fixtures and methods for testing against PostgreSQL and SQLite databases, including container-managed database instances.
- **Docker Integration**: Tools for managing Docker containers and orchestrating containerized test environments.
- **Frontend/Selenium**: Selenium WebDriver utilities for end-to-end UI testing, including element waiting strategies and browser interaction helpers.
- **HPS Integration**: Testing support for High Performance Computing Services, including deployment processes and stack management.
- **PIM Integration**: Utilities for testing Product Instance Management service interactions.
- **Pytest Enhancements**: Custom pytest fixtures, markers for platform-specific tests, mocking utilities, and test case documentation helpers.
- **E2E Solution Testing**: End-to-end testing infrastructure for SAF solutions, including GLOW engine integration, execution configurations, and project context management.
- **Process Management**: Tools for launching and managing external processes during test execution.

Design Principles
-----------------

This package adheres to strict design principles to ensure reliability and ease of use across the SAF ecosystem:

- **Explicit over implicit**: No ``autouse=True`` fixtures. Developers must explicitly enable fixtures to maintain clarity about test execution.
- **Simplicity and transparency**: Utilities are designed to be easy to understand, allowing developers to predict behavior when calling them.
- **Version-agnostic generality**: Utilities are generic and adaptable, avoiding dependencies on specific versions of SAF components.
- **Flat architecture**: No nested function or fixture calls, maintaining transparency and predictability in test execution.
- **Backward compatibility**: All changes must be backward compatible. Fixes for one repository should never break others.


Installation
============

Ensure you have all the necessary `prerequisites`_. Then, refer to the
`installation guidelines`_ for detailed instructions on how to install the
project in your system.


Documentation
=============

The `official documentation`_ of SAF SDK Testing contains
the following chapters:

- `Getting started`_. This section provides a brief overview and instructions on
  how to get started with the project. It typically includes information on how
  to install the project, set up any necessary dependencies, and run a basic
  example or test to ensure everything is functioning correctly.

- `User guide`_. The user guide section offers detailed documentation and
  instructions on how to use the project. It provides comprehensive explanations
  of the project's features, functionalities, and configuration options. The
  user guide aims to help users understand the project's concepts, best
  practices, and recommended workflows.

- `Contribute`_. This section provides guidelines and instructions on how to
  contribute to the project. It includes information on how to set up the
  development environment, run tests, submit pull requests, and follow
  contribution guidelines.


Troubleshooting
===============

For troubleshooting or reporting issues, open an issue in the project
repository.

Follow these steps to report an issue:

- Go to the project repository.
- Click on the ``Issues`` tab.
- Click on the ``New Issue`` button.
- Provide a clear and detailed description of the issue you are facing.
- Include any relevant error messages, code snippets, or screenshots.

Additionally, you can refer to the `official documentation`_ for additional
resources and troubleshooting guides.


License
=======

This project is licensed under the Apache 2.0 License - see the `LICENSE`_ file for details.


Changelog
=========

The changelog section provides a summary of notable changes for each version of
SAF SDK Testing for Python. It helps you keep track of updates, bug
fixes, new features, and improvements made to the project over time.

To view the complete changelog, visit the project repository and navigate
to the `CHANGELOG`_ file. It provides a comprehensive list of changes
categorized by version, along with brief descriptions of each change.


Getting Started
===============

Add to your package's ``pyproject.toml``:

.. code:: toml

    [tool.poetry.group.tests]
    optional = true
    [tool.poetry.group.tests.dependencies]
    ansys-saf-testing = { version = "^0.1" }
    ...

Pytest fixtures from ``ansys-saf-testing`` are automatically discovered during test collection.
No additional fixture registration or plugin configuration is required.

For methods, just import them when needed. Example:

.. code:: python

    from ansys.saf.testing.selenium import wait_for_element_to_be_clickable, wait_for_partial_text

Extra groups
===============

- ``selenium``: if you want to use Selenium-related fixtures and methods.
- ``hps``: if you want to use fixtures and methods for HPS-related testing.
- ``docker``: if you want to use Docker-related fixtures and methods.
- ``pim``: if you want to use fixtures and methods for PIM light server testing.


.. _prerequisites: https://saf-sdk-testing.docs.solutions.ansys.com/version/stable/getting-started#prerequisites
.. _installation guidelines: https://saf-sdk-testing.docs.solutions.ansys.com/version/stable/getting-started#installation

.. _official documentation: https://saf-sdk-testing.docs.solutions.ansys.com
.. _Getting started: https://saf-sdk-testing.docs.solutions.ansys.com/version/stable/getting-started.html
.. _User guide: https://saf-sdk-testing.docs.solutions.ansys.com/version/stable/user-guide.html
.. _Contribute: https://saf-sdk-testing.docs.solutions.ansys.com/version/stable/contribute.html
.. _LICENSE: https://github.com/ansys/saf-sdk-testing/blob/main/LICENSE
.. _CHANGELOG: https://github.com/ansys/saf-sdk-testing/blob/main/CHANGELOG.md

