Ejemplo n.º 1
0
from parameterized import parameterized
import unittest

from selenium.webdriver.common.by import By

from woniuboss.lib.woniuboss_gui.financial_management.financial_management import FinancialManagement
from woniuboss.tools.woniuboss_gui.utility import Utility
from woniuboss.tools.woniuboss_gui.service import Service
# 在该页面调试时test_config_info里需要多加一层跳出"..\\",testdata也需要多加一层
# 准备数据
test_config_info = Utility.get_json(
    '..\\..\\conf\\woniuboss_gui\\FM\\testdata.conf')
fm_financial_info = Utility.get_excel_to_tuple(test_config_info[0])
fm_financial_user_info = Utility.get_excel_to_user(test_config_info[0])
fm_1_subject_info = Utility.get_excel_to_tuple(test_config_info[1])
fm_2_subject_info = Utility.get_excel_to_tuple(test_config_info[2])
fm_financial_query_info = Utility.get_excel_to_tuple(test_config_info[3])
fm_last_month_query_info = Utility.get_excel_to_tuple(test_config_info[4])
fm_month_query_info = Utility.get_excel_to_tuple(test_config_info[5])
fm_new_water_info = Utility.get_excel_to_tuple(test_config_info[6])
fm_modify_water_info = Utility.get_excel_to_tuple(test_config_info[7])
fm_accounts_info = Utility.get_excel_to_tuple(test_config_info[8])
fm_students_info = Utility.get_excel_to_tuple(test_config_info[9])
fm_search_info = Utility.get_excel_to_tuple(test_config_info[10])
ffm_state_query_info = Utility.get_excel_to_tuple(test_config_info[11])
fm_name_query_info = Utility.get_excel_to_tuple(test_config_info[12])
fm_payment_refund_info = Utility.get_excel_to_tuple(test_config_info[13])

# ('http://192.168.75.128:8080/WoniuBoss2.5/user/login', 'POST',
# {'username': '******', 'password': '******', 'verifycode': '0000'}, 200, 'employment_management-pass'),
# login_info中[]的需要参照上面选取
import time
from selenium.webdriver.common.by import By
from woniuboss.lib.woniuboss_gui.login.decrypt import Decrypt
from woniuboss.lib.woniuboss_gui.student_manage.morning_exam_record import MorningExamRecord

from woniuboss.tools.woniuboss_gui.service import Service
import unittest
from woniuboss.tools.woniuboss_gui.utility import Utility
from parameterized import parameterized

test_config_info = Utility.get_json(
    '..\\..\\conf\\woniuboss_gui\\testdata_stu_manage.conf')
query_all_parameter = Utility.get_excel_to_tuple(test_config_info[11])
user_info = Utility.get_excel_to_user(test_config_info[11])

query_part_parameter = Utility.get_excel_to_tuple(test_config_info[12])


class MorningExamTest(unittest.TestCase):
    @classmethod
    def setUpClass(cls):
        cls.driver = Service.get_driver(user_info)
        cls.exam_record = MorningExamRecord(cls.driver)
        Service.miss_login(cls.driver, user_info)
        Decrypt(cls.driver).do_decrypt(user_info['secondpwd'])

    @classmethod
    def tearDownClass(cls):
        cls.driver.quit()

    @parameterized.expand(query_all_parameter)
Ejemplo n.º 3
0
from parameterized import parameterized
from selenium.webdriver.common.by import By
from woniuboss.lib.woniuboss4_gui.login.decrypt import Decrypt
from woniuboss.lib.woniuboss4_gui.login.login import Login
from woniuboss.tools.woniuboss_gui.service import Service
from woniuboss.tools.woniuboss_gui.utility import Utility
import unittest

test_config_info = Utility.get_json('..\\..\\conf\\woniuboss4_gui\\login.conf')
decrypt_info = Utility.get_excel_to_tuple(test_config_info[3])
decrypt_user_info = Utility.get_excel_to_user(test_config_info[3])


class DecryptTest(unittest.TestCase):
    @classmethod
    def setUpClass(cls):
        cls.driver = Service.get_driver(decrypt_user_info)
        Login(cls.driver).login(decrypt_user_info)
        cls.decrypt = Decrypt(cls.driver)

    @classmethod
    def tearDownClass(cls):
        cls.driver.quit()

    @parameterized.expand(decrypt_info)
    def test_decrypt(cls, second_pwd, expect):
        cls.decrypt.do_decrypt(second_pwd)
        if Service.is_element_present(
                cls.driver, By.CSS_SELECTOR,
                'body > div.bootbox.modal.fade.mydialog.in > div > '
                'div > div.modal-body > div'):
Ejemplo n.º 4
0
import time
from selenium.webdriver.common.by import By
from woniuboss.lib.woniuboss4_gui.login.decrypt import Decrypt
from woniuboss.lib.woniuboss4_gui.login.login import Login
from woniuboss.lib.woniuboss4_gui.teaching_manage.my_approval import MyApproval
from woniuboss.tools.woniuboss_gui.service import Service
import unittest
from woniuboss.tools.woniuboss_gui.utility import Utility
from parameterized import parameterized

test_config_info = Utility.get_json(
    '..\\..\\..\\conf\\woniuboss4_gui\\teaching_manage.conf')
query_my_approval_info = Utility.get_excel_to_tuple(test_config_info[12])
user_info = Utility.get_excel_to_user(test_config_info[12])


class MyApprovalTest(unittest.TestCase):
    @classmethod
    def setUpClass(cls):
        cls.driver = Service.get_driver(user_info)
        cls.my_approval = MyApproval(cls.driver)
        Login(cls.driver).login(user_info)
        Decrypt(cls.driver).do_decrypt(user_info['secondpwd'])

    @classmethod
    def tearDownClass(cls):
        cls.driver.quit()

    @parameterized.expand(query_my_approval_info)
    def test_query_my_approval(self, type, status, id, expect):
        self.my_approval.do_query_approval_info(type, status, id)
Ejemplo n.º 5
0
import time

from selenium.common.exceptions import NoAlertPresentException

from woniuboss.lib.woniuboss_gui.corpor_ate_customers.corporate_customers import CorporateCustomers
from woniuboss.lib.woniuboss_gui.login.decrypt import Decrypt
from woniuboss.tools.woniuboss_gui.service import Service
import unittest
from woniuboss.tools.woniuboss_gui.utility import Utility
from parameterized import parameterized

test_config_info = Utility.get_json(
    '..\\..\\conf\\woniuboss_gui\\corporate_customers.conf')
search_enterprise_info = Utility.get_excel_to_tuple(test_config_info[0])
user_info = Utility.get_excel_to_user(test_config_info[0])
add_enterp_info = Utility.get_excel_to_tuple(test_config_info[1])
modify_enterp_info = Utility.get_excel_to_tuple(test_config_info[2])


class CorporateTest(unittest.TestCase):
    @classmethod
    def setUpClass(cls):
        cls.driver = Service.get_driver(user_info)
        cls.enterprise_info = CorporateCustomers(cls.driver)
        Service.miss_login(cls.driver, user_info)
        Decrypt(cls.driver).do_decrypt(user_info['secondpwd'])

    @classmethod
    def tearDownClass(cls):
        cls.driver.quit()