Skip to main content

image

Framework for rapid development of API tests and report generation

Supported Versions

Authors

Features

  • Rapid and straightforward development of tests using high-level methods
  • Generating a report with test results in Allure
  • The report will be useful for stakeholder

Installation

Install my-project with pip:

  pip install anna-api-test-framework

Usage/Examples

from anna import Action, Report, Assert

@Report.epic('Simple tests')
@Report.story('Tests google')
@Report.testcase('https://www.google.com', 'Google')
@Report.link('https://www.google.com', 'Jast another link')
class TestExample:

    @Report.title('Simple test google')
    @Report.severity('CRITICAL')
    def test_simple_request(self):
        url = 'https://google.com'
        method = 'GET'
        want = 200 
        # insert discription of the test
        Report.description(url=url, method=method, other='other information')
        # doing request and geting response
        action = Action()
        response = action.request(method=method, url=url)
        got = response.status_code
        # checking response
        with Report.step('Checking response'):
            Assert.compare(
                variable_first=want,
                comparison_sign='==',
                variable_second=got,
                text_error='Response status code is not equal to expected'
            )

For run test and generat a report use following commands:

  pytest alluredir="./results"

For generat and open a report you need to install Allure and use the following commands:

  allure generate "./results" -c -o "./report"
  allure open "./report"

After that, the generated report will automatically open in your browser

image

The report contains all the information you need

image

Metadata

Release files for anna-api-test-framework 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for anna-api-test-framework 0.1.0
File Size Uploaded
anna-api-test-framework-0.1.0.tar.gz 5.1 kB Details

Release files / anna-api-test-framework-0.1.0.tar.gz

Download URL anna-api-test-framework-0.1.0.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
0f77695ce0e5d54dc8af35598a66c3cee4a930c4e8106fd6db1d85d86edde2dc
BLAKE2b-256 checksum
How to use checksums
f5b5ef7377b7cdbe3792ac5a92e806470ae641c56558265edda44840b66196d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.7

Release history Release notifications | RSS feed

This release

0.1.0 This release

1 release file

0.0.4

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page