def test2_login(self): m = LoginPage(self.driver) self.u = m.set_username(ReadExcel('admintest', 7, 6)) self.p = m.set_password(str(ReadExcel('admintest', 7, 7))) self.c = m.click() time.sleep(2) self.e = m.get_errortitle() self.assertEqual(self.e, ReadExcel('admintest', 7, 9))
def test1_newlogin(self): m=LoginPage(self.driver) self.a=m.set_username(ReadExcel('admintest',35,6)) self.b=m.set_password(ReadExcel('admintest',37,6)) self.c=m.click() time.sleep(4) self.d=m.get_DiaglogTitle() self.assertEqual(self.d,ReadExcel('admintest',10,9))
def test5_login(self): m = LoginPage(self.driver) self.u = m.set_username(ReadExcel('admintest', 10, 6)) self.p = m.set_password(ReadExcel('admintest', 10, 7)) self.c = m.click() time.sleep(4) self.f = m.get_DiaglogTitle() self.assertEqual(self.f, ReadExcel('admintest', 10, 9)) time.sleep(1)
def test3_userspeed(self): m = Configure_speed(self.driver) self.a = m.admin_advanced() time.sleep(1) self.b = m.uerupload_speed(int(ReadExcel('admintest', 30, 6))) self.c = m.userdownload_speed(int(ReadExcel('admintest', 31, 6))) self.d = m.speedok_btn() time.sleep(1) self.e = m.get_successtitle() time.sleep(1) self.assertEqual(self.e, ReadExcel('admintest', 32, 9))
def __init__(self): openWeb(self) inputUrl(self) u=ReadExcel(0,1,2) inputUserName(self,u) p=ReadExcel(0,1,3) p_new=int(p) inputPasswd(self,p_new) submit(self) custClick(self) custAdd(self) custName=ReadExcel(1,1,2) inputCustName(self,custName) Tel=ReadExcel(1,1,3) inputTel(self,Tel) custSubmit(self)
def test2_server(self): m = Serverpage(self.driver) # 重启服务器 self.a = m.restart_btn() time.sleep(15) # 判断正在运行图标元素是否存在 self.rest = m.is_ElementExist(ReadExcel('admintest', 14, 9)) # 关闭服务器 self.c = m.shutdown_btn() time.sleep(15) # 判断未运行图标元素是否存在 self.stop = m.is_ElementExist(ReadExcel('admintest', 15, 9)) # 启动服务器 self.d = m.start_btn() time.sleep(15) # 判断正在运行图标元素是否存在 self.star = m.is_ElementExist(ReadExcel('admintest', 16, 9))
def test1_server(self): m = Serverpage(self.driver) self.a = m.edition_btn() time.sleep(1) #输入服务器地址为域名 self.b = m.host_edit(ReadExcel('admintest', 12, 6)) time.sleep(1) #输入激活码 self.c = m.license_edit(ReadExcel('admintest', 13, 6)) self.d = m.edit_ok() time.sleep(2) self.e = m.confirm_btn() time.sleep(15) self.f = m.license_titles() #验证激活码是否激活成功 self.assertEqual(self.f, ReadExcel('admintest', 13, 9)) time.sleep(5)
def test1_emailedit(self): m = Configure_email(self.driver) self.a = m.set_email() time.sleep(1) self.b = m.set_nickname(ReadExcel('admintest', 18, 6)) self.c = m.set_fromemail(ReadExcel('admintest', 19, 6)) self.d = m.set_smtphost(ReadExcel('admintest', 20, 6)) self.e = m.set_smtpport(int(ReadExcel('admintest', 21, 6))) self.f = m.set_smtpaccount(ReadExcel('admintest', 22, 6)) self.g = m.set_password(ReadExcel('admintest', 23, 6)) time.sleep(1) self.h = m.emailok_btn()
def adminurl(): a = (ReadExcel('admintest', 4, 6)) return a
def nweurl(): a = (ReadExcel('admintest', 40, 6)) return a