Delayed screenshot in a Pass testcase with HTMLTestRunner
I´m using HTML Test Runner to generate reports for my executions.
I have modified the original file HTMLTestRunner.py to include screenshots for all status (Error, Failures and Pass) and it does work, however for Passed executions the screenshot is taken only after the TearDown is executed, (which makes the screenshot being taken of the browser a moment before the logout for my code). When the test fail,s the screenshot is taken correctly.
I have tried to include some sleeps to check if the issue was with the execution speed, but it didnt help, even with a sleep (30) the issue stayed the same. I have also tried to delete the TearDown and include the logout logic in my test, after the assert, but the screenshot taken was after the logout process.
This is a piece of my code:
class PerfilAcesso(
def setUp(self):
def test_visualiza_
sleep(5)
sleep(2)
assert exists(
def tearDown(self):
sleep(2)
sleep(1)
suite = unittest.
outfile = open("C:
screenshotfile = "C:\\EvidenciaT
runner = HTMLTestRunner.
runner.run(suite)
This is how the HTMLTestRunner.py looks:
def addSuccess(self, test):
output = self.complete_
if self.verbosity > 1:
else:
def addError(self, test, err):
_, _exc_str = self.errors[-1]
output = self.complete_
if self.verbosity > 1:
else:
def addFailure(self, test, err):
_, _exc_str = self.failures[-1]
output = self.complete_
if self.verbosity > 1:
else:
Can someone help me to understand this behaviour?
Thanks,
Question information
- Language:
- English Edit question
- Status:
- Expired
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply: