Esempio n. 1
0
    def test_RoleEdit(self,data):

        print('---------{}---------'.format(data['case_name']))

        Element(self.driver,'systemManager','systemManager_click').wait_click()
        Element(self.driver,'systemManager','rolemanager_click').wait_click()
        time.sleep(2)
        for i in range(1,7):
            pathvalue = self.driver.find_element_by_xpath('//*[@id="container"]/section/section/section/main/div/div[2]/div/div/div/div/div/table/tbody/tr[{}]/td[5]/span/a[2]'.format(i))

            print('pathvalue:',pathvalue)
            #点击查看按钮
            ActionChains(self.driver).move_to_element(pathvalue).click(pathvalue).perform()
            time.sleep(1)
            #取消查看
            Element(self.driver,'systemManager','rolemanager_cancelclick').wait_click()
            time.sleep(1)
            pathvalue = self.driver.find_element_by_xpath(
                '//*[@id="container"]/section/section/section/main/div/div[2]/div/div/div/div/div/table/tbody/tr[{}]/td[5]/span/a[2]'.format(
                    i))

            print('pathvalue:', pathvalue)
            # 点击查看按钮
            ActionChains(self.driver).move_to_element(pathvalue).click(pathvalue).perform()
            Element(self.driver,'systemManager','rolemanager_editokclick').wait_click()
            Element(self.driver, 'systemManager', 'rolemanager_editokclick').wait_not_click()
Esempio n. 2
0
 def Safer_pass(self):
     Element(self.driver, 'systemManager',
             'systemManager_click').wait_click()
     time.sleep(1)
     Element(self.driver, 'systemManager',
             'saferapprove_approveclick').wait_click()
     Element(self.driver, 'systemManager',
             'saferapprove_contextclick').wait_send_keys('test')
     Element(self.driver, 'systemManager',
             'saferapprove_passclick').wait_click()
     time.sleep(1)
     self.login.logout()
Esempio n. 3
0
    def test_addpartitionExpression(self,data):

        print('---------{}---------'.format(data['case_name']))

        Element(self.driver,'project','Projectfind_click').wait_send_keys(date+data["project_name"])
        Element(self.driver,'project','Projectfind_click').send_keys(Keys.ENTER)
        time.sleep(1)
        Element(self.driver,'project','enterProject_click').wait_click()
        Element(self.driver,'dataQuality','dataQuality_click').wait_click()
        Element(self.driver, 'dataQuality', 'regularManager_click').wait_click()
        time.sleep(2)
        Element(self.driver, 'dataQuality', 'table_seachinputclick').wait_send_keys(data["table_name"])
        time.sleep(1)
        Element(self.driver, 'dataQuality', 'table_seachclick').wait_click()
        time.sleep(1)
        Element(self.driver, 'dataQuality', 'monitor_addclick').wait_click()
        Element(self.driver, 'dataQuality', 'partitionexpression_addclick').wait_click()

        Element(self.driver, 'dataQuality', 'partitionexpression_nameclick').wait_send_keys(data["partitionexpression"])
        Element(self.driver, 'dataQuality', 'partitionexpression_okclick').wait_click()
        time.sleep(1)
        Element(self.driver, 'dataQuality', 'partitionexpression_successclick').wait_click()
        value= Element(self.driver, 'dataQuality', 'partitionexpression_successclick').get_attribute2()
        print('value的值是:',value)
        if value == '请求成功':

            Element(self.driver, 'dataQuality', 'partitionexpression_searchclick').wait_send_keys(
                data["partitionexpression"])
            time.sleep(1)
            Element(self.driver, 'dataQuality', 'partitionexpression_searchokclick').wait_click()
            time.sleep(1)

            element = get_el_dict('dataQuality', 'partitionexpression_moveclick')
            pathValue = element.get('pathValue')
            test = self.driver.find_element_by_xpath(pathValue)
            # 右键到编辑分区表达式界面
            ActionChains(self.driver).move_to_element(test).context_click(test).perform()
            time.sleep(1)
            Element(self.driver,'dataQuality','partitionexpression_editclick').click()
            Element(self.driver, 'dataQuality', 'partitionexpression_editokclick').click()
            time.sleep(2)
            element = get_el_dict('dataQuality', 'partitionexpression_moveclick')
            pathValue = element.get('pathValue')
            test = self.driver.find_element_by_xpath(pathValue)
            # 右键到编辑分区表达式界面
            ActionChains(self.driver).move_to_element(test).context_click(test).perform()
            time.sleep(1)
            Element(self.driver,'dataQuality','partitionexpression_deleteclick').wait_click()
            Element(self.driver, 'dataQuality', 'partitionexpression_editokclick').wait_click()

            time.sleep(2)
            Element(self.driver, 'dataQuality', 'partitionexpression_addclick').wait_click()
            Element(self.driver, 'dataQuality', 'partitionexpression_nameclick').wait_send_keys(
                data["partitionexpression"])
            Element(self.driver, 'dataQuality', 'partitionexpression_okclick').wait_click()
            time.sleep(1)
            Element(self.driver, 'dataQuality', 'partitionexpression_successclick').wait_click()
            value = Element(self.driver, 'dataQuality', 'partitionexpression_successclick').get_attribute2()
            self.assertEqual(value,'请求成功')
        else:
            pass
Esempio n. 4
0
    def test_mongoAdd(self, data):

        print('---------{}---------'.format(data['case_name']))

        Element(self.driver, 'project',
                'Projectfind_click').wait_send_keys(date +
                                                    data["project_name"])
        Element(self.driver, 'project',
                'Projectfind_click').send_keys(Keys.ENTER)
        time.sleep(1)
        Element(self.driver, 'project', 'enterProject_click').wait_click()
        time.sleep(1)
        Element(self.driver, 'dataAssert', 'dataAssert_click').wait_click()
        Element(self.driver, 'dataAssert', 'dataSource_click').wait_click()
        Element(self.driver, 'dataAssert', 'dataSourceadd_click').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourceaddmondb_click').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourceadd_nextclick').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourceaddmondbpre_click').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourceadd_nextclick').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourceaddmondbname_click').wait_send_keys(
                    data["dataSource_name"] + date)
        Element(self.driver, 'dataAssert',
                'dataSourceaddmondbdesc_click').wait_send_keys(
                    date + data["dataSouce_desc"])
        Element(self.driver, 'dataAssert',
                'dataSourceaddmondbserver_click').wait_send_keys(data["url"])
        Element(self.driver, 'dataAssert',
                'dataSourceaddmondbDBinfo_click').wait_send_keys(data["db"])
        Element(self.driver, 'dataAssert',
                'dataSourceaddmondbDBverify_click').wait_send_keys(
                    data['vertifydb'])
        Element(self.driver, 'dataAssert',
                'dataSourceaddmondbuser_click').wait_send_keys(data["user"])
        time.sleep(3)
        Element(self.driver, 'dataAssert',
                'dataSourceaddmondbpwd_click').wait_send_keys(int(data["pwd"]))
        Element(self.driver, 'dataAssert',
                'dataSourceaddmondbconnect_click').wait_click()
        current_url = Element(self.driver, 'dataAssert',
                              'dataSourceaddmondbsave_click').wait_click()
        time.sleep(1)
        try:
            self.check_result(current_url, data['expect_url1'])
        except:
            return
