예제 #1
0
def first_by_scan(init_app_by_scan):
    yield FirstPage()
    try:
        FirstPage().refresh()
    except Exception as e:
        print(e)
        restart_app()  # 如果失败,则重新初始化,得到首页
예제 #2
0
def evalution_management_list_by_scan(init_app_by_scan):
    first_page = init_app_by_scan
    evalution_management_list = first_page.go_evalution_management()
    yield evalution_management_list
    try:
        first_page.refresh()
    except Exception as e:
        print(e)
        restart_app()  # 如果失败,则重新初始化,得到首页
예제 #3
0
def evalution_management_page(init_app):
    first_page = init_app
    evalution_management_page = first_page.go_evalution_management()
    yield evalution_management_page
    try:
        first_page.refresh()
        first_page.self_check()
    except Exception as e:
        print(e)
        restart_app()  # 如果失败,则重新初始化,得到首页
예제 #4
0
def go_to_my_page_by_scan(init_app_by_scan):
    first_page = init_app_by_scan  # 进入首页
    my_page = first_page.go_my_page()  # 点击我的
    yield my_page  # 返回我的页面
    try:
        first_page.refresh()
        first_page.self_check()
    except Exception as e:
        print(e)
        restart_app()  # 如果失败,则重新初始化,得到首页
예제 #5
0
def batch_send_goods_list(init_app):
    first_page = init_app
    batch_send_goods_list_page = first_page.go_batch_send_goods_page()
    yield batch_send_goods_list_page
    try:
        first_page.refresh()
        first_page.self_check()
    except Exception as e:
        print(e)
        restart_app()  # 如果失败,则重新初始化,得到首页
예제 #6
0
def go_to_firstbatch_evaluation_page_by_scan(init_app_by_scan):
    first_page = init_app_by_scan  # 进入首页
    batch_evaluation_page = first_page.go_batch_evaluation_page()  # 点击批量评价
    yield batch_evaluation_page  # 返回批量评价页面
    try:
        first_page.refresh()
        first_page.self_check()
    except Exception as e:
        print(e)
        restart_app()  # 如果失败,则重新初始化,得到首页
예제 #7
0
def auto_evaluate_by_scan(init_app_by_scan):
    first_page = init_app_by_scan  # 进入首页
    first_page.go_auto_evaluate_page()
    yield AutoEvaluatePage()
    try:
        first_page.refresh()
        first_page.self_check()
    except Exception as e:
        print(e)
        restart_app()  # 如果失败,则重新初始化,得到首页
예제 #8
0
def wait_seller_send_goods_combine_by_scan(init_app_by_scan):
    first_page = init_app_by_scan  # 进入首页
    wait_seller_send_goods_page = first_page.search_order_by_No(
        WAIT_SELLER_SEND_GOODS_COMBINE[0])  # 输入订单号,搜索
    yield wait_seller_send_goods_page
    try:
        first_page.refresh()
        first_page.self_check()
    except Exception as e:
        print(e)
        restart_app()  # 如果失败,则重新初始化,得到首页
예제 #9
0
def wait_seller_send_goods_with_print_history_by_scan(init_app_by_scan):
    first_page = init_app_by_scan  # 进入首页
    wait_seller_send_goods_page = first_page.search_order_by_No(
        WAIT_SELLER_SEND_GOODS_WITH_PRINT_HISTORY)  # 输入订单号,搜索
    yield wait_seller_send_goods_page
    try:
        first_page.refresh()
        first_page.self_check()
    except Exception as e:
        print(e)
        restart_app()  # 如果失败,则重新初始化,得到首页
예제 #10
0
def go_to_negative_comment_interception_page_by_scan(init_app_by_scan):
    first_page = init_app_by_scan  # 进入首页
    negative_comment_interception_page = first_page.go_negative_comment_interception_page(
    )  # 点击差评拦截
    yield negative_comment_interception_page  # 返回差评拦截页面
    try:
        first_page.refresh()
        first_page.self_check()
    except Exception as e:
        print(e)
        restart_app()  # 如果失败,则重新初始化,得到首页
