Skip to main content

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_KEY environment variable

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://nova.amazon.com/act",
        headless=True
    )
    nova.start()
    yield nova
    nova.stop()

def test_example(nova_session):
    nova_session.act("Click learn more")
    expected = True
    result = nova_session.act("Am I on the Amazon AGI Labs 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:

  1. Run tests using Nova Act
  2. Embed Nova Act SDK logs and screenshots in the pytest-html report file in reports/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 Distribution

pytest_html_nova_act-1.0.2.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

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

pytest_html_nova_act-1.0.2-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

Details for the file pytest_html_nova_act-1.0.2.tar.gz.

File metadata

  • Download URL: pytest_html_nova_act-1.0.2.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for pytest_html_nova_act-1.0.2.tar.gz
Algorithm Hash digest
SHA256 bcec684c91f992fd6baf31d182fb4dbbae43bf79adc6a9fa2b243f0c034054a7
MD5 9498878c339ffffc68df827148f3ed3e
BLAKE2b-256 055b1bd61d309c7bc40f499310abf3100cf695e27915ccc4446605012297cc2e

See more details on using hashes here.

File details

Details for the file pytest_html_nova_act-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for pytest_html_nova_act-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 58ddb11b728ae4fd162b23f4df1ac9ffcd0aa9093838c246d0ae3c4fa57f69dc
MD5 08646c9c7f1cf561ea5b93c8c6a0a86c
BLAKE2b-256 fc497e61684d8ba6b885bb72189c36aed054bb099063afaa5b6c6e21d477e3e8

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