当前位置: 首页>>代码示例>>Python>>正文


Python WebUI.check方法代码示例

本文整理汇总了Python中webui.WebUI.check方法的典型用法代码示例。如果您正苦于以下问题:Python WebUI.check方法的具体用法?Python WebUI.check怎么用?Python WebUI.check使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在webui.WebUI的用法示例。


在下文中一共展示了WebUI.check方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: device_onboarding_not_deploy_policy

# 需要导入模块: from webui import WebUI [as 别名]
# 或者: from webui.WebUI import check [as 别名]
def device_onboarding_not_deploy_policy():
    wui = WebUI()
    device = Devices(wui.d("visit.url"), wui.d("visit.title"))
    if wui.session_id:
        #---------------------------------device on boarding ------------------------------------
        wui.click(myHome.get('Devices_button'))
        wui.info('go to add device page', True)           
        
        wui.click(DeviceOnboarding.get('Add_device_button'))
        wui.info('go to add device page', True)
        
        wui.click(DeviceOnboarding.get('Add_real_device_button'))
        wui.info('go to enter SN page', True)
        
        wui.input(DeviceOnboarding.get('Input_SN_Textarea'), wui.d("device.ap_SN"))
        wui.info('enter SN', True)
        
        wui.click(DeviceOnboarding.get('Next_button_add_SN_page'))
        wui.info('click of add sn page', True)
        
        wui.click(DeviceOnboarding.get('Next_button_added_device_page'))
        wui.info('click of added device list page', True)
        
        wui.check(DeviceOnboarding.get('Do_not_deploy_policy'))
        wui.info('click do not deploy policy', True)
        
        wui.click(DeviceOnboarding.get('Next_button_build_policy_page'))
        wui.info('click next of build policy', True)
        
        wui.click(DeviceOnboarding.get('Finish_button_device_onboarding'))
        wui.info('click finish button of device onboarding', True)        
        
        ap_SN = wui.d("device.ap_SN")
        check_device_devicepage(wui, ap_SN)
开发者ID:gvsurenderreddy,项目名称:AerohiveAuto,代码行数:36,代码来源:device_onboarding_not_deploy_policy.py

示例2: mac_filter_configuration

# 需要导入模块: from webui import WebUI [as 别名]
# 或者: from webui.WebUI import check [as 别名]
def mac_filter_configuration():
    wui = WebUI()
    config = Configuration(wui.d("visit.url"), wui.d("visit.title"))
    if wui.session_id:
        config.to_page_before_deployed_ssid()
        ssidname=wui.d("ssid.name")
        config.input_ssid_name(ssidname, ssidname)
        config.ssid_usage_settings('CUSTOM')

        #select to security method as wpa psk  
        psk_key="aerohive"      
        wui.info('will move scroll to access security...', True)
        wui.move_scroll_to_element(DeployedSSID.get('access_div'))
        wui.wait_until_element_displayed(DeployedSSID.get('psk_access_label'))
        wui.click(DeployedSSID.get('psk_access_span'))
        wui.wait_until_element_displayed(DeployedSSID.get('psk_key_value'))
        wui.input(DeployedSSID.get('psk_key_value'), psk_key)
        wui.wait_until_element_displayed(DeployedSSID.get('psk_confirm_value'))
        wui.input(DeployedSSID.get('psk_confirm_value'), psk_key)
        
        #select cwp tab to config cwp
        cwp_name = wui.d("ssid.cwp_name")
        wui.info('try to click captive web portal tab to enable cwp', True)
        wui.move_scroll_to_element_use_px(CWPConfig.get('ssid_tab'))
        wui.click(CWPConfig.get('cwp_tab'))
        wui.wait_until_element_displayed(CWPConfig.get('cwp_enable_switch'))
        wui.info('go to  cwp configuration section successfully...', True)
        #enable cwp switch
        wui.check(CWPConfig.get('cwp_enable_switch'))
        wui.info('enable cwp successfull....', True)
        
        #config cwp web directory name
        wui.info('try to move element to cwp name input line....', True)
        wui.move_scroll_to_element(CWPConfig.get('cwp_name_input_element'))
        wui.input(CWPConfig.get('cwp_to_use_input'),cwp_name)
        time.sleep(1)
        wui.info('input cwp name successfully', True)
        
        wui.info('try to click the save button to save the cwp object', True)
        wui.click(CWPConfig.get('cwp_to_use_save'))
        wui.wait_until_element_displayed(CWPConfig.get('new_cwp_title'))
        time.sleep(1)
        wui.info('go to new cwp page success...', True)
        
        wui.wait_until_element_displayed(CWPConfig.get('cwp_name'))
        wui.click(CWPConfig.get('new_cwp_save'))
        time.sleep(2)
        wui.info('try to move scroll to cwp section', True)
        wui.move_scroll_to_element(CWPConfig.get('cwp_name_input_element'))
        wui.info('create cwp successfully', True)
        
        # save the ssid level configuration
        wui.click(CWPConfig.get('new_ssid_save'))
        wui.wait_until_element_displayed(CWPConfig.get('new_ssid_success'))
        time.sleep(1)
        wui.info('Save ssid successfully', True)
        
        #go to deploy page, and push config
        wui.click(monitor_cfg.Deploy_policy_button)
        time.sleep(2)
        wui.info( 'go to deploy policy page success' , True )
