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 details)

Uploaded Source

Built Distribution

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

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: TheRuffianReportPro-1.0.0.tar.gz
  • Upload date:
  • Size: 19.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for TheRuffianReportPro-1.0.0.tar.gz
Algorithm Hash digest
SHA256 22be913717c3afd32584995dedddcb902883217456b124457fbb5335834d15ed
MD5 0c46b72dfea79eb01743ba65ce1750c4
BLAKE2b-256 bfe400a7e9b37ee20a45c61a185558ea4eed637b0a60707d613a55b6d1c1c1aa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for TheRuffianReportPro-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 04173f151598cafec103aba1276d37dffd2be8d3a221098a2e15c34c2dbaa804
MD5 05197e5c40aa53ff455a85923b9014e8
BLAKE2b-256 42d06cbb6db369a960d8629caeb42a64d0cd1b346ef39b0b6c8c4d92a59f9d38

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