Beispiel #1
0
 def head_update(self, picture):
     """更新头像"""
     self.login_element.click()
     time.sleep(1)
     photoChoiceElement = ReadElement().read_element(
         "DrawerMenuPage", 'photoChoice')
     clipBtndElement = ReadElement().read_element("DrawerMenuPage",
                                                  'clipBtnd')
     self.by_xpath_name(photoChoiceElement).send_keys(picture)
     self.by_xpath_name(clipBtndElement).click()
     time.sleep(1)
Beispiel #2
0
 def async_loading(self):
     """上拉分页"""
     time.sleep(3)
     loadElement = ReadElement().read_element("HomePage", 'load')
     clickHoldElement = self.by_xpath_name(loadElement)
     Slide(self.driver).slide(clickHoldElement, 0, 2500)  # 上拉加载
     time.sleep(3)
Beispiel #3
0
 def set_font_big(self):
     """设置大字体"""
     setFontBigElement = ReadElement().read_element("DetailPage",
                                                    'setFontBig')
     clickHoldElement = self.by_xpath_name(setFontBigElement)
     Slide(self.driver).slide(clickHoldElement, -100, 0)
     clickHoldElement.click()
Beispiel #4
0
 def down_refresh_data(self):
     """下拉刷新"""
     pullrefreshElement = ReadElement().read_element(
         "HomePage", 'pullrefresh')
     clickHoldElement = self.by_xpath_name(pullrefreshElement)
     Slide(self.driver).slide(clickHoldElement, 0, -200)  # 下拉刷新是负数
     time.sleep(3)
Beispiel #5
0
 def set_font_small(self):
     """设置小字体"""
     setFontSmallElement = ReadElement().read_element(
         "DetailPage", 'setFontSmall')
     clickHoldElement = self.by_xpath_name(setFontSmallElement)
     Slide(self.driver).slide(clickHoldElement, 100, 0)  # 左加右减
     clickHoldElement.click()
Beispiel #6
0
 def close_share(self):
     """关闭分享"""
     closeShareElement = ReadElement().read_element("DrawerMenuPage",
                                                    'closeShare')
     self.driver.switch_to_alert()
     self.by_xpath_name(closeShareElement).click()
Beispiel #7
0
 def share(self):
     """分享"""
     openShareElement = ReadElement().read_element("DrawerMenuPage",
                                                   'openShare')
     self.by_xpath_name(openShareElement).click()
Beispiel #8
0
 def like_num(self):
     likeNumElement = ReadElement().read_element("DetailPage", 'likeNum')
     return self.by_xpath_name(likeNumElement).text
Beispiel #9
0
 def login_btn(self):
     """登陆按钮"""
     loginBtnElement = ReadElement().read_element("PersonalPage",
                                                  'loginBtn')
     return self.by_xpath_name(loginBtnElement)
Beispiel #10
0
 def qr_code_link(self):
     """打开二维码弹窗"""
     qrCodeOpenElement = ReadElement().read_element("HomePage",
                                                    'qr_code_open')
     return self.by_xpath_name(qrCodeOpenElement).click()
Beispiel #11
0
 def detail_link(self):
     """跳转文章详情"""
     detailElement = ReadElement().read_element("HomePage", 'detail')
     return self.by_xpath_name(detailElement).click()
Beispiel #12
0
 def original_link(self):
     """独家原创"""
     originalLinkElement = ReadElement().read_element(
         "DrawerMenuPage", 'originalLink')
     self.by_xpath_name(originalLinkElement).click()
Beispiel #13
0
 def edit_personal_data(self):
     """编辑个人资料"""
     editPersonalDataElement = ReadElement().read_element(
         "DrawerMenuPage", 'editPersonalData')
     self.by_xpath_name(editPersonalDataElement).click()
Beispiel #14
0
 def goto_home_page(self):
     """返回首页"""
     gotoHomePageElement = ReadElement().read_element(
         "DetailPage", 'gotoHomePage')
     return self.by_xpath_name(gotoHomePageElement).click()
Beispiel #15
0
 def set_night_mode(self):
     """设置夜间|白天模式"""
     setNightModeElement = ReadElement().read_element(
         "DetailPage", 'setNightMode')
     return self.by_xpath_name(setNightModeElement).click()
Beispiel #16
0
 def cancel_set_font(self):
     """取消字体模式"""
     cancelSetFontElement = ReadElement().read_element(
         "DetailPage", 'cancelSetFont')
     return self.by_xpath_name(cancelSetFontElement).click()
Beispiel #17
0
 def set_font(self):
     """设置字体"""
     setFontElement = ReadElement().read_element("DetailPage", 'setFont')
     return self.by_xpath_name(setFontElement).click()
Beispiel #18
0
 def collect(self):
     """收藏"""
     collectElement = ReadElement().read_element("DetailPage", 'collect')
     return self.by_xpath_name(collectElement).click()
Beispiel #19
0
 def news_link(self):
     """咨询"""
     newsLinkElement = ReadElement().read_element("DrawerMenuPage",
                                                  'newsLink')
     self.by_xpath_name(newsLinkElement).click()
Beispiel #20
0
 def login_element(self):
     """头像"""
     headElement = ReadElement().read_element("DrawerMenuPage", 'head')
     return self.by_xpath_name(headElement)
Beispiel #21
0
 def big_data_link(self):
     """地产大数据"""
     bigDataLinkElement = ReadElement().read_element(
         "DrawerMenuPage", 'bigDataLink')
     self.by_xpath_name(bigDataLinkElement).click()
Beispiel #22
0
 def is_element_exist(self):
     """登陆状态判断"""
     loginStatusElement = ReadElement().read_element(
         "DrawerMenuPage", 'loginStatus')
     return self.by_xpath_name(loginStatusElement).text
Beispiel #23
0
 def drawer_menu_link(self):
     """跳转设置界面"""
     drawerElement = ReadElement().read_element("HomePage", 'drawer')
     return self.by_xpath_name(drawerElement).click()
Beispiel #24
0
 def login_title(self):
     """登陆标题"""
     loginTitleElement = ReadElement().read_element("DrawerMenuPage",
                                                    'loginTitle')
     return self.by_xpath_name(loginTitleElement).text
Beispiel #25
0
 def recent_read(self):
     """最近阅读"""
     recentReadElement = ReadElement().read_element("DrawerMenuPage",
                                                    'recentRead')
     self.by_xpath_name(recentReadElement).click()
Beispiel #26
0
 def my_collect(self):
     """我的收藏"""
     myCollectElement = ReadElement().read_element("DrawerMenuPage",
                                                   'myCollect')
     self.by_xpath_name(myCollectElement).click()
Beispiel #27
0
 def close_qr_code(self):
     """关闭二维码弹窗"""
     qrCodeCloseElement = ReadElement().read_element(
         "HomePage", 'qr_code_close')
     self.driver.switch_to_alert()
     return self.by_xpath_name(qrCodeCloseElement).click()
Beispiel #28
0
 def night_mode(self):
     """夜间模式"""
     nightModeElement = ReadElement().read_element("DrawerMenuPage",
                                                   'nightMode')
     return self.by_xpath_name(nightModeElement)
Beispiel #29
0
 def set_message(self):
     """消息设置"""
     setMessageElement = ReadElement().read_element("PersonalPage",
                                                    'setMessage')
     self.by_xpath_name(setMessageElement).click()
Beispiel #30
0
 def like(self):
     """点赞"""
     likeElement = ReadElement().read_element("DetailPage", 'like')
     return self.by_xpath_name(likeElement).click()