class AddMen(unittest.TestCase):
    def setUp(self):
        self.driver = webdriver.Chrome()
        # self.driver.maximize_window()
        self.driver.get('https://mgmt.ent-dev.kuban.io/')

        self.amb = AddMenBusiness(self.driver)
        self.lb = LoginBusiness(self.driver)

    def tearDown(self):
        for method_name, error in self._outcome.errors:
            if error:
                case_name = self._testMethodName
                file_path = os.path.abspath(
                    os.path.dirname(os.getcwd()) + '\image' + '\pic_' +
                    case_name + '.png')
                self.driver.save_screenshot(file_path)
        self.driver.close()

    @ddt.data(*login_data)
    def test_add_men(self, mendata):
        phone, sms_code, menName, menID, sapceTitle, menPhone, menEmail = mendata
        self.lb.login_function(phone, sms_code)
        time.sleep(3)
        self.amb.add_men_function(menName, menID, sapceTitle, menPhone,
                                  menEmail)
        time.sleep(3)
示例#2
0
class LocationAdminAddStaff(unittest.TestCase):
    def setUp(self) -> None:
        self.driver = webdriver.Chrome()
        self.driver.get('https://mgmt.ent-dev.kuban.io/')
        self.lab = LocationAdminAddStaffBusiness(self.driver)
        self.lb = LoginBusiness(self.driver)

    def tearDown(self) -> None:
        for method_name, error in self._outcome.errors:
            if error:
                case_name = self._testMethodName
                file_path = os.path.abspath(
                    os.path.dirname(os.getcwd()) + '\image' + '\pic_' +
                    case_name + '.png')
                self.driver.save_screenshot(file_path)
        self.driver.close()

    @ddt.data(*staff_data)
    def test_loaction_admin_add_staff(self, ldata):
        phone, sms_code, staff_name, staff_job_number, staff_space_title, staff_phone_num, staff_email = ldata
        print(ldata)
        self.lb.login_function(phone, sms_code)
        result = self.lab.location_admin_add_staff(staff_name,
                                                   staff_job_number,
                                                   staff_space_title,
                                                   staff_phone_num,
                                                   staff_email)
        self.assertFalse(result, '123')
class LocationAdminAddActivity(unittest.TestCase):
    def setUp(self) -> None:
        self.driver = webdriver.Chrome()
        self.driver.get('https://mgmt.ent-dev.kuban.io/')
        self.laab = LocationAdminAddActivityBusiness(self.driver)
        self.lb = LoginBusiness(self.driver)

    def tearDown(self) -> None:
        for method_name, error in self._outcome.errors:
            if error:
                case_name = self._testMethodName
                file_path = os.path.abspath(
                    os.path.dirname(os.getcwd()) + '\image' + '\pic_' +
                    case_name + '.png')
                self.driver.save_screenshot(file_path)
        self.driver.close()

    @ddt.data(*data)
    def test_location_admin_add_activity(self, fivdata):
        phone, sms_code, activity_title, activity_space, activity_ticket, activity_note, pic_path = fivdata
        self.lb.login_function(phone, sms_code)
        result = self.laab.add_activity(activity_title, activity_space,
                                        activity_ticket, activity_note,
                                        pic_path)
        self.assertFalse(result, 'over')
示例#4
0
class FrontWaiterInviteVisitor(unittest.TestCase):
    def setUp(self) -> None:
        self.driver = webdriver.Chrome()
        self.driver.get('https://mgmt.ent-dev.kuban.io/')
        self.fivb = FrontWaiterInviteVisitorBusiness(self.driver)
        self.lb = LoginBusiness(self.driver)

    def tearDown(self) -> None:
        for method_name, error in self._outcome.errors:
            if error:
                case_name = self._testMethodName
                file_path = os.path.abspath(
                    os.path.dirname(os.getcwd()) + '\image' + '\pic_' +
                    case_name + '.png')
                self.driver.save_screenshot(file_path)
        self.driver.close()

    @ddt.data(*data)
    def test_front_waiter_invite_nisitor(self, fivdata):
        phone, sms_code, visitor_name, visitor_email, visitor_phone, visitor_company, visitor_notes, suc_msg, name_error, email_error = fivdata
        self.lb.login_function(phone, sms_code)
        result = self.fivb.fronwaiterinvitevisitor(visitor_name, visitor_email,
                                                   visitor_phone,
                                                   visitor_company,
                                                   visitor_notes, suc_msg,
                                                   name_error, email_error)
        self.assertFalse(result, 'over')
    def setUp(self):
        self.driver = webdriver.Chrome()
        # self.driver.maximize_window()
        self.driver.get('https://mgmt.ent-dev.kuban.io/')

        self.amb = AddMenBusiness(self.driver)
        self.lb = LoginBusiness(self.driver)
示例#6
0
class LoginCase(unittest.TestCase):
    def setUp(self):
        self.driver = webdriver.Chrome()
        # self.driver.maximize_window()
        self.driver.get('https://mgmt.ent-dev.kuban.io/')
        self.lb = LoginBusiness(self.driver)

    def tearDown(self):
        for method_name, error in self._outcome.errors:
            if error:
                case_name = self._testMethodName
                file_path = os.path.abspath(
                    os.path.dirname(os.getcwd()) + '\webreport' + '\T' +
                    case_name + '.png')
                self.driver.save_screenshot(file_path)
        self.driver.close()

    #手机号    错误信息定位元素     错误信息提示
    # @ddt.data(
    #         ['123123','phone_error','百度一下'],
    #         ['111','phone_error','百度一下']
    #     )

    # @ddt.unpack
    @ddt.data(*data)
    def test_login(self, ldata):
        phone, sms_code = ldata
        login_success_msg = self.lb.login_function(phone, sms_code)
        self.assertTrue(login_success_msg, '登录成功')