开发者ID:gvsurenderreddy,项目名称:AerohiveAuto,代码行数:63,代码来源:cwp_config.py

示例3: data_collect_default_config_push

# 需要导入模块: from webui import WebUI [as 别名]
# 或者: from webui.WebUI import check [as 别名]
def data_collect_default_config_push():
    wui = WebUI()
    config = Configuration(wui.d("visit.url"), wui.d("visit.title"), wui.d("visit.pre_url"))
    if wui.session_id:
        config.to_url_home()
        config.to_menu(wui.d("policy.menu_name"))
        config.wait_until_to_menu_success(wui.d("policy.menu_name"))
           
        wui.click(monitor_cfg.Configuration_button)
        wui.info( 'go to configuration page success' , True )
       
        wui.click(monitor_cfg.add_button)
        wui.info( 'go to add network policy page success' , True )
       
        policyname = wui.d( "sw_policy_name")
        #policyname = "wwwu-2257"
        wui.input(monitor_cfg.get( 'PolicyName_txt'), policyname)
        wui.input(monitor_cfg.get( 'PolicyDesc_txt'), wui.d("NetworkPolicy.PolicyDesc" ))
        wui.info( 'input policy name and description success' , True )
       
        wui.click(monitor_cfg.Next_button)
        wui.info( 'create network policy success', True )
       
        # go to addtional setting to check kddr default status of the created network policy
        wui.click(DeviceDataCollection.additional_setting_button)
        try:
            wui.wait_until_element_displayed(DeviceDataCollection.ntp_elements)
            wui.info( 'go to additional settings page success' , True ) 
        except Exception, e:
            wui.error( 'go to additional settings page failed' , True )
       
        #check the sections of data collection displayed
        wui.click(DeviceDataCollection.data_collection_btn)
        #wui.wait_until_element_displayed(DeviceDataCollection.application_identify_switch)
        time.sleep(5)
    
        #change the application_identify switch as off
        wui.wait_until_element_displayed(DeviceDataCollection.get('application_identify_xpath'))
        wui.info( 'application visibility and control section displayed' , True )
        wui.check(DeviceDataCollection.get('application_identify_xpath'))
        time.sleep(2)
        wui.info('turn off switch for application identification success!', True)
    
        #change the section of statistic collection settings
        wui.wait_until_element_displayed(DeviceDataCollection.get('statistic_collection_xpath'))
        wui.info( 'statistic collection section displayed' , True )
        wui.check(DeviceDataCollection.get('statistic_collection_xpath'))
        time.sleep(2)
        wui.info('turn off switch for statistic collection success!', True)
        
        #change the section of kddr setting
        wui.move_scroll_bottom()
        wui.wait_until_element_displayed(DeviceDataCollection.get('kddr_name'))
        wui.wait_until_element_displayed(DeviceDataCollection.get('kddr_xpath'))
        #wui.check(DeviceDataCollection.get('kddr_xpath'))
        wui.click(DeviceDataCollection.get('kddr_xpath'))
        time.sleep(2)
        wui.info('turn on switch for kddr success', True)
       
        #click save button to save the configuration
        wui.click(DeviceDataCollection.data_collection_save_btn)
        wui.wait_until_element_displayed(DeviceDataCollection.data_collection_save_info)
        wui.info('the device data collection can be saved successfully', True )
开发者ID:gvsurenderreddy,项目名称:AerohiveAuto,代码行数:65,代码来源:data_collect_full_config_check.py

示例4: HM

