Files
AppAutoTest/page_objects/home_page.py
CNWei f1d1a5d35f feat: 移除DDT模式的支持,改用POM模式
- 删除 data_loader 数据驱动加载器。
- 删除 test_keyword_sample 测试执行代码
- 新增 base_page

[DDT模式极大的限制了灵活性,增加了代码的编写难度,另外项目使用者都会编码故而转用只针对POM模式进行优化]
2026-01-26 17:51:47 +08:00

25 lines
560 B
Python

#!/usr/bin/env python
# coding=utf-8
"""
@author: CNWei,ChenWei
@Software: PyCharm
@contact: t6g888@163.com
@file: home_page
@date: 2026/1/26 17:37
@desc:
"""
from core.base_page import BasePage
class HomePage(BasePage):
_LOGOUT_BTN = ("text", "退出登录")
_NICKNAME = ("id", "user_nickname")
def get_nickname(self):
return self.driver.get_text(*self._NICKNAME)
def logout(self):
self.driver.click(*self._LOGOUT_BTN)
# 【核心:链式跳转】
# 退出后回到登录页
return self.login_page