HTMLTestRunner add screens for a comparative regression test

Asked by reriadboom on 2020-09-15

Hello ;-)

I'm currently trying to develop a POC using Sikulix in a comparative regression test. What I'm doing is :

_ Excute some GUI actions on an Old version of my Soft and take some screen shots at defferent steps (for example screens : screen1, screen2 and screen3 are saved);
_ Do the same thing on the new version of the soft + at each step I check if the GUI has changed by testing the existence of the screens taken on the old version (testMethod having assertion).

It's working and the report is generated. But I just want to integrate links to the two screens (old/new) on each testMethod in the report like :
 old version screen1 "link" and new version screen1 "link"

Is there a simple way to add some code (method) in the HTMLTestRunner to do that ?

Question information

English Edit question
Sikuli Edit question
No assignee Edit question
Solved by:
Last query:
Last reply:
RaiMan (raimund-hocke) said : #1

--- Is there a simple way to add some code (method) in the HTMLTestRunner to do that ?

Look into the code of the bundled (app data folder Lib).

There is already a modification, to add the last screenshot to the output on failure.

This might help, to understand the principle.

Make a copy named stag. like, put it somewhere in your working environment and make your modifications.

How to make things ready to import it into your scripts:

reriadboom (raiderben) said : #2

Hello Raiman,

Thx for your speed response. Actually I have already looked at the bundled and I of course put a custom version of it in my "C:\Users\.....l\AppData\Roaming\Sikulix\Lib\site-packages" as indicated in the doc. And my custom version of is correctly loaded.

By may be because I m not a senior "Python" developper I'm facing some troubles to achieve my goal.
And to precise, the attempt was to add some static or class method to the "_TestResult" class and call it from my test method like :

def test1(self):
        self.screen_1 = captureZoneOnWindow()
        assert True

Let me know if I going on a right or bad direction.

reriadboom (raiderben) said : #3

And the new method "addScreen" looks like :

    def addScreen(img1):
        _TestResult.result.append((0, test, output, _exc_str, img1))

RaiMan (raimund-hocke) said : #4

Ok, I will have a look - might take some hours.

reriadboom (raiderben) said : #5

Ok, I appreciate.

Best RaiMan (raimund-hocke) said : #6

I have a principle solution.

I would like to continue with private mailing.

Please send me a mail contact to where I can send you a zip file with my current state and to further discuss it.

I am sikulix---at---outlook---dot---com.

reriadboom (raiderben) said : #7

Thanks RaiMan, that solved my question.