# 需要导入模块: from webui import WebUI [as 别名]
# 或者: from webui.WebUI import check [as 别名]
class HM(object):
    def __init__(self):
        self.w = WebUI()
        self.mode = None
        self.configer = Configuration()
    
    def admin_mode(self):
        self.mode = 'admin'
    
    def vhm_mode(self):
        self.mode = 'vhm'
    
    def is_admin_mode(self):
        return self.mode == 'admin'
    
    def is_vhm_mode(self):
        return self.mode == 'vhm'
      
    def _login(self, server, user, passwd):
        self.server = server
        self.user = user
        self.passwd = passwd
        
        self.w.info('trying to login %s as %s:%s' % (self.server, self.user, self.passwd))
        
        self.w.get(self.server)
        self.w.wait_until_element_displayed(LoginPage.get('login_btn'))
        self.w.check_title(LoginPage.get('login_page_title'), 'check title after open')
        
        self.w.input(LoginPage.get('username_txt'), self.user)
        self.w.input(LoginPage.get('password_txt'), self.passwd)
        
        self.w.info('login', True)
        self.w.click(LoginPage.get('login_btn'))

    def login(self, server, user, passwd):
        self.admin_mode()
        
        self._login(server, user, passwd)
        self.w.wait_until_element_displayed(MainPage.get('monitor_lnk'))
        
        self.w.register_cleanup(self.logout)

    def login_by_vhm(self, server, vhm_user, vhm_passwd, hive_name=None, hive_mgt_passwd=None, quick_ssid_passwd=None):
        self.vhm_mode()
        
        self._login(server, vhm_user, vhm_passwd)
        def __tmp(w):
            return w.s.title != LoginPage.get('login_page_title')
        self.w.wait_until(__tmp, msg='login page navigated')
        if self.w.title == EULAPage.get('eula_page_title'):
            self.w.wait_until_element_displayed(EULAPage.get('agree_btn'))
            self.w.info('agree with EUAL', True)
            self.w.click(EULAPage.get('agree_btn'))
            self.w.wait_until_element_displayed(WelcomePage.get('continue_btn'))
            self.w.check_title(WelcomePage.get('welcome_page_title'))
        
            self.w.input(WelcomePage.get('hive_name_txt'), hive_name)
            self.w.input(WelcomePage.get('hive_mgt_passwd_txt'), hive_mgt_passwd)
            self.w.input(WelcomePage.get('hive_mgt_passwd_confirm_txt'), hive_mgt_passwd)
            self.w.check(WelcomePage.get('enterprise_mode_radio'))
            self.w.wait_until_element_displayed(WelcomePage.get('quick_ssid_passwd_txt'))
            self.w.input(WelcomePage.get('quick_ssid_passwd_txt'), quick_ssid_passwd)
            self.w.input(WelcomePage.get('quick_ssid_passwd_confirm_txt'), quick_ssid_passwd)
            
            self.w.info('handle initial configuration', True)
            self.w.click(WelcomePage.get('continue_btn'))
            self.w.check_title(MainPage.get('main_page_title'), 'check title after login')
            
            time.sleep(5)
            
        self.w.register_cleanup(self.logout)

    def to_hiveaps_table(self, type='all'):
        self.w.click(MainPage.get('monitor_lnk'))
        self.w.wait_until_title_present(HiveAPsPage.get('allAPs_page_title'))

        if type == 'all':
            self.w.click(HiveAPsPage.get('hive_aps_lnk'))
            self.w.wait_until_title_present(HiveAPsPage.get('hiveAPs_page_title'))

            self.w.click(HiveAPsPage.get('auto_refresh_off'))
            selecter = self.w.get_selecter(HiveAPsPage.get('device_per_page_sel'))
            if selecter.first_selected_option.text != '500':
                selecter.select_by_value('500')
                self.w.debug('after select page size', True)
        elif type == 'rogue':
            self.w.click(RogueAPsPage.get('rogue_aps_lnk'))
            self.w.wait_until_title_present(RogueAPsPage.get('rogueAPs_page_title'))

            selecter = self.w.get_selecter(RogueAPsPage.get('device_per_page_sel'))
            if selecter.first_selected_option.text != '500':
                selecter.select_by_value('500')

    def select_ap(self, text='', by='default'):
        if by == 'default':
            try:
                self.w.wait_until_element_displayed(APsTablePage.locate_checkbox(text))
            except Exception, e:
                self.w.warn('Cannot find: %s' % text, True)
#.........这里部分代码省略.........
开发者ID:gvsurenderreddy,项目名称:AerohiveAuto,代码行数:103,代码来源:__init__.py

示例5: firewall_rule_create

