Htmltestrunner Chinese Version---Source of a great God source (added a failure screenshot, use case failed to re-execute function)

Source: Internet
Author: User

Htmltestrunner Chinese Version
    • 20170925
      • Complete localization of test reports, including Chinese processing of error logs
      • Increased failure auto functionality for selenium UI tests
      • Increased failure auto-retry function
      • Increase pie chart Statistics
      • Compatible with both python2.x and 3.x
    • 20180402
      • Table Style Optimization
      • Fix some bugs
      • Add groups to show multiple, first turn on auto play
      • Increase shows only the last run result, and when multiple retries, each test case is shown only once
Report Chinese

Selenium

function according to the test results, when the result is fail or error automatic method in _testresult test results collection, can be adjusted according to their own frame, selenium use get_screenshot_as_base64 Get the base64 encoding of the page to avoid problems with the picture file

So to extract the driver variable in the use case gets the Webdriver object, so the implementation function must be defined in the use case to define webdriver as driver

SetUp (self):    self.imgs=[]  = webdriver. Chrome ()   

You can also customize the addition of a step during the test process, such as creating a report that will show the results uniformly

Use case failed retry

According to the operation mechanism of unittest, judge the test result in stoptest, if the failure or error status is 1, decide whether to retry;

Appends a parameter when instantiating a Htmltestrunner object, retry, specifying the number of retries, and if Save_last_try is true, a use case displays only the results of the last Test.

Htmltestrunner (title="test report with description=" trial Sledgehammer Stream=open ("Sample_ test_report.html"WBverbosity=Retry=save_last_try=True)  

If Save_last_try is false, the results of all retries are displayed.

Htmltestrunner (title="test report with description=" trial Sledgehammer Stream=open ("Sample_ test_report.html"WBverbosity=Retry=save_last_try=False)  

The output in the run is as follows:

Url:https://github.com/goversky/htmltestrunner_cn/blob/master/readme.md

Source url:https://github.com/goversky/htmltestrunner_cn/blob/master/htmltestrunner_cn.py oneself Also in Baidu Cloud collection

Htmltestrunner Chinese Version---Source of a great God source (added failed, use case failed to re-execute function)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.