Although I have installed xmlrunner successfully (this is what I get from the logs of my IDE: 19/11/2020 09:37 Packages installed successfully: Installed packages: 'unittest-xml-reporting') I get the following error message: "Cannot find reference 'XMLTestRunner' in 'xmlrunner'" Here's my code, thank you in advance for your time and consideration (last line is the one relevant here):
import unittest
from xmlrunner import xmlrunner
from test_home_page_shop_1 import HomePageTest
from test_home_page_shop_2 import TestHomePage
from test_register_new_user_shop_2 import RegisterNewUser
from test_browser_navigation import NavigationTest
from test_compare_products_shop_2 import CompareProducts
from test_explicit_wait_shop_2 import (ExplicitWaitTests)
from test_explicit_waits_on_alerts_shop_2 import CompareProductsAlerts
# get all tests from SearchTest and HomePageTest class
test_home_page_shop_1 = unittest.TestLoader().loadTestsFromTestCase(HomePageTest)
test_home_page_shop_2 = unittest.TestLoader().loadTestsFromTestCase(TestHomePage)
test_register_new_user_shop_2 = unittest.TestLoader().loadTestsFromTestCase(RegisterNewUser)
test_browser_navigation = unittest.TestLoader().loadTestsFromTestCase(NavigationTest)
test_compare_products = unittest.TestLoader().loadTestsFromTestCase(CompareProducts)
test_explicit_waits = unittest.TestLoader().loadTestsFromTestCase(ExplicitWaitTests)
test_explicit_waits_alerts = unittest.TestLoader().loadTestsFromTestCase(CompareProductsAlerts)
# create a test suite combining search_test and home_page_test
smoke_tests = unittest.TestSuite([test_home_page_shop_1 , test_home_page_shop_2, test_register_new_user_shop_2,
test_browser_navigation, test_compare_products,
test_explicit_waits, test_explicit_waits_alerts])
# run the suite
xmlrunner.XMLTestRunner(verbosity=2, output='test-reports').run(smoke_tests)
Aucun commentaire:
Enregistrer un commentaire