# 需要导入模块: from webui import WebUI [as 别名]
# 或者: from webui.WebUI import check [as 别名]
def firewall_rule_create():
    wui = WebUI()
    config = Configuration(wui.d("visit.url"), wui.d("visit.title"))
    if wui.session_id:
        config.to_page_before_deployed_ssid()
        # input ssid name
        ssidname=wui.d("ssid.name")
        wui.move_scroll_top()
        config.input_ssid_name(ssidname, ssidname)
        config.ssid_usage_settings('CUSTOM')
        config.set_access_security('open')
        config.wait_deploy_element(2)

        config.to_customize_user_profile_page()
        
        wui.move_scroll_by_element(FireWall.get('user_profile_tabs'))
        wui.info('move to user-profile tabs successfully!', True)

        wui.click(FireWall.get('security_tab_btn'))
        wui.info('go to security tab successfully', True)

        wui.info('try to turn on the switch to enable firewall', True)
        wui.check(FireWall.get('firewall_switch'))

        wui.move_scroll_bottom()

        #click dropdown box for firewall rules
        wui.click(FireWall.get('bound_traffic_dropdown_btn'))
        wui.info('click the dropdown box button successfully', True)
        wui.wait_until_element_displayed(FireWall.get('inbound_traffic_element'))
        wui.wait_until_element_displayed(FireWall.get('outbound_traffic_element'))
        wui.info('can display the inbound/outbound elements successfully', True)

        #select outbound traffic
        wui.click(FireWall.get('outbound_traffic_element'))

        outbound_traffic_element = "Outbound Traffic"
        selected_bound_traffic_element = wui.find_element(FireWall.get('bound_traffic_selected')).text
        if outbound_traffic_element == selected_bound_traffic_element:
            wui.info('selected the outbound element successfully', True)
        else:
            wui.error('failed selected the bound element', True)

        #config firewall rules default action
        wui.wait_until_element_displayed(FireWall.get('firwall_defaction_area'))
        wui.info('display firewall rules default action area sucessfully!', True)


        #select the firewall rules default actions is permit
        wui.info('Try to click the dropdown box...', True)
        wui.click(FireWall.get('firewall_defaction_dropdown_btn'))
        wui.wait_until_element_displayed(FireWall.get('firewall_defaction_deny_element'))
        wui.wait_until_element_displayed(FireWall.get('firewall_defaction_permit_element'))
        wui.info('Click the dropdown box success.....', True)
        wui.click(FireWall.get('firewall_defaction_permit_element'))
        wui.info('Success to select action Permit for firewall rules!', True)

        #add a new ip policy rules
        wui.click(FireWall.get('firewall_new_btn'))
        wui.wait_until_element_displayed(FireWall.get('new_firewall_page_title'))
        wui.info('go to new firewall page success', True)
        config.wait_deploy_element(1)


        config.user_profile_srcurce_ip(wui.d("userprofile.src_hostname"), wui.d("userprofile.src_hostip"))
        wui.info('selected the srcurce ip address successfully', True)
        config.user_profile_destination_ip(wui.d("userprofile.des_hostname"), wui.d("userprofile.des_hostip"))
        wui.info('selected the destination ip address successfully', True)
        config.user_profile_select_net_service()
        wui.info('handle to select service successfully', True)




        #config the rule action:
        wui.info('try to config the rule action as Deny', True)
        wui.click(FireWall.get('new_rule_action_btn'))
        wui.wait_until_element_displayed(FireWall.get('new_rule_action_nat'))
        wui.info('click the action dropdown box successfully', True)
        wui.info('try to select the deny action....', True)
        wui.click(FireWall.get('new_rule_action_deny'))
        wui.info('success to select the deny action...', True)
        
        #config the rule logging action:
        wui.info('try to config logging action as drop', True)
        wui.click(FireWall.get('new_rule_log_btn'))
        wui.wait_until_element_displayed(FireWall.get('new_rule_log_off'))
        wui.info('click the logging dropdown box successfully', True)
        wui.info('try to select drop packets....', True)
        wui.click(FireWall.get('new_rule_log_drop'))
        wui.info('success to select the drop logging...', True)
        
        #save the new ip firewall rule
        wui.info('try to save the ip rule setting...', True)
        wui.click(FireWall.get('new_rule_dialog_save'))
        wui.info('save the ip firewall rule success...', True)
        
        #check if the added ip rule correct
        wui.info('try to move scroll to bottom....', True)
        wui.move_scroll_bottom()
#.........这里部分代码省略.........
开发者ID:gvsurenderreddy,项目名称:AerohiveAuto,代码行数:103,代码来源:firewall_config.py


注:本文中的webui.WebUI.check方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。