Esempio n. 5
0
    def test_opentsdb_publicNetAdd(self, data):

        print('---------{}---------'.format(data['case_name']))

        Element(self.driver, 'project',
                'Projectfind_click').wait_send_keys(date +
                                                    data["project_name"])
        Element(self.driver, 'project',
                'Projectfind_click').send_keys(Keys.ENTER)
        time.sleep(1)
        Element(self.driver, 'project', 'enterProject_click').wait_click()
        time.sleep(1)
        Element(self.driver, 'dataAssert', 'dataAssert_click').wait_click()
        Element(self.driver, 'dataAssert', 'dataSource_click').wait_click()
        Element(self.driver, 'dataAssert', 'dataSourceadd_click').wait_click()
        js = "document.getElementsByClassName('add-dataSourde')[0].scrollTop=1000"
        self.driver.execute_script(js)
        # time.sleep(2)
        Element(self.driver, 'dataAssert',
                'dataSourceaddopentsdb_click').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourceadd_nextclick').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourceaddopentsdbpre_click').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourceadd_nextclick').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourceaddopentsdbpubliciptype_click').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourceaddopentsdbpubliciptype_select').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourceaddopentsdbname_click').wait_send_keys(
                    data["dataSource_name"] + date)
        Element(self.driver, 'dataAssert',
                'dataSourceaddopentsdbdesc_click').wait_send_keys(
                    date + data["dataSouce_desc"])
        Element(self.driver, 'dataAssert',
                'dataSourceaddopentsdbpublicipurl_click').wait_send_keys(
                    data["url"])
        Element(self.driver, 'dataAssert',
                'dataSourceaddopentsdbconnect_click').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourceaddopentsdbparaAdd_click').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourceaddopentsdbpara1name_click').wait_send_keys(
                    data["paraname1"])
        Element(self.driver, 'dataAssert',
                'dataSourceaddopentsdbpara1type_click').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourceaddopentsdbpara1type2_select').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourceaddopentsdbdelete_click').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourceaddopentsdbparaAdd_click').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourceaddopentsdbpara1name_click').wait_send_keys(
                    data["paraname1"])
        Element(self.driver, 'dataAssert',
                'dataSourceaddopentsdbpara1type_click').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourceaddopentsdbpara1type2_select').wait_click()
        current_url = Element(self.driver, 'dataAssert',
                              'dataSourceaddopentsdbsave_click').wait_click()
        time.sleep(1)

        try:
            self.check_result(current_url, data['expect_url1'])
        except:
            return
Esempio n. 6
0
    def test_guidetable_LookandOperation(self, data):

        print('---------{}---------'.format(data['case_name']))

        Element(self.driver, 'project',
                'Projectfind_click').wait_send_keys(date +
                                                    data["project_name"])
        Element(self.driver, 'project',
                'Projectfind_click').send_keys(Keys.ENTER)
        time.sleep(1)
        Element(self.driver, 'project', 'enterProject_click').wait_click()
        time.sleep(1)
        Element(self.driver, 'dataStanard', 'dataStanard_click').wait_click()
        Element(self.driver, 'dataStanard', 'modelDesign_click').wait_click()
        Element(self.driver, 'dataStanard',
                'tablesearch_input').wait_send_keys(data["table_name"])
        Element(self.driver, 'dataStanard', 'standard_click').wait_click()
        Element(self.driver, 'dataStanard',
                'standard_chooseclick').wait_click()
        Element(self.driver, 'dataStanard',
                'tableedit_searchclick').wait_click()
        time.sleep(1)
        value = Element(self.driver, 'dataStanard',
                        'tablelook_click').is_enabled()
        print('value的值是:', value)
        self.assertTrue(value)
        time.sleep(1)
        value2 = Element(self.driver, 'dataStanard',
                         'tableoperation_click').is_enabled()
        print("value2:", value2)
        self.assertTrue(value2)
Esempio n. 7
0
    def test_fileStoreEdit(self,data):

        print('---------{}---------'.format(data['case_name']))

        Element(self.driver,'project','Projectfind_click').wait_send_keys(date+data["project_name"])
        Element(self.driver,'project','Projectfind_click').send_keys(Keys.ENTER)
        time.sleep(1)
        Element(self.driver,'project','enterProject_click').wait_click()
        time.sleep(1)
        Element(self.driver,'dataAssert','dataAssert_click').wait_click()
        Element(self.driver, 'dataAssert', 'dataSource_click').wait_click()
        Element(self.driver,'dataAssert', 'dataSourcefindname_click').wait_send_keys(data["dataSource_name"]+date)
        Element(self.driver, 'dataAssert', 'dataSourcedefault_find_click').wait_click()
        Element(self.driver,'dataAssert','dataSourceedit_click').wait_click()
        Element(self.driver,'dataAssert','dataSourcename_click').send_keys(Keys.CONTROL,'a')
        Element(self.driver, 'dataAssert', 'dataSourcename_click').send_keys(Keys.BACK_SPACE)
        Element(self.driver, 'dataAssert', 'dataSourcename_click').wait_send_keys(data["dataSource_name"]+date)
        current_url = Element(self.driver, 'dataAssert', 'dataSourceedit_saveclick').wait_click()
        time.sleep(1)
        try:
            self.check_result(current_url,data['expect_url1'])
        except:
            return
Esempio n. 8
0
    def test_hiveAdd(self,data):

        print('---------{}---------'.format(data['case_name']))

        Element(self.driver,'project','Projectfind_click').wait_send_keys(date+data["project_name"])
        Element(self.driver,'project','Projectfind_click').send_keys(Keys.ENTER)
        time.sleep(1)
        Element(self.driver,'project','enterProject_click').wait_click()
        time.sleep(1)
        Element(self.driver,'dataAssert','dataAssert_click').wait_click()
        Element(self.driver, 'dataAssert', 'dataSource_click').wait_click()
        Element(self.driver,'dataAssert','dataSourcedefault_click').wait_send_keys(data["defaultdataSource_name"])
        time.sleep(2)
        Element(self.driver, 'dataAssert', 'dataSourcedefault_find_click').wait_click()
        Element(self.driver, 'dataAssert', 'dataSourcedefault_look_click').wait_click()
        time.sleep(1)
        #动态获取默认数据源的用户名和url的值信息
        # Element(self.driver, 'dataAssert', 'dataSourcedefaultname_click').wait_click()
        # time.sleep(1)
        user = Element(self.driver,'dataAssert', 'dataSourcedefaultname_click').get_attribute2()
        print('user:'******'dataAssert', 'dataSourcedefaulturl_click').wait_click()
        # time.sleep(1)
        url = Element(self.driver,'dataAssert','dataSourcedefaulturl_click').get_attribute2()

        print('user的值是{},url值是{}'.format(user,url))
        Element(self.driver, 'dataAssert', 'dataSource2_click').wait_click()
        Element(self.driver, 'dataAssert', 'dataSourceadd_click').wait_click()
        Element(self.driver, 'dataAssert', 'dataSourceAddhive_click').wait_click()
        Element(self.driver, 'dataAssert', 'dataSourceadd_nextclick').wait_click()
        Element(self.driver, 'dataAssert', 'dataSourceAddhivepre_click').wait_click()
        Element(self.driver, 'dataAssert', 'dataSourceadd_nextclick').wait_click()
        Element(self.driver,'dataAssert','dataSourceAddhivename_click').wait_send_keys(data["dataSource_name"]+date)
        Element(self.driver, 'dataAssert', 'dataSourceAddhivedesc_click').wait_send_keys(date+data["dataSouce_desc"])
        Element(self.driver, 'dataAssert', 'dataSourceAddhiveurl_click').wait_send_keys(url)
        Element(self.driver,'dataAssert','dataSourceAddhiveuser_click').wait_send_keys(user)
        Element(self.driver,'dataAssert','dataSourceAddhivepwd_click').wait_send_keys(data["dataSource_pwd"])
        Element(self.driver,'dataAssert','dataSourceAddhiveconnect_click').wait_click()
        # Element(self.driver, 'dataAssert', 'dataSourceAddhiveconnect_click').wait_not_click()
        current_url = Element(self.driver, 'dataAssert', 'dataSourceAddhivesave_click').wait_click()
        time.sleep(1)

        try:
            self.check_result(current_url,data['expect_url1'])
        except:
            return
