def test_login_succeed_recent_read(self): """登录状态最近阅读""" print("========【case_0008】 登录状态最近阅读测试=====") drawerMenuPage = drawer_menu_page.DrawerMenuPage(self.driver) Common.is_login_status_fail(self.driver, 'xxxx', '2327') time.sleep(1) drawerMenuPage.recent_read time.sleep(1) drawerMenuPage.screenshot(Common.get_pic_path()) self.assertEquals(self.driver.title, "最近阅读") # 判断是否打开最近阅读
def test_head_update(self): """头像更新""" print("========【case_0029】 头像更新测试=====") drawerMenuPage = drawer_menu_page.DrawerMenuPage(self.driver) time.sleep(1) Common.is_login_status_fail(self.driver, 'xxxx', '2327') time.sleep(1) drawerMenuPage.head_update('D:\\20171218160332.png') time.sleep(1) drawerMenuPage.screenshot(Common.get_pic_path())
def test_login_succeed_my_collect(self): """登录状态我的收藏""" print("========【case_0010】 登录状态我的收藏测试=====") drawerMenuPage = drawer_menu_page.DrawerMenuPage(self.driver) time.sleep(1) Common.is_login_status_fail(self.driver, 'xxxx', '2327') time.sleep(1) drawerMenuPage.my_collect time.sleep(1) drawerMenuPage.screenshot(Common.get_pic_path()) self.assertEquals(self.driver.title, "我的收藏") # 判断是否打开我的收藏
def original_link(self): """独家原创""" self.by_xpath_name('//*[@id="drawerMenu"]/div/ul[2]/li[2]/a/p').click() @property def big_data_link(self): """地产大数据""" self.by_xpath_name('//*[@id="drawerMenu"]/div/ul[2]/li[3]/a/p').click() def head_update(self, picture): """更新头像""" self.login_element.click() time.sleep(1) self.by_id('filed').send_keys(picture) self.by_id('clipBtnd').click() time.sleep(1) if __name__ == "__main__": # pass Set_Resolution = SetResolution.SetResolution() options = Set_Resolution.set_current_resolution() driver = webdriver.Chrome(chrome_options=options) HomePage = DrawerMenuPage(driver) time.sleep(1) Common.is_login_status_fail(driver, 'xxxx', '2327') time.sleep(1) HomePage.head_update('D:\\20171218160332.png') time.sleep(1) driver.quit()