class HomeListTest(unittest.TestCase): """测试 首页 页面""" def setUp(self): self.a = login_B() self.b = PageTitle(self.a) self.c = Home(self.a) def tearDown(self): # sleep(40) # 防止提示验证码发送过快 self.c.close_broser() @BeautifulReport.add_img('HomeListTest_001_Home_fail') def test_001_Check_page(self): """ 用例一 :检查页面是否正常 """ try: self.b.switch_to_HomePage() sleep(1) self.c.click_HomePage() self.assertTrue(self.c.get_Business_income_today_msg()) except (BaseException, AssertionError ) as msg: # BaseException所有异常的基类,AssertionError断言语句失败 self.c.save_img('HomeListTest_001_Home_fail') InsertLog().debug(msg) raise BaseException
def setUpClass(self): self.a = login_C() self.b = PageTitle(self.a) self.c = OverviewAndCash(self.a)
class ReportCashRecordListTest(unittest.TestCase): """测试 报表--概览/现金记录 页面""" @classmethod def setUpClass(self): self.a = login_C() self.b = PageTitle(self.a) self.c = OverviewAndCash(self.a) @classmethod def tearDownClass(self): self.c.close_broser() def CashRecordListBusiness(self): self.b.switch_to_ShopPage() sleep(1) self.b.switch_to_ReportFormPage() sleep(1) self.c.click_carh_history() @BeautifulReport.add_img("ReportCash_001_Overview_page_fail") def test_001_Check_Overview_page(self): """ 用例一 :检查概览页面是否正常 """ try: self.b.switch_to_ReportFormPage() sleep(1) self.c.click_OverviewList() self.assertTrue(self.c.get_Cash_msg_txt()) except (BaseException, AssertionError) as msg: self.c.save_img('ReportCash_001_Overview_page_fail') InsertLog().debug(msg) raise BaseException @BeautifulReport.add_img("ReportCash_002_Cash_page_fail") def test_002_Check_Cash_page(self): """ 用例二 :检查现金记录页面是否正常 """ try: self.CashRecordListBusiness() self.assertTrue(self.c.get_carh_history_txt()) except (BaseException, AssertionError) as msg: self.c.save_img('ReportCash_002_Cash_page_fail') InsertLog().debug(msg) raise BaseException @BeautifulReport.add_img("ReportCash_003_input_shop_fail") def test_003_Verify_Input_Shop_Name(self): """ 用例三 :验证现金记录>门店名称使用输入的方式查询 """ try: # 传参 需要查询的门店名称 self.CashRecordListBusiness() sleep(1) self.assertTrue(self.c.verify_input_shop_query(shop_name)) except (BaseException, AssertionError) as msg: self.c.save_img('ReportCash_003_input_shop_fail') InsertLog().debug(msg) raise BaseException @BeautifulReport.add_img('ReportCash_004_select_shop_fail') def test_004_Verify_Select_Shop_name(self): """ 用例四 :验证现金记录>门店名称使用全选的方式查询 """ try: self.CashRecordListBusiness() self.assertIn(shop_name, self.c.verify_select_shop_query()) except (BaseException, AssertionError) as msg: self.c.save_img('ReportCash_004_select_shop_fail') InsertLog().debug(msg) raise BaseException @BeautifulReport.add_img('ReportCash_005_reset_fail') def test_005_Verify_Reset(self): """ 用例五 :验证现金记录>重置功能 """ try: # 传参,先输入开始日期,点击重置 self.CashRecordListBusiness() self.assertIn( '', self.c.verify_reset_function(start_day)) # 重置成功则返回空字符串 except (BaseException, AssertionError) as msg: self.c.save_img('ReportCash_005_reset_fail') InsertLog().debug(msg) raise BaseException @BeautifulReport.add_img('ReportCash_006_Day_fail') def test_006_Verify_Day_Query(self): """ 用例六 :验证现金记录>日期查询功能 """ try: # 传参 开始日期和结束日期,只能输入比当前日期前一天的时间 self.CashRecordListBusiness() self.assertIsNotNone(self.c.verify_day_query(start_day, end_day)) except (BaseException, AssertionError) as msg: self.c.save_img('ReportCash_006_Day_fail') InsertLog().debug(msg) raise BaseException
def setUpClass(self): self.a = login_C() self.b = PageTitle(self.a) self.c = OrderManagement(self.a)
class OrderManagementTest(unittest.TestCase): """测试 订单--订单管理 页面""" @classmethod def setUpClass(self): self.a = login_C() self.b = PageTitle(self.a) self.c = OrderManagement(self.a) @classmethod def tearDownClass(self): self.c.close_broser() def OrderManagermentBusiness(self): self.b.switch_to_ShopPage() sleep(1) self.b.switch_to_OrderPage() sleep(1) self.c.click_OrderManagement() @BeautifulReport.add_img("OrderTest_001_page_fail") def test_001_Check_page(self): """ 用例一 :检查页面是否正常 """ try: self.OrderManagermentBusiness() self.assertTrue(self.c.findElement('Cashier Order')) except (BaseException, AssertionError) as msg: self.c.save_img('OrderTest_001_page_fail') InsertLog().debug(msg) raise BaseException @BeautifulReport.add_img("OrderTest_002_search_fail") def test_002_Verify_Input_Shop_Name(self): """ 用例二 :验证门店名称使用输入的方式查询 """ try: # 传参 需要查询的门店名称 self.OrderManagermentBusiness() self.assertTrue(self.c.input_shop_query(shop_name)) except (BaseException, AssertionError) as msg: self.c.save_img('OrderTest_002_search_fail') InsertLog().debug(msg) raise BaseException @BeautifulReport.add_img("OrderTest_003_search_fail") def test_003_Verify_Select_Shop_name(self): """ 用例三 :验证门店名称使用全选的方式查询 """ try: self.OrderManagermentBusiness() self.assertTrue(self.c.verify_select_shop_query()) except (BaseException, AssertionError) as msg: self.c.save_img('OrderTest_003_search_fail') InsertLog().debug(msg) raise BaseException @BeautifulReport.add_img("OrderTest_004_details_fail") def test_004_Verify_Modify_Function(self): """ 用例四 :验证详情页面 """ try: self.OrderManagermentBusiness() self.assertTrue(self.c.verify_modify_function()) except (BaseException, AssertionError) as msg: self.c.save_img('OrderTest_004_details_fail') InsertLog().debug(msg) raise BaseException @BeautifulReport.add_img("OrderTest_005_reset_fail") def test_005_Verify_Reset(self): """ 用例五 :验证重置功能 """ try: # 传参,先输入门店名称,点击重置 sleep(2) self.OrderManagermentBusiness() self.assertIn('', self.c.verify_reset_function(shop_name)) # 重置成功则返回'' except (BaseException, AssertionError) as msg: self.c.save_img('OrderTest_005_reset_fail') InsertLog().debug(msg) raise BaseException
def setUpClass(self): self.a = login_C() self.b = PageTitle(self.a) self.c = Setting(self.a)
class SettingPageList(unittest.TestCase): """设置:时区设置、费用管理、结算货币""" @classmethod def setUpClass(self): self.a = login_C() self.b = PageTitle(self.a) self.c = Setting(self.a) @classmethod def tearDownClass(self): # sleep(10) self.c.close_broser() @BeautifulReport.add_img("Setting_001_setting_fail") def test_001_Click_Setting_Page(self): """ 用例一 :检查设置页面是否正常 """ try: self.b.switch_to_SettingPage() self.assertTrue(self.c.click_setting()) except (BaseException, AssertionError) as msg: self.c.save_img('Setting_001_setting_fail') InsertLog().debug(msg) raise BaseException @BeautifulReport.add_img("Setting_002_chang_timezone_fail") def test_002_Change_Time_Zone_Page(self): """ 用例二 :修改时区设置 """ try: self.b.switch_to_SettingPage() self.assertTrue(self.c.update_time_zone()) except (BaseException, AssertionError) as msg: self.c.save_img('Setting_002_chang_timezone_fail') InsertLog().debug(msg) raise BaseException @BeautifulReport.add_img("Setting_003_add_fees_fail") def test_003_Add_Fees_Tax_Page(self): """ 用例三 :添加费用管理 """ try: self.b.switch_to_SettingPage() self.assertTrue(self.c.add_fees_tax(fees_name, service_charge, tax)) except (BaseException, AssertionError) as msg: self.c.save_img('Setting_003_add_fees_fail') InsertLog().debug(msg) raise BaseException @BeautifulReport.add_img("Setting_004_modify_fees_fail") def test_004_Modify_Fees_Tax_Page(self): """ 用例四 :修改费用管理 """ try: self.b.switch_to_SettingPage() self.assertTrue(self.c.update_fees_tax()) except (BaseException, AssertionError) as msg: self.c.save_img('Setting_004_modify_fees_fail') InsertLog().debug(msg) raise BaseException @BeautifulReport.add_img("Setting_005_delete_fees_fail") def test_005_Delete_Fees_Tax_Page(self): """ 用例五 :删除费用管理 """ try: self.b.switch_to_SettingPage() self.assertTrue(self.c.delete_fees_tax()) except (BaseException, AssertionError) as msg: self.c.save_img('Setting_005_delete_fees_fail') InsertLog().debug(msg) raise BaseException @BeautifulReport.add_img("Setting_006_dai_crypto_fail") def test_006_Setting_Crypto_DAI_Page(self): """ 用例六 :结算货币切换成DAI """ try: self.b.switch_to_SettingPage() self.assertTrue(self.c.setting_crypto('DAI')) except (BaseException, AssertionError) as msg: self.c.save_img('Setting_006_dai_crypto_fail') InsertLog().debug(msg) raise BaseException @BeautifulReport.add_img("Setting_007_usdt_crypto_fail") def test_007_Setting_Crypto_USDT_Page(self): """ 用例七 :结算货币切换成USDT """ try: self.b.switch_to_SettingPage() self.assertTrue(self.c.setting_crypto('USDT')) except (BaseException, AssertionError) as msg: self.c.save_img('Setting_007_usdt_crypto_fail') InsertLog().debug(msg) raise BaseException
class ShopListTest(unittest.TestCase): """测试 门店--门店列表 页面""" @classmethod def setUpClass(self): self.a = login_C() self.b = PageTitle(self.a) self.c = Shop(self.a) @classmethod def tearDownClass(self): self.c.close_broser() def ShopListBusiness(self): self.b.switch_to_OrderPage() sleep(1) self.b.switch_to_ShopPage() sleep(1) self.c.click_shop_list() @BeautifulReport.add_img('ShopListTest_001_page_error') def test_001_Check_page(self): """ 用例一 :检查页面是否正常 """ try: self.ShopListBusiness() self.assertTrue(self.c.get_newshop_msg()) except (BaseException, AssertionError) as msg: self.c.save_img('001_page_error') InsertLog().debug(msg) raise BaseException @BeautifulReport.add_img('ShopListTest_002_add_shop_fail') def test_002_Add_Shop(self): """ 用例二 :新增门店 """ try: # 传参 门店名称,门店地址,门店电话 self.ShopListBusiness() self.assertTrue(self.c.add_shop_success(add_shop_name, u'深圳南山', tel)) except (BaseException, AssertionError) as msg: self.c.save_img('ShopListTest_002_add_shop_fail') InsertLog().debug(msg) raise BaseException @BeautifulReport.add_img('ShopListTest_003_search_fail') def test_003_Verify_Shop_number(self): """ 用例三 :验证门店编号查询 """ try: # 传参 需要查询的门店编号 sleep(1) self.ShopListBusiness() self.assertTrue(self.c.verify_shop_number_query(shop_number)) except (BaseException, AssertionError) as msg: self.c.save_img('ShopListTest_003_search_fail') InsertLog().debug(msg) raise BaseException @BeautifulReport.add_img('ShopListTest_004_search_fail') def test_004_Verify_Shop_Name(self): """ 用例四 :验证门店名称查询 """ try: # 传参 需要查询的门店名称 self.ShopListBusiness() self.assertTrue(self.c.verify_shop_name_query(shop_name)) except (BaseException, AssertionError) as msg: self.c.save_img('ShopListTest_004_search_fail') InsertLog().debug(msg) raise BaseException @BeautifulReport.add_img('ShopListTest_005_search_fail') def test_005_Verify_Tel_Phone(self): """ 用例五 :验证电话查询 """ try: # 传参 需要查询的电话 self.ShopListBusiness() self.assertTrue(self.c.verify_telephone_query(tel)) except (BaseException, AssertionError) as msg: self.c.save_img('ShopListTest_005_search_fail') InsertLog().debug(msg) raise BaseException @BeautifulReport.add_img('ShopListTest_006_reset_fail') def test_006_Verify_Reset(self): """ 用例六 :验证重置功能 """ try: # 传参任意,先输入门店名称,点击重置 test = u'门店' self.ShopListBusiness() self.assertIn('', self.c.verify_reset_function(test)) # 重置成功则返回'' except (BaseException, AssertionError) as msg: self.c.save_img('ShopListTest_006_reset_fail') InsertLog().debug(msg) raise BaseException @BeautifulReport.add_img('ShopListTest_007_edit_fail') def test_007_Verify_Edit_Success(self): """ 用例七 :验证编辑成功后返回信息 """ try: sleep(1) self.ShopListBusiness() self.assertTrue(self.c.verify_edit_function()) except (BaseException, AssertionError) as msg: self.c.save_img('ShopListTest_007_edit_fail') InsertLog().debug(msg) raise BaseException @BeautifulReport.add_img('ShopListTest_008_delete_fail') def test_008_Verify_Delete_Success(self): """ 用例八 :验证删除成功后返回信息 """ try: self.ShopListBusiness() self.assertTrue(self.c.verify_delete_function()) except (BaseException, AssertionError) as msg: self.c.save_img('ShopListTest_008_delete_fail') InsertLog().debug(msg) raise BaseException
def setUpClass(self): self.a = login_C() self.b = PageTitle(self.a) self.c = DigitalCurrencyRecord(self.a)
class DigitalCurrencyRecordListTest(unittest.TestCase): """报表--数字货币记录 页面""" @classmethod def setUpClass(self): self.a = login_C() self.b = PageTitle(self.a) self.c = DigitalCurrencyRecord(self.a) @classmethod def tearDownClass(self): self.c.close_broser() def DigitalCurrencyRecordList(self): self.b.switch_to_HomePage() sleep(1) self.b.switch_to_ReportFormPage() sleep(1) self.c.click_DigitalCurrencyRecordList() @BeautifulReport.add_img("DigitalCurrency_001_Currency_page_fail") def test_001_Check_Cash_page(self): """ 用例一 :检查数字货币记录页面是否正常 """ try: self.DigitalCurrencyRecordList() self.assertTrue(self.c.get_Digital_record_msg_txt()) except (BaseException, AssertionError) as msg: self.c.save_img('DigitalCurrency_001_Currency_page_fail') InsertLog().debug(msg) raise BaseException @BeautifulReport.add_img("DigitalCurrency_002_input_shop_fail") def test_002_Verify_Input_Shop_Name(self): """ 用例二 :验证数字货币记录>门店名称使用输入的方式查询 """ try: # 传参 需要查询的门店名称 self.DigitalCurrencyRecordList() sleep(1) self.assertTrue(self.c.verify_input_shop_query(shop_name)) except (BaseException, AssertionError) as msg: self.c.save_img('DigitalCurrency_002_input_shop_fail') InsertLog().debug(msg) raise BaseException @BeautifulReport.add_img('DigitalCurrency_003_select_shop_fail') def test_003_Verify_Select_Shop_name(self): """ 用例三 :验证数字货币记录>门店名称使用全选的方式查询 """ try: self.DigitalCurrencyRecordList() self.assertIn(shop_name, self.c.verify_select_shop_query()) except (BaseException, AssertionError) as msg: self.c.save_img('DigitalCurrency_003_select_shop_fail') InsertLog().debug(msg) raise BaseException @BeautifulReport.add_img('DigitalCurrency_004_reset_fail') def test_004_Verify_Reset(self): """ 用例四 :验证数字货币记录>重置功能 """ try: # 传参,先输入开始日期,点击重置 self.DigitalCurrencyRecordList() self.assertIn( '', self.c.verify_reset_function(start_day)) # 重置成功则返回空字符串 except (BaseException, AssertionError) as msg: self.c.save_img('DigitalCurrency_004_reset_fail') InsertLog().debug(msg) raise BaseException @BeautifulReport.add_img('DigitalCurrency_005_Day_fail') def test_005_Verify_Day_Query(self): """ 用例五 :验证数字货币记录>日期查询功能 """ try: # 传参 开始日期和结束日期,只能输入比当前日期前一天的时间 self.DigitalCurrencyRecordList() self.assertIsNotNone(self.c.verify_day_query(start_day, end_day)) except (BaseException, AssertionError) as msg: self.c.save_img('DigitalCurrency_005_Day_fail') InsertLog().debug(msg) raise BaseException @BeautifulReport.add_img('DigitalCurrency_006_order_number_fail') def test_006_Verify_Day_Query(self): """ 用例六 :验证订单号查询功能 """ try: # 传参 订单号 self.DigitalCurrencyRecordList() self.assertTrue(self.c.verify_order_number(order_number)) except (BaseException, AssertionError) as msg: self.c.save_img('DigitalCurrency_006_order_number_fail') InsertLog().debug(msg) raise BaseException @BeautifulReport.add_img('DigitalCurrency_007_cashier_fail') def test_007_Verify_Cashier(self): """ 用例七 :验证收银员查询功能 """ try: self.DigitalCurrencyRecordList() self.assertIsNotNone(self.c.verify_cashier(cashier_name)) except (BaseException, AssertionError) as msg: self.c.save_img('DigitalCurrency_007_cashier_fail') InsertLog().debug(msg) raise BaseException
def setUpClass(self): self.a = login_C() self.b = PageTitle(self.a) self.c = Account(self.a)
class StaffListTest(unittest.TestCase): """测试账号列表页面""" @classmethod def setUpClass(self): self.a = login_C() self.b = PageTitle(self.a) self.c = Account(self.a) @classmethod def tearDownClass(self): self.c.close_broser() def AccountListBusiness(self): self.b.switch_to_HomePage() sleep(1) self.b.switch_to_PersonnelPage() sleep(1) self.c.click_account_list() @BeautifulReport.add_img("StaffListTest_001_check_page_fail") def test_001_Check_page(self): """ 用例一 :检查页面是否正常 """ try: self.AccountListBusiness() self.assertTrue(self.c.get_new_account_txt()) except (BaseException, AssertionError) as msg: self.c.save_img('StaffListTest_001_check_page_fail') InsertLog().debug(msg) raise BaseException @BeautifulReport.add_img('StaffListTest_002_shop_check_fail') def test_002_Verify_Select_Shop_name(self): """ 用例二 :验证门店名称使用全选的方式查询 """ try: self.AccountListBusiness() self.assertIsNotNone(self.c.verify_select_shop_query()) except (BaseException, AssertionError) as msg: self.c.save_img('StaffListTest_002_shop_check_fail') InsertLog().debug(msg) raise BaseException @BeautifulReport.add_img('StaffListTest_003_staff_number_fail') def test_003_Verify_Staff_Number(self): """ 用例三 :验证工号查询 """ try: # 传参 需要查询的工号 self.AccountListBusiness() self.assertTrue(self.c.verify_work_number_query(staff_number)) except (BaseException, AssertionError) as msg: self.c.save_img('StaffListTest_003_staff_number_fail') InsertLog().debug(msg) raise BaseException @BeautifulReport.add_img('StaffListTest_004_user_number_fail') def test_004_Verify_User_Number(self): """ 用例四 :验证用户编号查询 """ try: # 传参 需要查询的用户编号 self.AccountListBusiness() self.assertTrue(self.c.verify_user_number_query(user_number)) except (BaseException, AssertionError) as msg: self.c.save_img('StaffListTest_004_user_number_fail') InsertLog().debug(msg) raise BaseException @BeautifulReport.add_img('StaffListTest_005_phone_number_fail') def test_005_Verify_Phone(self): """ 用例五 :验证手机号码查询 """ try: # 传参 需要查询的手机号码 self.AccountListBusiness() self.assertTrue(self.c.verify_telephone_query(phone_number)) except (BaseException, AssertionError) as msg: self.c.save_img('StaffListTest_005_phone_number_fail') InsertLog().debug(msg) raise BaseException @BeautifulReport.add_img('StaffListTest_006_name_search_fail') def test_006_Verify_Name(self): """ 用例六 :验证姓名查询 """ try: # 传参需要查询的姓名 self.AccountListBusiness() self.assertTrue(self.c.verify_name_query(user_name)) except (BaseException, AssertionError) as msg: self.c.save_img('StaffListTest_006_name_search_fail') InsertLog().debug(msg) raise BaseException @BeautifulReport.add_img('StaffListTest_007_reset_fail') def test_007_Verify_Reset(self): """ 用例七 :验证重置功能 """ try: # 传参任意,先输入工号,点击重置 self.AccountListBusiness() self.assertIn( '', self.c.verify_reset_function(user_number)) # 重置成功则返回空字符串 except (BaseException, AssertionError) as msg: self.c.save_img('StaffListTest_007_reset_fail') InsertLog().debug(msg) raise BaseException @BeautifulReport.add_img('StaffListTest_008_edit_fail') def test_008_Verify_Modify_Success(self): """ 用例八 :验证修改成功 """ try: self.AccountListBusiness() self.assertTrue(self.c.verify_modify_function()) except (BaseException, AssertionError) as msg: self.c.save_img('StaffListTest_008_edit_fail') InsertLog().debug(msg) raise BaseException @BeautifulReport.add_img('StaffListTest_009_add_account_fail') def test_009_Add_Account(self): """ 用例九 :新增账号 """ try: # 传参国家和对应的手机号码,姓名,登陆密码,支付密码 self.AccountListBusiness() self.assertTrue( self.c.add_account(nation, newphone, name, loginpwd, paymentpwd)) except (BaseException, AssertionError) as msg: self.c.save_img('StaffListTest_009_add_account_fail') InsertLog().debug(msg) raise BaseException
def setUp(self): self.a = login_B() self.b = PageTitle(self.a) self.c = Home(self.a)
def setUpClass(self): self.a = login_C() self.b = PageTitle(self.a) self.c = Device(self.a)
class DeviceListTest(unittest.TestCase): """测试设备列表 页面""" @classmethod def setUpClass(self): self.a = login_C() self.b = PageTitle(self.a) self.c = Device(self.a) @classmethod def tearDownClass(self): self.c.close_broser() def DeviceBusiness(self): self.b.switch_to_ReportFormPage() sleep(1) self.b.switch_to_DevicePage() sleep(1) self.c.click_DeviceList() @BeautifulReport.add_img('DeviceListTest_001_check_page_fail') def test_001_Check_page(self): """ 用例一 :检查页面是否正常 """ try: self.b.switch_to_DevicePage() sleep(1) self.c.click_DeviceList() self.assertTrue(self.c.get_DeviceId_msg_txt()) except (BaseException, AssertionError) as msg: self.c.save_img('DeviceListTest_001_check_page_fail') InsertLog().error(msg) raise BaseException @BeautifulReport.add_img('DeviceListTest_002_store_search_fail') def test_002_Verify_input_shop_query(self): """ 用例二 :验证门店查询 """ try: # 传参 需要查询的门店名称 self.DeviceBusiness() self.assertTrue(self.c.input_shop_query(shop_name)) except (BaseException, AssertionError) as msg: self.c.save_img('DeviceListTest_002_store_search_fail') InsertLog().debug(msg) raise BaseException @BeautifulReport.add_img('DeviceListTest_003_device_Imei_fail') def test_003_Verify_DeviceIMEI(self): """ 用例三 :验证设备IMEI查询 """ try: # 传参 需要查询的设备IMEI self.DeviceBusiness() self.assertTrue(self.c.verify_device_imei_query(device_imei)) except (BaseException, AssertionError) as msg: self.c.save_img('DeviceListTest_003_device_Imei_fail') InsertLog().debug(msg) raise BaseException @BeautifulReport.add_img('DeviceListTest_004_device_status_fail') def test_004_Verify_Device_LockState(self): """ 用例四 :验证设备锁定状态查询 """ try: self.DeviceBusiness() self.assertTrue(self.c.verify_device_lock_status_query()) except (BaseException, AssertionError) as msg: self.c.save_img('DeviceListTest_004_device_status_fail') InsertLog().debug(msg) raise BaseException @BeautifulReport.add_img('DeviceListTest_005_reset_fail') def test_005_Verify_Reset(self): """ 用例五 :验证重置功能 """ try: # 传参任意,先输入设备imei、点击重置 self.DeviceBusiness() self.assertIn( '', self.c.verify_reset_function(device_imei)) # 重置成功则返回空字符串 except (BaseException, AssertionError) as msg: self.c.save_img('DeviceListTest_005_reset_fail') InsertLog().debug(msg) raise BaseException @BeautifulReport.add_img('DeviceListTest_006_edit_fail') def test_006_Verify_Edit_Success(self): """ 用例六 :验证编辑成功后返回信息 '""" try: self.DeviceBusiness() self.assertTrue(self.c.verify_edit_success(shop_name)) except (BaseException, AssertionError) as msg: self.c.save_img('DeviceListTest_006_edit_fail') InsertLog().debug(msg) raise BaseException
class AssetsSalesListTest(unittest.TestCase): """测试 资产 菜单-- 销售账户 页面""" @classmethod def setUpClass(self): self.a = login_C() self.b = PageTitle(self.a) self.c = SalesAccount(self.a) @classmethod def tearDownClass(self): self.c.close_broser() def AssetsListBusiness(self): self.b.switch_to_OrderPage() sleep(1) self.b.switch_to_AssetsPage() sleep(1) self.c.click_sales_account() @BeautifulReport.add_img('AssetsSales_001_funds_sales_account_fail') def test_001_Cashier_Account_page(self): """ 用例一 :检查页面是否正常 """ try: self.AssetsListBusiness() self.assertTrue(self.c.get_account_history_txt()) except (BaseException, AssertionError) as msg: self.c.save_img('AssetsSales_001_funds_sales_account_fail') InsertLog().debug(msg) raise BaseException @BeautifulReport.add_img('AssetsSales_002_funds_withdrawal_usdt_fail') def test_002_Withdrawal_USDT(self): """ 用例二 :提现USDT功能 """ try: # 传参提现地址,支付密码 self.AssetsListBusiness() self.assertTrue(self.c.withdrawal_USDT(withdrawal_address, paypwd)) except (BaseException, AssertionError) as msg: self.c.save_img('AssetsSales_002_funds_withdrawal_usdt_fail') InsertLog().debug(msg) raise BaseException @BeautifulReport.add_img('AssetsSales_003_funds_withdrawal_dai_fail') def test_003_Withdrawal_DAI(self): """ 用例三 :提现DAI功能 """ try: # 传参提现地址,支付密码 self.AssetsListBusiness() self.assertTrue(self.c.withdrawal_DAI(withdrawal_address, paypwd)) except (BaseException, AssertionError) as msg: self.c.save_img('AssetsSales_003_funds_withdrawal_dai_fail') InsertLog().debug(msg) raise BaseException @BeautifulReport.add_img('AssetsSales_004_deposit_fail') def test_004_Deposit_Function(self): """ 用例四 :检验充值功能 """ try: self.AssetsListBusiness() self.assertTrue(self.c.click_deposit()) except (BaseException, AssertionError) as msg: self.c.save_img('AssetsSales_004_deposit_fail') InsertLog().debug(msg) raise BaseException @BeautifulReport.add_img('AssetsSales_005_reset_fail') def test_005_Verify_Reset(self): """ 用例五 :验证销售账户>重置功能 """ try: # 传参,先输入开始日期,点击重置 self.AssetsListBusiness() self.assertIn('', self.c.verify_reset_function(start_day)) # 重置成功则返回空字符串 except (BaseException, AssertionError) as msg: self.c.save_img('AssetsSales_005_reset_fail') InsertLog().debug(msg) raise BaseException @BeautifulReport.add_img('AssetsSales_006_Day_fail') def test_006_Verify_Day_Query(self): """ 用例六 :验证销售账户>日期查询功能 """ try: # 传参 开始日期和结束日期,只能输入比当前日期前一天的时间 self.AssetsListBusiness() self.assertIsNotNone(self.c.verify_day_query(start_day, end_day)) except (BaseException, AssertionError) as msg: self.c.save_img('AssetsSales_006_Day_fail') InsertLog().debug(msg) raise BaseException