class MyTest(unittest.TestCase): def setUp(self): self.driver = DriverBase().open_broswer() self.driver.implicitly_wait(10) self.driver.maximize_window() def tearDown(self): self.driver.quit()
# coding:utf-8 import unittest from PageObject.UploadContractPageObject import Upload_contract from public.GetExcelData import get_excel_data from config import readconfig from Base.DriverBase import DriverBase from public.SQLconnect import MySQLUtil from public.GetToastText import ToastText driverbase = DriverBase() uploaddata = get_excel_data(('upload_contract')) sql_data = get_excel_data('sql_data') mysql = MySQLUtil(db=readconfig.sql_db_qiyuebao) class UploadContract(unittest.TestCase): def setUp(self): self.driver = driverbase.open_broswer() driverbase.max_window() self.driver.implicitly_wait(10) self.upload = Upload_contract(self.driver) self.toast = ToastText(self.driver) def tearDown(self): driverbase.quit_broswer() # 上传pdf文件 def upload_pdf(self): mysql.update(sql_data[0]['table'], sql_data[0]['set or search'], sql_data[0]['where']) # 修改当前公司字段为0 mysql.update(sql_data[1]['table'], sql_data[1]['set or search'], sql_data[1]['where']) # 更新 成都知道创宇信息计数有限公司为当前公司
def setUp(self): self.driver = DriverBase().open_broswer() self.driver.implicitly_wait(10) self.driver.maximize_window()