def test_send_goods_without_logsitics(self, send_goods): """ 1.进入列表页,搜索出一笔订单 2.点击发货按钮,进入发货页面面 3.选择无需物流 4.点击立即发货按钮,成功返回列表页 :return: """ send_goods.without_contact() deliver_page.push_deliver_button() assert ay_exists(my_list.order_status_anchor), '点击立即发货后,没有发货成功!'
def test_without_logsitics(self, wait_seller_send_goods): """ 1.进入列表页,搜索出一笔订单,点击宝贝主图进入详情页 2.点击立即发货按钮,进入发货页面面 3.选择无需物流 4.点击立即发货按钮,成功返回列表页 :return: """ my_list = wait_seller_send_goods deliver_page = my_list.detail_go_to_deliver() deliver_page.without_contact() deliver_page.push_deliver_button() assert ay_exists(my_list.detail_delivery_locator), '点击立即发货后,没有发货成功!'
def close_order(self): close_order = init_element(self.close_order_locator) close_order.click() # 关闭订单按钮点击后可能没有反应 try: poco(text='确认关闭').wait_for_appearance(3) self.back() return True except Exception: if ay_exists(self.copy_mobile_number_locator): # 可能会误点到收货地址 ay_click(self.copy_mobile_number_locator) close_order.invalidate() close_order.click() res = poco(text='确认关闭').exists() self.back() return res
def test_detail_page_scan_to_deliver_contact_myself( self, wait_seller_send_goods): """ 1.进入列表页,搜索出一笔订单,点击宝贝主图进入详情页 2.点击扫码发货按钮,选择相册中的第一张二维码 3.进入发货页面,选择自己联系 4.输入快递公司 5.点击立即发货按钮,成功返回列表页 :return:` """ my_list = wait_seller_send_goods deliver_page = my_list.detail_scan_to_deliver() deliver_page.contact_myself() deliver_page.choose_logistics_company_contact_myself('芝麻开门') deliver_page.push_deliver_button() assert ay_exists(my_list.detail_delivery_locator), '点击立即发货后,没有发货成功!'
def choose_wait_buyer_confirm_goods(self): """ 在订单列表页面点击'已发货'标签 :return:None """ wait_buyer_confirm_goods = init_element(self.tab_wait_buyer_confirm_goods_locator) wait_buyer_confirm_goods.click() check = wait_buyer_confirm_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 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 is_combine(self): order_status = self.get_order_status() cancel_combine_status = ay_exists(self.cancel_combine_locator) number_status = ay_exists(self.num_of_combining_order_locator) return order_status, cancel_combine_status, number_status