Answer the question
In order to leave comments, you need to log in
How to attach Sceenshot to HTLM report after passing the test?
Tell me how to attach Screenshot to HTLM report
Using HTLMTestRunner which generates a report after TestSuite completes - I would like to see a screenshot after everything like here -
(from https://pypi.org/project/pytest-html/1.17.0/)
Now TestRunner looks like So
def TestRunner(base_url):
print base_url
suite = unittest.TestSuite()
##Add additional test suites as classes here:
suite.addTests([
unittest.defaultTestLoader.loadTestsFromTestCase(SmokeTestSuite)
])
# Invoke TestRunner
dir = os.getcwd()
now = datetime.datetime.now()
fp = file('./PATH-' + str(now.strftime("%B-%d-%Y %H-%M-%S")) + '.html', 'wb')
# runner = unittest.TextTestRunner(buf) #DEBUG: this is the unittest baseline
runner = HTMLTestRunner(
stream=fp,
title=' PS-02-Full-Smoke-Test ' + base_url,
verbosity=0,
description='Smoke test suite'
)
runner.run(suite)
TestRunner(base_url)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question