Metadata-Version: 2.4
Name: ansys-saf-testing
Version: 0.11.dev0
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.10,<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.10
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
Provides-Extra: solution
Requires-Dist: ansys-hps-client (>=0.12,<1.0) ; extra == "hps" or extra == "all"
Requires-Dist: ansys-saf-glow-engine[dash] (>=1.41.dev1,<2.0) ; extra == "solution" or extra == "all"
Requires-Dist: ansys-saf-product-configuration (>=0.20.dev0,<1.0) ; extra == "hps" or extra == "pim" or extra == "all"
Requires-Dist: click (>=8.1.7,<9.0.0)
Requires-Dist: cryptography (>=46.0.0,<47.0.0)
Requires-Dist: dash (>=2.18.2,<3.4.0) ; extra == "solution" or extra == "all"
Requires-Dist: docker (>=7.1.0,<8.0.0) ; extra == "hps" or extra == "docker" or extra == "all"
Requires-Dist: fastapi (>=0.115.2,<1.0) ; extra == "solution" 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: httpx (>=0,<1)
Requires-Dist: marshmallow (>=3.20.2,<4.0.0) ; extra == "hps" or extra == "all"
Requires-Dist: psutil (>=6.0,<7.0)
Requires-Dist: pydantic (>=2.7,<3.0)
Requires-Dist: pytest (>=9.0.3,<10.0.0)
Requires-Dist: pytest-mock (>=3.14.1,<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: starlette (>=0.49.1,<0.50.0) ; extra == "solution" 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 serves two primary objectives:

1. **Centralizing testing utilities for SAF development**: 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.

2. **Empowering solution developers**: Delivers ready-to-use testing tools for solution developers—consumers of the
   SAF platform—enabling them to efficiently test their custom solutions built on SAF. This includes utilities for
   end-to-end solution testing, UI automation, service integration testing, and more.

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.
- **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.dev7", source = "solutions-private-pypi", allow-prereleases = true }
    ...

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.
- ``process``: if you want to use Process class for launching external processes.
- ``solution``: if you want to use fixtures and methods to launch a Solution.


.. _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