예제 #11
0
def need_seller_rate_by_scan(init_app_by_scan):
    first_page = init_app_by_scan  # 进入首页
    # need_seller_rate_page = first_page.go_order_list_page()  # 点击订单列表
    first_page.search_order_by_No(NEED_RATE)  # 根据订单号搜索订单,大写字符标识常量
    yield first_page, NEED_RATE  # 返回元组(页面,页面校验结果),其中页面校验结果仍然为元组(是否正确,详细比对结果)
    try:
        first_page.refresh()
        first_page.self_check()
    except Exception as e:
        print(e)
        restart_app()  # 如果失败,则重新初始化,得到首页
예제 #12
0
def batch_send_goods_single_order_handle_by_scan(init_app_by_scan):
    first_page = init_app_by_scan
    batch_send_goods_list = first_page.go_batch_send_goods_page()
    batch_send_goods_page = batch_send_goods_list.choose_single_order()
    yield batch_send_goods_page
    try:
        first_page.refresh()
        first_page.self_check()
    except Exception as e:
        print(e)
        restart_app()  # 如果失败,则重新初始化,得到首页
예제 #13
0
def wait_buyer_confirm_goods_by_scan(init_app_by_scan):
    first_page = init_app_by_scan  # 进入首页
    wait_buyer_confirm_goods_page = first_page.search_order_by_No(
        WAIT_BUYER_CONFIRM_GOODS)  # 根据订单号搜索订单,大写字符标识常量
    yield wait_buyer_confirm_goods_page
    try:
        first_page.refresh()
        first_page.self_check()
    except Exception as e:
        print(e)
        restart_app()  # 如果失败,则重新初始化,得到首页
예제 #14
0
def wait_buyer_pay_by_scan(init_app_by_scan):
    first_page = init_app_by_scan
    wait_buyer_pay_page = first_page.search_order_by_No(WAIT_BUYER_PAY_ORDER)
    wait_buyer_pay_page.self_check()
    yield wait_buyer_pay_page
    try:
        first_page.refresh()
        first_page.self_check()
    except Exception as e:
        print(e)
        restart_app()  # 如果失败,则重新初始化,得到首页
예제 #15
0
def send_goods_combine(init_app):
    first_page = init_app  # 进入首页
    wait_seller_send_goods_page = first_page.search_order_by_No(
        WAIT_SELLER_SEND_GOODS_COMBINE[0])  # 输入订单号,搜索
    wait_seller_send_goods_page.go_to_deliver()
    yield SendGoodsPage()
    try:
        first_page.refresh()
        first_page.self_check()
    except Exception as e:
        print(e)
        restart_app()  # 如果失败,则重新初始化,得到首页
예제 #16
0
def send_goods_without_print_history_by_scan(init_app_by_scan):
    first_page = init_app_by_scan  # 进入首页
    wait_seller_send_goods_page = first_page.search_order_by_No(
        WAIT_SELLER_SEND_GOODS_WITHOUT_PRINT_HISTORY)  # 输入订单号,搜索
    wait_seller_send_goods_page.go_to_deliver()
    yield SendGoodsPage()
    try:
        first_page.refresh()
        first_page.self_check()
    except Exception as e:
        print(e)
        restart_app()  # 如果失败,则重新初始化,得到首页
예제 #17
0
def send_goods_by_scan(init_app_by_scan):
    first_page = init_app_by_scan  # 进入首页
    wait_seller_send_goods_page = first_page.search_order_by_No(
        WAIT_BUYER_CONFIRM_GOODS)  # 输入订单号,搜索
    wait_seller_send_goods_page.go_to_deliver()
    yield SendGoodsPage()
    try:
        first_page.refresh()
        first_page.self_check()
    except Exception as e:
        print(e)
        restart_app()  # 如果失败,则重新初始化,得到首页
예제 #18
0
def wait_refund_order_list_by_scan(init_app_by_scan):
    first_page = init_app_by_scan
    wait_refund_order_list_page = first_page.search_order_by_No(
        WAIT_REFUND_ORDER)  # 搜索退款中订单
    wait_refund_order_list_page.init_page(WAIT_REFUND_ORDER)
    wait_refund_order_list_page.self_check()
    yield wait_refund_order_list_page
    try:
        first_page.refresh()
        first_page.self_check()
    except Exception as e:
        print(e)
        restart_app()  # 如果失败,则重新初始化,得到首页