Esempio n. 9
0
    def test_addDataQuality(self, data):

        print('---------{}---------'.format(data['case_name']))
        #
        Element(self.driver, 'project',
                'Projectfind_click').wait_send_keys(date +
                                                    data["project_name"])
        # Element(self.driver,'project','Projectfind_click').wait_send_keys(data["project_name"])
        Element(self.driver, 'project',
                'Projectfind_click').send_keys(Keys.ENTER)
        time.sleep(1)
        Element(self.driver, 'project', 'enterProject_click').wait_click()
        Element(self.driver, 'dataQuality', 'dataQuality_click').wait_click()
        Element(self.driver, 'dataQuality',
                'regularManager_click').wait_click()
        Element(self.driver, 'dataQuality',
                'table_seachinputclick').wait_send_keys(data["table_name"])
        time.sleep(1)
        Element(self.driver, 'dataQuality', 'table_seachclick').wait_click()
        time.sleep(2)
        Element(self.driver, 'dataQuality', 'monitor_addclick').wait_click()

        Element(self.driver, 'dataQuality',
                'partitionexpression_searchclick').wait_send_keys(
                    data["partitionexpression"])
        time.sleep(1)
        Element(self.driver, 'dataQuality',
                'partitionexpression_searchokclick').wait_click()
        time.sleep(1)
        Element(self.driver, 'dataQuality', 'regular_addclick').wait_click()
        Element(self.driver, 'dataQuality',
                'regular_nameclick').wait_send_keys(data["regular_name"])
        Element(self.driver, 'dataQuality', 'regular_samllclick').wait_click()
        Element(self.driver, 'dataQuality',
                'regular_stronglclick').wait_click()
        Element(self.driver, 'dataQuality', 'regular_samllclick').wait_click()
        Element(self.driver, 'dataQuality', 'regularSource_click').wait_click()
        Element(self.driver, 'dataQuality', 'regularinit_click').wait_click()
        Element(self.driver, 'dataQuality', 'regulartype_click').wait_click()
        Element(self.driver, 'dataQuality',
                'regulartype_chooseclick').wait_click()
        Element(self.driver, 'dataQuality', 'regularpara_click').wait_click()
        Element(self.driver, 'dataQuality',
                'regularpara1_chooseclick').wait_click()
        Element(self.driver, 'dataQuality', 'regularmodel_click').wait_click()
Esempio n. 10
0
    def test_maxcomputeAdd(self, data):

        print('---------{}---------'.format(data['case_name']))

        Element(self.driver, 'project',
                'Projectfind_click').wait_send_keys(date +
                                                    data["project_name"])
        Element(self.driver, 'project',
                'Projectfind_click').send_keys(Keys.ENTER)
        time.sleep(1)
        Element(self.driver, 'project', 'enterProject_click').wait_click()
        time.sleep(1)
        Element(self.driver, 'dataAssert', 'dataAssert_click').wait_click()
        Element(self.driver, 'dataAssert', 'dataSource_click').wait_click()
        Element(self.driver, 'dataAssert', 'dataSourceadd_click').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourceaddmaxcompute_click').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourceadd_nextclick').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourceaddmaxcomputepre_click').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourceadd_nextclick').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourceaddmaxcomputename_click').wait_send_keys(
                    data["dataSource_name"] + date)
        Element(self.driver, 'dataAssert',
                'dataSourceaddmaxcomputedesc_click').wait_send_keys(
                    date + data["dataSouce_desc"])
        Element(self.driver, 'dataAssert',
                'dataSourceaddmaxcomputeaccid_click').wait_send_keys(
                    data["AccessKeyId"])
        Element(self.driver, 'dataAssert',
                'dataSourceaddmaxcomputeAccS_click').wait_send_keys(
                    data["AccessKeySecret"])
        Element(self.driver, 'dataAssert',
                'dataSourceaddmaxcomputeProject_click').wait_send_keys(
                    data["project"])
        Element(self.driver, 'dataAssert',
                'dataSourceaddmaxcomputeODPS_click').wait_send_keys(
                    data["ODPSEndpoint"])
        Element(self.driver, 'dataAssert',
                'dataSourceaddmaxcomputeTunnel_click').wait_send_keys(
                    data["TunnelEndPoint"])
        Element(self.driver, 'dataAssert',
                'dataSourceaddmaxcomputeconnect_click').wait_click()
        current_url = Element(
            self.driver, 'dataAssert',
            'dataSourceaddmaxcomputesave_click').wait_click()
        time.sleep(1)

        try:
            self.check_result(current_url, data['expect_url1'])
        except:
            return
Esempio n. 11
0
    def test_Safemangeropenoff(self,data):

        print('---------{}---------'.format(data['case_name']))

        Element(self.driver,'systemManager','systemManager_click').wait_click()
        Element(self.driver,'systemManager','safemanager_click').wait_click()

        #判断是否开启三员管理,若未开启则开启
        if Element(self.driver, 'systemManager', 'safemanager_openclick').get_attribute('aria-checked') == 'false':

            Element(self.driver, 'systemManager', 'safemanager_openclick').wait_click()
            Element(self.driver, 'systemManager', 'safemanager_saferclick').wait_click()
            Element(self.driver, 'systemManager', 'safemanager_saferselect').wait_click()
            time.sleep(1)
            Element(self.driver, 'systemManager', 'safemanager_auditerclick').wait_click()
            Element(self.driver, 'systemManager', 'safemanager_auditerselect').wait_click()
            time.sleep(2)
            Element(self.driver, 'systemManager', 'safemanager_useraddclick').wait_click()
            Element(self.driver, 'systemManager', 'safemanager_usereditclick').wait_click()
            Element(self.driver, 'systemManager', 'safemanager_modifypasswordclick').wait_click()
            Element(self.driver, 'systemManager', 'safemanager_roleeditclick').wait_click()
            Element(self.driver, 'systemManager', 'safemanager_saveclick').wait_click()
            time.sleep(1)
            #提交关闭三员管理
            Element(self.driver, 'systemManager', 'safemanager_openclick').wait_click()
            time.sleep(1)
            #安全管理员驳回关闭三员管理
            safer_approve().Safer_pass()
            time.sleep(1)

        else:
            Element(self.driver, 'systemManager', 'safemanager_openclick').wait_click()
            time.sleep(1)
            safer_approve().Safer_pass()