示例#7
0
class AdminAddSpaceDivice(unittest.TestCase):
    def setUp(self) -> None:
        self.driver = webdriver.Chrome()
        self.driver.get('https://mgmt.ent-dev.kuban.io/')
        self.lb = LoginBusiness(self.driver)
        self.asd = AdminAddSpaceDeviceBusiness(self.driver)

    def tearDown(self) -> None:
        for method_name, error in self._outcome.errors:
            if error:
                case_name = self._testMethodName
                file_path = os.path.abspath(os.path.dirname(os.getcwd()) + '\image' + '\pic_' + case_name + '.png')
                self.driver.save_screenshot(file_path)
        self.driver.close()
    @ddt.data(*data)
    def test_admin_add_sapce_device(self,smdata):
        phone,sms_code = smdata
        self.lb.login_function(phone,sms_code)
        self.asd.admin_add_device()
示例#8
0
class FrontOperationVisitor(unittest.TestCase):
    def setUp(self) -> None:
        self.driver = webdriver.Chrome()
        self.driver.get('https://mgmt.ent-dev.kuban.io/')
        self.lb = LoginBusiness(self.driver)
        self.fovb = FrontOperationVisitorBusiness(self.driver)

    def tearDown(self) -> None:
        for method_name, error in self._outcome.errors:
            if error:
                case_name = self._testMethodName
                file_path = os.path.abspath(
                    os.path.dirname(os.getcwd()) + '\image' + '\pic_' +
                    case_name + '.png')
                self.driver.save_screenshot(file_path)
        self.driver.close()

    @ddt.data(*data)
    def test_front_operatin_visitor(self, smdata):
        phone, sms_code = smdata
        self.lb.login_function(phone, sms_code)
        self.fovb.frontoperationvisitor()
class StaffSelectCabinetList(unittest.TestCase):
    def setUp(self) -> None:
        self.driver = webdriver.Chrome()
        self.driver.get('https://mgmt.ent-dev.kuban.io/')
        self.scb = StaffSelectCabinetListBusiness(self.driver)
        self.lb = LoginBusiness(self.driver)

    def tearDown(self) -> None:
        for method_name, error in self._outcome.errors:
            if error:
                case_name = self._testMethodName
                file_path = os.path.abspath(
                    os.path.dirname(os.getcwd()) + '\image' + '\pic_' +
                    case_name + '.png')
                self.driver.save_screenshot(file_path)
        self.driver.close()

    @ddt.data(*data)
    def test_staff_select_cabinet_list(self, datas):
        phone, sms_code = datas
        self.lb.login_function(phone, sms_code)
        result = self.scb.staff_select_cabinet_list_base()
        self.assertTrue(result, '一切正常,over')
class StaffBookMeeting(unittest.TestCase):
    def setUp(self):
        self.driver = webdriver.Chrome()
        self.driver.get('https://mgmt.ent-dev.kuban.io/')
        self.smb = StaffBookMeetingBusiness(self.driver)
        self.lb = LoginBusiness(self.driver)

    def tearDown(self):
        for method_name, error in self._outcome.errors:
            if error:
                case_name = self._testMethodName
                file_path = os.path.abspath(
                    os.path.dirname(os.getcwd()) + '\image' + '\pic_' +
                    case_name + '.png')
                self.driver.save_screenshot(file_path)
        self.driver.close()

    @ddt.data(*data)
    def test_staff_book_meeting(self, smdata):
        phone, sms_code, meeting_theme, meeting_issue = smdata
        self.lb.login_function(phone, sms_code)
        time.sleep(15)
        self.smb.StaffBookMeetingBusiness_base(meeting_theme, meeting_issue)
        time.sleep(2)
示例#11
0
 def setUp(self) -> None:
     self.driver = webdriver.Chrome()
     self.driver.get('https://mgmt.ent-dev.kuban.io/')
     self.fivb = FrontWaiterInviteVisitorBusiness(self.driver)
     self.lb = LoginBusiness(self.driver)
 def setUp(self):
     self.driver = webdriver.Chrome()
     self.driver.get('https://mgmt.ent-dev.kuban.io/')
     self.ivb = StaffInviteVisitorBusiness(self.driver)
     self.lb = LoginBusiness(self.driver)
示例#13
0
 def setUp(self) -> None:
     self.driver = webdriver.Chrome()
     self.driver.get('https://mgmt.ent-dev.kuban.io/')
     self.lab = LocationAdminAddStaffBusiness(self.driver)
     self.lb = LoginBusiness(self.driver)
示例#14
0
 def setUp(self) -> None:
     self.driver = webdriver.Chrome()
     self.driver.get('https://mgmt.ent-dev.kuban.io/')
     self.lb = LoginBusiness(self.driver)
     self.asd = AdminAddSpaceDeviceBusiness(self.driver)
 def setUp(self):
     self.driver = webdriver.Chrome()
     self.driver.get('https://mgmt.ent-dev.kuban.io/')
     self.smb = StaffBookMeetingBusiness(self.driver)
     self.lb = LoginBusiness(self.driver)
 def setUp(self) -> None:
     self.driver = webdriver.Chrome()
     self.driver.get('https://mgmt.ent-dev.kuban.io/')
     self.scb = StaffSelectCabinetListBusiness(self.driver)
     self.lb = LoginBusiness(self.driver)
示例#17
0
 def setUp(self) -> None:
     self.driver = webdriver.Chrome()
     self.driver.get('https://mgmt.ent-dev.kuban.io/')
     self.lb = LoginBusiness(self.driver)
     self.fovb = FrontOperationVisitorBusiness(self.driver)