import unittest

from src.framework.HTMLTestRunner import HTMLTestRunner
from src.framework import common

from src.testcase.testLoginPage import TestLoginPage as TLP
from src.testcase.testMainPage import TestMainPage as TMP
# from src.testcase.testWordPage import TestWordPage as TWP

if __name__ == '__main__':
    testunit = unittest.TestSuite()
    testunit.addTest(TLP('testLogin'))
    testunit.addTests([TMP('test_1_UnStartLive'), TMP('test_2_StartLive'), TMP('test_3_ReviewLive')])

    # 定义报告输出路径
    htmlPath = "./report/AI-XM_Report{}.html".format(common.year_to_minute())
    with(open(htmlPath, 'wb')) as fp:
        runner = HTMLTestRunner(
            stream=fp,
            title='AI-小麦测试报告',
            description='描述'
        )
        runner.run(testunit)