Esempio n. 12
0
    def test_ModifyPassword(self, data):

        print('---------{}---------'.format(data['case_name']))

        Element(self.driver, 'systemManager',
                'systemManager_click').wait_click()
        Element(self.driver, 'systemManager', 'usermanager_click').wait_click()
        Element(self.driver, 'systemManager',
                'account_click').wait_send_keys(data["username2"])
        Element(self.driver, 'systemManager',
                'account_click_find').wait_click()
        Element(self.driver, 'systemManager',
                'modifyPassword_click').wait_click()
        Element(self.driver, 'systemManager', 'modifyPassword_click')
        Element(self.driver, 'systemManager',
                'oldPassword_click').wait_send_keys(data['password2'])
        Element(self.driver, 'systemManager',
                'newPassword_click').wait_send_keys(data['confirmPassword'])
        Element(self.driver, 'systemManager',
                'modifyPassword_cancelclick').wait_click()
        time.sleep(1)
        Element(self.driver, 'systemManager',
                'account_click').send_keys(Keys.CONTROL + 'a')
        Element(self.driver, 'systemManager',
                'account_click').send_keys(Keys.DELETE)
        time.sleep(1)
        Element(self.driver, 'systemManager',
                'account_click').wait_send_keys(data["username"])
        Element(self.driver, 'systemManager',
                'account_click_find').wait_click()
        Element(self.driver, 'systemManager',
                'modifyPassword_click').wait_click()
        Element(self.driver, 'systemManager',
                'oldPassword_click').wait_send_keys(data['password'])
        Element(self.driver, 'systemManager',
                'newPassword_click').wait_send_keys(data['confirmPassword'])
        Element(self.driver, 'systemManager',
                'modifyPassword_okclick').wait_click()
        try:
            Element(self.driver, 'systemManager',
                    'modifyPassword_okclick').wait_not_click()
        except:
            Element(self.driver, 'systemManager', 'cancel_click').wait_click()
Esempio n. 13
0
    def test_createProject(self,data):

        print('---------{}---------'.format(data['case_name']))
        Element(self.driver,'project','createProject_click').wait_click()
        Element(self.driver,'project','Projectname_click').wait_send_keys(date+data["project_name"])
        Element(self.driver,'project','Projectdesc_click').wait_send_keys(data["project_desc"])
        Element(self.driver,'project','Projectcancel_click').wait_click()
        time.sleep(2)
        Element(self.driver,'project','createProject_click').wait_click()
        Element(self.driver,'project','Projectname_click').wait_send_keys(date + data["project_name"])
        Element(self.driver,'project','Projectdesc_click').wait_send_keys(data["project_desc"])
        Element(self.driver, 'project', 'Projectok_click').wait_click()
        #添加如下的异常场景,新建项目时候不会显示等待创建页面消失
        try:
            Element(self.driver, 'project', 'Projectok_click').wait_not_click()
        except:
            return self.check_result()

        Element(self.driver,'project','Projectfind_click').wait_send_keys(date+data["project_name"])
        Element(self.driver,'project','Projectfind_click').send_keys(Keys.ENTER)
        time.sleep(1)
        Element(self.driver,'project','enterProject_click').wait_click()
        Element(self.driver,'projectmanager','projectmanager_click').wait_click()
        Element(self.driver,'projectmanager', 'projectmanageredit_click').wait_click()
        time.sleep(1)
        Element(self.driver, 'projectmanager', 'projectmanageredit_name_click').clear()
        Element(self.driver, 'projectmanager', 'projectmanageredit_name_click').wait_send_keys(date+data["edit_project_name"])
        Element(self.driver, 'projectmanager', 'projectmanageredit_desc_click').clear()
        Element(self.driver, 'projectmanager', 'projectmanageredit_desc_click').wait_send_keys(date + data["edit_project_desc"])
        Element(self.driver,'projectmanager','projectmanageredit_save_click').wait_click()
        time.sleep(2)
        self.check_result()
Esempio n. 14
0
    def test_ScriptCreteTable(self, data):

        print('---------{}---------'.format(data['case_name']))

        Element(self.driver, 'project',
                'Projectfind_click').wait_send_keys(date +
                                                    data["project_name"])
        Element(self.driver, 'project',
                'Projectfind_click').send_keys(Keys.ENTER)
        time.sleep(1)
        Element(self.driver, 'project', 'enterProject_click').wait_click()
        time.sleep(1)
        Element(self.driver, 'dataAssert', 'dataAssert_click').wait_click()
        Element(self.driver, 'dataTable', 'dataTable_click').wait_click()
        Element(self.driver, 'dataTable',
                'dataTablescriptcreateTable_click').wait_click()
        Element(self.driver, 'dataTable',
                'dataTableScript_inputclick').wait_click()
        ActionChains(self.driver).send_keys(data["script"]).perform()
        time.sleep(1)
        Element(self.driver, 'dataTable',
                'dataTableScript_cancelclick').wait_click()
        time.sleep(2)
        Element(self.driver, 'dataTable',
                'dataTablescriptcreateTable_click').wait_click()
        time.sleep(1)
        Element(self.driver, 'dataTable',
                'dataTableScript_inputclick').wait_click()
        ActionChains(self.driver).send_keys(data["script"]).perform()
        time.sleep(1)
        Element(self.driver, 'dataTable',
                'dataTableScript_saveclick').wait_click()
        Element(self.driver, 'dataTable',
                'dataTableScript_saveclick').wait_not_click()
        time.sleep(1)
        Element(self.driver, 'dataTable',
                'dataTablefind_click').wait_send_keys(data["table_name"])
        time.sleep(1)
        content = Element(self.driver, 'dataTable',
                          'dataTablefind_totalclick').get_text_value()

        self.check_result(content)
