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 GavinReportPro.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 GavinReportPro.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

gavinreportpro-1.0.0.tar.gz (51.0 kB view details)

Uploaded Source

Built Distribution

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

GavinReportPro-1.0.0-py3-none-any.whl (59.7 kB view details)

Uploaded Python 3

File details

Details for the file gavinreportpro-1.0.0.tar.gz.

File metadata

  • Download URL: gavinreportpro-1.0.0.tar.gz
  • Upload date:
  • Size: 51.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.2

File hashes

Hashes for gavinreportpro-1.0.0.tar.gz
Algorithm Hash digest
SHA256 501d70dafcef33f6d1644eb65f2454f208ee6cf216bd5a99adc9d6942b0fc397
MD5 f4dd625bab02b7455c0a98905ba0cc68
BLAKE2b-256 3eed75a2f8ac6c426ac35823a8765938bea1a6440531387129b08195aa79ea80

See more details on using hashes here.

File details

Details for the file GavinReportPro-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: GavinReportPro-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 59.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.2

File hashes

Hashes for GavinReportPro-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 20ab706ec399ea3213024fb2cae5e427795aca54b2b59a46e548f30d7b9b86d0
MD5 ace058a18852f0c6f3431d99e9612354
BLAKE2b-256 2bd489f38d4ac6f28676ac4f8e00479960511813598b35228476d2521fd8ccd7

See more details on using hashes here.

Supported by

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