Beispiel #1
0
    def test_fm_modify_water(cls, one_subject, two_subject, fm_type,
                             settlement, fm_trading_time, head, payment,
                             fm_amount, trading, fm_other_trading,
                             fm_capital_uses, expect):
        try:
            FinancialManagement(cls.driver).fm_new_water(
                one_subject, two_subject, fm_type, settlement, fm_trading_time,
                head, payment, fm_amount, trading, fm_other_trading,
                fm_capital_uses)
            capital_uses = f"'{fm_capital_uses}'"

            sql = f'SELECT first_subject_id FROM detailed_dealings WHERE comm = {capital_uses} ;'
            fm_modify_water = Utility.query_one(fm_financial_user_info, sql)
            fm_results = fm_modify_water[0]
            if fm_results == one_subject:
                actual = 'FM_correct'
            else:
                actual = 'FM_failed'
                cls.driver.refresh()
            cls.assertEqual(actual, expect)
            cls.driver.refresh()
        except Exception as e:
            actual = 'FM_failed'
            cls.driver.refresh()
            cls.assertEqual(actual, expect)
Beispiel #2
0
 def test_fm_financial_interface(cls, data, expect):
     try:
         FinancialManagement(cls.driver).fm_financial_interface()
         if Service.is_element_present(cls.driver, By.LINK_TEXT, '财务流水'):
             actual = 'FM_correct'
         else:
             actual = 'FM_failed'
             cls.driver.refresh()
         cls.assertEqual(actual, expect)
     except Exception as e:
         actual = 'FM_failed'
         cls.driver.refresh()
         cls.assertEqual(actual, expect)
Beispiel #3
0
    def test_fm_last_month_query(cls, data, expect):
        try:
            FinancialManagement(cls.driver).fm_last_month_query()

            actual = Service.text_xpath(
                cls.driver, '/html/body/div[7]/div[3]/div/div/div/div[1]/'
                'div[4]/div[1]/div[2]/div[2]/table/tbody/tr/td')
            cls.assertEqual(actual, expect)
            cls.driver.refresh()
        except Exception as e:
            actual = 'FM_failed'
            cls.driver.refresh()
            cls.assertEqual(actual, expect)
Beispiel #4
0
    def test_fm_2_subject(cls, data, expect):
        try:
            test_fm_2_subject = FinancialManagement(cls.driver).fm_2_subject()

            if '就业培训' in test_fm_2_subject:
                actual = 'FM_correct'
            else:
                actual = 'FM_failed'
                cls.driver.refresh()
            cls.assertEqual(actual, expect)
        except Exception as e:
            actual = 'FM_failed'
            cls.driver.refresh()
            cls.assertEqual(actual, expect)
Beispiel #5
0
    def test_fm_name_query(cls, fm_name, expect):
        try:
            FinancialManagement(cls.driver).fm_name_query(fm_name)

            actual = Service.text_css(
                cls.driver,
                '/html/body/div[7]/div[3]/div/div/div/div[3]/div[3]'
                '/div[1]/div[2]/div[2]/table/tbody/tr/td[2]')
            cls.assertEqual(actual, expect)
            cls.driver.refresh()
        except Exception as e:
            actual = 'FM_failed'
            cls.driver.refresh()
            cls.assertEqual(actual, expect)
Beispiel #6
0
    def test_fm_search(cls, data, expect):
        try:
            test_fm_search = FinancialManagement(cls.driver).fm_search()

            if '待缴费' in test_fm_search:
                actual = 'FM_correct'
            else:
                actual = 'FM_failed'
                cls.driver.refresh()
            cls.assertEqual(actual, expect)
        except Exception as e:
            actual = 'FM_failed'
            cls.driver.refresh()
            cls.assertEqual(actual, expect)
Beispiel #7
0
    def test_fm_financial_query(cls, fm_start_time, fm_end_time, one_subject,
                                two_subject, expect):
        try:
            FinancialManagement(cls.driver).fm_financial_query(
                fm_start_time, fm_end_time, one_subject, two_subject)

            actual = Service.text_css(
                cls.driver,
                '/html/body/div[7]/div[3]/div/div/div/div[1]/div[4]'
                '/div[1]/div[2]/div[2]/table/tbody/tr[1]/td[11]')
            cls.assertEqual(actual, expect)
            cls.driver.refresh()
        except Exception as e:
            actual = 'FM_failed'
            cls.driver.refresh()
            cls.assertEqual(actual, expect)
Beispiel #8
0
    def test_fm_payment_refund(cls, student_class, stustatus, fm_stupay_amount,
                               select, payment_account, fm_added, expect):
        try:
            FinancialManagement(cls.driver).fm_payment_refund(
                student_class, stustatus, fm_stupay_amount, select,
                payment_account, fm_added)

            actual = Service.text_xpath(
                cls.driver,
                '/html/body/div[7]/div[3]/div/div/div/div[3]/div[3]/div[1]'
                '/div[2]/div[2]/table/tbody/tr/td[7]')
            if actual == stustatus:
                actual = 'FM_correct'
            else:
                actual = 'FM_failed'
                cls.driver.refresh()
            cls.assertEqual(actual, expect)
            cls.driver.refresh()
        except Exception as e:
            actual = 'FM_failed'
            cls.driver.refresh()
            cls.assertEqual(actual, expect)