Esempio n. 15
0
    def test_guideCreateTable_ods(self, data):

        print('---------{}---------'.format(data['case_name']))

        Element(self.driver, 'project',
                'Projectfind_click').wait_send_keys(date +
                                                    data["project_name"])
        Element(self.driver, 'project',
                'Projectfind_click').send_keys(Keys.ENTER)
        time.sleep(1)
        Element(self.driver, 'project', 'enterProject_click').wait_click()
        time.sleep(1)
        Element(self.driver, 'dataStanard', 'dataStanard_click').wait_click()
        Element(self.driver, 'dataStanard', 'modelDesign_click').wait_click()
        Element(self.driver, 'dataStanard',
                'guideCreateTable_click').wait_click()
        Element(self.driver, 'dataStanard', 'levelchoose_click').wait_click()
        Element(self.driver, 'dataStanard',
                'levelchoose_ods_click').wait_click()
        Element(self.driver, 'dataStanard', 'apply_choose_click').wait_click()
        Element(self.driver, 'dataStanard',
                'applychoose_erp_click').wait_click()
        Element(self.driver, 'dataStanard', 'increment_click').wait_click()
        Element(self.driver, 'dataStanard',
                'increment_chooseclick').wait_click()
        Element(self.driver, 'dataStanard',
                'ods_define_click').wait_send_keys(data["define"])
        Element(self.driver, 'dataStanard', 'ods_flency_click').wait_click()
        Element(self.driver, 'dataStanard',
                'ods_flency_chooseclick').wait_click()
        Element(self.driver, 'dataStanard',
                'tabledesc_click').wait_send_keys(data["desc"])
        Element(self.driver, 'dataStanard', 'tabledesc_info').wait_click()
        time.sleep(1)
        value = Element(self.driver, 'dataStanard',
                        'tabledesc_info').get_attribute(data["property"])
        print('value的值是:', value)
        Element(self.driver, 'dataStanard',
                'tablelifeStyle_click').wait_click()
        Element(self.driver, 'dataStanard',
                'tablelifeStyle_select').wait_click()
        Element(self.driver, 'dataStanard',
                'tablelifeStyle_input').wait_send_keys(int(data["lifecycle"]))
        time.sleep(1)
        Element(self.driver, 'dataStanard', 'next_click').wait_click()
        if value == 'correct':
            Element(self.driver, 'dataStanard', 'addpar_click').wait_click()
            Element(self.driver, 'dataStanard', 'paraname1_click').wait_click()
            Element(self.driver, 'dataStanard',
                    'paraname1_inputclick').wait_send_keys(data["para1name"])
            Element(self.driver, 'dataStanard', 'paraname1_click').wait_click()
            time.sleep(1)
            Element(self.driver, 'dataStanard',
                    'paraname1_typeclick').wait_click()
            Element(self.driver, 'dataStanard',
                    'paraname1_typeselect').wait_click()
            Element(self.driver, 'dataStanard',
                    'para1desc_intputclick').wait_send_keys(data["para1desc"])
            Element(self.driver, 'dataStanard', 'paraname1_save').wait_click()
            time.sleep(1)
            Element(self.driver, 'dataStanard', 'addpar_click').wait_click()
            Element(self.driver, 'dataStanard', 'paraname2_click').wait_click()
            Element(self.driver, 'dataStanard',
                    'paraname2_inputclick').wait_send_keys(data["para2name"])
            Element(self.driver, 'dataStanard', 'paraname2_click').wait_click()
            Element(self.driver, 'dataStanard',
                    'paraname2_typeclick').wait_click()
            Element(self.driver, 'dataStanard',
                    'paraname2_typeselect').wait_click()
            Element(self.driver, 'dataStanard',
                    'para2desc_inputclick').wait_send_keys(data["para2desc"])
            Element(self.driver, 'dataStanard', 'paraname2_save').wait_click()
            time.sleep(1)
            Element(self.driver, 'dataStanard',
                    'paraname2_delete').wait_click()
            time.sleep(1)
            Element(self.driver, 'dataStanard', 'addpar_click').wait_click()
            Element(self.driver, 'dataStanard', 'paraname2_click').wait_click()
            Element(self.driver, 'dataStanard',
                    'paraname2_inputclick').wait_send_keys(data["para2name"])
            Element(self.driver, 'dataStanard', 'paraname2_click').wait_click()
            Element(self.driver, 'dataStanard',
                    'paraname2_typeclick').wait_click()
            Element(self.driver, 'dataStanard',
                    'paraname2_typeselect').wait_click()
            Element(self.driver, 'dataStanard',
                    'para2desc_inputclick').wait_send_keys(data["para2desc"])
            Element(self.driver, 'dataStanard', 'paraname2_save').wait_click()
            Element(self.driver, 'dataStanard',
                    'paraname2_editclick').wait_click()
            Element(self.driver, 'dataStanard', 'paraname2_save').wait_click()

            Element(self.driver, 'dataStanard', 'addpar_click').wait_click()
            Element(self.driver, 'dataStanard', 'paraname3_click').wait_click()
            Element(self.driver, 'dataStanard',
                    'paraname3_inputclick').wait_send_keys(data["para3name"])
            Element(self.driver, 'dataStanard', 'paraname3_click').wait_click()
            Element(self.driver, 'dataStanard',
                    'paraname3_typeclick').wait_click()
            js = "document.getElementsByClassName('ant-select-dropdown-menu  ant-select-dropdown-menu-root ant-select-dropdown-menu-vertical')[0].scrollTop=10000"
            self.driver.execute_script(js)
            time.sleep(1)
            Element(self.driver, 'dataStanard',
                    'paraname3_typeselect').wait_click()
            Element(self.driver, 'dataStanard',
                    'para3desc_inputclick').wait_send_keys(data["para3desc"])
            Element(self.driver, 'dataStanard', 'paraname3_save').wait_click()
            time.sleep(1)
            Element(self.driver, 'dataStanard', 'partition_click').wait_click()
            Element(self.driver, 'dataStanard',
                    'nopartition_click').wait_click()
            Element(self.driver, 'dataStanard', 'partition_click').wait_click()
            js = "document.getElementsByClassName('add-dataSheet')[0].scrollTop=10000"
            self.driver.execute_script(js)
            time.sleep(1)
            Element(self.driver, 'dataStanard',
                    'partition_addclick').wait_click()
            Element(self.driver, 'dataStanard',
                    'partition_para1_click').wait_click()
            Element(self.driver, 'dataStanard',
                    'partition_para1_inputclick').wait_send_keys(
                        data["partition_par1"])
            Element(self.driver, 'dataStanard',
                    'partition_para1_inputclick').wait_click()
            Element(self.driver, 'dataStanard',
                    'partition_para1_typeclick').wait_click()
            Element(self.driver, 'dataStanard',
                    'partition_para1_typeselect').wait_click()
            Element(self.driver, 'dataStanard',
                    'partition_para1desc_inputclick').wait_send_keys(
                        data["partition1_desc"])
            Element(self.driver, 'dataStanard',
                    'partition_para1desc_inputclick').wait_click()
            Element(self.driver, 'dataStanard',
                    'partition_para1_saveclick').wait_click()
            Element(self.driver, 'dataStanard',
                    'partition_addclick').wait_click()
            Element(self.driver, 'dataStanard',
                    'partition_para2_click').wait_click()
            Element(self.driver, 'dataStanard',
                    'partition_para2_inputclick').wait_send_keys(
                        data["partition_par2"])
            Element(self.driver, 'dataStanard',
                    'partition_para2_inputclick').wait_click()
            Element(self.driver, 'dataStanard',
                    'partition_para2_typeclick').wait_click()
            Element(self.driver, 'dataStanard',
                    'partition_para2_typeselect').wait_click()
            Element(self.driver, 'dataStanard',
                    'partition_para2_descClick').wait_send_keys(
                        data["partition2_desc"])
            Element(self.driver, 'dataStanard',
                    'partition_para2_saveclick').wait_click()
            Element(self.driver, 'dataStanard',
                    'partition_para2_editclick').wait_click()
            Element(self.driver, 'dataStanard',
                    'partition_para2_saveclick').wait_click()
            Element(self.driver, 'dataStanard',
                    'partition_para2_deleteclick').wait_click()
            # time.sleep(1)
            Element(self.driver, 'dataStanard',
                    'partition_addclick').wait_click()
            Element(self.driver, 'dataStanard',
                    'partition_para2_click').wait_click()
            Element(self.driver, 'dataStanard',
                    'partition_para2_inputclick').wait_send_keys(
                        data["partition_par2"])
            time.sleep(1)
            Element(self.driver, 'dataStanard',
                    'partition_para2_inputclick').wait_click()
            Element(self.driver, 'dataStanard',
                    'partition_para2_typeclick').wait_click()
            Element(self.driver, 'dataStanard',
                    'partition_para2_typeselect').wait_click()
            Element(self.driver, 'dataStanard',
                    'partition_para2_descClick').wait_send_keys(
                        data["partition2_desc"])

            Element(self.driver, 'dataStanard',
                    'partition_para2_saveclick').wait_click()
            time.sleep(1)
            Element(self.driver, 'dataStanard', 'para_pre_lick').wait_click()
            Element(self.driver, 'dataStanard', 'next_click').wait_click()
            Element(self.driver, 'dataStanard', 'para_save_click').wait_click()

            Element(self.driver, 'dataStanard',
                    'table_successclick').wait_click()
            context = Element(self.driver, 'dataStanard',
                              'table_successclick').get_attribute2()
            print('  context = :', context)
            self.assertEqual(context, data["expect_result"])

        else:
            pass
