Run Multiple test and generate results in one test report

Asked by Ali Ahmed on 2021-03-23

so for my test result it generating 3 reports and the one that has both of the test is blank though and the other 2 have the individual test results. Is there a way to have results appear in just one report? Or atleast have the results appear in one html file.

This is what I have in the Test Suite:

Code:

import random
import shutil
import os
import xlrd
import BidsAndOffersModule

from SubmittingOffersMisoHourlyParameters import *
from SubmittingOffersMisoEnergySchedOffer import *

#from ddt import ddt, data,unpack

import utils

import HTMLTestRunner
import unittest

outfile = open("RunMultipleTests.html", "w")
runner = HTMLTestRunner.HTMLTestRunner(stream=outfile, title='Test Suite', description='Test Suite')

loader = unittest.TestLoader()
suite1 = loader.loadTestsFromModule(SubmittingOffersMisoHourlyParameters)
suite2 = loader.loadTestsFromModule(SubmittingOffersMisoEnergySchedOffer)

all_suite = unittest.TestSuite([suite1,suite2])
runner.run(all_suite)

I tried to replace (in the individual tests)

suite = unittest.TestLoader().loadTestsFromTestCase(SubmittingOffersMisoHourlyParameters)
outfile = open("SubmittingOffersMisoHourlyParameters.html", "w")
myrunner = HTMLTestRunner.HTMLTestRunner(stream = outfile, title = 'SubmittingOffersMisoHourlyParameters', description = 'NEW').run(suite)

with this

if __name__ == '__main__':
    unittest.main(testRunner=HTMLTestRunner.HTMLTestRunner())

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
2021-03-23
Last reply:
2021-03-31
Ali Ahmed (ali13xii) said : #1

Just need to figure this out, any help would be greatly be appreciated

Can you help with this problem?

Provide an answer of your own, or ask Ali Ahmed for more information if necessary.

To post a message you must log in.