Test#
This page provides guidance for solution developers on how to use the testing fixtures provided by the
ansys.saf.glow.testing pytest plugin for SAF GLOW Engine-based solutions. Pytest discovers the plugin automatically; no
fixture imports or pytest_plugins configuration are required.
The primary fixtures are:
client_project: Enables backend testing, giving you access to a GLOW client to interact with your solution’s API. With this fixture, you can test transaction methods, operate with your step fields and validate project-level operations. The client is initiated with a random project for every single test.init_dashclient: Enables frontend testing of your Dash callbacks and UI logic. You can then import your callbacks and execute them, also using theproject_namefixture.mock_product_instance: Extend backend testing to support transactions that use product instances, either in a shared or unshared way, without having to actually run the product.
In all cases, you don’t need to externally launch your solution. The fixtures automatically launch and interact with your Solution API in a process-based way using FastAPI’s TestClient. All data is stored in temporary directories. Furthermore, none of them require changes in your solution implementation or configuration.
These fixtures help you write robust tests for both backend logic and frontend user interfaces, ensuring your solution works correctly in real-world scenarios while keeping tests isolated.
Get started with installation and your first test.
Test backend logic using the client_project fixture.
Test Dash callbacks and UI logic using init_dashclient.
Test transactions with mocked Ansys product instances.
Configure solution environments and use additional utilities.
Advanced patterns for reusing setup code and complex scenarios.
Test the complete install, package, launch, API, and browser lifecycle.