예제 #19
0
def shopping_cart_wait_buyer_pay_order_list_by_scan(init_app_by_scan):
    first_page = init_app_by_scan
    wait_buyer_pay_shopping_cart_order_list_page = first_page.search_order_by_No(
        WAIT_BUYER_PAY_ORDER_CART)  # 搜索待付款订单
    wait_buyer_pay_shopping_cart_order_list_page.self_check()
    poco("__react-content").child().child()[5].child()[1].swipe([0, -1])
    time.sleep(1)
    yield wait_buyer_pay_shopping_cart_order_list_page
    try:
        first_page.refresh()
        first_page.self_check()
    except Exception as e:
        print(e)
        restart_app()  # 如果失败,则重新初始化,得到首页
예제 #20
0
def to_be_shipped_orderlist_by_scan(init_app_by_scan):
    first_page = init_app_by_scan  # 进入首页
    to_be_shipped_order_list_page = first_page.go_order_list_page()  # 点击订单列表
    to_be_shipped_order_list_page.search_order_by_No(
        WAIT_SELLER_SEND_GOODS)  # 根据订单号搜索订单,大写字符标识常量
    to_be_shipped_order_list_page.init_page(
        WAIT_SELLER_SEND_GOODS)  # 调用init_page方法,获取动态属性的定位字符串
    yield to_be_shipped_order_list_page
    try:
        first_page.refresh()
        first_page.self_check()
    except Exception as e:
        print(e)
        restart_app()  # 如果失败,则重新初始化,得到首页
예제 #21
0
def need_seller_rate_list_by_scan(init_app_by_scan):
    first_page = init_app_by_scan  # 进入首页
    need_seller_rate_list_page = first_page.go_order_list_page()  # 点击订单列表
    poco("android:id/content").offspring(
        "com.taobao.qianniu:id/fragment_container"
    ).child("android.widget.RelativeLayout").offspring(
        "__react-content").child("android.view.View").offspring(
            "tabNEED_RATE").child("android.view.View").click()  # 点击需要评价列表
    yield need_seller_rate_list_page  # 返回元组(页面,页面校验结果),其中页面校验结果仍然为元组(是否正确,详细比对结果)
    try:
        first_page.refresh()
        first_page.self_check()
    except Exception as e:
        print(e)
        restart_app()  # 如果失败,则重新初始化,得到首页
예제 #22
0
def to_be_shipped_orderlist(init_app):
    first_page = init_app  # 进入首页
    to_be_shipped_order_list_page = first_page.go_order_list_page()  # 点击订单列表
    to_be_shipped_order_list_page.search_order_by_No(
        WAIT_SELLER_SEND_GOODS)  # 根据订单号搜索订单,大写字符标识常量
    to_be_shipped_order_list_page.init_page(
        WAIT_SELLER_SEND_GOODS)  # 调用init_page方法,获取动态属性的定位字符串
    yield to_be_shipped_order_list_page  # , check_order_info(
    #  WAIT_SELLER_SEND_GOODS)  # 返回元组(页面,页面校验结果),其中页面校验结果仍然为元组(是否正确,详细比对结果)
    try:
        first_page.refresh()
        first_page.self_check()
    except Exception as e:
        print(e)
        restart_app()  # 如果失败,则重新初始化,得到首页
예제 #23
0
        restart_app()  # 如果失败,则重新初始化,得到首页


# 前往首页差评拦截页面
@pytest.fixture(scope='function')
def go_to_negative_comment_interception_page_by_scan(init_app_by_scan):
    first_page = init_app_by_scan  # 进入首页
    negative_comment_interception_page = first_page.go_negative_comment_interception_page(
    )  # 点击差评拦截
    yield negative_comment_interception_page  # 返回差评拦截页面
    try:
        first_page.refresh()
        first_page.self_check()
    except Exception as e:
        print(e)
        restart_app()  # 如果失败,则重新初始化,得到首页


@pytest.fixture()
# 进入我的页面
def go_mine_by_scan(init_app_by_scan):
    first_page = init_app_by_scan  # 进入首页
    first_page.go_my_page()
    yield MinePage()
    first_page.refresh()


if __name__ == '__main__':
    wakeup()
    restart_app()
예제 #24
0
def init_app():
    wakeup_trade()
    restart_app()
    first = FirstPage()
    first.self_check()
    return first