#coding=utf-8
from business.register_business import RegisterBusiness
from selenium import webdriver
import unittest
class FirstCase(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Chrome()
self.driver.get("http://www.5itest.cn/register")
self.driver.minimize_window()
self.login = RegisterBusiness(self.driver)
def tearDown(self):
self.driver.close()
def test_login_email_error(self):
email_error = self.login.login_email_error('34','user111','111111','test1')
if email_error == True:
print("注册成功,此条case执行失败")
else:
print("注册失败,case成功")
def test_login_username_error(self):
username_error = self.login.login_name_error('34@qq.com', '1', '111111', 'test1')
if username_error == True:
print("注册成功,此条case执行失败")
def test_login_code_error(self):
code_error = self.login.login_code_error('34@163.com', 'ussadaer111', '111111', 'test1')
if code_error == True:
print("注册成功,此条case执行失败")
# def test_login_sucess(self):
# pass
'''def main():
first = FirstCase()
first.test_login_email_error()
first.test_login_username_error()
first.test_login_code_error()
'''
if __name__ == '__main__':
unittest.main()