test-rest-api


Nametest-rest-api JSON
Version 0.0.0.0.40 PyPI version JSON
download
home_pagehttps://github.com/troymjose/test_rest_api
SummaryAsynchronous Test Framework #HighPerformance #EasyToLearn #FastToCode #AsyncTests
upload_time2023-12-18 12:10:51
maintainer
docs_urlNone
authorTroy M Jose
requires_python
license
keywords test unittest restapi testframework asyncio async asynchronous testingframework rest api python python3 testing unittesting automation automationtest automationtesting restapitest restapitesting restapiunittest restapiunittesting restapiautomation restapiautomationtest restapiautomationtesting apitest apitesting apiunittest apiunittesting apiautomation apiautomationtest apiautomationtesting
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
<img alt="test_rest_api" src="https://raw.githubusercontent.com/troymjose/test_rest_api/main/assets/test_rest_api.png"  width="50%" >

# TEST REST API

Create fast modern __asynchronous__ tests for __REST API__ testing

```#FAST #EASY #ASYNC #RESTAPI #TESTING #AUTOMATION```

- [Features](#features)
- [Installation](#installation)
- [Usage](#usage)
    - [Basic usage](#1-basic-usage)
    - [Set report path](#2-set-report-path)
    - [Set .env path](#3-set-env-path)
    - [Set testdata path](#4-set-testdata-path)
    - [Set hashtags](#5-set-hashtags)
    - [Project structure](#6-project-structure)
    - [Command line execution](#7-command-line-execution)
- [Examples](#examples)
    - [My first test](#1-my-first-test)
    - [Configure my test](#2-configure-my-test)
    - [Replace inbuilt assert](#3-replace-inbuilt-assert)
    - [My first log](#4-my-first-log)
    - [Set global variables value](#5-set-global-variables-value)
    - [Set global variables value as constant](#6-set-global-variables-value-as-constant)
    - [Get global variables value](#7-get-global-variables-value)
    - [My first bug](#8-my-first-bug)
    - [Configure my bug](#9-configure-my-bug)
    - [My first rest api](#10-my-first-rest-api)
    - [Configure my rest api](#11-configure-my-rest-api)
    - [Reuse my rest api](#12-reuse-my-rest-api)
    - [Send my rest api](#13-send-my-rest-api)
    - [Rest api response](#14-rest-api-response)
    - [Demo with all the above features](#15-demo)
- [Reports](#reports)
    - [My first report](#1-my-first-report)
    - [Async tests report](#2-async-tests-report)
    - [Sync tests report](#3-sync-tests-report)
    - [Sync & Async report](#4-sync-and-async-report)
    - [Multi status report](#5-multi-status-report)
    - [Multi bug report](#6-multi-bug-report)
    - [Rest api errors](#7-rest-api-errors)
    - [Global variables errors](#8-global-variables-errors)
    - [Bug errors](#9-bug-errors)
    - [Logger errors](#10-logger-errors)
    - [Unexpected errors](#11-unexpected-errors)
- [Author](#author)
- [License](#license)

<h2 id="features">Features</h2>

- __Asyncronus__ programming (Powered by [asyncio](https://pypi.org/project/asyncio/))
- __Auto discovery__ of test modules and functions
- Supports both __asyncronus__ & __syncronuous__ tests
- __High speed__ test executions using async functions
- __Html test reporting__ with custom logs & summary dashboards
- Create complex flows using __parameterization__ & __correlation__
- __Group__ similar tests using hashtags eg: __#smoke__
- Supports __CI/CD__ test automation integrations
- Designed to be __easy__ to use & learn

<h2 id="installation">Installation</h2>

If you already have [Python](http://python.org/) with [pip](https://pip.pypa.io/) installed, you can simply run:

```pip install test_rest_api```

<h2 id="usage">Usage</h2>

<h4 id="1-basic-usage">1. Basic usage</h4>

- - -

```python
from test_rest_api import Runner

runner = Runner(test_suite_path="/Documents/Testsuite")
runner.run()
```  

- Test can be executed from __.py__ file using the __test_rest_api__ module
- Import __Runner__ from __test_rest_api__
- Create an instance of __Runner__
- The basic usage is by providing __test_suite_path__
- Remaining __attributes__ are __optional__ for Runner instance creation
- __test_suite_path__ can be a file or folder path
- We can __organise__ folders, sub folders and python files in any __custom__ structure
- test_rest_api will __autodetect__ python files and folders as __Test suites__
- Call __run()__ method to execute the tests

<h4 id="2-set-report-path">2. Set report path</h4>

- - -

```python
from test_rest_api import Runner

runner = Runner(test_suite_path="/Documents/Testsuite", test_result_path='/Documents/Result')
runner.run()
```  

- In the above example, __html test report__ is saved under the same test folder path
- We can save the final report to our __custom path__ by providing __test_result_path__ attribute
- test_rest_api __creates__ beautiful rich test report with summary dashboards
- We can also add our __custom logs__ to each individual tests in the test report

<h4 id="3-set-env-path">3. Set .env path</h4>

- - -

```python
from test_rest_api import Runner

runner = Runner(test_suite_path="/Documents/Testsuite", env_path='/Documents/.env')
runner.run()
```  

- We can __set variables__ with values, example Domain, Username, Password etc. in __.env file__
- test_rest_api will __auto fetch__ all these values and save under __environment__
- __environment__ can be accessed in tests for __parametrization__
- One example can be __dynamic__ url creation. Domain can be __parameterised__ in url creation
- This will also help developers to run the same tests in __different environments__ by creating separate .env files
- We can __set__ the environment variables by providing __env_path__ attribute

<h4 id="4-set-testdata-path">4. Set testdata path</h4>

- - -

```python
from test_rest_api import Runner

runner = Runner(test_suite_path="/Documents/Testsuite", test_data_path='/Documents/Testdata/')
runner.run()
```  

- We can __set testdata__ with values, example products list, credit card details etc. in __.json files__
- __test_data_path__ can be a json file or folder path
- We can __organise__ folders, sub folders and json files in any __custom__ structure
- test_rest_api will __autodetect__ json files and folders as __Testdata__
- __testdata__ can be accessed in tests for __parametrization__
- This will also help developers to run the same tests with __different testdata__ by creating separate testdata folders
- We can __set__ the testdata variables by providing __test_data_path__ attribute


<h4 id="5-set-hashtags">5. Set hashtags</h4>

- - -

```python
from test_rest_api import Runner

runner = Runner(test_suite_path="/Documents/Testsuite", test_tags=['#SMOKE'])
runner.run()
```  

- __Group__ your test by providing tags in test creation
- This helps to __execute__ a group of testcases, example __smoke testing__, __regression testing__ etc.
- test_rest_api will fetch all tests with the __provided tags__ and executes them
- We can set the __hashtags__ for execution by providing __test_tags_ attribute
- When __no__ tags are provided, __all the tests__ are executed
- When we provide a __single tag__, only those testcases with that tag are executed
- Some tests like login should __run always__ for all tags irrespective of the value
- In this case it's not practical to add all tags to the login test function
- Adding __all tags__ will be hard to maintain when we introduce new custom tags
- To tackle this issue, we can use inbuilt __#ALWAYS tag__
- __#ALWAYS__ tagged tests will always be executed. It will not be skipped
- Tests like login, logout etc. are __perfect candidates__ for #ALWAYS

<h4 id="6-project-structure">6. Project structure</h4>

- - -

```
.
├── api                           # Store all your rest api files
│   ├── auth                      # Custom structure for subfolders & files
│   │   ├── login.py              # Python file to store rest_api code
│   │   │   ├── def user_login()  # Python function to create rest_api
│   │   │   ├── def admin_login()
│   │   │   └── ...    
│   │   └── ...
│   └── ...
├── testsuite                     # Root testsuite folder
│   ├── auth                      # Custom structure for subfolders & files
│   │   ├── login.py              # Python file as testsuite to store tests
│   │   │   ├── async def t001()  # Python async function as testcases
│   │   │   ├── async def t002()
│   │   │   └── ...    
│   │   └── ...
│   └── ...
└── ...
```

- 2 sub folders __api__ & __testsuite__
- Any __custom names__ can be used instead of __api__ & __testsuite__
- __api__ should store all the api creation python files
- __testsuite__ should store all the test creation python files
- Any __custom structure__ with multiple sub folders can be used to organise the files
- __Separating__ api from tests will avoid __code duplication__ for rest_api creation
- Root testsuite folder __path__ will be used in command line __execution__ value for __-t__

<h2 id="examples">Examples</h2>

<h4 id="1-my-first-test">1. My first test</h4>

- - -

```python
from test_rest_api import test


@test()
async def my_first_test():
    assert 4 == 5
```   

- Create an __async__ python function with any __custom__ name
- Decorate the function using __@test()__
- __Async__ python functions decoratd with __@test()__ will be auto-detected as testcase
- __Normal__ python functions decoratd with __@test()__ will __not__ be considered as testcase

__Congrats !__

You have successfully created your first test (__my_first_test__)

Now let's __execute__ it from command line . . .

- __Create__ a
  python [virtual environment](https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/#creating-a-virtual-environment)
- Install __test_rest_api__ using __command__ ```pip install test_rest_api```
- Create new python file (eg: __my_first_testsuite.py__) and paste the above code
- Execute the test from the __command line__ using the test_rest_api module directly

``` python -m test_rest_api -t "<Test folder/file path>" -r "Result folder path" ```

<h4 id="2-configure-my-test">2. Configure my test</h4>

- - -

```python
from test_rest_api import test


@test(name='Custom Name', desc='Description', enabled=True, tags=['SMOKE', 'ABC'], is_async=True, execution_order='1')
async def my_second_test():
    assert 4 == 5
```

- In our first example, we used @test() decorator with __empty parameters__
- In this example, we are __using parameters__ to configure our test function
- This can be considered as adding __settings__ to your test function


- __name__
    - Mandatory: False
    - Data Type: str
    - Expected: Custom name for your test
    - Default: Function name
- __desc__
    - Mandatory: False
    - Data Type: str
    - Expected: Test description
    - Default: Empty string
- __enabled__
    - Mandatory: False
    - Data Type: bool
    - Expected: True or False. Provide False, to disable the test
    - Default: True
- __tags__
    - Mandatory: False
    - Data Type: list
    - Expected: List of tags. Group your tests with custom tags
    - Default: Empty list
- __is_async__
    - Mandatory: False
    - Data Type: bool
    - Expected: True or False. Provide False, to run tests sequentially
    - Default: True
- __execution_order__
    - Mandatory: False
    - Data Type: str
    - Expected: Custom text for ordering. This will work only when is_async = False
    - Default: 'zzzzz'

<h4 id="3-replace-inbuilt-assert">3. Replace inbuilt assert</h4>

- - -

```python
from test_rest_api import test, Assert


@test()
async def my_first_logger():
    # assert 4 == 5
    Assert.equal(4, 5)
```

- Assert is same as inbuilt python assert statement
- Using test rest api Assert class improves logging
- Assertions done using Assert will be automatically logged in final html report
- It is __recommended__ to use Assert instead of inbuilt assert statement for all your tests

<h4 id="4-my-first-log">4. My first log</h4>

- - -

```python
from test_rest_api import test


@test()
async def my_first_logger():
    print('My 1st log')
    print('My 2nd log')
    assert 4 == 5
```

- Python inbuilt ```print()``` function is used to add __custom messages__ to the final html test report
- Add print() functions inside your __test function__
- Add any number of log messages without any limit
- It is __recommended__ to add logs for all your tests
- Note: ```print()``` statements will not be printed to console

<h4 id="5-set-global-variables-value">5. Set global variables value</h4>

- - -

```python
from test_rest_api import test, GlobalVariables


@test()
async def set_global_variables_value():
    GlobalVariables.set(name='token', value='token from response')
```

- Global variables are used to __save__ & __retrieve__ values in runtime
- This will help in __parameterization__ and __correlation__ of tests
- Save __Token__ from login api response in your first test
- Retrieve this Token in all your __upcoming tests__ for authentication
- Here we will learn how to __set__ the value in GlobalVariables

```GlobalVariables.set(name='token', value='token from response')```

- __name__
    - Mandatory: True
    - Data Type: str
    - Expected: Custom name for your global variable
- __value__
    - Mandatory: True
    - Data Type: any
    - Expected: Any python data type can be stored as global variables value

<h4 id="6-set-global-variables-value-as-constant">6. Set global variables value as constant</h4>

- - -

```python
from test_rest_api import test, GlobalVariables


@test()
async def set_global_variables_value_as_constant():
    GlobalVariables.set(name='pi', value=3.14, is_constant=True)
```

- In the above example we learned to __set__ value to global variables
- __Multiple set__ calls are possible for the same variable
- Token variable can be __set again__ in a different test function
- To avoid this, we can set global variables as a __constant__ value
- Use __is_consant__ optional parameter & make it True

```GlobalVariables.set(name='pi', value=3.14, is_constant=True)```

- __name__
    - Mandatory: True
    - Data Type: str
    - Expected: Custom name for your global variable
- __value__
    - Mandatory: True
    - Data Type: any
    - Expected: Any python data type can be stored as global variables value
- __is_constant__
    - Mandatory: False
    - Data Type: bool
    - Expected: True or False. Provide True, to create constants
    - Default: False

<h4 id="7-get-global-variables-value">7. Get global variables value</h4>

- - -

```python
from test_rest_api import test, GlobalVariables


@test()
async def get_global_variables_value():
    token: str = GlobalVariables.get(name='token')
    pi: float = GlobalVariables.get(name='pi')
```

- In the above examples we learned to __set__ varying and constant value to global variables
- Now it's time to __retrieve__ them in our tests
- Please make sure to use __valid variable names__ while retrieving the values
- If the variable name is __not present__ in global variables, test will __terminate with error__

```GlobalVariables.get(name='token')```

- __name__
    - Mandatory: True
    - Data Type: str
    - Expected: Valid name of any saved global variable

<h4 id="8-my-first-bug">8. My first bug</h4>

- - -

```python
from test_rest_api import test, Bug


@test()
async def my_first_bug():
    Bug()
```

- Bug is used to __raise issues__ in tests
- Add custom __checks__ in your tests to validate __rest api response__
- If __actual result__ is not the __expected result__, just call ```Bug()```
- This will __terminate__ the current test function execution
- Bug __details__ can be viewed in final html test __report__

<h4 id="9-configure-my-bug">9. Configure my bug</h4>

- - -

```python
from test_rest_api import test, Bug, Logger


@test()
async def my_second_bug():
    logger = Logger()
    logger.log('step 1')
    logger.log('step 2')
    logger.log('Consider all steps are logged')
    Bug(message="msg", priority=Bug.PRIORITY.BLOCKER, actual_result="", expected_result="", steps_to_reproduce=logger)
```

- In our first bug example, we used Bug() with __empty attributes__
- In this example, we are __using attributes__ to configure our Bug
- This can be considered as adding __more info__ to your bug in the final html test report
- We are adding custom __logging__ in this example to show how logger instance is __useful in Bug creation__
- Logger instance variable can be passed to __steps_to_reproduce__ attribute during Bug creation

```
Bug(message='', priority='', actual_result='', expected_result='', steps_to_reproduce='')
```

- __message__
    - Mandatory: False
    - Data Type: str
    - Expected: Custom message for your bug
    - Default: Empty string
- __priority__
    - Mandatory: False
    - Data Type: str
    - Expected: Priority for this bug. Supported list: Bug.PRIORITY.__[ items ]__
    - Default: Empty string
- __actual_result__
    - Mandatory: False
    - Data Type: str
    - Expected: Provide the actual result
    - Default: Empty string
- __expected_result__
    - Mandatory: False
    - Data Type: str
    - Expected: Provide the expected result
    - Default: Empty list
- __steps_to_reproduce__
    - Mandatory: False
    - Data Type: str
    - Expected: Logger instance can be used to auto-populate this field
    - Default: Empty string

<h4 id="10-my-first-rest-api">10. My first rest api</h4>

- - -

```python
from test_rest_api import test, RestApi


@test()
async def my_first_rest_api():
    rest_api = RestApi(url='https://dummyjson.com/products/1')
```

- RestApi is used __create__ rest api instance in tests
- Here we have created a basic rest api with just the __url information__
- This example is only about creating rest api, no __send action__ is performed here
- We will use this __instance variable__ for sending the request in upcoming examples

<h4 id="11-configure-my-rest-api">11. Configure my rest api</h4>

- - -

```python
from test_rest_api import test, RestApi


@test()
async def configure_my_rest_api():
    rest_api = RestApi(url='my url', parameters={'p1': 'v1', 'p2': 'val2'}, headers={'h1': 'v1', 'h2': 'val1'}, body={})
```

- In the above example, we have only used __url attribute__ for rest api creation
- Other attributes for creation are __parameters__, __headers__ and __body__
- This example shows the syntax for adding these __optional attributes__


- __url__
    - Mandatory: True
    - Data Type: str
    - Expected: Rest api url
- __parameters__
    - Mandatory: False
    - Data Type: dict
    - Expected: Key value pairs of parameter name & value
    - Default: {}
- __headers__
    - Mandatory: False
    - Data Type: dict
    - Expected: Key value pairs of header name & value
    - Default: {}
- __body__
    - Mandatory: False
    - Data Type: dict
    - Expected: Provide the json request payload
    - Default: {}

<h4 id="12-reuse-my-rest-api">12. Reuse my rest api</h4>

- - -

```python
from test_rest_api import RestApi, GlobalVariables


def login_api(username: str, password: str):
    domain = GlobalVariables.get('DOMAIN')
    url = f'https://{domain}/login'
    body = {'username': username, 'password': password}
    return RestApi(url=url, body=body)
```

- A rest api will be used for __multiple tests__
- __Creation__ of rest api __inside__ test async functions will result in __code duplication__
- Duplicate code makes your program __lengthy__ and decreases your code __quality__
- __Updating__ & __maintaining__ this rest api creations in __multiple__ tests will be difficult
- __New changes__ to rest api, will result in changing the __same code multiple times__
- To avoid duplication, we can use a __separate folder__ for rest api files
- Use python __functions__ to create a rest api which will avoid __code duplication__
- You can __call__ a function __100__ times instead of __writing__ it __100__ times
- In this example we have created a simple __login api__
- All the __dynamic values__ for rest api creation can be passed as function __parameters__
- This helps in calling the same api with __different inputs__
- Return the __RestApi instance__ which can be used in test functions for __sending__

<h4 id="13-send-my-rest-api">13. Send my rest api</h4>

- - -

```python
from test_rest_api import test, RestApi


@test()
async def send_my_rest_api():
    rest_api = RestApi(url='https://dummyjson.com/products/1')
    response1 = await rest_api.get()
    response2 = await rest_api.send(method='get')
    response3 = await rest_api.send(method=rest_api.METHODS.GET)
```

- In the above examples, we learned to __create__ a rest api
- Now it's time to __send__ them using http methods
- __Supported__ http methods are GET, POST, PUT, PATCH, DELETE, OPTIONS & HEAD
- Here we are sending the rest_api using __GET__ http method
- All the responses (1, 2 & 3) will have the __same result__
- Because they perform the same functionality with __different syntax__
- Similarly, __other http methods__ can be used, with your desired syntax

<h4 id="14-rest-api-response">14. Rest api response</h4>

- - -

```python
from test_rest_api import test, RestApi


@test()
async def send_my_rest_api():
    rest_api = RestApi(url='https://dummyjson.com/products/1')
    response = await rest_api.get()

    status_code = response.status_code
    body = response.body
    headers = response.headers
    content_type = response.content_type
    obj = response.obj
```

- We have covered rest api __creation__ & __sending__ part
- Now lets see more about the __response object__
- Mostly __all checks__ will be performed using response object data
- Response object contains the below details


- __response.status_code__
    - Data Type: int
    - Value: Response status code
- __response.body__
    - Data Type: dict
    - Value: Response body
- __response.headers__
    - Data Type: dict
    - Value: Response headers
- __response.content_type__
    - Data Type: str
    - Value: Response content type
- __response.obj__
    - Data Type: aiohttp.ClientResponse
    - Value: Python aiohttp ClientResponse object

<h4 id="15-demo">15. Demo with all the above features</h4>

- - -

```
.env file
---------

DOMAIN=dummyjson.com
```

```python
from test_rest_api import test, RestApi, Bug, Logger, GlobalVariables


@test(name='Demo', desc='All features')
async def demo():
    logger = Logger()
    logger.log('Starting the test')

    logger.log('Creating rest api')
    domain = GlobalVariables.get('DOMAIN')
    rest_api = RestApi(url=f"https://{domain}/products/1")

    logger.log('Sending rest api')
    response = await rest_api.get()

    logger.log(f'Response code = {response.status_code}')
    logger.log(f'Response body = {response.body}')

    logger.log('Validate response code')
    if response.status_code != 200:
        Bug(message='Invalid status code', priority=Bug.PRIORITY.MINOR, actual_result=response.status_code,
            expected_result='200', steps_to_reproduce=logger)

    logger.log('Save price details to global variables')
    title = response.body.get('title', '')
    price = response.body.get('price', '')
    GlobalVariables.set(name=title, value=price)

    logger.log('Successfully completed the test')

```

<h2 id="reports">Reports</h2>

<h4 id="1-my-first-report">1. My first report</h4>

- - -

- Single basic test with __PASS__ status

[Click here to view the html report](https://raw.githack.com/troymjose/test_rest_api/main/assets/reports/my_first_report.html)

Console output

```bash
2023-04-08 15:40:22,712: 
                          =======================================================
                        || ..................................................... ||
                        || ..................................................... ||
                        || ...........  T E S T - R E S T - A P I   ............ ||
                        || ..................................................... ||
                        || ..................................................... ||
                          =======================================================
                        
2023-04-08 15:40:22,712: Starting test setup
2023-04-08 15:40:22,712: Auto detecting test suites
2023-04-08 15:40:22,712: Total test suites: 1
2023-04-08 15:40:22,712: Auto detecting tests
2023-04-08 15:40:22,713: Total synchronous tests: 0
2023-04-08 15:40:22,714: Total asynchronous tests: 1
2023-04-08 15:40:22,714: Total tests: 1
2023-04-08 15:40:22,714: Created aiohttp client session
2023-04-08 15:40:22,714: Completed test setup
2023-04-08 15:40:22,714: 
                          =======================================================
                        || ............... A S Y N C - T E S T S ............... ||
                          =======================================================
2023-04-08 15:40:22,714: PASS    my_first_test (root file) [1]
2023-04-08 15:40:22,715: 
                          =======================================================
                        || ..................................................... ||
                        || ............  T E S T - S U M M A R Y   ............. ||
                        || ..................................................... ||
                          =======================================================
                        
                        Status:             PASS
                        Tests:              1
                        Start:              2023-04-08 15-40-22
                        End:                2023-04-08 15-40-22
                        Duration:           0.000956233 seconds
                        Tags:               []
                        
                        PASS:               1
                        FAIL:               0
                        ERROR:              0
                        DISABLE:            0
                        SKIP:               0
                        
                        LOW:                0
                        MINOR:              0
                        MAJOR:              0
                        CRITICAL:           0
                        BLOCKER:            0
                        
                        REST API:           0
                        GLOBAL VARIABLES:   0
                        BUG:                0
                        LOGGER:             0
                        UNEXPECTED:         0
```

<h4 id="2-async-tests-report">2. Async tests report</h4>

- - -

- 5 __async__ tests
- Each tests takes __1 second__ to complete

[Click here to view the html report](https://raw.githack.com/troymjose/test_rest_api/main/assets/reports/async_tests_report.html)

Console output

```bash
2023-04-08 15:52:05,062: 
                          =======================================================
                        || ..................................................... ||
                        || ..................................................... ||
                        || ...........  T E S T - R E S T - A P I   ............ ||
                        || ..................................................... ||
                        || ..................................................... ||
                          =======================================================
                        
2023-04-08 15:52:05,062: Starting test setup
2023-04-08 15:52:05,062: Auto detecting test suites
2023-04-08 15:52:05,062: Total test suites: 1
2023-04-08 15:52:05,062: Auto detecting tests
2023-04-08 15:52:05,063: Total synchronous tests: 0
2023-04-08 15:52:05,063: Total asynchronous tests: 5
2023-04-08 15:52:05,063: Total tests: 5
2023-04-08 15:52:05,063: Created aiohttp client session
2023-04-08 15:52:05,063: Completed test setup
2023-04-08 15:52:05,063: 
                          =======================================================
                        || ............... A S Y N C - T E S T S ............... ||
                          =======================================================
2023-04-08 15:52:06,064: PASS    testcase_1 (root file) [1]
2023-04-08 15:52:06,064: PASS    testcase_2 (root file) [2]
2023-04-08 15:52:06,065: PASS    testcase_3 (root file) [3]
2023-04-08 15:52:06,065: PASS    testcase_4 (root file) [4]
2023-04-08 15:52:06,065: PASS    testcase_5 (root file) [5]
2023-04-08 15:52:06,066: 
                          =======================================================
                        || ..................................................... ||
                        || ............  T E S T - S U M M A R Y   ............. ||
                        || ..................................................... ||
                          =======================================================
                        
                        Status:             PASS
                        Tests:              5
                        Start:              2023-04-08 15-52-05
                        End:                2023-04-08 15-52-06
                        Duration:           1.002069748 seconds
                        Tags:               []
                        
                        PASS:               5
                        FAIL:               0
                        ERROR:              0
                        DISABLE:            0
                        SKIP:               0
                        
                        LOW:                0
                        MINOR:              0
                        MAJOR:              0
                        CRITICAL:           0
                        BLOCKER:            0
                        
                        REST API:           0
                        GLOBAL VARIABLES:   0
                        BUG:                0
                        LOGGER:             0
                        UNEXPECTED:         0
```

<h4 id="3-sync-tests-report">3. Sync tests report</h4>

- - -

- 5 __sync__ tests
- Each tests takes __1 second__ to complete

[Click here to view the html report](https://raw.githack.com/troymjose/test_rest_api/main/assets/reports/sync_tests_report.html)

Console output

```bash
2023-04-08 15:56:19,128: 
                          =======================================================
                        || ..................................................... ||
                        || ..................................................... ||
                        || ...........  T E S T - R E S T - A P I   ............ ||
                        || ..................................................... ||
                        || ..................................................... ||
                          =======================================================
                        
2023-04-08 15:56:19,129: Starting test setup
2023-04-08 15:56:19,129: Auto detecting test suites
2023-04-08 15:56:19,129: Total test suites: 1
2023-04-08 15:56:19,129: Auto detecting tests
2023-04-08 15:56:19,129: Total synchronous tests: 5
2023-04-08 15:56:19,129: Total asynchronous tests: 0
2023-04-08 15:56:19,129: Total tests: 5
2023-04-08 15:56:19,129: Created aiohttp client session
2023-04-08 15:56:19,129: Completed test setup
2023-04-08 15:56:19,130: 
                          =======================================================
                        || ................  S Y N C - T E S T S ............... ||
                          =======================================================
2023-04-08 15:56:20,131: PASS    testcase_1 (root file) [1]
2023-04-08 15:56:21,132: PASS    testcase_2 (root file) [2]
2023-04-08 15:56:22,132: PASS    testcase_3 (root file) [3]
2023-04-08 15:56:23,134: PASS    testcase_4 (root file) [4]
2023-04-08 15:56:24,135: PASS    testcase_5 (root file) [5]
2023-04-08 15:56:24,137: 
                          =======================================================
                        || ..................................................... ||
                        || ............  T E S T - S U M M A R Y   ............. ||
                        || ..................................................... ||
                          =======================================================
                        
                        Status:             PASS
                        Tests:              5
                        Start:              2023-04-08 15-56-19
                        End:                2023-04-08 15-56-24
                        Duration:           5.006235552 seconds
                        Tags:               []
                        
                        PASS:               5
                        FAIL:               0
                        ERROR:              0
                        DISABLE:            0
                        SKIP:               0
                        
                        LOW:                0
                        MINOR:              0
                        MAJOR:              0
                        CRITICAL:           0
                        BLOCKER:            0
                        
                        REST API:           0
                        GLOBAL VARIABLES:   0
                        BUG:                0
                        LOGGER:             0
                        UNEXPECTED:         0
```

<h4 id="4-sync-and-async-report">4. Sync & Async report</h4>

- - -

- 5 __sync__ & __async__ tests each
- Total __10__ tests
- Each tests takes __1 second__ to complete

[Click here to view the html report](https://raw.githack.com/troymjose/test_rest_api/main/assets/reports/sync_and_async_report.html)

Console output

```bash
2023-04-08 15:59:38,170: 
                          =======================================================
                        || ..................................................... ||
                        || ..................................................... ||
                        || ...........  T E S T - R E S T - A P I   ............ ||
                        || ..................................................... ||
                        || ..................................................... ||
                          =======================================================
                        
2023-04-08 15:59:38,170: Starting test setup
2023-04-08 15:59:38,170: Auto detecting test suites
2023-04-08 15:59:38,170: Total test suites: 1
2023-04-08 15:59:38,170: Auto detecting tests
2023-04-08 15:59:38,172: Total synchronous tests: 5
2023-04-08 15:59:38,172: Total asynchronous tests: 5
2023-04-08 15:59:38,172: Total tests: 10
2023-04-08 15:59:38,173: Created aiohttp client session
2023-04-08 15:59:38,173: Completed test setup
2023-04-08 15:59:38,173: 
                          =======================================================
                        || ................  S Y N C - T E S T S ............... ||
                          =======================================================
2023-04-08 15:59:39,174: PASS    testcase_1 (root file) [1]
2023-04-08 15:59:40,176: PASS    testcase_2 (root file) [2]
2023-04-08 15:59:41,177: PASS    testcase_3 (root file) [3]
2023-04-08 15:59:42,178: PASS    testcase_4 (root file) [4]
2023-04-08 15:59:43,180: PASS    testcase_5 (root file) [5]
2023-04-08 15:59:43,180: 
                          =======================================================
                        || ............... A S Y N C - T E S T S ............... ||
                          =======================================================
2023-04-08 15:59:44,182: PASS    testcase_async_1 (root file) [6]
2023-04-08 15:59:44,182: PASS    testcase_async_2 (root file) [7]
2023-04-08 15:59:44,183: PASS    testcase_async_3 (root file) [8]
2023-04-08 15:59:44,183: PASS    testcase_async_4 (root file) [9]
2023-04-08 15:59:44,183: PASS    testcase_async_5 (root file) [10]
2023-04-08 15:59:44,185: 
                          =======================================================
                        || ..................................................... ||
                        || ............  T E S T - S U M M A R Y   ............. ||
                        || ..................................................... ||
                          =======================================================
                        
                        Status:             PASS
                        Tests:              10
                        Start:              2023-04-08 15-59-38
                        End:                2023-04-08 15-59-44
                        Duration:           6.01064299 seconds
                        Tags:               []
                        
                        PASS:               10
                        FAIL:               0
                        ERROR:              0
                        DISABLE:            0
                        SKIP:               0
                        
                        LOW:                0
                        MINOR:              0
                        MAJOR:              0
                        CRITICAL:           0
                        BLOCKER:            0
                        
                        REST API:           0
                        GLOBAL VARIABLES:   0
                        BUG:                0
                        LOGGER:             0
                        UNEXPECTED:         0
```

<h4 id="5-multi-status-report">5. Multi status report</h4>

- - -

- 5 __async__ tests with different __status__ values
- __Status list__: PASS, FAIL, ERROR, DISABLE & SKIP

[Click here to view the html report](https://raw.githack.com/troymjose/test_rest_api/main/assets/reports/multi_status_report.html)

Console output

```bash
2023-04-08 16:17:44,328: 
                          =======================================================
                        || ..................................................... ||
                        || ..................................................... ||
                        || ...........  T E S T - R E S T - A P I   ............ ||
                        || ..................................................... ||
                        || ..................................................... ||
                          =======================================================
                        
2023-04-08 16:17:44,329: Starting test setup
2023-04-08 16:17:44,329: Auto detecting test suites
2023-04-08 16:17:44,329: Total test suites: 1
2023-04-08 16:17:44,329: Auto detecting tests
2023-04-08 16:17:44,330: Total synchronous tests: 0
2023-04-08 16:17:44,330: Total asynchronous tests: 5
2023-04-08 16:17:44,330: Total tests: 5
2023-04-08 16:17:44,330: Created aiohttp client session
2023-04-08 16:17:44,330: Completed test setup
2023-04-08 16:17:44,330: 
                          =======================================================
                        || ............... A S Y N C - T E S T S ............... ||
                          =======================================================
2023-04-08 16:17:44,330: ERROR   t_error (root file) [2]
2023-04-08 16:17:44,331: FAIL    t_fail (root file) [3]
2023-04-08 16:17:44,331: PASS    t_pass (root file) [4]
2023-04-08 16:17:44,332: 
                          =======================================================
                        || ..................................................... ||
                        || ............  T E S T - S U M M A R Y   ............. ||
                        || ..................................................... ||
                          =======================================================
                        
                        Status:             FAIL
                        Tests:              5
                        Start:              2023-04-08 16-17-44
                        End:                2023-04-08 16-17-44
                        Duration:           0.001355524 seconds
                        Tags:               ['SMOKE']
                        
                        PASS:               1
                        FAIL:               1
                        ERROR:              1
                        DISABLE:            1
                        SKIP:               1
                        
                        LOW:                0
                        MINOR:              0
                        MAJOR:              1
                        CRITICAL:           0
                        BLOCKER:            0
                        
                        REST API:           0
                        GLOBAL VARIABLES:   0
                        BUG:                0
                        LOGGER:             0
                        UNEXPECTED:         1
```

<h4 id="6-multi-bug-report">6. Multi bug report</h4>

- 5 __async__ tests with different __bug priority__ values
- __Priority list__: LOW, MINOR, MAJOR, CRITICAL, BLOCKER

[Click here to view the html report](https://raw.githack.com/troymjose/test_rest_api/main/assets/reports/multi_bug_report.html)

Console output

```bash
2023-04-08 16:30:21,400: 
                          =======================================================
                        || ..................................................... ||
                        || ..................................................... ||
                        || ...........  T E S T - R E S T - A P I   ............ ||
                        || ..................................................... ||
                        || ..................................................... ||
                          =======================================================
                        
2023-04-08 16:30:21,400: Starting test setup
2023-04-08 16:30:21,400: Auto detecting test suites
2023-04-08 16:30:21,400: Total test suites: 1
2023-04-08 16:30:21,400: Auto detecting tests
2023-04-08 16:30:21,401: Total synchronous tests: 0
2023-04-08 16:30:21,401: Total asynchronous tests: 5
2023-04-08 16:30:21,401: Total tests: 5
2023-04-08 16:30:21,402: Created aiohttp client session
2023-04-08 16:30:21,402: Completed test setup
2023-04-08 16:30:21,402: 
                          =======================================================
                        || ............... A S Y N C - T E S T S ............... ||
                          =======================================================
2023-04-08 16:30:21,402: FAIL    t_blocker (root file) [1]
2023-04-08 16:30:21,404: FAIL    t_critical (root file) [2]
2023-04-08 16:30:21,404: FAIL    t_low (root file) [3]
2023-04-08 16:30:21,404: FAIL    t_major (root file) [4]
2023-04-08 16:30:21,404: FAIL    t_minor (root file) [5]
2023-04-08 16:30:21,406: 
                          =======================================================
                        || ..................................................... ||
                        || ............  T E S T - S U M M A R Y   ............. ||
                        || ..................................................... ||
                          =======================================================
                        
                        Status:             FAIL
                        Tests:              5
                        Start:              2023-04-08 16-30-21
                        End:                2023-04-08 16-30-21
                        Duration:           0.003122595 seconds
                        Tags:               []
                        
                        PASS:               0
                        FAIL:               5
                        ERROR:              0
                        DISABLE:            0
                        SKIP:               0
                        
                        LOW:                1
                        MINOR:              1
                        MAJOR:              1
                        CRITICAL:           1
                        BLOCKER:            1
                        
                        REST API:           0
                        GLOBAL VARIABLES:   0
                        BUG:                0
                        LOGGER:             0
                        UNEXPECTED:         0
```

<h4 id="7-rest-api-errors">7. Rest api errors</h4>

- - -

- Developers can make __errors__ while coding
- __General__ error exception __messages__ will increase the time to __find__ and __fix__ these issues
- test_rest_api provides __short__ & __precise__ error's with exact __traceback__ info
- Here we are __purposefully__ making errors in __RestApi__ functions

[Click here to view the html report](https://raw.githack.com/troymjose/test_rest_api/main/assets/reports/rest_api_errors.html)

Console output

```bash
2023-04-08 19:41:19,099: 
                          =======================================================
                        || ..................................................... ||
                        || ..................................................... ||
                        || ...........  T E S T - R E S T - A P I   ............ ||
                        || ..................................................... ||
                        || ..................................................... ||
                          =======================================================
                        
2023-04-08 19:41:19,099: Starting test setup
2023-04-08 19:41:19,099: Auto detecting test suites
2023-04-08 19:41:19,099: Total test suites: 1
2023-04-08 19:41:19,099: Auto detecting tests
2023-04-08 19:41:19,099: Total synchronous tests: 0
2023-04-08 19:41:19,099: Total asynchronous tests: 12
2023-04-08 19:41:19,099: Total tests: 12
2023-04-08 19:41:19,099: Created aiohttp client session
2023-04-08 19:41:19,099: Completed test setup
2023-04-08 19:41:19,099: 
                          =======================================================
                        || ............... A S Y N C - T E S T S ............... ||
                          =======================================================
2023-04-08 19:41:19,100: ERROR   t1 (root file) [1]
2023-04-08 19:41:19,101: ERROR   t10 (root file) [2]
2023-04-08 19:41:19,110: ERROR   t2 (root file) [5]
2023-04-08 19:41:19,110: ERROR   t3 (root file) [6]
2023-04-08 19:41:19,110: ERROR   t4 (root file) [7]
2023-04-08 19:41:19,110: ERROR   t5 (root file) [8]
2023-04-08 19:41:19,110: ERROR   t6 (root file) [9]
2023-04-08 19:41:19,111: ERROR   t7 (root file) [10]
2023-04-08 19:41:19,111: ERROR   t8 (root file) [11]
2023-04-08 19:41:19,111: ERROR   t9 (root file) [12]
2023-04-08 19:41:19,115: ERROR   t11 (root file) [3]
2023-04-08 19:41:19,285: ERROR   t12 (root file) [4]
2023-04-08 19:41:19,288: 
                          =======================================================
                        || ..................................................... ||
                        || ............  T E S T - S U M M A R Y   ............. ||
                        || ..................................................... ||
                          =======================================================
                        
                        Status:             FAIL
                        Tests:              12
                        Start:              2023-04-08 19-41-19
                        End:                2023-04-08 19-41-19
                        Duration:           0.18714125 seconds
                        Tags:               []
                        
                        PASS:               0
                        FAIL:               0
                        ERROR:              12
                        DISABLE:            0
                        SKIP:               0
                        
                        LOW:                0
                        MINOR:              0
                        MAJOR:              0
                        CRITICAL:           0
                        BLOCKER:            0
                        
                        REST API:           12
                        GLOBAL VARIABLES:   0
                        BUG:                0
                        LOGGER:             0
                        UNEXPECTED:         0
```

<h4 id="8-global-variables-errors">8. Global variables errors</h4>

- - -

- Developers can make __errors__ while coding
- __General__ error exception __messages__ will increase the time to __find__ and __fix__ these issues
- test_rest_api provides __short__ & __precise__ error's with exact __traceback__ info
- Here we are __purposefully__ making errors in __GlobalVariables__ functions

[Click here to view the html report](https://raw.githack.com/troymjose/test_rest_api/main/assets/reports/global_variables_errors.html)

Console output

```bash
2023-04-08 18:38:05,825: 
                          =======================================================
                        || ..................................................... ||
                        || ..................................................... ||
                        || ...........  T E S T - R E S T - A P I   ............ ||
                        || ..................................................... ||
                        || ..................................................... ||
                          =======================================================
                        
2023-04-08 18:38:05,825: Starting test setup
2023-04-08 18:38:05,825: Auto detecting test suites
2023-04-08 18:38:05,826: Total test suites: 1
2023-04-08 18:38:05,826: Auto detecting tests
2023-04-08 18:38:05,827: Total synchronous tests: 0
2023-04-08 18:38:05,827: Total asynchronous tests: 13
2023-04-08 18:38:05,827: Total tests: 13
2023-04-08 18:38:05,827: Created aiohttp client session
2023-04-08 18:38:05,827: Completed test setup
2023-04-08 18:38:05,827: 
                          =======================================================
                        || ............... A S Y N C - T E S T S ............... ||
                          =======================================================
2023-04-08 18:38:05,827: ERROR   t_1 (root file) [1]
2023-04-08 18:38:05,828: ERROR   t_10 (root file) [2]
2023-04-08 18:38:05,828: ERROR   t_11 (root file) [3]
2023-04-08 18:38:05,828: ERROR   t_12 (root file) [4]
2023-04-08 18:38:05,829: ERROR   t_13 (root file) [5]
2023-04-08 18:38:05,829: ERROR   t_2 (root file) [6]
2023-04-08 18:38:05,829: ERROR   t_3 (root file) [7]
2023-04-08 18:38:05,829: ERROR   t_4 (root file) [8]
2023-04-08 18:38:05,829: ERROR   t_5 (root file) [9]
2023-04-08 18:38:05,830: ERROR   t_6 (root file) [10]
2023-04-08 18:38:05,830: ERROR   t_7 (root file) [11]
2023-04-08 18:38:05,830: ERROR   t_8 (root file) [12]
2023-04-08 18:38:05,830: ERROR   t_9 (root file) [13]
2023-04-08 18:38:05,831: 
                          =======================================================
                        || ..................................................... ||
                        || ............  T E S T - S U M M A R Y   ............. ||
                        || ..................................................... ||
                          =======================================================
                        
                        Status:             FAIL
                        Tests:              13
                        Start:              2023-04-08 18-38-05
                        End:                2023-04-08 18-38-05
                        Duration:           0.003679225 seconds
                        Tags:               []
                        
                        PASS:               0
                        FAIL:               0
                        ERROR:              13
                        DISABLE:            0
                        SKIP:               0
                        
                        LOW:                0
                        MINOR:              0
                        MAJOR:              0
                        CRITICAL:           0
                        BLOCKER:            0
                        
                        REST API:           0
                        GLOBAL VARIABLES:   13
                        BUG:                0
                        LOGGER:             0
                        UNEXPECTED:         0
```

<h4 id="9-bug-errors">9. Bug errors</h4>

- - -

- Developers can make __errors__ while coding
- __General__ error exception __messages__ will increase the time to __find__ and __fix__ these issues
- test_rest_api provides __short__ & __precise__ error's with exact __traceback__ info
- Here we are __purposefully__ making errors in __Bug__ functions

[Click here to view the html report](https://raw.githack.com/troymjose/test_rest_api/main/assets/reports/bug_errors.html)

Console output

```bash
2023-04-08 19:55:51,870: 
                          =======================================================
                        || ..................................................... ||
                        || ..................................................... ||
                        || ...........  T E S T - R E S T - A P I   ............ ||
                        || ..................................................... ||
                        || ..................................................... ||
                          =======================================================
                        
2023-04-08 19:55:51,871: Starting test setup
2023-04-08 19:55:51,871: Auto detecting test suites
2023-04-08 19:55:51,871: Total test suites: 1
2023-04-08 19:55:51,871: Auto detecting tests
2023-04-08 19:55:51,872: Total synchronous tests: 0
2023-04-08 19:55:51,872: Total asynchronous tests: 7
2023-04-08 19:55:51,872: Total tests: 7
2023-04-08 19:55:51,872: Created aiohttp client session
2023-04-08 19:55:51,872: Completed test setup
2023-04-08 19:55:51,872: 
                          =======================================================
                        || ............... A S Y N C - T E S T S ............... ||
                          =======================================================
2023-04-08 19:55:51,872: ERROR   t1 (root file) [1]
2023-04-08 19:55:51,874: ERROR   t2 (root file) [2]
2023-04-08 19:55:51,875: ERROR   t3 (root file) [3]
2023-04-08 19:55:51,875: ERROR   t4 (root file) [4]
2023-04-08 19:55:51,875: ERROR   t5 (root file) [5]
2023-04-08 19:55:51,875: ERROR   t6 (root file) [6]
2023-04-08 19:55:51,876: ERROR   t7 (root file) [7]
2023-04-08 19:55:51,877: 
                          =======================================================
                        || ..................................................... ||
                        || ............  T E S T - S U M M A R Y   ............. ||
                        || ..................................................... ||
                          =======================================================
                        
                        Status:             FAIL
                        Tests:              7
                        Start:              2023-04-08 19-55-51
                        End:                2023-04-08 19-55-51
                        Duration:           0.003555115 seconds
                        Tags:               []
                        
                        PASS:               0
                        FAIL:               0
                        ERROR:              7
                        DISABLE:            0
                        SKIP:               0
                        
                        LOW:                0
                        MINOR:              0
                        MAJOR:              0
                        CRITICAL:           0
                        BLOCKER:            0
                        
                        REST API:           0
                        GLOBAL VARIABLES:   0
                        BUG:                7
                        LOGGER:             0
                        UNEXPECTED:         0
```

<h4 id="10-logger-errors">10. Logger errors</h4>

- - -

- Developers can make __errors__ while coding
- __General__ error exception __messages__ will increase the time to __find__ and __fix__ these issues
- test_rest_api provides __short__ & __precise__ error's with exact __traceback__ info
- Here we are __purposefully__ making errors in __Logger__ functions

[Click here to view the html report](https://raw.githack.com/troymjose/test_rest_api/main/assets/reports/logger_errors.html)

Console output

```bash
2023-04-08 21:54:56,023: 
                          =======================================================
                        || ..................................................... ||
                        || ..................................................... ||
                        || ...........  T E S T - R E S T - A P I   ............ ||
                        || ..................................................... ||
                        || ..................................................... ||
                          =======================================================
                        
2023-04-08 21:54:56,023: Starting test setup
2023-04-08 21:54:56,023: Auto detecting test suites
2023-04-08 21:54:56,023: Total test suites: 1
2023-04-08 21:54:56,023: Auto detecting tests
2023-04-08 21:54:56,023: Total synchronous tests: 0
2023-04-08 21:54:56,023: Total asynchronous tests: 7
2023-04-08 21:54:56,023: Total tests: 7
2023-04-08 21:54:56,023: Created aiohttp client session
2023-04-08 21:54:56,023: Completed test setup
2023-04-08 21:54:56,023: 
                          =======================================================
                        || ............... A S Y N C - T E S T S ............... ||
                          =======================================================
2023-04-08 21:54:56,023: ERROR   t1 (root file) [1]
2023-04-08 21:54:56,025: ERROR   t2 (root file) [2]
2023-04-08 21:54:56,025: ERROR   t3 (root file) [3]
2023-04-08 21:54:56,026: ERROR   t4 (root file) [4]
2023-04-08 21:54:56,026: ERROR   t5 (root file) [5]
2023-04-08 21:54:56,026: ERROR   t6 (root file) [6]
2023-04-08 21:54:56,026: ERROR   t7 (root file) [7]
2023-04-08 21:54:56,027: 
                          =======================================================
                        || ..................................................... ||
                        || ............  T E S T - S U M M A R Y   ............. ||
                        || ..................................................... ||
                          =======================================================
                        
                        Status:             FAIL
                        Tests:              7
                        Start:              2023-04-08 21-54-56
                        End:                2023-04-08 21-54-56
                        Duration:           0.003578533 seconds
                        Tags:               []
                        
                        PASS:               0
                        FAIL:               0
                        ERROR:              7
                        DISABLE:            0
                        SKIP:               0
                        
                        LOW:                0
                        MINOR:              0
                        MAJOR:              0
                        CRITICAL:           0
                        BLOCKER:            0
                        
                        REST API:           0
                        GLOBAL VARIABLES:   0
                        BUG:                0
                        LOGGER:             7
                        UNEXPECTED:         0
```

<h4 id="11-unexpected-errors">11. Unexpected errors</h4>

- - -


[Click here to view the html report](https://raw.githack.com/troymjose/test_rest_api/main/assets/reports/unexpected_errors.html)

- Developers can make __errors__ while coding
- __General__ error exception __messages__ will increase the time to __find__ and __fix__ these issues
- test_rest_api provides __short__ & __precise__ error's with exact __traceback__ info
- Here we are __purposefully__ making unexpected errors in tests

Console output

```bash
2023-04-08 21:58:04,529: 
                          =======================================================
                        || ..................................................... ||
                        || ..................................................... ||
                        || ...........  T E S T - R E S T - A P I   ............ ||
                        || ..................................................... ||
                        || ..................................................... ||
                          =======================================================
                        
2023-04-08 21:58:04,529: Starting test setup
2023-04-08 21:58:04,530: Auto detecting test suites
2023-04-08 21:58:04,530: Total test suites: 1
2023-04-08 21:58:04,530: Auto detecting tests
2023-04-08 21:58:04,530: Total synchronous tests: 0
2023-04-08 21:58:04,530: Total asynchronous tests: 6
2023-04-08 21:58:04,530: Total tests: 6
2023-04-08 21:58:04,531: Created aiohttp client session
2023-04-08 21:58:04,531: Completed test setup
2023-04-08 21:58:04,531: 
                          =======================================================
                        || ............... A S Y N C - T E S T S ............... ||
                          =======================================================
2023-04-08 21:58:04,531: ERROR   t1 (root file) [1]
2023-04-08 21:58:04,532: ERROR   t2 (root file) [2]
2023-04-08 21:58:04,533: ERROR   t3 (root file) [3]
2023-04-08 21:58:04,534: ERROR   t4 (root file) [4]
2023-04-08 21:58:04,534: ERROR   t5 (root file) [5]
2023-04-08 21:58:04,534: ERROR   t6 (root file) [6]
2023-04-08 21:58:04,535: 
                          =======================================================
                        || ..................................................... ||
                        || ............  T E S T - S U M M A R Y   ............. ||
                        || ..................................................... ||
                          =======================================================
                        
                        Status:             FAIL
                        Tests:              6
                        Start:              2023-04-08 21-58-04
                        End:                2023-04-08 21-58-04
                        Duration:           0.003570664 seconds
                        Tags:               []
                        
                        PASS:               0
                        FAIL:               0
                        ERROR:              6
                        DISABLE:            0
                        SKIP:               0
                        
                        LOW:                0
                        MINOR:              0
                        MAJOR:              0
                        CRITICAL:           0
                        BLOCKER:            0
                        
                        REST API:           0
                        GLOBAL VARIABLES:   0
                        BUG:                0
                        LOGGER:             0
                        UNEXPECTED:         6
```

<h2 id="author">Author</h2>

- [Troy M Jose](https://www.linkedin.com/in/troymjose/)

<h2 id="license">License</h2>

Copyright Troy M Jose, 2023.

Distributed under the terms of the [MIT](https://choosealicense.com/licenses/mit/) license, test_rest_api is free and
open source software.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/troymjose/test_rest_api",
    "name": "test-rest-api",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "test,unittest,restapi,testframework,asyncio,async,asynchronous,testingframework,rest,api,python,python3,testing,unittesting,automation,automationtest,automationtesting,restapitest,restapitesting,restapiunittest,restapiunittesting,restapiautomation,restapiautomationtest,restapiautomationtesting,apitest,apitesting,apiunittest,apiunittesting,apiautomation,apiautomationtest,apiautomationtesting",
    "author": "Troy M Jose",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/0a/17/75ca872d8fe5a740a94eed34b00b67cbae418d51c62c729160582578022d/test_rest_api-0.0.0.0.40.tar.gz",
    "platform": null,
    "description": "\n<img alt=\"test_rest_api\" src=\"https://raw.githubusercontent.com/troymjose/test_rest_api/main/assets/test_rest_api.png\"  width=\"50%\" >\n\n# TEST REST API\n\nCreate fast modern __asynchronous__ tests for __REST API__ testing\n\n```#FAST #EASY #ASYNC #RESTAPI #TESTING #AUTOMATION```\n\n- [Features](#features)\n- [Installation](#installation)\n- [Usage](#usage)\n    - [Basic usage](#1-basic-usage)\n    - [Set report path](#2-set-report-path)\n    - [Set .env path](#3-set-env-path)\n    - [Set testdata path](#4-set-testdata-path)\n    - [Set hashtags](#5-set-hashtags)\n    - [Project structure](#6-project-structure)\n    - [Command line execution](#7-command-line-execution)\n- [Examples](#examples)\n    - [My first test](#1-my-first-test)\n    - [Configure my test](#2-configure-my-test)\n    - [Replace inbuilt assert](#3-replace-inbuilt-assert)\n    - [My first log](#4-my-first-log)\n    - [Set global variables value](#5-set-global-variables-value)\n    - [Set global variables value as constant](#6-set-global-variables-value-as-constant)\n    - [Get global variables value](#7-get-global-variables-value)\n    - [My first bug](#8-my-first-bug)\n    - [Configure my bug](#9-configure-my-bug)\n    - [My first rest api](#10-my-first-rest-api)\n    - [Configure my rest api](#11-configure-my-rest-api)\n    - [Reuse my rest api](#12-reuse-my-rest-api)\n    - [Send my rest api](#13-send-my-rest-api)\n    - [Rest api response](#14-rest-api-response)\n    - [Demo with all the above features](#15-demo)\n- [Reports](#reports)\n    - [My first report](#1-my-first-report)\n    - [Async tests report](#2-async-tests-report)\n    - [Sync tests report](#3-sync-tests-report)\n    - [Sync & Async report](#4-sync-and-async-report)\n    - [Multi status report](#5-multi-status-report)\n    - [Multi bug report](#6-multi-bug-report)\n    - [Rest api errors](#7-rest-api-errors)\n    - [Global variables errors](#8-global-variables-errors)\n    - [Bug errors](#9-bug-errors)\n    - [Logger errors](#10-logger-errors)\n    - [Unexpected errors](#11-unexpected-errors)\n- [Author](#author)\n- [License](#license)\n\n<h2 id=\"features\">Features</h2>\n\n- __Asyncronus__ programming (Powered by [asyncio](https://pypi.org/project/asyncio/))\n- __Auto discovery__ of test modules and functions\n- Supports both __asyncronus__ & __syncronuous__ tests\n- __High speed__ test executions using async functions\n- __Html test reporting__ with custom logs & summary dashboards\n- Create complex flows using __parameterization__ & __correlation__\n- __Group__ similar tests using hashtags eg: __#smoke__\n- Supports __CI/CD__ test automation integrations\n- Designed to be __easy__ to use & learn\n\n<h2 id=\"installation\">Installation</h2>\n\nIf you already have [Python](http://python.org/) with [pip](https://pip.pypa.io/) installed, you can simply run:\n\n```pip install test_rest_api```\n\n<h2 id=\"usage\">Usage</h2>\n\n<h4 id=\"1-basic-usage\">1. Basic usage</h4>\n\n- - -\n\n```python\nfrom test_rest_api import Runner\n\nrunner = Runner(test_suite_path=\"/Documents/Testsuite\")\nrunner.run()\n```  \n\n- Test can be executed from __.py__ file using the __test_rest_api__ module\n- Import __Runner__ from __test_rest_api__\n- Create an instance of __Runner__\n- The basic usage is by providing __test_suite_path__\n- Remaining __attributes__ are __optional__ for Runner instance creation\n- __test_suite_path__ can be a file or folder path\n- We can __organise__ folders, sub folders and python files in any __custom__ structure\n- test_rest_api will __autodetect__ python files and folders as __Test suites__\n- Call __run()__ method to execute the tests\n\n<h4 id=\"2-set-report-path\">2. Set report path</h4>\n\n- - -\n\n```python\nfrom test_rest_api import Runner\n\nrunner = Runner(test_suite_path=\"/Documents/Testsuite\", test_result_path='/Documents/Result')\nrunner.run()\n```  \n\n- In the above example, __html test report__ is saved under the same test folder path\n- We can save the final report to our __custom path__ by providing __test_result_path__ attribute\n- test_rest_api __creates__ beautiful rich test report with summary dashboards\n- We can also add our __custom logs__ to each individual tests in the test report\n\n<h4 id=\"3-set-env-path\">3. Set .env path</h4>\n\n- - -\n\n```python\nfrom test_rest_api import Runner\n\nrunner = Runner(test_suite_path=\"/Documents/Testsuite\", env_path='/Documents/.env')\nrunner.run()\n```  \n\n- We can __set variables__ with values, example Domain, Username, Password etc. in __.env file__\n- test_rest_api will __auto fetch__ all these values and save under __environment__\n- __environment__ can be accessed in tests for __parametrization__\n- One example can be __dynamic__ url creation. Domain can be __parameterised__ in url creation\n- This will also help developers to run the same tests in __different environments__ by creating separate .env files\n- We can __set__ the environment variables by providing __env_path__ attribute\n\n<h4 id=\"4-set-testdata-path\">4. Set testdata path</h4>\n\n- - -\n\n```python\nfrom test_rest_api import Runner\n\nrunner = Runner(test_suite_path=\"/Documents/Testsuite\", test_data_path='/Documents/Testdata/')\nrunner.run()\n```  \n\n- We can __set testdata__ with values, example products list, credit card details etc. in __.json files__\n- __test_data_path__ can be a json file or folder path\n- We can __organise__ folders, sub folders and json files in any __custom__ structure\n- test_rest_api will __autodetect__ json files and folders as __Testdata__\n- __testdata__ can be accessed in tests for __parametrization__\n- This will also help developers to run the same tests with __different testdata__ by creating separate testdata folders\n- We can __set__ the testdata variables by providing __test_data_path__ attribute\n\n\n<h4 id=\"5-set-hashtags\">5. Set hashtags</h4>\n\n- - -\n\n```python\nfrom test_rest_api import Runner\n\nrunner = Runner(test_suite_path=\"/Documents/Testsuite\", test_tags=['#SMOKE'])\nrunner.run()\n```  \n\n- __Group__ your test by providing tags in test creation\n- This helps to __execute__ a group of testcases, example __smoke testing__, __regression testing__ etc.\n- test_rest_api will fetch all tests with the __provided tags__ and executes them\n- We can set the __hashtags__ for execution by providing __test_tags_ attribute\n- When __no__ tags are provided, __all the tests__ are executed\n- When we provide a __single tag__, only those testcases with that tag are executed\n- Some tests like login should __run always__ for all tags irrespective of the value\n- In this case it's not practical to add all tags to the login test function\n- Adding __all tags__ will be hard to maintain when we introduce new custom tags\n- To tackle this issue, we can use inbuilt __#ALWAYS tag__\n- __#ALWAYS__ tagged tests will always be executed. It will not be skipped\n- Tests like login, logout etc. are __perfect candidates__ for #ALWAYS\n\n<h4 id=\"6-project-structure\">6. Project structure</h4>\n\n- - -\n\n```\n.\n\u251c\u2500\u2500 api                           # Store all your rest api files\n\u2502   \u251c\u2500\u2500 auth                      # Custom structure for subfolders & files\n\u2502   \u2502   \u251c\u2500\u2500 login.py              # Python file to store rest_api code\n\u2502   \u2502   \u2502   \u251c\u2500\u2500 def user_login()  # Python function to create rest_api\n\u2502   \u2502   \u2502   \u251c\u2500\u2500 def admin_login()\n\u2502   \u2502   \u2502   \u2514\u2500\u2500 ...    \n\u2502   \u2502   \u2514\u2500\u2500 ...\n\u2502   \u2514\u2500\u2500 ...\n\u251c\u2500\u2500 testsuite                     # Root testsuite folder\n\u2502   \u251c\u2500\u2500 auth                      # Custom structure for subfolders & files\n\u2502   \u2502   \u251c\u2500\u2500 login.py              # Python file as testsuite to store tests\n\u2502   \u2502   \u2502   \u251c\u2500\u2500 async def t001()  # Python async function as testcases\n\u2502   \u2502   \u2502   \u251c\u2500\u2500 async def t002()\n\u2502   \u2502   \u2502   \u2514\u2500\u2500 ...    \n\u2502   \u2502   \u2514\u2500\u2500 ...\n\u2502   \u2514\u2500\u2500 ...\n\u2514\u2500\u2500 ...\n```\n\n- 2 sub folders __api__ & __testsuite__\n- Any __custom names__ can be used instead of __api__ & __testsuite__\n- __api__ should store all the api creation python files\n- __testsuite__ should store all the test creation python files\n- Any __custom structure__ with multiple sub folders can be used to organise the files\n- __Separating__ api from tests will avoid __code duplication__ for rest_api creation\n- Root testsuite folder __path__ will be used in command line __execution__ value for __-t__\n\n<h2 id=\"examples\">Examples</h2>\n\n<h4 id=\"1-my-first-test\">1. My first test</h4>\n\n- - -\n\n```python\nfrom test_rest_api import test\n\n\n@test()\nasync def my_first_test():\n    assert 4 == 5\n```   \n\n- Create an __async__ python function with any __custom__ name\n- Decorate the function using __@test()__\n- __Async__ python functions decoratd with __@test()__ will be auto-detected as testcase\n- __Normal__ python functions decoratd with __@test()__ will __not__ be considered as testcase\n\n__Congrats !__\n\nYou have successfully created your first test (__my_first_test__)\n\nNow let's __execute__ it from command line . . .\n\n- __Create__ a\n  python [virtual environment](https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/#creating-a-virtual-environment)\n- Install __test_rest_api__ using __command__ ```pip install test_rest_api```\n- Create new python file (eg: __my_first_testsuite.py__) and paste the above code\n- Execute the test from the __command line__ using the test_rest_api module directly\n\n``` python -m test_rest_api -t \"<Test folder/file path>\" -r \"Result folder path\" ```\n\n<h4 id=\"2-configure-my-test\">2. Configure my test</h4>\n\n- - -\n\n```python\nfrom test_rest_api import test\n\n\n@test(name='Custom Name', desc='Description', enabled=True, tags=['SMOKE', 'ABC'], is_async=True, execution_order='1')\nasync def my_second_test():\n    assert 4 == 5\n```\n\n- In our first example, we used @test() decorator with __empty parameters__\n- In this example, we are __using parameters__ to configure our test function\n- This can be considered as adding __settings__ to your test function\n\n\n- __name__\n    - Mandatory: False\n    - Data Type: str\n    - Expected: Custom name for your test\n    - Default: Function name\n- __desc__\n    - Mandatory: False\n    - Data Type: str\n    - Expected: Test description\n    - Default: Empty string\n- __enabled__\n    - Mandatory: False\n    - Data Type: bool\n    - Expected: True or False. Provide False, to disable the test\n    - Default: True\n- __tags__\n    - Mandatory: False\n    - Data Type: list\n    - Expected: List of tags. Group your tests with custom tags\n    - Default: Empty list\n- __is_async__\n    - Mandatory: False\n    - Data Type: bool\n    - Expected: True or False. Provide False, to run tests sequentially\n    - Default: True\n- __execution_order__\n    - Mandatory: False\n    - Data Type: str\n    - Expected: Custom text for ordering. This will work only when is_async = False\n    - Default: 'zzzzz'\n\n<h4 id=\"3-replace-inbuilt-assert\">3. Replace inbuilt assert</h4>\n\n- - -\n\n```python\nfrom test_rest_api import test, Assert\n\n\n@test()\nasync def my_first_logger():\n    # assert 4 == 5\n    Assert.equal(4, 5)\n```\n\n- Assert is same as inbuilt python assert statement\n- Using test rest api Assert class improves logging\n- Assertions done using Assert will be automatically logged in final html report\n- It is __recommended__ to use Assert instead of inbuilt assert statement for all your tests\n\n<h4 id=\"4-my-first-log\">4. My first log</h4>\n\n- - -\n\n```python\nfrom test_rest_api import test\n\n\n@test()\nasync def my_first_logger():\n    print('My 1st log')\n    print('My 2nd log')\n    assert 4 == 5\n```\n\n- Python inbuilt ```print()``` function is used to add __custom messages__ to the final html test report\n- Add print() functions inside your __test function__\n- Add any number of log messages without any limit\n- It is __recommended__ to add logs for all your tests\n- Note: ```print()``` statements will not be printed to console\n\n<h4 id=\"5-set-global-variables-value\">5. Set global variables value</h4>\n\n- - -\n\n```python\nfrom test_rest_api import test, GlobalVariables\n\n\n@test()\nasync def set_global_variables_value():\n    GlobalVariables.set(name='token', value='token from response')\n```\n\n- Global variables are used to __save__ & __retrieve__ values in runtime\n- This will help in __parameterization__ and __correlation__ of tests\n- Save __Token__ from login api response in your first test\n- Retrieve this Token in all your __upcoming tests__ for authentication\n- Here we will learn how to __set__ the value in GlobalVariables\n\n```GlobalVariables.set(name='token', value='token from response')```\n\n- __name__\n    - Mandatory: True\n    - Data Type: str\n    - Expected: Custom name for your global variable\n- __value__\n    - Mandatory: True\n    - Data Type: any\n    - Expected: Any python data type can be stored as global variables value\n\n<h4 id=\"6-set-global-variables-value-as-constant\">6. Set global variables value as constant</h4>\n\n- - -\n\n```python\nfrom test_rest_api import test, GlobalVariables\n\n\n@test()\nasync def set_global_variables_value_as_constant():\n    GlobalVariables.set(name='pi', value=3.14, is_constant=True)\n```\n\n- In the above example we learned to __set__ value to global variables\n- __Multiple set__ calls are possible for the same variable\n- Token variable can be __set again__ in a different test function\n- To avoid this, we can set global variables as a __constant__ value\n- Use __is_consant__ optional parameter & make it True\n\n```GlobalVariables.set(name='pi', value=3.14, is_constant=True)```\n\n- __name__\n    - Mandatory: True\n    - Data Type: str\n    - Expected: Custom name for your global variable\n- __value__\n    - Mandatory: True\n    - Data Type: any\n    - Expected: Any python data type can be stored as global variables value\n- __is_constant__\n    - Mandatory: False\n    - Data Type: bool\n    - Expected: True or False. Provide True, to create constants\n    - Default: False\n\n<h4 id=\"7-get-global-variables-value\">7. Get global variables value</h4>\n\n- - -\n\n```python\nfrom test_rest_api import test, GlobalVariables\n\n\n@test()\nasync def get_global_variables_value():\n    token: str = GlobalVariables.get(name='token')\n    pi: float = GlobalVariables.get(name='pi')\n```\n\n- In the above examples we learned to __set__ varying and constant value to global variables\n- Now it's time to __retrieve__ them in our tests\n- Please make sure to use __valid variable names__ while retrieving the values\n- If the variable name is __not present__ in global variables, test will __terminate with error__\n\n```GlobalVariables.get(name='token')```\n\n- __name__\n    - Mandatory: True\n    - Data Type: str\n    - Expected: Valid name of any saved global variable\n\n<h4 id=\"8-my-first-bug\">8. My first bug</h4>\n\n- - -\n\n```python\nfrom test_rest_api import test, Bug\n\n\n@test()\nasync def my_first_bug():\n    Bug()\n```\n\n- Bug is used to __raise issues__ in tests\n- Add custom __checks__ in your tests to validate __rest api response__\n- If __actual result__ is not the __expected result__, just call ```Bug()```\n- This will __terminate__ the current test function execution\n- Bug __details__ can be viewed in final html test __report__\n\n<h4 id=\"9-configure-my-bug\">9. Configure my bug</h4>\n\n- - -\n\n```python\nfrom test_rest_api import test, Bug, Logger\n\n\n@test()\nasync def my_second_bug():\n    logger = Logger()\n    logger.log('step 1')\n    logger.log('step 2')\n    logger.log('Consider all steps are logged')\n    Bug(message=\"msg\", priority=Bug.PRIORITY.BLOCKER, actual_result=\"\", expected_result=\"\", steps_to_reproduce=logger)\n```\n\n- In our first bug example, we used Bug() with __empty attributes__\n- In this example, we are __using attributes__ to configure our Bug\n- This can be considered as adding __more info__ to your bug in the final html test report\n- We are adding custom __logging__ in this example to show how logger instance is __useful in Bug creation__\n- Logger instance variable can be passed to __steps_to_reproduce__ attribute during Bug creation\n\n```\nBug(message='', priority='', actual_result='', expected_result='', steps_to_reproduce='')\n```\n\n- __message__\n    - Mandatory: False\n    - Data Type: str\n    - Expected: Custom message for your bug\n    - Default: Empty string\n- __priority__\n    - Mandatory: False\n    - Data Type: str\n    - Expected: Priority for this bug. Supported list: Bug.PRIORITY.__[ items ]__\n    - Default: Empty string\n- __actual_result__\n    - Mandatory: False\n    - Data Type: str\n    - Expected: Provide the actual result\n    - Default: Empty string\n- __expected_result__\n    - Mandatory: False\n    - Data Type: str\n    - Expected: Provide the expected result\n    - Default: Empty list\n- __steps_to_reproduce__\n    - Mandatory: False\n    - Data Type: str\n    - Expected: Logger instance can be used to auto-populate this field\n    - Default: Empty string\n\n<h4 id=\"10-my-first-rest-api\">10. My first rest api</h4>\n\n- - -\n\n```python\nfrom test_rest_api import test, RestApi\n\n\n@test()\nasync def my_first_rest_api():\n    rest_api = RestApi(url='https://dummyjson.com/products/1')\n```\n\n- RestApi is used __create__ rest api instance in tests\n- Here we have created a basic rest api with just the __url information__\n- This example is only about creating rest api, no __send action__ is performed here\n- We will use this __instance variable__ for sending the request in upcoming examples\n\n<h4 id=\"11-configure-my-rest-api\">11. Configure my rest api</h4>\n\n- - -\n\n```python\nfrom test_rest_api import test, RestApi\n\n\n@test()\nasync def configure_my_rest_api():\n    rest_api = RestApi(url='my url', parameters={'p1': 'v1', 'p2': 'val2'}, headers={'h1': 'v1', 'h2': 'val1'}, body={})\n```\n\n- In the above example, we have only used __url attribute__ for rest api creation\n- Other attributes for creation are __parameters__, __headers__ and __body__\n- This example shows the syntax for adding these __optional attributes__\n\n\n- __url__\n    - Mandatory: True\n    - Data Type: str\n    - Expected: Rest api url\n- __parameters__\n    - Mandatory: False\n    - Data Type: dict\n    - Expected: Key value pairs of parameter name & value\n    - Default: {}\n- __headers__\n    - Mandatory: False\n    - Data Type: dict\n    - Expected: Key value pairs of header name & value\n    - Default: {}\n- __body__\n    - Mandatory: False\n    - Data Type: dict\n    - Expected: Provide the json request payload\n    - Default: {}\n\n<h4 id=\"12-reuse-my-rest-api\">12. Reuse my rest api</h4>\n\n- - -\n\n```python\nfrom test_rest_api import RestApi, GlobalVariables\n\n\ndef login_api(username: str, password: str):\n    domain = GlobalVariables.get('DOMAIN')\n    url = f'https://{domain}/login'\n    body = {'username': username, 'password': password}\n    return RestApi(url=url, body=body)\n```\n\n- A rest api will be used for __multiple tests__\n- __Creation__ of rest api __inside__ test async functions will result in __code duplication__\n- Duplicate code makes your program __lengthy__ and decreases your code __quality__\n- __Updating__ & __maintaining__ this rest api creations in __multiple__ tests will be difficult\n- __New changes__ to rest api, will result in changing the __same code multiple times__\n- To avoid duplication, we can use a __separate folder__ for rest api files\n- Use python __functions__ to create a rest api which will avoid __code duplication__\n- You can __call__ a function __100__ times instead of __writing__ it __100__ times\n- In this example we have created a simple __login api__\n- All the __dynamic values__ for rest api creation can be passed as function __parameters__\n- This helps in calling the same api with __different inputs__\n- Return the __RestApi instance__ which can be used in test functions for __sending__\n\n<h4 id=\"13-send-my-rest-api\">13. Send my rest api</h4>\n\n- - -\n\n```python\nfrom test_rest_api import test, RestApi\n\n\n@test()\nasync def send_my_rest_api():\n    rest_api = RestApi(url='https://dummyjson.com/products/1')\n    response1 = await rest_api.get()\n    response2 = await rest_api.send(method='get')\n    response3 = await rest_api.send(method=rest_api.METHODS.GET)\n```\n\n- In the above examples, we learned to __create__ a rest api\n- Now it's time to __send__ them using http methods\n- __Supported__ http methods are GET, POST, PUT, PATCH, DELETE, OPTIONS & HEAD\n- Here we are sending the rest_api using __GET__ http method\n- All the responses (1, 2 & 3) will have the __same result__\n- Because they perform the same functionality with __different syntax__\n- Similarly, __other http methods__ can be used, with your desired syntax\n\n<h4 id=\"14-rest-api-response\">14. Rest api response</h4>\n\n- - -\n\n```python\nfrom test_rest_api import test, RestApi\n\n\n@test()\nasync def send_my_rest_api():\n    rest_api = RestApi(url='https://dummyjson.com/products/1')\n    response = await rest_api.get()\n\n    status_code = response.status_code\n    body = response.body\n    headers = response.headers\n    content_type = response.content_type\n    obj = response.obj\n```\n\n- We have covered rest api __creation__ & __sending__ part\n- Now lets see more about the __response object__\n- Mostly __all checks__ will be performed using response object data\n- Response object contains the below details\n\n\n- __response.status_code__\n    - Data Type: int\n    - Value: Response status code\n- __response.body__\n    - Data Type: dict\n    - Value: Response body\n- __response.headers__\n    - Data Type: dict\n    - Value: Response headers\n- __response.content_type__\n    - Data Type: str\n    - Value: Response content type\n- __response.obj__\n    - Data Type: aiohttp.ClientResponse\n    - Value: Python aiohttp ClientResponse object\n\n<h4 id=\"15-demo\">15. Demo with all the above features</h4>\n\n- - -\n\n```\n.env file\n---------\n\nDOMAIN=dummyjson.com\n```\n\n```python\nfrom test_rest_api import test, RestApi, Bug, Logger, GlobalVariables\n\n\n@test(name='Demo', desc='All features')\nasync def demo():\n    logger = Logger()\n    logger.log('Starting the test')\n\n    logger.log('Creating rest api')\n    domain = GlobalVariables.get('DOMAIN')\n    rest_api = RestApi(url=f\"https://{domain}/products/1\")\n\n    logger.log('Sending rest api')\n    response = await rest_api.get()\n\n    logger.log(f'Response code = {response.status_code}')\n    logger.log(f'Response body = {response.body}')\n\n    logger.log('Validate response code')\n    if response.status_code != 200:\n        Bug(message='Invalid status code', priority=Bug.PRIORITY.MINOR, actual_result=response.status_code,\n            expected_result='200', steps_to_reproduce=logger)\n\n    logger.log('Save price details to global variables')\n    title = response.body.get('title', '')\n    price = response.body.get('price', '')\n    GlobalVariables.set(name=title, value=price)\n\n    logger.log('Successfully completed the test')\n\n```\n\n<h2 id=\"reports\">Reports</h2>\n\n<h4 id=\"1-my-first-report\">1. My first report</h4>\n\n- - -\n\n- Single basic test with __PASS__ status\n\n[Click here to view the html report](https://raw.githack.com/troymjose/test_rest_api/main/assets/reports/my_first_report.html)\n\nConsole output\n\n```bash\n2023-04-08 15:40:22,712: \n                          =======================================================\n                        || ..................................................... ||\n                        || ..................................................... ||\n                        || ...........  T E S T - R E S T - A P I   ............ ||\n                        || ..................................................... ||\n                        || ..................................................... ||\n                          =======================================================\n                        \n2023-04-08 15:40:22,712: Starting test setup\n2023-04-08 15:40:22,712: Auto detecting test suites\n2023-04-08 15:40:22,712: Total test suites: 1\n2023-04-08 15:40:22,712: Auto detecting tests\n2023-04-08 15:40:22,713: Total synchronous tests: 0\n2023-04-08 15:40:22,714: Total asynchronous tests: 1\n2023-04-08 15:40:22,714: Total tests: 1\n2023-04-08 15:40:22,714: Created aiohttp client session\n2023-04-08 15:40:22,714: Completed test setup\n2023-04-08 15:40:22,714: \n                          =======================================================\n                        || ............... A S Y N C - T E S T S ............... ||\n                          =======================================================\n2023-04-08 15:40:22,714: PASS    my_first_test (root file) [1]\n2023-04-08 15:40:22,715: \n                          =======================================================\n                        || ..................................................... ||\n                        || ............  T E S T - S U M M A R Y   ............. ||\n                        || ..................................................... ||\n                          =======================================================\n                        \n                        Status:             PASS\n                        Tests:              1\n                        Start:              2023-04-08 15-40-22\n                        End:                2023-04-08 15-40-22\n                        Duration:           0.000956233 seconds\n                        Tags:               []\n                        \n                        PASS:               1\n                        FAIL:               0\n                        ERROR:              0\n                        DISABLE:            0\n                        SKIP:               0\n                        \n                        LOW:                0\n                        MINOR:              0\n                        MAJOR:              0\n                        CRITICAL:           0\n                        BLOCKER:            0\n                        \n                        REST API:           0\n                        GLOBAL VARIABLES:   0\n                        BUG:                0\n                        LOGGER:             0\n                        UNEXPECTED:         0\n```\n\n<h4 id=\"2-async-tests-report\">2. Async tests report</h4>\n\n- - -\n\n- 5 __async__ tests\n- Each tests takes __1 second__ to complete\n\n[Click here to view the html report](https://raw.githack.com/troymjose/test_rest_api/main/assets/reports/async_tests_report.html)\n\nConsole output\n\n```bash\n2023-04-08 15:52:05,062: \n                          =======================================================\n                        || ..................................................... ||\n                        || ..................................................... ||\n                        || ...........  T E S T - R E S T - A P I   ............ ||\n                        || ..................................................... ||\n                        || ..................................................... ||\n                          =======================================================\n                        \n2023-04-08 15:52:05,062: Starting test setup\n2023-04-08 15:52:05,062: Auto detecting test suites\n2023-04-08 15:52:05,062: Total test suites: 1\n2023-04-08 15:52:05,062: Auto detecting tests\n2023-04-08 15:52:05,063: Total synchronous tests: 0\n2023-04-08 15:52:05,063: Total asynchronous tests: 5\n2023-04-08 15:52:05,063: Total tests: 5\n2023-04-08 15:52:05,063: Created aiohttp client session\n2023-04-08 15:52:05,063: Completed test setup\n2023-04-08 15:52:05,063: \n                          =======================================================\n                        || ............... A S Y N C - T E S T S ............... ||\n                          =======================================================\n2023-04-08 15:52:06,064: PASS    testcase_1 (root file) [1]\n2023-04-08 15:52:06,064: PASS    testcase_2 (root file) [2]\n2023-04-08 15:52:06,065: PASS    testcase_3 (root file) [3]\n2023-04-08 15:52:06,065: PASS    testcase_4 (root file) [4]\n2023-04-08 15:52:06,065: PASS    testcase_5 (root file) [5]\n2023-04-08 15:52:06,066: \n                          =======================================================\n                        || ..................................................... ||\n                        || ............  T E S T - S U M M A R Y   ............. ||\n                        || ..................................................... ||\n                          =======================================================\n                        \n                        Status:             PASS\n                        Tests:              5\n                        Start:              2023-04-08 15-52-05\n                        End:                2023-04-08 15-52-06\n                        Duration:           1.002069748 seconds\n                        Tags:               []\n                        \n                        PASS:               5\n                        FAIL:               0\n                        ERROR:              0\n                        DISABLE:            0\n                        SKIP:               0\n                        \n                        LOW:                0\n                        MINOR:              0\n                        MAJOR:              0\n                        CRITICAL:           0\n                        BLOCKER:            0\n                        \n                        REST API:           0\n                        GLOBAL VARIABLES:   0\n                        BUG:                0\n                        LOGGER:             0\n                        UNEXPECTED:         0\n```\n\n<h4 id=\"3-sync-tests-report\">3. Sync tests report</h4>\n\n- - -\n\n- 5 __sync__ tests\n- Each tests takes __1 second__ to complete\n\n[Click here to view the html report](https://raw.githack.com/troymjose/test_rest_api/main/assets/reports/sync_tests_report.html)\n\nConsole output\n\n```bash\n2023-04-08 15:56:19,128: \n                          =======================================================\n                        || ..................................................... ||\n                        || ..................................................... ||\n                        || ...........  T E S T - R E S T - A P I   ............ ||\n                        || ..................................................... ||\n                        || ..................................................... ||\n                          =======================================================\n                        \n2023-04-08 15:56:19,129: Starting test setup\n2023-04-08 15:56:19,129: Auto detecting test suites\n2023-04-08 15:56:19,129: Total test suites: 1\n2023-04-08 15:56:19,129: Auto detecting tests\n2023-04-08 15:56:19,129: Total synchronous tests: 5\n2023-04-08 15:56:19,129: Total asynchronous tests: 0\n2023-04-08 15:56:19,129: Total tests: 5\n2023-04-08 15:56:19,129: Created aiohttp client session\n2023-04-08 15:56:19,129: Completed test setup\n2023-04-08 15:56:19,130: \n                          =======================================================\n                        || ................  S Y N C - T E S T S ............... ||\n                          =======================================================\n2023-04-08 15:56:20,131: PASS    testcase_1 (root file) [1]\n2023-04-08 15:56:21,132: PASS    testcase_2 (root file) [2]\n2023-04-08 15:56:22,132: PASS    testcase_3 (root file) [3]\n2023-04-08 15:56:23,134: PASS    testcase_4 (root file) [4]\n2023-04-08 15:56:24,135: PASS    testcase_5 (root file) [5]\n2023-04-08 15:56:24,137: \n                          =======================================================\n                        || ..................................................... ||\n                        || ............  T E S T - S U M M A R Y   ............. ||\n                        || ..................................................... ||\n                          =======================================================\n                        \n                        Status:             PASS\n                        Tests:              5\n                        Start:              2023-04-08 15-56-19\n                        End:                2023-04-08 15-56-24\n                        Duration:           5.006235552 seconds\n                        Tags:               []\n                        \n                        PASS:               5\n                        FAIL:               0\n                        ERROR:              0\n                        DISABLE:            0\n                        SKIP:               0\n                        \n                        LOW:                0\n                        MINOR:              0\n                        MAJOR:              0\n                        CRITICAL:           0\n                        BLOCKER:            0\n                        \n                        REST API:           0\n                        GLOBAL VARIABLES:   0\n                        BUG:                0\n                        LOGGER:             0\n                        UNEXPECTED:         0\n```\n\n<h4 id=\"4-sync-and-async-report\">4. Sync & Async report</h4>\n\n- - -\n\n- 5 __sync__ & __async__ tests each\n- Total __10__ tests\n- Each tests takes __1 second__ to complete\n\n[Click here to view the html report](https://raw.githack.com/troymjose/test_rest_api/main/assets/reports/sync_and_async_report.html)\n\nConsole output\n\n```bash\n2023-04-08 15:59:38,170: \n                          =======================================================\n                        || ..................................................... ||\n                        || ..................................................... ||\n                        || ...........  T E S T - R E S T - A P I   ............ ||\n                        || ..................................................... ||\n                        || ..................................................... ||\n                          =======================================================\n                        \n2023-04-08 15:59:38,170: Starting test setup\n2023-04-08 15:59:38,170: Auto detecting test suites\n2023-04-08 15:59:38,170: Total test suites: 1\n2023-04-08 15:59:38,170: Auto detecting tests\n2023-04-08 15:59:38,172: Total synchronous tests: 5\n2023-04-08 15:59:38,172: Total asynchronous tests: 5\n2023-04-08 15:59:38,172: Total tests: 10\n2023-04-08 15:59:38,173: Created aiohttp client session\n2023-04-08 15:59:38,173: Completed test setup\n2023-04-08 15:59:38,173: \n                          =======================================================\n                        || ................  S Y N C - T E S T S ............... ||\n                          =======================================================\n2023-04-08 15:59:39,174: PASS    testcase_1 (root file) [1]\n2023-04-08 15:59:40,176: PASS    testcase_2 (root file) [2]\n2023-04-08 15:59:41,177: PASS    testcase_3 (root file) [3]\n2023-04-08 15:59:42,178: PASS    testcase_4 (root file) [4]\n2023-04-08 15:59:43,180: PASS    testcase_5 (root file) [5]\n2023-04-08 15:59:43,180: \n                          =======================================================\n                        || ............... A S Y N C - T E S T S ............... ||\n                          =======================================================\n2023-04-08 15:59:44,182: PASS    testcase_async_1 (root file) [6]\n2023-04-08 15:59:44,182: PASS    testcase_async_2 (root file) [7]\n2023-04-08 15:59:44,183: PASS    testcase_async_3 (root file) [8]\n2023-04-08 15:59:44,183: PASS    testcase_async_4 (root file) [9]\n2023-04-08 15:59:44,183: PASS    testcase_async_5 (root file) [10]\n2023-04-08 15:59:44,185: \n                          =======================================================\n                        || ..................................................... ||\n                        || ............  T E S T - S U M M A R Y   ............. ||\n                        || ..................................................... ||\n                          =======================================================\n                        \n                        Status:             PASS\n                        Tests:              10\n                        Start:              2023-04-08 15-59-38\n                        End:                2023-04-08 15-59-44\n                        Duration:           6.01064299 seconds\n                        Tags:               []\n                        \n                        PASS:               10\n                        FAIL:               0\n                        ERROR:              0\n                        DISABLE:            0\n                        SKIP:               0\n                        \n                        LOW:                0\n                        MINOR:              0\n                        MAJOR:              0\n                        CRITICAL:           0\n                        BLOCKER:            0\n                        \n                        REST API:           0\n                        GLOBAL VARIABLES:   0\n                        BUG:                0\n                        LOGGER:             0\n                        UNEXPECTED:         0\n```\n\n<h4 id=\"5-multi-status-report\">5. Multi status report</h4>\n\n- - -\n\n- 5 __async__ tests with different __status__ values\n- __Status list__: PASS, FAIL, ERROR, DISABLE & SKIP\n\n[Click here to view the html report](https://raw.githack.com/troymjose/test_rest_api/main/assets/reports/multi_status_report.html)\n\nConsole output\n\n```bash\n2023-04-08 16:17:44,328: \n                          =======================================================\n                        || ..................................................... ||\n                        || ..................................................... ||\n                        || ...........  T E S T - R E S T - A P I   ............ ||\n                        || ..................................................... ||\n                        || ..................................................... ||\n                          =======================================================\n                        \n2023-04-08 16:17:44,329: Starting test setup\n2023-04-08 16:17:44,329: Auto detecting test suites\n2023-04-08 16:17:44,329: Total test suites: 1\n2023-04-08 16:17:44,329: Auto detecting tests\n2023-04-08 16:17:44,330: Total synchronous tests: 0\n2023-04-08 16:17:44,330: Total asynchronous tests: 5\n2023-04-08 16:17:44,330: Total tests: 5\n2023-04-08 16:17:44,330: Created aiohttp client session\n2023-04-08 16:17:44,330: Completed test setup\n2023-04-08 16:17:44,330: \n                          =======================================================\n                        || ............... A S Y N C - T E S T S ............... ||\n                          =======================================================\n2023-04-08 16:17:44,330: ERROR   t_error (root file) [2]\n2023-04-08 16:17:44,331: FAIL    t_fail (root file) [3]\n2023-04-08 16:17:44,331: PASS    t_pass (root file) [4]\n2023-04-08 16:17:44,332: \n                          =======================================================\n                        || ..................................................... ||\n                        || ............  T E S T - S U M M A R Y   ............. ||\n                        || ..................................................... ||\n                          =======================================================\n                        \n                        Status:             FAIL\n                        Tests:              5\n                        Start:              2023-04-08 16-17-44\n                        End:                2023-04-08 16-17-44\n                        Duration:           0.001355524 seconds\n                        Tags:               ['SMOKE']\n                        \n                        PASS:               1\n                        FAIL:               1\n                        ERROR:              1\n                        DISABLE:            1\n                        SKIP:               1\n                        \n                        LOW:                0\n                        MINOR:              0\n                        MAJOR:              1\n                        CRITICAL:           0\n                        BLOCKER:            0\n                        \n                        REST API:           0\n                        GLOBAL VARIABLES:   0\n                        BUG:                0\n                        LOGGER:             0\n                        UNEXPECTED:         1\n```\n\n<h4 id=\"6-multi-bug-report\">6. Multi bug report</h4>\n\n- 5 __async__ tests with different __bug priority__ values\n- __Priority list__: LOW, MINOR, MAJOR, CRITICAL, BLOCKER\n\n[Click here to view the html report](https://raw.githack.com/troymjose/test_rest_api/main/assets/reports/multi_bug_report.html)\n\nConsole output\n\n```bash\n2023-04-08 16:30:21,400: \n                          =======================================================\n                        || ..................................................... ||\n                        || ..................................................... ||\n                        || ...........  T E S T - R E S T - A P I   ............ ||\n                        || ..................................................... ||\n                        || ..................................................... ||\n                          =======================================================\n                        \n2023-04-08 16:30:21,400: Starting test setup\n2023-04-08 16:30:21,400: Auto detecting test suites\n2023-04-08 16:30:21,400: Total test suites: 1\n2023-04-08 16:30:21,400: Auto detecting tests\n2023-04-08 16:30:21,401: Total synchronous tests: 0\n2023-04-08 16:30:21,401: Total asynchronous tests: 5\n2023-04-08 16:30:21,401: Total tests: 5\n2023-04-08 16:30:21,402: Created aiohttp client session\n2023-04-08 16:30:21,402: Completed test setup\n2023-04-08 16:30:21,402: \n                          =======================================================\n                        || ............... A S Y N C - T E S T S ............... ||\n                          =======================================================\n2023-04-08 16:30:21,402: FAIL    t_blocker (root file) [1]\n2023-04-08 16:30:21,404: FAIL    t_critical (root file) [2]\n2023-04-08 16:30:21,404: FAIL    t_low (root file) [3]\n2023-04-08 16:30:21,404: FAIL    t_major (root file) [4]\n2023-04-08 16:30:21,404: FAIL    t_minor (root file) [5]\n2023-04-08 16:30:21,406: \n                          =======================================================\n                        || ..................................................... ||\n                        || ............  T E S T - S U M M A R Y   ............. ||\n                        || ..................................................... ||\n                          =======================================================\n                        \n                        Status:             FAIL\n                        Tests:              5\n                        Start:              2023-04-08 16-30-21\n                        End:                2023-04-08 16-30-21\n                        Duration:           0.003122595 seconds\n                        Tags:               []\n                        \n                        PASS:               0\n                        FAIL:               5\n                        ERROR:              0\n                        DISABLE:            0\n                        SKIP:               0\n                        \n                        LOW:                1\n                        MINOR:              1\n                        MAJOR:              1\n                        CRITICAL:           1\n                        BLOCKER:            1\n                        \n                        REST API:           0\n                        GLOBAL VARIABLES:   0\n                        BUG:                0\n                        LOGGER:             0\n                        UNEXPECTED:         0\n```\n\n<h4 id=\"7-rest-api-errors\">7. Rest api errors</h4>\n\n- - -\n\n- Developers can make __errors__ while coding\n- __General__ error exception __messages__ will increase the time to __find__ and __fix__ these issues\n- test_rest_api provides __short__ & __precise__ error's with exact __traceback__ info\n- Here we are __purposefully__ making errors in __RestApi__ functions\n\n[Click here to view the html report](https://raw.githack.com/troymjose/test_rest_api/main/assets/reports/rest_api_errors.html)\n\nConsole output\n\n```bash\n2023-04-08 19:41:19,099: \n                          =======================================================\n                        || ..................................................... ||\n                        || ..................................................... ||\n                        || ...........  T E S T - R E S T - A P I   ............ ||\n                        || ..................................................... ||\n                        || ..................................................... ||\n                          =======================================================\n                        \n2023-04-08 19:41:19,099: Starting test setup\n2023-04-08 19:41:19,099: Auto detecting test suites\n2023-04-08 19:41:19,099: Total test suites: 1\n2023-04-08 19:41:19,099: Auto detecting tests\n2023-04-08 19:41:19,099: Total synchronous tests: 0\n2023-04-08 19:41:19,099: Total asynchronous tests: 12\n2023-04-08 19:41:19,099: Total tests: 12\n2023-04-08 19:41:19,099: Created aiohttp client session\n2023-04-08 19:41:19,099: Completed test setup\n2023-04-08 19:41:19,099: \n                          =======================================================\n                        || ............... A S Y N C - T E S T S ............... ||\n                          =======================================================\n2023-04-08 19:41:19,100: ERROR   t1 (root file) [1]\n2023-04-08 19:41:19,101: ERROR   t10 (root file) [2]\n2023-04-08 19:41:19,110: ERROR   t2 (root file) [5]\n2023-04-08 19:41:19,110: ERROR   t3 (root file) [6]\n2023-04-08 19:41:19,110: ERROR   t4 (root file) [7]\n2023-04-08 19:41:19,110: ERROR   t5 (root file) [8]\n2023-04-08 19:41:19,110: ERROR   t6 (root file) [9]\n2023-04-08 19:41:19,111: ERROR   t7 (root file) [10]\n2023-04-08 19:41:19,111: ERROR   t8 (root file) [11]\n2023-04-08 19:41:19,111: ERROR   t9 (root file) [12]\n2023-04-08 19:41:19,115: ERROR   t11 (root file) [3]\n2023-04-08 19:41:19,285: ERROR   t12 (root file) [4]\n2023-04-08 19:41:19,288: \n                          =======================================================\n                        || ..................................................... ||\n                        || ............  T E S T - S U M M A R Y   ............. ||\n                        || ..................................................... ||\n                          =======================================================\n                        \n                        Status:             FAIL\n                        Tests:              12\n                        Start:              2023-04-08 19-41-19\n                        End:                2023-04-08 19-41-19\n                        Duration:           0.18714125 seconds\n                        Tags:               []\n                        \n                        PASS:               0\n                        FAIL:               0\n                        ERROR:              12\n                        DISABLE:            0\n                        SKIP:               0\n                        \n                        LOW:                0\n                        MINOR:              0\n                        MAJOR:              0\n                        CRITICAL:           0\n                        BLOCKER:            0\n                        \n                        REST API:           12\n                        GLOBAL VARIABLES:   0\n                        BUG:                0\n                        LOGGER:             0\n                        UNEXPECTED:         0\n```\n\n<h4 id=\"8-global-variables-errors\">8. Global variables errors</h4>\n\n- - -\n\n- Developers can make __errors__ while coding\n- __General__ error exception __messages__ will increase the time to __find__ and __fix__ these issues\n- test_rest_api provides __short__ & __precise__ error's with exact __traceback__ info\n- Here we are __purposefully__ making errors in __GlobalVariables__ functions\n\n[Click here to view the html report](https://raw.githack.com/troymjose/test_rest_api/main/assets/reports/global_variables_errors.html)\n\nConsole output\n\n```bash\n2023-04-08 18:38:05,825: \n                          =======================================================\n                        || ..................................................... ||\n                        || ..................................................... ||\n                        || ...........  T E S T - R E S T - A P I   ............ ||\n                        || ..................................................... ||\n                        || ..................................................... ||\n                          =======================================================\n                        \n2023-04-08 18:38:05,825: Starting test setup\n2023-04-08 18:38:05,825: Auto detecting test suites\n2023-04-08 18:38:05,826: Total test suites: 1\n2023-04-08 18:38:05,826: Auto detecting tests\n2023-04-08 18:38:05,827: Total synchronous tests: 0\n2023-04-08 18:38:05,827: Total asynchronous tests: 13\n2023-04-08 18:38:05,827: Total tests: 13\n2023-04-08 18:38:05,827: Created aiohttp client session\n2023-04-08 18:38:05,827: Completed test setup\n2023-04-08 18:38:05,827: \n                          =======================================================\n                        || ............... A S Y N C - T E S T S ............... ||\n                          =======================================================\n2023-04-08 18:38:05,827: ERROR   t_1 (root file) [1]\n2023-04-08 18:38:05,828: ERROR   t_10 (root file) [2]\n2023-04-08 18:38:05,828: ERROR   t_11 (root file) [3]\n2023-04-08 18:38:05,828: ERROR   t_12 (root file) [4]\n2023-04-08 18:38:05,829: ERROR   t_13 (root file) [5]\n2023-04-08 18:38:05,829: ERROR   t_2 (root file) [6]\n2023-04-08 18:38:05,829: ERROR   t_3 (root file) [7]\n2023-04-08 18:38:05,829: ERROR   t_4 (root file) [8]\n2023-04-08 18:38:05,829: ERROR   t_5 (root file) [9]\n2023-04-08 18:38:05,830: ERROR   t_6 (root file) [10]\n2023-04-08 18:38:05,830: ERROR   t_7 (root file) [11]\n2023-04-08 18:38:05,830: ERROR   t_8 (root file) [12]\n2023-04-08 18:38:05,830: ERROR   t_9 (root file) [13]\n2023-04-08 18:38:05,831: \n                          =======================================================\n                        || ..................................................... ||\n                        || ............  T E S T - S U M M A R Y   ............. ||\n                        || ..................................................... ||\n                          =======================================================\n                        \n                        Status:             FAIL\n                        Tests:              13\n                        Start:              2023-04-08 18-38-05\n                        End:                2023-04-08 18-38-05\n                        Duration:           0.003679225 seconds\n                        Tags:               []\n                        \n                        PASS:               0\n                        FAIL:               0\n                        ERROR:              13\n                        DISABLE:            0\n                        SKIP:               0\n                        \n                        LOW:                0\n                        MINOR:              0\n                        MAJOR:              0\n                        CRITICAL:           0\n                        BLOCKER:            0\n                        \n                        REST API:           0\n                        GLOBAL VARIABLES:   13\n                        BUG:                0\n                        LOGGER:             0\n                        UNEXPECTED:         0\n```\n\n<h4 id=\"9-bug-errors\">9. Bug errors</h4>\n\n- - -\n\n- Developers can make __errors__ while coding\n- __General__ error exception __messages__ will increase the time to __find__ and __fix__ these issues\n- test_rest_api provides __short__ & __precise__ error's with exact __traceback__ info\n- Here we are __purposefully__ making errors in __Bug__ functions\n\n[Click here to view the html report](https://raw.githack.com/troymjose/test_rest_api/main/assets/reports/bug_errors.html)\n\nConsole output\n\n```bash\n2023-04-08 19:55:51,870: \n                          =======================================================\n                        || ..................................................... ||\n                        || ..................................................... ||\n                        || ...........  T E S T - R E S T - A P I   ............ ||\n                        || ..................................................... ||\n                        || ..................................................... ||\n                          =======================================================\n                        \n2023-04-08 19:55:51,871: Starting test setup\n2023-04-08 19:55:51,871: Auto detecting test suites\n2023-04-08 19:55:51,871: Total test suites: 1\n2023-04-08 19:55:51,871: Auto detecting tests\n2023-04-08 19:55:51,872: Total synchronous tests: 0\n2023-04-08 19:55:51,872: Total asynchronous tests: 7\n2023-04-08 19:55:51,872: Total tests: 7\n2023-04-08 19:55:51,872: Created aiohttp client session\n2023-04-08 19:55:51,872: Completed test setup\n2023-04-08 19:55:51,872: \n                          =======================================================\n                        || ............... A S Y N C - T E S T S ............... ||\n                          =======================================================\n2023-04-08 19:55:51,872: ERROR   t1 (root file) [1]\n2023-04-08 19:55:51,874: ERROR   t2 (root file) [2]\n2023-04-08 19:55:51,875: ERROR   t3 (root file) [3]\n2023-04-08 19:55:51,875: ERROR   t4 (root file) [4]\n2023-04-08 19:55:51,875: ERROR   t5 (root file) [5]\n2023-04-08 19:55:51,875: ERROR   t6 (root file) [6]\n2023-04-08 19:55:51,876: ERROR   t7 (root file) [7]\n2023-04-08 19:55:51,877: \n                          =======================================================\n                        || ..................................................... ||\n                        || ............  T E S T - S U M M A R Y   ............. ||\n                        || ..................................................... ||\n                          =======================================================\n                        \n                        Status:             FAIL\n                        Tests:              7\n                        Start:              2023-04-08 19-55-51\n                        End:                2023-04-08 19-55-51\n                        Duration:           0.003555115 seconds\n                        Tags:               []\n                        \n                        PASS:               0\n                        FAIL:               0\n                        ERROR:              7\n                        DISABLE:            0\n                        SKIP:               0\n                        \n                        LOW:                0\n                        MINOR:              0\n                        MAJOR:              0\n                        CRITICAL:           0\n                        BLOCKER:            0\n                        \n                        REST API:           0\n                        GLOBAL VARIABLES:   0\n                        BUG:                7\n                        LOGGER:             0\n                        UNEXPECTED:         0\n```\n\n<h4 id=\"10-logger-errors\">10. Logger errors</h4>\n\n- - -\n\n- Developers can make __errors__ while coding\n- __General__ error exception __messages__ will increase the time to __find__ and __fix__ these issues\n- test_rest_api provides __short__ & __precise__ error's with exact __traceback__ info\n- Here we are __purposefully__ making errors in __Logger__ functions\n\n[Click here to view the html report](https://raw.githack.com/troymjose/test_rest_api/main/assets/reports/logger_errors.html)\n\nConsole output\n\n```bash\n2023-04-08 21:54:56,023: \n                          =======================================================\n                        || ..................................................... ||\n                        || ..................................................... ||\n                        || ...........  T E S T - R E S T - A P I   ............ ||\n                        || ..................................................... ||\n                        || ..................................................... ||\n                          =======================================================\n                        \n2023-04-08 21:54:56,023: Starting test setup\n2023-04-08 21:54:56,023: Auto detecting test suites\n2023-04-08 21:54:56,023: Total test suites: 1\n2023-04-08 21:54:56,023: Auto detecting tests\n2023-04-08 21:54:56,023: Total synchronous tests: 0\n2023-04-08 21:54:56,023: Total asynchronous tests: 7\n2023-04-08 21:54:56,023: Total tests: 7\n2023-04-08 21:54:56,023: Created aiohttp client session\n2023-04-08 21:54:56,023: Completed test setup\n2023-04-08 21:54:56,023: \n                          =======================================================\n                        || ............... A S Y N C - T E S T S ............... ||\n                          =======================================================\n2023-04-08 21:54:56,023: ERROR   t1 (root file) [1]\n2023-04-08 21:54:56,025: ERROR   t2 (root file) [2]\n2023-04-08 21:54:56,025: ERROR   t3 (root file) [3]\n2023-04-08 21:54:56,026: ERROR   t4 (root file) [4]\n2023-04-08 21:54:56,026: ERROR   t5 (root file) [5]\n2023-04-08 21:54:56,026: ERROR   t6 (root file) [6]\n2023-04-08 21:54:56,026: ERROR   t7 (root file) [7]\n2023-04-08 21:54:56,027: \n                          =======================================================\n                        || ..................................................... ||\n                        || ............  T E S T - S U M M A R Y   ............. ||\n                        || ..................................................... ||\n                          =======================================================\n                        \n                        Status:             FAIL\n                        Tests:              7\n                        Start:              2023-04-08 21-54-56\n                        End:                2023-04-08 21-54-56\n                        Duration:           0.003578533 seconds\n                        Tags:               []\n                        \n                        PASS:               0\n                        FAIL:               0\n                        ERROR:              7\n                        DISABLE:            0\n                        SKIP:               0\n                        \n                        LOW:                0\n                        MINOR:              0\n                        MAJOR:              0\n                        CRITICAL:           0\n                        BLOCKER:            0\n                        \n                        REST API:           0\n                        GLOBAL VARIABLES:   0\n                        BUG:                0\n                        LOGGER:             7\n                        UNEXPECTED:         0\n```\n\n<h4 id=\"11-unexpected-errors\">11. Unexpected errors</h4>\n\n- - -\n\n\n[Click here to view the html report](https://raw.githack.com/troymjose/test_rest_api/main/assets/reports/unexpected_errors.html)\n\n- Developers can make __errors__ while coding\n- __General__ error exception __messages__ will increase the time to __find__ and __fix__ these issues\n- test_rest_api provides __short__ & __precise__ error's with exact __traceback__ info\n- Here we are __purposefully__ making unexpected errors in tests\n\nConsole output\n\n```bash\n2023-04-08 21:58:04,529: \n                          =======================================================\n                        || ..................................................... ||\n                        || ..................................................... ||\n                        || ...........  T E S T - R E S T - A P I   ............ ||\n                        || ..................................................... ||\n                        || ..................................................... ||\n                          =======================================================\n                        \n2023-04-08 21:58:04,529: Starting test setup\n2023-04-08 21:58:04,530: Auto detecting test suites\n2023-04-08 21:58:04,530: Total test suites: 1\n2023-04-08 21:58:04,530: Auto detecting tests\n2023-04-08 21:58:04,530: Total synchronous tests: 0\n2023-04-08 21:58:04,530: Total asynchronous tests: 6\n2023-04-08 21:58:04,530: Total tests: 6\n2023-04-08 21:58:04,531: Created aiohttp client session\n2023-04-08 21:58:04,531: Completed test setup\n2023-04-08 21:58:04,531: \n                          =======================================================\n                        || ............... A S Y N C - T E S T S ............... ||\n                          =======================================================\n2023-04-08 21:58:04,531: ERROR   t1 (root file) [1]\n2023-04-08 21:58:04,532: ERROR   t2 (root file) [2]\n2023-04-08 21:58:04,533: ERROR   t3 (root file) [3]\n2023-04-08 21:58:04,534: ERROR   t4 (root file) [4]\n2023-04-08 21:58:04,534: ERROR   t5 (root file) [5]\n2023-04-08 21:58:04,534: ERROR   t6 (root file) [6]\n2023-04-08 21:58:04,535: \n                          =======================================================\n                        || ..................................................... ||\n                        || ............  T E S T - S U M M A R Y   ............. ||\n                        || ..................................................... ||\n                          =======================================================\n                        \n                        Status:             FAIL\n                        Tests:              6\n                        Start:              2023-04-08 21-58-04\n                        End:                2023-04-08 21-58-04\n                        Duration:           0.003570664 seconds\n                        Tags:               []\n                        \n                        PASS:               0\n                        FAIL:               0\n                        ERROR:              6\n                        DISABLE:            0\n                        SKIP:               0\n                        \n                        LOW:                0\n                        MINOR:              0\n                        MAJOR:              0\n                        CRITICAL:           0\n                        BLOCKER:            0\n                        \n                        REST API:           0\n                        GLOBAL VARIABLES:   0\n                        BUG:                0\n                        LOGGER:             0\n                        UNEXPECTED:         6\n```\n\n<h2 id=\"author\">Author</h2>\n\n- [Troy M Jose](https://www.linkedin.com/in/troymjose/)\n\n<h2 id=\"license\">License</h2>\n\nCopyright Troy M Jose, 2023.\n\nDistributed under the terms of the [MIT](https://choosealicense.com/licenses/mit/) license, test_rest_api is free and\nopen source software.\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Asynchronous Test Framework #HighPerformance #EasyToLearn #FastToCode #AsyncTests",
    "version": "0.0.0.0.40",
    "project_urls": {
        "Homepage": "https://github.com/troymjose/test_rest_api",
        "Source": "https://github.com/troymjose/test_rest_api",
        "Tracker": "https://github.com/troymjose/test_rest_api/issues"
    },
    "split_keywords": [
        "test",
        "unittest",
        "restapi",
        "testframework",
        "asyncio",
        "async",
        "asynchronous",
        "testingframework",
        "rest",
        "api",
        "python",
        "python3",
        "testing",
        "unittesting",
        "automation",
        "automationtest",
        "automationtesting",
        "restapitest",
        "restapitesting",
        "restapiunittest",
        "restapiunittesting",
        "restapiautomation",
        "restapiautomationtest",
        "restapiautomationtesting",
        "apitest",
        "apitesting",
        "apiunittest",
        "apiunittesting",
        "apiautomation",
        "apiautomationtest",
        "apiautomationtesting"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "36734846bd7d7bc7f1407fa29cf6208eb456bde8e6be7b803bdb189717995541",
                "md5": "f663a1b172235bcfc450514e56a57985",
                "sha256": "8f2ecfa487c1a8a9de2fa5ac4d7eac498b9f5c2c3561d705532ecfdbb707f2ce"
            },
            "downloads": -1,
            "filename": "test_rest_api-0.0.0.0.40-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f663a1b172235bcfc450514e56a57985",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 45076,
            "upload_time": "2023-12-18T12:10:49",
            "upload_time_iso_8601": "2023-12-18T12:10:49.479748Z",
            "url": "https://files.pythonhosted.org/packages/36/73/4846bd7d7bc7f1407fa29cf6208eb456bde8e6be7b803bdb189717995541/test_rest_api-0.0.0.0.40-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0a1775ca872d8fe5a740a94eed34b00b67cbae418d51c62c729160582578022d",
                "md5": "8881e4d966c3163c8c92b602ddf5182b",
                "sha256": "af2e23885590bb3cf242f44a5d312928cea570aa978d413ff75e5a1ae517e40f"
            },
            "downloads": -1,
            "filename": "test_rest_api-0.0.0.0.40.tar.gz",
            "has_sig": false,
            "md5_digest": "8881e4d966c3163c8c92b602ddf5182b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 55054,
            "upload_time": "2023-12-18T12:10:51",
            "upload_time_iso_8601": "2023-12-18T12:10:51.571158Z",
            "url": "https://files.pythonhosted.org/packages/0a/17/75ca872d8fe5a740a94eed34b00b67cbae418d51c62c729160582578022d/test_rest_api-0.0.0.0.40.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-18 12:10:51",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "troymjose",
    "github_project": "test_rest_api",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "test-rest-api"
}
        
Elapsed time: 3.52895s