#! user/bin/python

'''                                                           
Code description：自动化测试所有
'''
import sys
sys.path.append('../../../../')   # cmd运行需打开
from po.config.conf import *
from po.models.testreport import *
from po.models.sendemail import SendMail

os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

if __name__ == '__main__':
    try:
        '''
        BeautifulReport 测试报告
        '''
        # suite = addTc(rule='*Tc.py')
        # runTc(suite)

        '''
        HTMLTestRunner 测试报告
        '''
        runner, fp, fileName = testreport()
        test_suite = unittest.defaultTestLoader.discover(tcPath, pattern='*Tc.py')
        runner.run(test_suite)
    except Exception as e:
        print('运行出错！！！please check！！！')
        raise e
    else:
        sendmail = SendMail()
        sendmail.send('用户名', '密码')




#! user/bin/python

'''                                                           
Code description：自动化测试所有
'''
import sys
sys.path.append('../../../../')   # cmd运行需打开
from po.config.conf import *
from po.models.testreport import *
from po.models.sendemail import SendMail

os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

if __name__ == '__main__':
    try:
        '''
        BeautifulReport 测试报告
        '''
        # suite = addTc(rule='*Tc.py')
        # runTc(suite)

        '''
        HTMLTestRunner 测试报告
        '''
        runner, fp, fileName = testreport()
        test_suite = unittest.defaultTestLoader.discover(tcPath, pattern='*Tc.py')
        runner.run(test_suite)
    except Exception as e:
        print('运行出错！！！please check！！！')
        raise e
    else:
        sendmail = SendMail()
        sendmail.send('用户名', '密码')




#! user/bin/python Code description：自动化测试所有 # cmd运行需打开 BeautifulReport 测试报告 # suite = addTc(rule='*Tc.py') # runTc(suite) HTMLTestRunner 测试报告