二、PO模型之设计操作层-2

1、business业务层是将handle操作层封装在case样例层中。

即:handle操作层,放入business业务层。case样例层调用business业务层即可。

  • case样例层:D:\imooc\selenium\case\first_case.py
  • handle操作层:D:\imooc\selenium\handle\register_handle.py
  • business业务层:D:\imooc\selenium\business\register_business.py

2、case样例层:D:\imooc\selenium\case\first_case.py

# Function -- 注册项样本 --
# Time -- 2022.10.19 --
# Developer -- zhangjieqiong --

# coding=utf-8
class FirstCase(object):
    # 邮箱错误
    def test_login_email_error(self):
        # login('233','111111')
        # 通过assert判断是否为error
        pass
    # 用户名错误
    def test_login_username_error(self):
        pass
    # 验证码错误
    def test_login_code_error(self):
        pass
    # 成功
    def test_login_success(self):
        pass

 

3、handle操作层:D:\imooc\selenium\handle\register_handle.py

# Function -- 处理注册项样本 --
# 操作层
# Time -- 2022.10.19 --
# Developer -- zhangjieqiong --

# coding=utf-8

class LoginHandle(object):
    # 输入邮箱
    def send_user_email(self):
        pass
    # 输入用户名
    def send_user_name(self):
        pass
    # 输入密码
    def send_user_password(self):
        pass
    # 输入验证码
    def send_user_code(self):
        pass

 

4、business业务层:D:\imooc\selenium\business\register_business.py

# Function -- 执行操作层 --
# Time -- 2022.11.17 --
# Developer -- zhangjieqiong --

# coding=utf-8

class RegisterBusiness(object):
    # 执行操作
    def login(self):
        pass

 

posted @ 2022-11-07 14:21  酱汁怪兽  阅读(58)  评论(0)    收藏  举报