Skip to main content

Report for unittest

Project description

Introduction

Modified based on unittestreport
Added automatic screenshot and picture display for assertion failure
Added the lark Robot api

Install

pip install TheRuffianReportPro

Author

name:TheRuffian
email:bugpz2779@gmail.com
email:theruffian@163.com

Instructions for use

Case

import unittest
from selenium import webdriver
from TheRuffianReportPro.common import failure_monitor

class Test_demo(unittest.TestCase):
    def setUp(self) -> None:
        self.driver = webdriver.Chrome()
        self.failureException = failure_monitor(self,'images')
        self.driver.get("url")
    
    def test_example(self):
        self.driver.find_element(By, Element).send_keys(keyword)
        self.driver.find_element(By, Element).click()
        self.assertEqual(first,second) # Take a screenshot if the first assertion fails 

Run

import unittest
from TheRuffianReportPro.core.testRunner import TestRunner
from case.xxx import Test_demo

runner = TestRunner(unittest.TestLoader().loadTestsFromTestCase(Test_demo),
                        filename='report.html',
                        report_dir='./Report',
                        templates=3)
runner.run()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

TheRuffianReportPro-1.0.0.tar.gz (19.6 kB view hashes)

Uploaded Source

Built Distribution

TheRuffianReportPro-1.0.0-py3-none-any.whl (23.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page