def test_02_add_new_address_first(self): '''add_address新版页面首次新增地址并编辑''' BaseSteps.add_address_in_setting() # 编辑地址 BasePage.wait_element_exists( self.d(resourceId='com.vova.android:id/addressModifyIv')) time.sleep(2) # 兼容刷新不完成时点击编辑无效,待完善 shipping_address.shipping_address_page( ).click_edit_button_for_address_v2() add_address_v2.add_address_page().wait_edit_page() add_address_v2.add_address_page().input_address( 'updated' + self.test_data['detail_address']) add_address_v2.add_address_page().click_save_button() a = self.d(resourceId="com.vova.android:id/addressDesTv", textContains='updated').exists(timeout=6) self.assertTrue(a)
def test_03_add_new_address_no_first(self): '''add_address新版页面非首次新增地址并删除''' BaseSteps.add_address_in_setting() BasePage.wait_element_exists( self.d(resourceId='com.vova.android:id/addressModifyIv')[1]) time.sleep(2) # 兼容刷新不完成时点击编辑无效,待完善 # 删除地址 shipping_address.shipping_address_page( ).click_edit_button_for_address_v2() add_address_v2.add_address_page().wait_edit_page() add_address_v2.add_address_page().click_del_button_for_address_v2() BasePage.wait_element_exists( self.d(resourceId='com.vova.android:id/addressModifyIv')) self.d(resourceId="com.vova.android:id/addressDesTv", textContains='updated').wait_gone(timeout=4.0) self.assertFalse( self.d(resourceId="com.vova.android:id/addressDesTv", textContains='updated').exists())