Esempio n. 16
0
    def test_guide_edit(self, data):

        print('---------{}---------'.format(data['case_name']))

        Element(self.driver, 'project', 'Projectfind_click').wait_send_keys(date + data["project_name"])
        Element(self.driver, 'project', 'Projectfind_click').send_keys(Keys.ENTER)
        time.sleep(1)
        Element(self.driver, 'project', 'enterProject_click').wait_click()
        time.sleep(1)
        Element(self.driver, 'dataStanard', 'dataStanard_click').wait_click()
        Element(self.driver, 'dataStanard', 'modelDesign_click').wait_click()
        Element(self.driver, 'dataStanard', 'tablesearch_input').wait_send_keys(data["table_name"])
        Element(self.driver, 'dataStanard', 'standard_click').wait_click()
        Element(self.driver, 'dataStanard', 'standard_chooseclick').wait_click()
        Element(self.driver, 'dataStanard', 'tableedit_searchclick').wait_click()
        Element(self.driver, 'dataStanard', 'table_edit_click').wait_click()
        Element(self.driver, 'dataStanard', 'table_nameregular_click').wait_click()
        Element(self.driver, 'dataStanard', 'table_nameregular_okclick').wait_click()
        time.sleep(1)
        Element(self.driver, 'dataStanard', 'tableedit_lifestyleclick').wait_click()
        Element(self.driver, 'dataStanard', 'tableedit_lifestyle_chooseclick').wait_click()
        Element(self.driver, 'dataStanard', 'tableedit_lifestyleclick').wait_click()
        Element(self.driver, 'dataStanard', 'tableedit_lifestyle_defineclick').wait_click()
        Element(self.driver, 'dataStanard', 'tableedit_lifestyle_defineinputclick').wait_send_keys(int(data["lifestyle"]))
        Element(self.driver, 'dataStanard', 'tableedit_addpara_click').wait_click()
        Element(self.driver, 'dataStanard', 'tableedit_addpara1_click').wait_click()
        time.sleep(1)
        Element(self.driver, 'dataStanard', 'tableedit_addpara_inputclick').wait_send_keys("para3name")
        Element(self.driver, 'dataStanard', 'tableedit_addpara1_typeclick').wait_click()
        js = "document.getElementsByClassName('ant-select-dropdown-menu  ant-select-dropdown-menu-root ant-select-dropdown-menu-vertical')[0].scrollTop=10000"

        self.driver.execute_script(js)
        time.sleep(1)
        Element(self.driver, 'dataStanard', 'tableedit_addpara1_typechooseclick').wait_click()
        Element(self.driver, 'dataStanard', 'tableedit_addpara1_saveclick').wait_click()
        Element(self.driver, 'dataStanard', 'tableedit_addpara1_editclick').wait_click()
        Element(self.driver, 'dataStanard', 'tableedit_addpara1_editsaveclick').wait_click()
        Element(self.driver, 'dataStanard', 'tableedit_addpara1_deleteclick').wait_click()
        time.sleep(1)
        Element(self.driver, 'dataStanard', 'tableedit_addpara_click').wait_click()
        Element(self.driver, 'dataStanard', 'tableedit_addpara1_click').wait_click()
        time.sleep(1)
        Element(self.driver, 'dataStanard', 'tableedit_addpara_inputclick').wait_send_keys("para3name")
        Element(self.driver, 'dataStanard', 'tableedit_addpara1_typeclick').wait_click()
        js = "document.getElementsByClassName('ant-select-dropdown-menu  ant-select-dropdown-menu-root ant-select-dropdown-menu-vertical')[0].scrollTop=10000"
        self.driver.execute_script(js)
        time.sleep(1)
        Element(self.driver, 'dataStanard', 'tableedit_addpara1_typechooseclick').wait_click()
        Element(self.driver, 'dataStanard', 'tableedit_addpara1_saveclick').wait_click()
        current_url = Element(self.driver, 'dataStanard', 'tableedit_saveclick').wait_click()
        print('current_url:',current_url)
        time.sleep(1)
        try:
            self.check_result(current_url, data['expect_url1'])
        except:
            return
Esempio n. 17
0
    def test_hdfsAdd(self, data):

        print('---------{}---------'.format(data['case_name']))

        Element(self.driver, 'project',
                'Projectfind_click').wait_send_keys(date +
                                                    data["project_name"])
        Element(self.driver, 'project',
                'Projectfind_click').send_keys(Keys.ENTER)
        time.sleep(1)
        Element(self.driver, 'project', 'enterProject_click').wait_click()
        time.sleep(1)
        Element(self.driver, 'dataAssert', 'dataAssert_click').wait_click()
        Element(self.driver, 'dataAssert', 'dataSource_click').wait_click()
        Element(self.driver, 'dataAssert', 'dataSourceadd_click').wait_click()
        js = "document.getElementsByClassName('add-dataSourde')[0].scrollTop=1000"
        self.driver.execute_script(js)
        time.sleep(2)
        Element(self.driver, 'dataAssert',
                'dataSourceaddhdfs_click').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourceadd_nextclick').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourceaddhdfspre_click').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourceadd_nextclick').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourceaddhdfname_click').wait_send_keys(
                    data["dataSource_name"] + date)
        Element(self.driver, 'dataAssert',
                'dataSourceaddhdfdesc_click').wait_send_keys(
                    date + data["dataSouce_desc"])
        Element(self.driver, 'dataAssert',
                'dataSourceaddhdfconnect_click').wait_click()
        current_url = Element(self.driver, 'dataAssert',
                              'dataSourceaddhdfsave_click').wait_click()
        time.sleep(1)

        try:
            self.check_result(current_url, data['expect_url1'])
        except:
            return
