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
示例#2
0
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
示例#3
0
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