zoukankan      html  css  js  c++  java
  • Appium_Page object设计模式

    Page object设计模式思维,把app按页面去划分,一个页面就是一个page对象
    每个页面的元素集中管理、页面上按钮操作方法单独封装
    # __author__ = " Caric Lee "
    from autoTest.auto_appium_yipao.common.base import BaseApp
    from autoTest.auto_appium_yipao.page.page_element.pages import *
    
    class orderHomePage(BaseApp):
        '''订单页面_断言'''
        def text_allOrder(self):
            self.is_element_exist(YiPaoOrder.订单_全部订单)
        def text_Train(self):
            self.is_element_exist(YiPaoOrder.订单_火车票)
        def text_Flight(self):
            self.is_element_exist(YiPaoOrder.订单_机票)
        def text_Bus(self):
            self.is_element_exist(YiPaoOrder.订单_汽车票)
        def text_Hotel(self):
            self.is_element_exist(YiPaoOrder.订单_酒店)
        def text_SpecialOrder(self):
            self.is_element_exist(YiPaoOrder.订单_专车订单)
        def text_steamerTicketOrder(self):
            self.is_element_exist(YiPaoOrder.订单_船票订单)
        def text_ticketsOrder(self):
            self.is_element_exist(YiPaoOrder.订单_门票订单)
    工程下新建一个page的包
    每个Page页面单独写一个.py 文件,封装定位和操作元素方法

    用例层是相互独立的(用例不用调用用例),用例层可以调用任何page页面

    那么看个实际的脚本,是怎么写的:

    作者:含笑半步颠√

    博客链接:https://www.cnblogs.com/lixy-88428977

    声明:本文为博主学习感悟总结,水平有限,如果不当,欢迎指正。如果您认为还不错,欢迎转载。转载与引用请注明作者及出处。

  • 相关阅读:
    ioctl函数用法小记
    scanf函数用法小记
    printf函数用法小记
    REDIS
    lspci 虚拟机网卡对应关系
    vmware安装ubuntu " Intel VT-x 处于禁用状态"
    win10远程桌面配置
    Win10如何彻底禁用小娜?彻底禁用小娜的方法
    为什么Windows7打开项目的方式是灰的不能修改
    以下suse11.3x64可以安装pycrypto-2.6.1
  • 原文地址:https://www.cnblogs.com/lixy-88428977/p/9561771.html
Copyright © 2011-2022 走看看