Esempio n. 18
0
    def test_httpmdtEditdeltecreate(self, data):

        print('---------{}---------'.format(data['case_name']))

        Element(self.driver, 'project',
                'Projectfind_click').wait_send_keys(date +
                                                    data["project_name"])
        Element(self.driver, 'project',
                'Projectfind_click').send_keys(Keys.ENTER)
        time.sleep(1)
        Element(self.driver, 'project', 'enterProject_click').wait_click()
        time.sleep(1)
        Element(self.driver, 'dataAssert', 'dataAssert_click').wait_click()
        Element(self.driver, 'dataAssert', 'dataSource_click').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourcefindname_click').wait_send_keys(
                    data["dataSource_name"] + date)
        Element(self.driver, 'dataAssert',
                'dataSourcedefault_find_click').wait_click()
        Element(self.driver, 'dataAssert', 'dataSourceedit_click').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourcename_click').send_keys(Keys.CONTROL, 'a')
        Element(self.driver, 'dataAssert',
                'dataSourcename_click').send_keys(Keys.BACK_SPACE)
        Element(
            self.driver, 'dataAssert',
            'dataSourcename_click').wait_send_keys(data["dataSource_name"] +
                                                   date)
        current_url = Element(self.driver, 'dataAssert',
                              'dataSourceedit_saveclick').wait_click()
        time.sleep(1)
        Element(self.driver, 'dataAssert',
                'dataSourcefindname_click').wait_send_keys(
                    data["dataSource_name"] + date)
        Element(self.driver, 'dataAssert',
                'dataSourcedefault_find_click').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourcehttpmdtdelete_click').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourcehttpmdtdelete_ok').wait_click()
        time.sleep(1)
        Element(self.driver, 'dataAssert', 'dataSourceadd_click').wait_click()
        js = "document.getElementsByClassName('add-dataSourde')[0].scrollTop=1000"
        self.driver.execute_script(js)
        Element(self.driver, 'dataAssert',
                'dataSourceaddHttpMdt_click').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourceadd_nextclick').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourceaddHttpMdtpre_click').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourceadd_nextclick').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourceaddHttpMdttname_click').wait_send_keys(
                    data["dataSource_name"] + date)
        Element(
            self.driver, 'dataAssert',
            'dataSourceaddHttpMdttopic_click').wait_send_keys(data["topic"] +
                                                              date)
        Element(self.driver, 'dataAssert',
                'dataSourceaddHttpMdttdesc_click').wait_send_keys(date +
                                                                  data["desc"])
        Element(self.driver, 'dataAssert',
                'dataSourceaddHttpMdttparaAdd_click').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourceaddHttpMdttpara1name_click').wait_send_keys(
                    data["paraname1"])
        Element(self.driver, 'dataAssert',
                'dataSourceaddopentsdbpara1type_click').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourceaddopentsdbpara1type2_select').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourceaddopentsdbdelete_click').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourceaddHttpMdttparaAdd_click').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourceaddHttpMdttpara1name_click').wait_send_keys(
                    data["paraname1"])
        Element(self.driver, 'dataAssert',
                'dataSourceaddopentsdbpara1type_click').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourceaddopentsdbpara1type2_select').wait_click()
        time.sleep(1)
        current_url = Element(self.driver, 'dataAssert',
                              'dataSourceaddHttpMdttsave_click').wait_click()
        time.sleep(1)

        try:
            self.check_result(current_url, data['expect_url1'])
        except:
            return
Esempio n. 19
0
    def test_db2Add(self, data):

        print('---------{}---------'.format(data['case_name']))

        Element(self.driver, 'project',
                'Projectfind_click').wait_send_keys(date +
                                                    data["project_name"])
        Element(self.driver, 'project',
                'Projectfind_click').send_keys(Keys.ENTER)
        time.sleep(1)
        Element(self.driver, 'project', 'enterProject_click').wait_click()
        time.sleep(1)
        Element(self.driver, 'dataAssert', 'dataAssert_click').wait_click()
        Element(self.driver, 'dataAssert', 'dataSource_click').wait_click()
        Element(self.driver, 'dataAssert', 'dataSourceadd_click').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourceaddDB2_click').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourceadd_nextclick').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourceTestConpre_click').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourceadd_nextclick').wait_click()
        Element(
            self.driver, 'dataAssert',
            'dataSourcename_click').wait_send_keys(data["dataSource_name"] +
                                                   date)
        Element(self.driver, 'dataAssert',
                'dataSourcedesc_click').wait_send_keys(date +
                                                       data["dataSouce_desc"])
        Element(self.driver, 'dataAssert',
                'dataSourceurl_click').wait_send_keys(data["dataSource_url"])
        Element(self.driver, 'dataAssert',
                'dataBase_click').wait_send_keys(data["database"])
        Element(self.driver, 'dataAssert',
                'dataSourceuser_click').wait_send_keys(data["dataSource_user"])
        Element(self.driver, 'dataAssert',
                'dataSourcepwd_click').wait_send_keys(
                    int(data["dataSource_pwd"]))
        Element(self.driver, 'dataAssert',
                'dataSourceTestCon_click').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourceTestConpre_click').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourceadd_nextclick').wait_click()
        time.sleep(3)
        current_url = Element(self.driver, 'dataAssert',
                              'dataSourceSave_click').wait_click()
        time.sleep(1)

        try:
            self.check_result(current_url, data['expect_url1'])
        except:
            return
Esempio n. 20
0
    def test_mqttAdd(self, data):

        print('---------{}---------'.format(data['case_name']))

        Element(self.driver, 'project',
                'Projectfind_click').wait_send_keys(date +
                                                    data["project_name"])
        Element(self.driver, 'project',
                'Projectfind_click').send_keys(Keys.ENTER)
        time.sleep(1)
        Element(self.driver, 'project', 'enterProject_click').wait_click()
        time.sleep(1)
        Element(self.driver, 'dataAssert', 'dataAssert_click').wait_click()
        Element(self.driver, 'dataAssert', 'dataSource_click').wait_click()
        Element(self.driver, 'dataAssert', 'dataSourceadd_click').wait_click()
        js = "document.getElementsByClassName('add-dataSourde')[0].scrollTop=1000"
        self.driver.execute_script(js)
        Element(self.driver, 'dataAssert',
                'dataSourceaddmqtt_click').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourceadd_nextclick').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourceaddmqttpre_click').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourceadd_nextclick').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourceaddmqttname_click').wait_send_keys(
                    data["dataSource_name"] + date)
        Element(self.driver, 'dataAssert',
                'dataSourceaddmqtttopic_click').wait_send_keys(data["topic"] +
                                                               date)
        Element(self.driver, 'dataAssert',
                'dataSourceaddmqttdesc_click').wait_send_keys(date +
                                                              data["desc"])
        Element(self.driver, 'dataAssert',
                'dataSourceaddmqttpermiss_click').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourceaddmqttpermisssubscription_select').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourceaddmqttadd_click').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourceaddmqttpara1name_click').wait_send_keys(
                    data["paraname1"])
        Element(self.driver, 'dataAssert',
                'dataSourceaddmqttpara1type_click').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourceaddmqttpara1type_select').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourceaddmqttpara1desc_click').wait_send_keys(
                    data["para_desc"])
        Element(self.driver, 'dataAssert',
                'dataSourceaddmqttpara1delete_click').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourceaddmqttadd_click').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourceaddmqttpara1name_click').wait_send_keys(
                    data["paraname1"])
        Element(self.driver, 'dataAssert',
                'dataSourceaddmqttpara1type_click').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourceaddmqttpara1type_select').wait_click()
        Element(self.driver, 'dataAssert',
                'dataSourceaddmqttpara1desc_click').wait_send_keys(
                    data["para_desc"])
        time.sleep(1)
        current_url = Element(self.driver, 'dataAssert',
                              'dataSourceaddmqttsave_click').wait_click()
        time.sleep(1)
        try:
            self.check_result(current_url, data['expect_url1'])
        except:
            return
