A Pytest Plugin for Amazon Nova Act Python SDK.
Project description
pytest-html-nova-act
pytest-html-nova-act is a pytest plugin that integrates HTML test reporting with Amazon Nova Act SDK capabilities. This plugin enhances pytest-html reports by adding Nova Act-specific features and metadata.
Usage
Requirements
- Python 3.11+
- pytest 8.0+
- pytest-html 4.0+
- nova-act 1.0+
- Nova Act API key
- Visit Nova Act home page to generate your API key and set it to the
NOVA_ACT_API_KEYenvironment variable
- Visit Nova Act home page to generate your API key and set it to the
Installation
Install via pip:
pip install nova-act pytest pytest-html pytest-html-nova-act
Configuration
Add to pytest.ini:
[pytest]
addopts = --html=reports/report.html --self-contained-html --add-nova-act-report
Pytest Example
The below sample code shows how to create a pytest fixture which instantiates the Nova Act client, starts it, and stops it after the test completes. It also includes an example test.
import pytest
from nova_act import NovaAct, BOOL_SCHEMA
@pytest.fixture()
def nova_session():
nova = NovaAct(
starting_page="https://amazon.com",
headless=True
)
nova.start()
yield nova
nova.stop()
def test_example(nova_session):
nova_session.act("Search for a coffee maker")
expected = True
result = nova_session.act("Am I on the coffee maker search results page?", schema=BOOL_SCHEMA)
actual = result.matches_schema and result.parsed_response
assert expected == actual
Usage
pytest
Running the pytest command in a valid pytest project and using the pytest configuration and sample code mentioned above will result in:
- Run tests using Nova Act
- Embed Nova Act SDK logs and screenshots in the
pytest-htmlreport file inreports/report.html
Resources
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pytest_html_nova_act-1.0.0-py3-none-any.whl.
File metadata
- Download URL: pytest_html_nova_act-1.0.0-py3-none-any.whl
- Upload date:
- Size: 9.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8564800d5e9a53dce6c781143b9e076a54174bddfa8431b4843dd459b86c43cb
|
|
| MD5 |
b70414d5262c949fad762eb95c239a5c
|
|
| BLAKE2b-256 |
f73ddfc43f968c250057d2862f6c9625b49d0e0c8fb2074a7c16917a177054c0
|