def choose_three_month(self): """ 在订单列表页面点击'近三个月'标签,检查标签是否处于选中状态 :return:None """ three_month = init_element(self.tab_three_month_locator) ay_swipe(self.tab_wait_buyer_confirm_goods_locator, 'left') # 选择已发货标签执行向左滑动滑动操作 three_month.invalidate() three_month.click() check = three_month.parent().child() if len(check) > 1: return True else: return False
def choose_wait_seller_send_goods(self): """ 在订单列表页面点击'待发货'标签 :return:None """ wait_seller_send_goods = init_element(self.tab_wait_seller_send_goods_locator) ay_swipe(self.tab_wait_buyer_confirm_goods_locator, 'right') # 选择已发货标签执行向右滑动滑动操作 wait_seller_send_goods.invalidate() wait_seller_send_goods.click() check = wait_seller_send_goods.parent().child() if len(check) > 1: self.check_search_box_isempty() if ay_exists(self.block_buyer_locator): order_status = self.get_order_status() expected_status = ['待发货', '当前没有任何订单', '待发货合单', '部分发货'] if order_status in expected_status: return True, '' else: return False, '订单状态不正确' else: return False, '待发货标签没有点中'
def choose_trade_refund(self): """ 在订单列表页面点击'退款中'标签 :return:None """ trade_refund = init_element(self.tab_refund_locator) ay_swipe(self.tab_wait_buyer_confirm_goods_locator, 'right') # 选择已发货标签执行向左滑动滑动操作 trade_refund.invalidate() trade_refund.click() check = trade_refund.parent().child() if len(check) > 1: self.check_search_box_isempty() if ay_exists(self.block_buyer_locator): order_status = self.get_order_status() expected_status = ['退款中', '已发货退款', '待发货退款'] if order_status in expected_status: return True, '' else: return False, '订单状态不正确' else: return True, '当前没有退款中订单' else: return False, '退款中标签没有点中'
def choose_need_rate(self): """ 在订单列表页面点击'待评价'标签 :return:None """ need_rate = init_element(self.tab_need_rate_locator) ay_swipe(self.tab_wait_buyer_confirm_goods_locator, 'right') # 选择已发货标签执行向右滑动滑动操作 need_rate.invalidate() need_rate.click() check = need_rate.parent().child() if len(check) > 1: self.check_search_box_isempty() if ay_exists(self.block_buyer_locator): order_status = self.get_order_status() expected_status = ['待评价', '双方未评', '买家已评'] if order_status in expected_status: return True, '' else: return False, '订单状态不正确' else: return True, '当前没有待评价订单' else: return False, '待评价标签没有点中'
def choose_trade_finished(self): """ 在订单列表页面点击'已成功'标签 :return:None """ trade_finished = init_element(self.tab_succeeded_locator) ay_swipe(self.tab_wait_buyer_confirm_goods_locator, 'left') # 选择已发货标签执行向左滑动滑动操作 trade_finished.invalidate() trade_finished.click() check = trade_finished.parent().child() if len(check) > 1: self.check_search_box_isempty() if ay_exists(self.block_buyer_locator): order_status = self.get_order_status() expected_status = ['已成功', '待评价', '双方未评', '买家已评'] if order_status in expected_status: return True, '' else: return False, '订单状态不正确' else: return True, '当前没有已成功订单' else: return False, '已成功标签没有点中'
def choose_all_closed(self): """ 在订单列表页面点击'已关闭'标签 :return:None """ all_closed = init_element(self.tab_closed_locator) ay_swipe(self.tab_wait_buyer_confirm_goods_locator, 'left') # 选择已发货标签执行向左滑动滑动操作 all_closed.invalidate() all_closed.click() check = all_closed.parent().child() if len(check) > 1: self.check_search_box_isempty() if ay_exists(self.block_buyer_locator): order_status = self.get_order_status() expected_status = ['已关闭'] if order_status in expected_status: return True, '' else: return False, '订单状态不正确' else: return True, '当前没有已关闭订单' else: return False, '已关闭标签没有点中'
def choose_wait_buyer_pay(self): """ 在订单列表页面点击'待付款'标签 :return:None """ pending_payment = init_element(self.tab_pending_payment_locator) ay_swipe(self.tab_wait_buyer_confirm_goods_locator, 'right') # 选择已发货标签执行向左滑动滑动操作 pending_payment.invalidate() pending_payment.click() check = pending_payment.parent().child() if len(check) > 1: self.check_search_box_isempty() if ay_exists(self.block_buyer_locator): order_status = self.get_order_status() expected_status = ['待付款'] if order_status in expected_status: return True, '' else: return False, '订单状态不正确' else: return True, '当前没有待付款订单' else: return False, '待付款标签没有点中'
def go_to_deliver(self): ay_swipe(self.block_buyer_locator, 'up') ay_click(self.send_goods_locator) if poco(text='确认').exists(): poco(text='确认').click() return SendGoodsPage()