class Picture(Basepage): def rec_create_btn(self): self.logger = Logger(loggername=self.__class__.__name__).get_logger() self.logger.debug(u'找到新建广告位按钮') return self.find_element('css_selector=>div.panel_page_button_text') def click_create_btn(self): self.rec_create_btn().click() self.logger.debug(u'点击新建广告位按钮')
class AdPosition(Basepage): def rec_picture_btn(self): self.logger = Logger(loggername=self.__class__.__name__).get_logger() self.logger.debug(u'找到图文按钮') return self.find_element('css_selector=>div#adPos_adKind_tuwen') def click_picture_btn(self): self.rec_picture_btn().click() self.logger.debug(u'点击图文按钮') return Picture(self.driver)
class SearchPage(Basepage): def rec_search_input(self): self.logger = Logger(loggername=self.__class__.__name__).get_logger() self.logger.debug(u'找到搜索Input.') return self.find_element(selector='id=>kw') def rec_search_btn(self): self.logger = Logger(loggername=self.__class__.__name__).get_logger() self.logger.debug(u'找到百度一下Input.') return self.find_element(selector='id=>su') def click_search_btn(self): self.rec_search_btn().click() self.logger = Logger(loggername=self.__class__.__name__).get_logger() self.logger.debug(u'点击"立即登录 "按钮.')
class LoginPage(Basepage): def rec_user_input(self): self.logger = Logger(loggername=self.__class__.__name__).get_logger() self.logger.debug(u'找到"登录用户名"输入input.') return self.find_element(selector='id=>login_dialog_input_user_mail') def rec_passwd_input(self): self.logger = Logger(loggername=self.__class__.__name__).get_logger() self.logger.debug(u'找到"密码"输入input.') return self.find_element(selector='id=>login_dialog_input_user_pwd') def rec_rmb_user_btn(self): self.logger = Logger(loggername=self.__class__.__name__).get_logger() self.logger.debug(u'找到"记住用户名"按钮.') return self.find_element(selector='id=>login_dialog_rmb_user') def rec_rmb_pwd_btn(self): self.logger = Logger(loggername=self.__class__.__name__).get_logger() self.logger.debug(u'找到"记住密码"按钮.') return self.find_element(selector='id=>login_dialog_rmb_pwd') def rec_login_btn(self): self.logger = Logger(loggername=self.__class__.__name__).get_logger() self.logger.debug(u'找到"立即登录"按钮.') return self.find_element(selector='id=>login_dialog_login_button') def click_login_btn(self): self.logger = Logger(loggername=self.__class__.__name__).get_logger() self.logger.debug(u'点击"立即登录 "按钮.') self.click_sel(selector='id=>login_dialog_login_button') def get_main_page(self): return MainPage(self.driver)