def setUp(self): # 前置条件 # 实例化对象 self.driver = AutomateDriver() self.base_url = self.driver.base_url self.base_page = BasePage(self.driver, self.base_url) self.statistical_form_page = StatisticalFormPage( self.driver, self.base_url) self.statistical_form_page_read_csv = StatisticalFormPageReadCsv() self.log_in_base = LogInBase(self.driver, self.base_url) self.connect_sql = ConnectSql() self.search_sql = SearchSql(self.driver, self.base_url) self.statistical_form_page3 = StatisticFormPage3( self.driver, self.base_url) self.assert_text = AssertText() self.form_page = FormPage(self.driver, self.base_url) self.page = Page(self.driver, self.base_url) self.form_export_page = FormExportPage(self.driver, self.base_url) self.statistical_form_page4 = StatisticFormPage4( self.driver, self.base_url) # 打开页面,填写用户名、密码、点击登录 self.base_page.open_page() self.driver.set_window_max() self.driver.implicitly_wait(5) self.driver.clear_cookies() self.log_in_base.log_in_jimitest() current_handle = self.driver.get_current_window_handle() self.statistical_form_page.click_control_after_click_statistical_form_page( ) sleep(3) self.base_page.change_windows_handle(current_handle)
def setUp(self): # 前置条件 # 实例化对象 self.driver = AutomateDriver() self.base_url = self.driver.base_url self.base_page = BasePage(self.driver, self.base_url) self.statistical_form_page = StatisticalFormPage( self.driver, self.base_url) self.statistical_form_page_read_csv = StatisticalFormPageReadCsv() self.seasrch_sql = SearchSql(self.driver, self.base_url) self.log_in_base = LogInBase(self.driver, self.base_url) self.connect_sql = ConnectSql() self.search_sql = SearchSql(self.driver, self.base_url) self.statistical_form_page3 = StatisticFormPage3( self.driver, self.base_url) self.statistical_form_page4 = StatisticFormPage4( self.driver, self.base_url) # 打开页面,填写用户名、密码、点击登录 self.base_page.open_page() self.assert_text = AssertText() self.driver.set_window_max() self.driver.implicitly_wait(5) self.log_in_base.log_in_jimitest() # 登录之后点击统计报表 self.statistical_form_page.click_control_after_click_statistical_form_page( ) sleep(3)