Esempio n. 21
0
    def test_UserEdit(self, data):

        print('---------{}---------'.format(data['case_name']))
        global s, str1

        Element(self.driver, 'systemManager',
                'systemManager_click').wait_click()
        Element(self.driver, 'systemManager', 'usermanager_click').wait_click()
        Element(self.driver, 'systemManager',
                'account_click').wait_send_keys(date + data["username2"])
        time.sleep(1)
        Element(self.driver, 'systemManager',
                'usernamecheck_click').wait_click()
        Element(self.driver, 'systemManager',
                "usernamecheckcancel_click").wait_click()
        time.sleep(1)
        Element(self.driver, 'systemManager',
                'usernameEdit_click').wait_click()
        Element(self.driver, 'systemManager',
                'email_click').send_keys(Keys.CONTROL, 'a')
        Element(self.driver, 'systemManager',
                'email_click').send_keys(Keys.BACK_SPACE)
        Element(self.driver, 'systemManager',
                'email_click').wait_send_keys(date + data["email"])
        time.sleep(1)
        Element(self.driver, 'systemManager',
                'phone_click').send_keys(Keys.CONTROL, 'a')
        Element(self.driver, 'systemManager',
                'phone_click').send_keys(Keys.BACK_SPACE)
        Element(self.driver, 'systemManager',
                'phone_click').wait_send_keys(str(int(data["phone"])) + date)
        time.sleep(1)
        Element(self.driver, 'systemManager',
                'name_click').send_keys(Keys.CONTROL, 'a')
        Element(self.driver, 'systemManager',
                'name_click').send_keys(Keys.BACK_SPACE)
        Element(self.driver, 'systemManager',
                'name_click').wait_send_keys(data["name"])
        time.sleep(1)
        Element(self.driver, 'systemManager',
                'usernameEditcancel_click').wait_click()
        time.sleep(1)
        Element(self.driver, 'systemManager',
                'usernameEdit_click').wait_click()
        Element(self.driver, 'systemManager',
                'email_click').send_keys(Keys.CONTROL, 'a')
        Element(self.driver, 'systemManager',
                'email_click').send_keys(Keys.BACK_SPACE)
        Element(self.driver, 'systemManager',
                'email_click').wait_send_keys(date + data["email"])
        time.sleep(1)
        Element(self.driver, 'systemManager',
                'phone_click').send_keys(Keys.CONTROL, 'a')
        Element(self.driver, 'systemManager',
                'phone_click').send_keys(Keys.BACK_SPACE)
        Element(self.driver, 'systemManager',
                'phone_click').wait_send_keys(str(int(data["phone"])) + date)
        time.sleep(1)
        Element(self.driver, 'systemManager',
                'name_click').send_keys(Keys.CONTROL, 'a')
        Element(self.driver, 'systemManager',
                'name_click').send_keys(Keys.BACK_SPACE)
        Element(self.driver, 'systemManager',
                'name_click').wait_send_keys(data["name"])
        time.sleep(1)
        Element(self.driver, 'systemManager',
                'usernameEditok_click').wait_click()
        time.sleep(1)
        Element(self.driver, 'systemManager',
                'usernameModifyPassword_click').wait_click()
        Element(self.driver, 'systemManager',
                'password_click').wait_send_keys(data["password2"])
        time.sleep(1)
        Element(self.driver, 'systemManager',
                'usernameModifyPasswordconfirm_click').wait_send_keys(
                    data["confirmPassword"])
        time.sleep(1)
        Element(self.driver, 'systemManager',
                'usernameModifyPasswordcancel_click').wait_click()
        Element(self.driver, 'systemManager',
                'usernameModifyPasswordcancel_click').wait_not_click()
        Element(self.driver, 'systemManager',
                'usernameModifyPassword_click').wait_click()
        Element(self.driver, 'systemManager',
                'password_click').wait_send_keys(data["password"])
        time.sleep(1)
        Element(self.driver, 'systemManager',
                'usernameModifyPasswordconfirm_click').wait_send_keys(
                    data["confirmPassword"])
        time.sleep(1)
        Element(self.driver, 'systemManager',
                'usernameModifyPasswordok_click').wait_click()
        time.sleep(1)
        content = Element(self.driver, 'systemManager',
                          'total_click').get_text_value()

        self.check_result(content)
Esempio n. 22
0
    def test_UserAdd(self, data):

        print('---------{}---------'.format(data['case_name']))

        Element(self.driver, 'systemManager',
                'systemManager_click').wait_click()
        Element(self.driver, 'systemManager', 'usermanager_click').wait_click()
        time.sleep(1)
        Element(self.driver, 'systemManager', 'userAdd_click').wait_click()
        time.sleep(2)
        Element(self.driver, 'systemManager',
                'userName_click').wait_send_keys(date + data["username2"])
        time.sleep(1)
        Element(self.driver, 'systemManager',
                'password_click').wait_send_keys(data["password2"])
        time.sleep(1)
        Element(self.driver, 'systemManager',
                'confirmPassword_click').wait_send_keys(
                    data["confirmPassword"])
        time.sleep(1)
        Element(self.driver, 'systemManager',
                'email_click').wait_send_keys(date + data["email"])
        time.sleep(1)

        Element(self.driver, 'systemManager',
                'phone_click').wait_send_keys(str(int(data["phone"])) + date)
        time.sleep(1)
        Element(self.driver, 'systemManager',
                'name_click').wait_send_keys(data["name"])
        time.sleep(1)
        Element(self.driver, 'systemManager',
                'department_click').wait_send_keys(data["partment"])
        time.sleep(1)
        Element(self.driver, 'systemManager',
                'position_click').wait_send_keys(data["position"])
        time.sleep(1)
        Element(self.driver, 'systemManager', 'open_click').wait_click()
        time.sleep(1)
        Element(self.driver, 'systemManager', 'open_click').wait_click()
        time.sleep(1)
        Element(self.driver, 'systemManager', 'cancel_click').wait_click()
        time.sleep(1)
        Element(self.driver, 'systemManager', 'userAdd_click').wait_click()
        Element(self.driver, 'systemManager',
                'userName_click').wait_send_keys(date + data["username2"])
        time.sleep(1)
        Element(self.driver, 'systemManager',
                'password_click').wait_send_keys(data["password2"])
        time.sleep(1)
        Element(self.driver, 'systemManager',
                'confirmPassword_click').wait_send_keys(
                    data["confirmPassword"])
        time.sleep(1)
        Element(self.driver, 'systemManager',
                'email_click').wait_send_keys(date + data["email"])
        time.sleep(1)

        Element(self.driver, 'systemManager',
                'phone_click').wait_send_keys(str(int(data["phone"])) + date)
        time.sleep(1)
        Element(self.driver, 'systemManager',
                'name_click').wait_send_keys(data["name"])
        time.sleep(1)
        Element(self.driver, 'systemManager',
                'department_click').wait_send_keys(data["partment"])
        time.sleep(1)
        Element(self.driver, 'systemManager',
                'position_click').wait_send_keys(data["position"])
        time.sleep(1)
        Element(self.driver, 'systemManager', 'open_click').wait_click()
        Element(self.driver, 'systemManager', 'save_click').wait_click()
        try:
            Element(self.driver, 'systemManager',
                    'save_click').wait_not_click()
        except:
            Element(self.driver, 'systemManager', 'cancel_click').wait_click()

        time.sleep(1)
        Element(self.driver, 'systemManager',
                'account_click').wait_send_keys(date + data["username2"])
        time.sleep(1)
        content = Element(self.driver, 'systemManager',
                          'total_click').get_text_value()
        print('content:', content)

        self.check_result(content)