Пример #1
0
    def setUp(self):
        logger.info("----start---")
        self.login_page = LoginPage(browser_type='chrome').get(
            self.ZHSQ_URL, maximize_window=True)
        self.house_add_page = HouseAddPage(self.login_page)
        self.house_find_page = HouseFindPage(self.login_page)
        self.house_del_page = HouseDelPage(self.login_page)
        self.house_edit_page = HouseEditPage(self.login_page)

        try:

            self.login_page.click_checkbox()
            self.login_page.click_closeAlert()
            self.login_page.input_userAcct(self.userAcct)
            self.login_page.input_userPwd(self.userPwd)
            self.login_page.click_smsCodeButton()
            self.login_page.input_smsCode(self.smsCode)
            self.login_page.click_loginButton()
            self.login_page.wait()
            self.house_add_page.click_chooseModTree()
            self.house_add_page.click_chooseHouseManageTree()
            self.house_add_page.wait()
        except Exception as msg:
            self.login_page.save_screen_shot("test_login")
            logger.info("异常信息:%s" % msg)
            raise
Пример #2
0
    def setUp(self):
        logger.info("----start---")
        self.login_page = LoginPage(browser_type='chrome').get(
            self.ZHSQ_URL, maximize_window=True)
        self.menu_page = MenuPage(self.login_page)
        self.guard_add_page = GuardAddPage(self.login_page)
        self.guard_find_page = GuardFindPage(self.login_page)
        self.guard_edit_page = GuardEditPage(self.login_page)
        self.guard_del_page = GuardDelPage(self.login_page)
        self.guard_restart_page = GuardRestartPage(self.login_page)
        try:
            #遗留问题,先录入账号再勾选协议找不到元素
            #原因可能是因为倒计时,导致页面有动态元素
            self.login_page.click_checkbox()
            self.login_page.click_closeAlert()
            self.login_page.input_userAcct(self.userAcct)
            self.login_page.input_userPwd(self.userPwd)
            self.login_page.click_smsCodeButton()
            self.login_page.input_smsCode(self.smsCode)
            self.login_page.click_loginButton()
            self.login_page.wait(3)
            self.menu_page.click_deviceManage()
            self.menu_page.click_accessContro()
            self.menu_page.wait()

        except Exception as msg:
            self.login_page.save_screen_shot("test_login")
            logger.info("异常信息:%s" % msg)
            raise
Пример #3
0
    def setUp(self):
        logger.info("----start---")
        self.login_page = LoginPage(browser_type='chrome').get(
            self.ZHSQ_URL, maximize_window=True)
        self.menu_page = MenuPage(self.login_page)
        self.tenant_find_page = TenantFindPage(self.login_page)
        self.tenant_add_page = TenantAddPage(self.login_page)
        self.tenant_edit_page = TenantEditPage(self.login_page)
        self.tenant_xuyue_page = TenantXuyuePage(self.login_page)
        self.tenant_del_page = TenantDelPage(self.login_page)
        try:
            #遗留问题,先录入账号再勾选协议找不到元素
            #原因可能是因为倒计时,导致页面有动态元素
            self.login_page.click_checkbox()
            self.login_page.click_closeAlert()
            self.login_page.input_userAcct(self.userAcct)
            self.login_page.input_userPwd(self.userPwd)
            self.login_page.click_smsCodeButton()
            self.login_page.input_smsCode(self.smsCode)
            self.login_page.click_loginButton()
            self.login_page.wait(3)
            self.menu_page.click_householdManage()
            self.menu_page.click_tenantManage()
            self.menu_page.wait()

        except Exception as msg:
            self.login_page.save_screen_shot("test_login")
            logger.info("异常信息:%s" % msg)
            raise