コード例 #1
0
    def selectOrganize(self,organize):
        oganize_selector = ['id',self.getIdSuffix('select','organize')]
        HtmlButton(HtmlElement(selector1=oganize_selector).element.find_elements_by_tag_name('span')[2]).clickBtn()
    
        oganize1_selector = ['xpath','/html/body/div[2]/ul/li']
        HtmlButton(selector1=oganize1_selector).clickBtn()
        
        oganize2_selector = ['xpath','/html/body/div[2]/ul[2]']
        HtmlSelect(selector1=oganize2_selector).selectLiByText(organize.get('organize3'))

        if HtmlMenu(selector1=oganize2_selector).element.is_displayed():
            HtmlButton(HtmlElement(selector1=oganize_selector).element.find_elements_by_tag_name('span')[2]).clickBtn()
コード例 #2
0
 def clickclose(self):
     # selector = ['xpath','/html/body/div[1]/div/div[2]/section/section/section/main/div/div/div[3]/div/div[1]/button']
     selector = [
         'css_selector',
         '#system_user_modal_showAddAccount > div:nth-child(1) > div:nth-child(1) > button:nth-child(2)'
     ]
     HtmlButton(selector1=selector).clickBtn()
コード例 #3
0
 def clickOK(self):
     btn_selector = ['xpath', '/html/body/div[1]/div/div[2]/section/section/section/main/div/div/div[1]/div/div[1]/div[1]/span[4]/button']
     HtmlButton(selector1=btn_selector).clickBtn()
     
     
     
     
     
コード例 #4
0
ファイル: deptMainPage.py プロジェクト: zhuypy/AutoTest_UI
    def setDialog_addDept(self, testData):
        deptName_selector = ['id', self.getIdSuffix('input', 'deptName')]
        deptLeader_selector = [
            'xpath',
            '/html/body/div[1]/div/div[2]/section/section/section/main/div/div/div[2]/div/div[2]/div/form/div[2]/div/div/div[2]/input'
        ]
        deptTel_selector = ['id', self.getIdSuffix('input', 'tel')]
        deptAddress_selector = ['id', self.getIdSuffix('input', 'address')]
        deptDesc_selector = ['id', self.getIdSuffix('input', 'desc')]

        for key in testData:
            if key == 'deptName':
                ret = HtmlText(selector1=deptName_selector).setText(
                    testData.get(key))
            elif key == 'deptLeader':
                HtmlButton(selector1=deptLeader_selector).clickBtn()
                ret = HtmlSelect(
                    selector1=['xpath', '/html/body/div[3]/div[1]/div[1]/ul'
                               ]).selectLiByText(testData.get(key))
            elif key == 'tel':
                ret = HtmlText(selector1=deptTel_selector).setText(
                    testData.get(key))
            elif key == 'address':
                ret = HtmlText(selector1=deptAddress_selector).setText(
                    testData.get(key))
            elif key == 'desc':
                ret = HtmlText(selector1=deptDesc_selector).setText(
                    testData.get(key))
            else:
                ret = False
                logger.error('invalid parameter %s' % (key))

            if ret:
                logger.info('set %s:%s success' % (key, testData.get(key)))
            else:
                logger.error('set %s:%s fail' % (key, testData.get(key)))
コード例 #5
0
ファイル: deptMainPage.py プロジェクト: zhuypy/AutoTest_UI
 def clickAbleBtn(self):
     addRoleBtn_selector = ['id', self.getIdSuffix('button', 'ableDept')]
     HtmlButton(selector1=addRoleBtn_selector).clickBtn()
コード例 #6
0
ファイル: deptMainPage.py プロジェクト: zhuypy/AutoTest_UI
 def clickSaveBtn(self):
     addRoleBtn_selector = ['id', self.getIdSuffix('button', 'deptSave')]
     HtmlButton(selector1=addRoleBtn_selector).clickBtn()
コード例 #7
0
ファイル: deptMainPage.py プロジェクト: zhuypy/AutoTest_UI
 def clickAddRoleBtn(self):
     addRoleBtn_selector = ['id', self.getIdSuffix('input', 'addRoleGroup')]
     HtmlButton(selector1=addRoleBtn_selector).clickBtn()
コード例 #8
0
ファイル: deptMainPage.py プロジェクト: zhuypy/AutoTest_UI
 def clickConfirmBtn(self):
     HtmlButton(
         selector1=['xpath', '/html/body/div[2]/div/div[3]/button[2]'
                    ]).clickBtn()
コード例 #9
0
ファイル: deptMainPage.py プロジェクト: zhuypy/AutoTest_UI
 def editRow(self, key_value):
     self.search(key_value[1])
     HtmlButton(
         selector1=['name',
                    self.getIdSuffix('buttons', '0_editDept')]).clickBtn()
コード例 #10
0
ファイル: deptMainPage.py プロジェクト: zhuypy/AutoTest_UI
 def search(self, keyword):
     logger.info('search %s' % (keyword))
     selector_text = ['id', self.getIdSuffix('input', 'text')]
     selector_btn = ['id', self.getIdSuffix('button', 'search')]
     HtmlText(selector1=selector_text).setText(keyword)
     HtmlButton(selector1=selector_btn).clickBtn()
コード例 #11
0
 def clickSaveBtn(self):
     btn_selector = ['id', self.getIdSuffix('button', 'saveEditAuthority')]
     HtmlButton(selector1=btn_selector).clickBtn()
     sleep(1)
コード例 #12
0
 def closePopWin(self):
     try:
         btn_selector = ['xpath','/html/body/div[1]/div/div[2]/section/section/section/main/div/div/div[2]/div/div[1]/button']
         HtmlButton(selector1=btn_selector).clickBtn()
     except:
         pass
コード例 #13
0
 def clickSaveBtn(self):
     selector = ['id', self.getIdSuffix('button', 'accountSave')]
     HtmlButton(selector1=selector).clickBtn()
コード例 #14
0
 def clickDisAbleBtn(self):
     selector = ['id', self.getIdSuffix('button', 'disableAccount')]
     HtmlButton(selector1=selector).clickBtn()
コード例 #15
0
 def clickAddBtn(self):
     selector = ['id', self.getIdSuffix('button', 'addAccount')]
     HtmlButton(selector1=selector).clickBtn()
コード例 #16
0
ファイル: roleMainPage.py プロジェクト: zhuypy/AutoTest_UI
 def clickclose(self):
     selector = [
         'css_selector',
         '#system_role_modal_showAddRole > div:nth-child(1) > div:nth-child(1) > button:nth-child(2)'
     ]
     HtmlButton(selector1=selector).clickBtn()