diff options
| -rw-r--r-- | cases/object/test_accounts.py | 15 | ||||
| -rw-r--r-- | common/ui_common/objects/fqdns.py | 17 | ||||
| -rw-r--r-- | common/ui_common/objects/ip_address.py | 70 | ||||
| -rw-r--r-- | common/ui_common/objects/keywords.py | 41 | ||||
| -rw-r--r-- | common/ui_common/objects/moible_identities.py | 38 | ||||
| -rw-r--r-- | common/ui_common/objects/objects_public_operations.py | 23 | ||||
| -rw-r--r-- | common/ui_common/objects/subscriber_ids.py | 25 | ||||
| -rw-r--r-- | page_element/objects_element_position.py | 65 | ||||
| -rw-r--r-- | testdata/ui_file/objects/import_file/Keywords_error_format.txt | 2 |
9 files changed, 137 insertions, 159 deletions
diff --git a/cases/object/test_accounts.py b/cases/object/test_accounts.py index 13a12845..570924dd 100644 --- a/cases/object/test_accounts.py +++ b/cases/object/test_accounts.py @@ -356,21 +356,6 @@ class TestAccounts: @pytest.mark.parametrize("data", [ { - "ids": "创建或修改时,点击Cancel按钮,代表此数据未创建或修改成功,Audit Logs中无相关操作日志-T058 ", - "Model": "create", - "Type": 0, - "Name": "", - "Search type": "", - "Items": [ - "accounts_single_item导入文件.txt[ImportFromFile]" - ] - } - ]) - def test_dataNotSaved_afterCancel(self, data): - pass - - @pytest.mark.parametrize("data", [ - { "ids": "创建Group,引用子对象,可以选择Exclude或Include-T063 ", "Model": "create", "Type": 1, diff --git a/common/ui_common/objects/fqdns.py b/common/ui_common/objects/fqdns.py index 6a818b50..60980501 100644 --- a/common/ui_common/objects/fqdns.py +++ b/common/ui_common/objects/fqdns.py @@ -384,7 +384,7 @@ class FQDNs: self.driver.isElementExist(Element=main_ObjectPage_import_files_error_type_posXpath) if self.driver.Exist: self.item_error = self.driver.find_element(By.XPATH,main_ObjectPage_import_files_error_type_posXpath).text - assert self.item_error =="Items cannot be empty","断言item为空" + assert self.item_error =="Please add at least one item","断言item为空" @screenshot_on_failure def _create(self,data:{}): self.loading_parameter(data) @@ -524,19 +524,19 @@ class FQDNs: item_datas = f.readlines() #读取所有行 item_data = item_datas[random.randint(0,len(item_datas)) - 2].strip() # Total校验 - total = self.driver.find_element(By.XPATH,"//div[@class='item-container']//div[contains(text(),'Total')]").text - count = total.split("Total:") + total = self.driver.find_element(By.XPATH,main_first_Item_count_posXpath).text + # count = total.split("Total:") total_files_num = len(set(item_datas)) - self.objects_po.invalid_format_num if total_files_num > 30: total_files_num = 30 - assert total_files_num == int(count[1]) + assert total_files_num == int(total) #item搜索校验 if '*' in item_data: item_data = item_data.strip('*') elif '$' in item_data: item_data = item_data.strip('$') self.driver.find_element(By.XPATH,mainPage_ObjectSearch_buttonSearch_Item_posXpath).send_keys(item_data + Keys.ENTER) - self.item_check_content = self.driver.find_element(By.XPATH,"//div[@class='item-box']//span/span").text + self.item_check_content = self.driver.find_element(By.XPATH,mobileIdentitiesObjectPage_content_inputItem1_posId).text assert item_data in self.item_check_content, "断言检查item文本正确" @@ -1618,13 +1618,12 @@ if __name__ == '__main__': # model=0/1 ====0:单个 1group # type =IMSI/Phone_Number/IMEI data= { - "ids": "用例3:FQDNs添加item", - "Name": "test-1", + "ids": "用例24:FQDN的item为空校验", + "Name": "test", "Create": { "model": "0", "type": "new_object", - "item": ["^example.com$"], - "item_modify": {"type": "add", "add_data": ["com$"]} + "item": "null" }, "Createtype": "FQDN", "Subtype": "", diff --git a/common/ui_common/objects/ip_address.py b/common/ui_common/objects/ip_address.py index a7a108b6..5908d4fd 100644 --- a/common/ui_common/objects/ip_address.py +++ b/common/ui_common/objects/ip_address.py @@ -87,7 +87,7 @@ class IPAddress: self.driver.find_element(By.XPATH, ip_address_statistics_select_posXpath).click() self.driver.find_element(By.XPATH, acc_ObjectDetailPage_objectStatistics_elaborate_posXpath).click() self.driver.find_element(By.XPATH, ip_addressObjectPage_button_OK_posXpath).click() - self.driver.find_element(By.XPATH, ip_addressObjectPage_button_warningSaveYes_posXpath).click() + # self.driver.find_element(By.XPATH, ip_addressObjectPage_button_warningSaveYes_posXpath).click() self.objects_po.View_statistics(edit_element=listPage_object_ip_address_editButton_posXpath) self._delete(data) @@ -261,7 +261,7 @@ class IPAddress: self.driver.find_element(By.XPATH,main_ObjectPage_Import_Mobile_Identity_files_OK_Button_posXpath).click() # 确认创建 self.driver.find_element(By.XPATH, ip_addressObjectPage_button_OK_posXpath).click() - self.driver.find_element(By.XPATH, ip_addressObjectPage_button_warningSaveYes_posXpath).click() + # self.driver.find_element(By.XPATH, ip_addressObjectPage_button_warningSaveYes_posXpath).click() elif data['Create']['files_type'] == "error_format": data['Create']['model'] = "2" assert self.driver.find_element(By.XPATH, @@ -319,7 +319,7 @@ class IPAddress: elif self.modify_status =="1": # 确认创建 self.driver.find_element(By.XPATH, ip_addressObjectPage_button_OK_posXpath).click() - self.driver.find_element(By.XPATH, ip_addressObjectPage_button_warningSaveYes_posXpath).click() + # self.driver.find_element(By.XPATH, ip_addressObjectPage_button_warningSaveYes_posXpath).click() # try: # self.driver.isElementExist(Element=ip_addressObjectPage_button_warningSaveYes_posXpath) # if self.driver.Exist: @@ -664,15 +664,15 @@ class IPAddress: item_datas = f.readlines() #读取所有行 item_data = item_datas[random.randint(0,len(item_datas)) - 2].strip() # Total校验 - total = self.driver.find_element(By.XPATH,"//div[@class='item-container']//div[contains(text(),'Total')]").text - count = total.split("Total:") + total = self.driver.find_element(By.XPATH,main_first_Item_count_posXpath).text + # count = total.split("Total:") total_files_num = len(set(item_datas)) - self.objects_po.invalid_format_num if total_files_num >30: total_files_num =30 - assert total_files_num == int(count[1]) + assert total_files_num == int(total) #item搜索校验 self.driver.find_element(By.XPATH, mainPage_ObjectSearch_buttonSearch_Item_posXpath).send_keys(item_data + Keys.ENTER) - self.item_check_content = self.driver.find_element(By.XPATH,ip_addressObjectPage_button_addItem_first_item_posXpath).text + self.item_check_content = self.driver.find_element(By.XPATH,mobileIdentitiesObjectPage_content_inputItem1_posId).text assert self.item_check_content == item_data, "断言检查item文本正确" @@ -699,7 +699,7 @@ class IPAddress: self.driver.find_element(By.XPATH,main_listPage_object_select_Second_object_posXpath).click() self.driver.isElementExist(Element=listPage_object_ip_address_delButton_disable_posXpath) assert self.driver.Exist,"断言删除按钮状态为置灰状态" - self.driver.find_element(By.XPATH, main_listPage_object_select_Second_object_posXpath).click() + # self.driver.find_element(By.XPATH, main_listPage_object_select_Second_object_posXpath).click() self.quote_count = self.driver.find_element(By.XPATH,list_quote_content_object_HTTP_Signatures_posXpath).text # 3、提取引用个数 4、点击引用框,断言第一行存在引用,第二行不存在引用 assert int(self.quote_count) == 1,"断言引用计数为1" @@ -708,13 +708,13 @@ class IPAddress: assert self.driver.Exist,"断言第一行引用计数存在" self.driver.isElementExist(Element=list_quote_second_row_object_HTTP_Signatures_posXpath) assert self.driver.Exist ==False ,"断言第二行引用不存在" - self.driver.find_element(By.XPATH,"//div[@class='el-dropdown-menu__item el-row']").click() - self.driver.find_element(By.XPATH,"//button[@id='objectEdit_slider']").click() + self.driver.find_element(By.XPATH,list_quote_first_row_object_HTTP_Signatures_posXpath).click() + self.driver.find_element(By.XPATH,list_quote_object_Edit_posXpath).click() self.driver.find_element(By.XPATH,ip_addressObjectPage_button_cancel_posCss).click() for i in range(4): time.sleep(1) - self.driver.find_element(By.XPATH,listPage_object_ip_address_select_First_object_posXpath).click() # 选择第一个对象 + self.driver.find_element(By.XPATH, listPage_object_ip_address_select_First_object_posXpath).click() # 选择第一个对象 self.driver.find_element(By.XPATH, listPage_object_ip_address_delButton_posXpath).click() self.driver.find_element(By.XPATH, listPage_object_ip_address_del_yes_Button_posXpath).click() elif data['Subtype'] == "export_files": @@ -1301,7 +1301,7 @@ class IPAddress: self.driver.find_element(By.XPATH, ip_addressObjectPage_button_inputItem_posXpath).send_keys(data["modify_sou_item"]) self.driver.find_element(By.XPATH, ip_addressObjectPage_button_Save_Item_posXpath).click() self.driver.find_element(By.XPATH, ip_addressObjectPage_button_SaveYes_posXpath).click() - self.driver.find_element(By.XPATH, ip_addressObjectPage_button_warningSaveYes_posXpath).click() + # self.driver.find_element(By.XPATH, ip_addressObjectPage_button_warningSaveYes_posXpath).click() self.driver.find_element(By.XPATH, ip_addressObjectPage_button_OK_posXpath).click() self.driver.find_element(By.XPATH, ip_address_ObjectDetailPage_okButton_yes_posXpath).click() self._goto_subObjectPage() @@ -1383,7 +1383,7 @@ class IPAddress: self.driver.find_element(By.XPATH, ip_addressObjectPage_button_inputItem_posXpath).send_keys(data["modify_des_item"]) self.driver.find_element(By.XPATH, ip_addressObjectPage_button_Save_Item_posXpath).click() self.driver.find_element(By.XPATH, ip_addressObjectPage_button_SaveYes_posXpath).click() - self.driver.find_element(By.XPATH, ip_addressObjectPage_button_warningSaveYes_posXpath).click() + # self.driver.find_element(By.XPATH, ip_addressObjectPage_button_warningSaveYes_posXpath).click() self.driver.find_element(By.XPATH, ip_addressObjectPage_button_OK_posXpath).click() self.driver.find_element(By.XPATH, ip_address_ObjectDetailPage_okButton_yes_posXpath).click() # 调用公用的sync点击逻辑 @@ -1569,12 +1569,12 @@ class IPAddress: self.loading_parameter(data) self._sub_ip_address_create(data) self.driver.find_element(By.XPATH, ip_addressObjectPage_button_SaveYes_posXpath).click() - self.driver.find_element(By.XPATH, ip_addressObjectPage_button_warningSaveYes_posXpath).click() + # self.driver.find_element(By.XPATH, ip_addressObjectPage_button_warningSaveYes_posXpath).click() self.driver.find_element(By.XPATH, ip_object_group_subobject_close_posXpath).click() self.driver.find_element(By.XPATH, listPage_object_group_exclude_open_posXpath).click() time.sleep(2) self.driver.find_element(By.XPATH, ip_addressObjectPage_button_OK_posXpath).click() - self.driver.find_element(By.XPATH, ip_addressObjectPage_button_warningSaveYes_posXpath).click() + # self.driver.find_element(By.XPATH, ip_addressObjectPage_button_warningSaveYes_posXpath).click() assert self.driver.find_element(By.XPATH,"//div[@role='alert']//p").text == "When enabling excluded objects, there must be at least one valid piece of data" self.driver.find_element(By.XPATH,ip_addressObjectPage_button_cancel_posCss).click() self.driver.find_element(By.XPATH, asn_ObjectDetailPage_leaveThisPage_yesButton_posXpath).click() @@ -1586,12 +1586,12 @@ class IPAddress: self.driver.find_element(By.XPATH, listPage_object_group_subobject_fist_posXpath).click() self.driver.find_element(By.XPATH, ip_object_group_subobject_close_posXpath).click() self.driver.find_element(By.XPATH, ip_addressObjectPage_button_OK_posXpath).click() - self.driver.find_element(By.XPATH, ip_addressObjectPage_button_warningSaveYes_posXpath).click() + # self.driver.find_element(By.XPATH, ip_addressObjectPage_button_warningSaveYes_posXpath).click() assert self.driver.find_element(By.XPATH,"//div[@role='alert']//p").text == "Subordinate objects of an object cannot contain only excluded objects" elif data["Subtype"] == "2": self.driver.find_element(By.XPATH, listPage_object_group_exclude_open_posXpath).click() self.driver.find_element(By.XPATH, ip_addressObjectPage_button_OK_posXpath).click() - self.driver.find_element(By.XPATH, ip_addressObjectPage_button_warningSaveYes_posXpath).click() + # self.driver.find_element(By.XPATH, ip_addressObjectPage_button_warningSaveYes_posXpath).click() assert self.driver.find_element(By.XPATH,"//div[@role='alert']//p").text == "Subordinate objects of an object cannot be null" elif data["Subtype"] == "3": # self.driver.find_element(By.XPATH, ip_address_Group_sub_Object_addButton_posXpath).click() # 添加sub_Object @@ -1601,7 +1601,7 @@ class IPAddress: sub_object_name.append(self.random_number) self._sub_ip_address_create(data) self.driver.find_element(By.XPATH, ip_addressObjectPage_button_SaveYes_posXpath).click() - self.driver.find_element(By.XPATH, ip_addressObjectPage_button_warningSaveYes_posXpath).click() + # self.driver.find_element(By.XPATH, ip_addressObjectPage_button_warningSaveYes_posXpath).click() self.driver.find_element(By.XPATH, ip_object_group_subobject_close_posXpath).click() self.driver.find_element(By.XPATH, listPage_object_group_exclude_open_posXpath).click() # self.driver.find_element(By.XPATH, "(" + ip_address_Group_sub_Object_addButton_posXpath + ")" + f"[{2}]").click() @@ -1724,8 +1724,7 @@ class IPAddress: assert self.driver.find_element(By.XPATH,groupObjectDetailPage_addSubObjecDrawer_totalText_posXpath).get_attribute("innerHTML") == "Total:0" # 正确校验 self.driver.find_element(By.XPATH, groupObjectDetailPage_addSubObjecDrawer_searchInput_posXpath).clear() - self.driver.find_element(By.XPATH, groupObjectDetailPage_addSubObjecDrawer_searchInput_posXpath).send_keys( - search_value + Keys.ENTER) + self.driver.find_element(By.XPATH, groupObjectDetailPage_addSubObjecDrawer_searchInput_posXpath).send_keys(search_value + Keys.ENTER) # resulte_text = self.driver.find_element(By.XPATH,"//div[@class='IpItems list-box']//ul[@class='row-container tableList']/li[1]/div").text # 等待查询结果加载 item_result_pos = groupObjectDetailPage_addSubObjecDrawer_firstSubObject_posXpath @@ -1798,7 +1797,7 @@ if __name__ == '__main__': command_executor="http://192.168.39.77:4444", options=chrome_option ) - a.get("http://192.168.45.158/policies/security-rules?vsys=1&t=1729131281875") + a.get("http://192.168.45.158") a.maximize_window() a.find_element(By.XPATH, '//*[@id="root"]/div/div[2]/div/div[1]/input').send_keys("admin") a.find_element(By.XPATH, '//*[@id="root"]/div/div[2]/div/div[2]/input').send_keys("admin") @@ -1807,21 +1806,20 @@ if __name__ == '__main__': # model=0/1 ====0:单个 1group # type =IMSI/Phone_Number/IMEI data={ - "ids": "用例32、Name的部分值搜索", - "Name": "random", - "Create": { - "model": "0", - "type": "new_object", - "item": [ - "1.1.1.1", - "1.1.1.1-1.1.1.1", - "1:1:1::1-2:2:2::2", - "94E5:E27A::6041" - ] - }, - "Createtype": "IP", - "Subtype": "", - "Search_type": "fuzzy->Name" + "ids": "用例6、IP_Group的增删改查", + "Name": "test-1", + "Create": { + "model": "1", + "type": "new_object", + "item": [ + "1.1.1.1", + "1.1.1.1-1.1.1.1", + "1:1:1::1" + ] + }, + "Createtype": "IP", + "Subtype": "Five_layer", + "Search_type": "Name" } # r._clear_counter(data) r.ip_address_case(data) diff --git a/common/ui_common/objects/keywords.py b/common/ui_common/objects/keywords.py index 5e019a9f..e157eb89 100644 --- a/common/ui_common/objects/keywords.py +++ b/common/ui_common/objects/keywords.py @@ -419,12 +419,12 @@ class Keywords: item_datas = f.readlines() #读取所有行 item_data = item_datas[random.randint(0,len(item_datas)) - 2].strip() # Total校验 - total = self.driver.find_element(By.XPATH,"//div[@class='item-container']//div[contains(text(),'Total')]").text - count = total.split("Total:") + total = self.driver.find_element(By.XPATH,main_first_Item_count_posXpath).text + # count = total.split("Total:") total_files_num = len(set(item_datas)) - self.objects_po.invalid_format_num if total_files_num > 30: total_files_num = 30 - assert total_files_num == int(count[1]) + assert total_files_num == int(total) if '*' in item_data: item_data = item_data.strip('*') elif '$' in item_data: @@ -432,7 +432,7 @@ class Keywords: # item搜索校验 self.driver.find_element(By.XPATH,mainPage_ObjectSearch_buttonSearch_Item_posXpath).send_keys(item_data + Keys.ENTER) #获取key - self.item_check_content = self.driver.find_element(By.XPATH,"//div[@class='item-box']/div/div[1]/span").text + self.item_check_content = self.driver.find_element(By.XPATH,mobileIdentitiesObjectPage_content_inputItem1_posId).text assert item_data in self.item_check_content, "断言检查item文本正确" @@ -530,26 +530,26 @@ class Keywords: if "sub_name" not in data['Create'].keys(): # 确认创建sub_new_fqdns self.driver.find_element(By.XPATH, Keywords_Group_sub_Object_add_new_one_OK1_Button_posXpath).click() - self.driver.find_element(By.XPATH, Keywords_Group_sub_Object_add_new_one_OK1_Warning_Yes_Button_posXpath).click() + # self.driver.find_element(By.XPATH, Keywords_Group_sub_Object_add_new_one_OK1_Warning_Yes_Button_posXpath).click() # 确认创建 self.driver.find_element(By.XPATH, KeywordsObjectPage_button_SaveYes_posXpath).click() - try: - self.driver.isElementExist(Element=KeywordsObjectPage_button_warningSaveYes_posXpath) - if self.driver.Exist: - self.driver.find_element(By.XPATH, KeywordsObjectPage_button_warningSaveYes_posXpath).click() - except: - pass + # try: + # self.driver.isElementExist(Element=KeywordsObjectPage_button_warningSaveYes_posXpath) + # if self.driver.Exist: + # self.driver.find_element(By.XPATH, KeywordsObjectPage_button_warningSaveYes_posXpath).click() + # except: + # pass # time.sleep(2) # self.objects_po.extract_ele() elif "sub_name" in data['Create'].keys(): # 确认创建 self.driver.find_element(By.XPATH, KeywordsObjectPage_button_SaveYes_posXpath).click() - try: - self.driver.isElementExist(Element=KeywordsObjectPage_button_warningSaveYes_posXpath) - if self.driver.Exist: - self.driver.find_element(By.XPATH, KeywordsObjectPage_button_warningSaveYes_posXpath).click() - except: - pass + # try: + # self.driver.isElementExist(Element=KeywordsObjectPage_button_warningSaveYes_posXpath) + # if self.driver.Exist: + # self.driver.find_element(By.XPATH, KeywordsObjectPage_button_warningSaveYes_posXpath).click() + # except: + # pass # time.sleep(2) # self.objects_po.extract_ele() elif data['Create']['model'] == "2": @@ -861,7 +861,7 @@ class Keywords: data["modify_sou_item"]) self.driver.find_element(By.XPATH, KeywordsObjectPage_button_Save_Item_posXpath).click() self.driver.find_element(By.XPATH, Keywords_Group_sub_Object_add_new_one_OK1_Button_posXpath).click() - self.driver.find_element(By.XPATH, Keywords_Group_sub_Object_add_new_one_OK1_Warning_Yes_Button_posXpath).click() + # self.driver.find_element(By.XPATH, Keywords_Group_sub_Object_add_new_one_OK1_Warning_Yes_Button_posXpath).click() self.driver.find_element(By.XPATH, keywords_ObjectPage_button_OK_posXpath).click() self.driver.find_element(By.XPATH, ObjectDetailPage_okButton_yes_posXpath).click() self._goto_subObjectPage() @@ -946,8 +946,7 @@ class Keywords: data["modify_des_item"]) self.driver.find_element(By.XPATH, KeywordsObjectPage_button_Save_Item_posXpath).click() self.driver.find_element(By.XPATH, Keywords_Group_sub_Object_add_new_one_OK1_Button_posXpath).click() - self.driver.find_element(By.XPATH, - Keywords_Group_sub_Object_add_new_one_OK1_Warning_Yes_Button_posXpath).click() + # self.driver.find_element(By.XPATH,Keywords_Group_sub_Object_add_new_one_OK1_Warning_Yes_Button_posXpath).click() self.driver.find_element(By.XPATH, keywords_ObjectPage_button_OK_posXpath).click() self.driver.find_element(By.XPATH, ObjectDetailPage_okButton_yes_posXpath).click() # 调用公用的sync点击逻辑 @@ -1156,7 +1155,7 @@ class Keywords: sub_object_name.append(self.random_number) self.Keywords_create_object_group(data) self.driver.find_element(By.XPATH, Keywords_Group_sub_Object_add_new_one_OK1_Button_posXpath).click() - self.driver.find_element(By.XPATH,Keywords_Group_sub_Object_add_new_one_OK1_Warning_Yes_Button_posXpath).click() + # self.driver.find_element(By.XPATH,Keywords_Group_sub_Object_add_new_one_OK1_Warning_Yes_Button_posXpath).click() self.driver.find_element(By.XPATH, ip_object_group_subobject_close_posXpath).click() self.driver.find_element(By.XPATH, Keywords_Group_sub_Object_exclude_open_posXpath).click() # self.driver.find_element(By.XPATH, "(" + ip_address_Group_sub_Object_addButton_posXpath + ")" + f"[{2}]").click() diff --git a/common/ui_common/objects/moible_identities.py b/common/ui_common/objects/moible_identities.py index 2a642b0c..4feabbf7 100644 --- a/common/ui_common/objects/moible_identities.py +++ b/common/ui_common/objects/moible_identities.py @@ -161,7 +161,7 @@ class mobile_identiities: self.driver.find_element(By.XPATH, ip_address_statistics_select_posXpath).click() self.driver.find_element(By.XPATH,"//div[@x-placement='bottom-start']//div[text()='Elaborate']").click() self.driver.find_element(By.XPATH, mobileIdentitiesObjectPage_button_SaveYes_posXpath).click() - self.driver.find_element(By.XPATH, mobileIdentitiesObjectPage_button_warningSaveYes_posXpath).click() + # self.driver.find_element(By.XPATH, mobileIdentitiesObjectPage_button_warningSaveYes_posXpath).click() self.objects_po.View_statistics(edit_element=listPage_object_mobileIdentities_editButton_posXpath) self._delete(data) @@ -556,7 +556,7 @@ class mobile_identiities: self.driver.find_element(By.XPATH, mobileIdentitiesObjectPage_input_Name_posXpath).send_keys(self.objects_po.modify_name) # 确认创建 self.driver.find_element(By.XPATH, mobileIdentitiesObjectPage_button_SaveYes_posXpath).click() - self.driver.find_element(By.XPATH, mobileIdentitiesObjectPage_button_warningSaveYes_posXpath).click() + # self.driver.find_element(By.XPATH, mobileIdentitiesObjectPage_button_warningSaveYes_posXpath).click() time.sleep(3) self.objects_po.assert_ele() self.assert_ex_details(data) @@ -569,7 +569,7 @@ class mobile_identiities: if data["item_modify"]["type"] == "add": # 添加item self.add_item = data["item_modify"]["add_data"] - self.assert_item_count = self.driver.find_element(By.XPATH,mobileIdentitiesObjectPage_IMSI_button_Edit_assert_first_Item_count_posXpath).text + self.assert_item_count = self.driver.find_element(By.XPATH,main_first_Item_count_posXpath).text for item in self.add_item: self.driver.find_element(By.XPATH, mobileIdentitiesObjectPage_button_addItem_posXpath).click() if data["Createtype"]== "Phone_Number": @@ -582,10 +582,10 @@ class mobile_identiities: # 断言item是否添加成功,只能断言添加一个item,多个item未补充 assert str(self.assert_item_content) == self.add_item[0],"校验添加item是否添加成功======Total" - assert self.objects_po._split_assert(assert_content=self.assert_item_count) == self.driver.find_element(By.XPATH,mobileIdentitiesObjectPage_IMSI_button_Edit_assert_first_Item_count_posXpath).text + assert str(int(self.assert_item_content) + 1) == self.driver.find_element(By.XPATH,main_first_Item_count_posXpath).text # 确认创建 self.driver.find_element(By.XPATH, mobileIdentitiesObjectPage_button_SaveYes_posXpath).click() - self.driver.find_element(By.XPATH, mobileIdentitiesObjectPage_button_warningSaveYes_posXpath).click() + # self.driver.find_element(By.XPATH, mobileIdentitiesObjectPage_button_warningSaveYes_posXpath).click() elif data["item_modify"]["type"] == "check": self.assert_text1 = data["item_modify"]["check_data"] self.driver.find_element(By.XPATH,mainPage_ObjectSearch_buttonSearch_Item_posXpath).send_keys(self.assert_text1+Keys.ENTER) @@ -981,25 +981,25 @@ class mobile_identiities: # 保存Object # 确认创建 self.driver.find_element(By.XPATH, mobileIdentitiesObjectPage_button_SaveYes_posXpath).click() - self.driver.find_element(By.XPATH, mobileIdentitiesObjectPage_button_warningSaveYes_posXpath).click() + # self.driver.find_element(By.XPATH, mobileIdentitiesObjectPage_button_warningSaveYes_posXpath).click() time.sleep(3) self.objects_po.extract_ele() # self.ex_details(data) elif "sub_name" in data['Create'].keys(): # 确认创建 self.driver.find_element(By.XPATH, mobileIdentitiesObjectPage_button_SaveYes_posXpath).click() - self.driver.find_element(By.XPATH, mobileIdentitiesObjectPage_button_warningSaveYes_posXpath).click() + # self.driver.find_element(By.XPATH, mobileIdentitiesObjectPage_button_warningSaveYes_posXpath).click() time.sleep(3) self.objects_po.extract_ele() # self.ex_details(data) else: # 保存subObject self.driver.find_element(By.XPATH,mobile_Identities_Group_sub_Object_add_new_one_OK1_Button_posXpath).click() # 保存new_Object - self.driver.find_element(By.XPATH,mobile_Identities_Group_sub_Object_add_new_one_OK1_Warning_Yes_Button_posXpath).click() # 确认新建保存按钮 + # self.driver.find_element(By.XPATH,mobile_Identities_Group_sub_Object_add_new_one_OK1_Warning_Yes_Button_posXpath).click() # 确认新建保存按钮 # 保存Object # 确认创建 self.driver.find_element(By.XPATH, mobileIdentitiesObjectPage_button_SaveYes_posXpath).click() - self.driver.find_element(By.XPATH, mobileIdentitiesObjectPage_button_warningSaveYes_posXpath).click() + # self.driver.find_element(By.XPATH, mobileIdentitiesObjectPage_button_warningSaveYes_posXpath).click() time.sleep(3) self.objects_po.extract_ele() # self.ex_details(data) @@ -1156,7 +1156,7 @@ class mobile_identiities: self.driver.find_element(By.XPATH, mobile_Identities_Group_sub_Object_add_new_one_OK1_Button_posXpath).click() self.driver.find_element(By.XPATH, mobile_Identities_Group_sub_Object_add_new_one_OK1_Warning_Yes_Button_posXpath).click() self.driver.find_element(By.XPATH, mobileIdentitiesObjectPage_button_SaveYes_posXpath).click() - self.driver.find_element(By.XPATH, mobileIdentitiesObjectPage_button_warningSaveYes_posXpath).click() + # self.driver.find_element(By.XPATH, mobileIdentitiesObjectPage_button_warningSaveYes_posXpath).click() self._goto_subObjectPage() self._search(data) time.sleep(2) @@ -1243,7 +1243,7 @@ class mobile_identiities: self.driver.find_element(By.XPATH, mobile_Identities_Group_sub_Object_add_new_one_OK1_Button_posXpath).click() self.driver.find_element(By.XPATH, mobile_Identities_Group_sub_Object_add_new_one_OK1_Warning_Yes_Button_posXpath).click() self.driver.find_element(By.XPATH, mobileIdentitiesObjectPage_button_SaveYes_posXpath).click() - self.driver.find_element(By.XPATH, mobileIdentitiesObjectPage_button_warningSaveYes_posXpath).click() + # self.driver.find_element(By.XPATH, mobileIdentitiesObjectPage_button_warningSaveYes_posXpath).click() # 调用公用的sync点击逻辑 Request_ID = self.objects_po.click_sync(Request_ID) if data["cluster_id"] == 2: @@ -1433,7 +1433,7 @@ class mobile_identiities: self.driver.find_element(By.XPATH, mobile_Identities_Group_sub_Object_exclude_open_posXpath).click() time.sleep(2) self.driver.find_element(By.XPATH, mobileIdentitiesObjectPage_button_SaveYes_posXpath).click() - self.driver.find_element(By.XPATH, mobileIdentitiesObjectPage_button_warningSaveYes_posXpath).click() + # self.driver.find_element(By.XPATH, mobileIdentitiesObjectPage_button_warningSaveYes_posXpath).click() assert self.driver.find_element(By.XPATH,"//div[@role='alert']//p").text == "When enabling excluded objects, there must be at least one valid piece of data" self.driver.find_element(By.XPATH,mobileIdentitiesObjectPage_button_cancel_posXpath).click() self.driver.find_element(By.XPATH, asn_ObjectDetailPage_leaveThisPage_yesButton_posXpath).click() @@ -1452,7 +1452,7 @@ class mobile_identiities: self.driver.find_element(By.XPATH, http_signature_object_group_close_posXpath).click() time.sleep(2) self.driver.find_element(By.XPATH, mobileIdentitiesObjectPage_button_SaveYes_posXpath).click() - self.driver.find_element(By.XPATH, mobileIdentitiesObjectPage_button_warningSaveYes_posXpath).click() + # self.driver.find_element(By.XPATH, mobileIdentitiesObjectPage_button_warningSaveYes_posXpath).click() assert self.driver.find_element(By.XPATH,"//div[@role='alert']//p").text == "Subordinate objects of an object cannot contain only excluded objects" self.driver.find_element(By.XPATH, mobileIdentitiesObjectPage_button_cancel_posXpath).click() self.driver.find_element(By.XPATH, asn_ObjectDetailPage_leaveThisPage_yesButton_posXpath).click() @@ -1460,7 +1460,7 @@ class mobile_identiities: elif data["Subtype"] == "2": self.driver.find_element(By.XPATH, mobile_Identities_Group_sub_Object_exclude_open_posXpath).click() self.driver.find_element(By.XPATH, mobileIdentitiesObjectPage_button_SaveYes_posXpath).click() - self.driver.find_element(By.XPATH, mobileIdentitiesObjectPage_button_warningSaveYes_posXpath).click() + # self.driver.find_element(By.XPATH, mobileIdentitiesObjectPage_button_warningSaveYes_posXpath).click() assert self.driver.find_element(By.XPATH, "//div[@role='alert']//p").text == "Subordinate objects of an object cannot be null" elif data["Subtype"] == "3": sub_object_name = [] @@ -2095,14 +2095,14 @@ if __name__ == '__main__': # 菜单操作 跳转到mobile_identities页面 data ={ - "ids": "用例1、创建IMSI、查询IMSI、删除IMSI", - "Name": "test-1", + "ids": "用例3、创建Mobile Identity Group、查询Mobile Identity Group、删除Mobile Identity Group(Type:IMSI)", + "Name": "test-mobile-identity group", "Create": { - "model": "0", + "model": "1", "type": "new_object", - "item": ["^12312312321", "^12312312321$"] + "item": ["^123$"] }, - "Createtype": "IMSI", + "Createtype": "Phone_Number", "Subtype": "", "Search_type": "Name" } diff --git a/common/ui_common/objects/objects_public_operations.py b/common/ui_common/objects/objects_public_operations.py index 40e7fbe0..1cc183aa 100644 --- a/common/ui_common/objects/objects_public_operations.py +++ b/common/ui_common/objects/objects_public_operations.py @@ -1412,7 +1412,7 @@ class ObjectsPublicOperations: self.Page_Tips = self.driver.find_element(By.XPATH, listPage_object_mobileIdentities_del_after_ele_posXpath).text try: - assert self.Page_Tips == "No Data", "校验是否删除成功生效" + assert self.Page_Tips == "No rows", "校验是否删除成功生效" print("未查询到该Object,该Object不存在,断言成功") except: print("仍然可以查询到Object,断言失败") @@ -2251,21 +2251,14 @@ class ObjectsPublicOperations: from collections import Counter value_pos = acc_ObjectDetailPage_importDrawer_importTipsValue_posXpath_template # 页面Import Tips中获取结果 - valid_num = int(self.driver.find_element(By.XPATH, value_pos.format("Object Name")).get_attribute("title")) - self.invalid_format_num = int( - self.driver.find_element(By.XPATH, value_pos.format("Invalid format")).get_attribute("title")) - duplicate_within_file_num = int( - self.driver.find_element(By.XPATH, value_pos.format("Duplicate Within File")).get_attribute("title")) - duplicate_within_existing_num = int( - self.driver.find_element(By.XPATH, value_pos.format("Duplicate Within Existing")).get_attribute("title")) - total_num = int(self.driver.find_element(By.XPATH, value_pos.format("Total")).get_attribute("title")) + valid_num = int(self.driver.find_element(By.XPATH, ObjectDetailPage_importDrawer_importTipsValue_Valid_posXpath).text) + self.invalid_format_num = int(self.driver.find_element(By.XPATH,ObjectDetailPage_importDrawer_importTipsValue_InvalidFormat_posXpath).text) + duplicate_within_file_num = int(self.driver.find_element(By.XPATH, ObjectDetailPage_importDrawer_importTipsValue_Duplicates_current_file_posXpath).text) + duplicate_within_existing_num = int(self.driver.find_element(By.XPATH, ObjectDetailPage_importDrawer_importTipsValue_Duplicates_global_objects_posXpath).text) + total_num = int(self.driver.find_element(By.XPATH,ObjectDetailPage_importDrawer_importTipsValue_Total_posXpath).text) # 页面 importTable中获取结果 - import_table_value_pos = '//div[@class="importTable"]//*[@class="{}"]' - failed_items_num_in_import_table = len( - self.driver.find_elements(By.XPATH, import_table_value_pos.format("iconfont icon-Dashboarddisablepolicy"))) - total_num_in_import_table = int(self.driver.find_element(By.XPATH, - import_table_value_pos.format( - "el-pagination__total")).text[6:]) + failed_items_num_in_import_table = len(self.driver.find_elements(By.XPATH, ObjectDetailPage_importDrawer_importTable_Failed_items_posXpath)) + total_num_in_import_table = int(self.driver.find_element(By.XPATH,ObjectDetailPage_importDrawer_importTable_Total_posXpath).text[6:]) # 文件中统计结果 with open(self.my_files._obj_files_path(file_name=data_file_name), "r", encoding='utf-8') as f: # 打开文件 diff --git a/common/ui_common/objects/subscriber_ids.py b/common/ui_common/objects/subscriber_ids.py index 9ceb0848..9b53073f 100644 --- a/common/ui_common/objects/subscriber_ids.py +++ b/common/ui_common/objects/subscriber_ids.py @@ -306,9 +306,9 @@ class Base_Subscriber_IDs: self.error_tip = self.driver.find_element(By.XPATH,main_ObjectPage_import_files_error_type_posXpath).text assert self.error_tip == "Items cannot be empty", "断言item为空的情况" if data.get('Subtype') == "error_item": - self.driver.isElementExist(Element=main_Import_Mobile_Identity_files_item_error_posXpath) + self.driver.isElementExist(Element=main_Item_length_error_posXpath) if self.driver.Exist: - self.error_tip = self.driver.find_element(By.XPATH,main_Import_Mobile_Identity_files_item_error_posXpath).text + self.error_tip = self.driver.find_element(By.XPATH,main_Item_length_error_posXpath).text assert self.error_tip == "Format error", "断言错误item的情况" if len(data['Name']) < 4: # 进行断言 Name长度/item为空的情况 @@ -1724,17 +1724,16 @@ if __name__ == '__main__': # model=0/1 ====0:单个 1group # type =IMSI/Phone_Number/IMEI data ={ - "ids": "用例3-2:Subscriber_IDs的item中修改test2", - "Name":"test-1", - "Create":{ - "model": "0", - "type": "new_object", - "item": ["test1"], - "item_modify": {"type": "modify","modify_data": ["test2"]} - }, - "Createtype": "Subscriber_IDs", - "Subtype":"", - "Search_type": "Name" + "ids": "用例26:item小于三个字符", + "Name": "test", + "Create": { + "model": "0", + "type": "new_object", + "item": "^1$" + }, + "Createtype": "Subscriber_IDs", + "Subtype": "", + "Search_type": "Name" } r = Subscriber_IDs(a) r.subscriber_ids_case(data) diff --git a/page_element/objects_element_position.py b/page_element/objects_element_position.py index 51f2d58d..2aef4ec5 100644 --- a/page_element/objects_element_position.py +++ b/page_element/objects_element_position.py @@ -123,7 +123,7 @@ mainPage_ObjectSearch_buttonClear_posId = "searchClear" # 清空查询按钮id mainPage_ObjectSearch_buttonClear_posXpath = "//button[@class='MuiAutocomplete-clearIndicator css-25qtv2']" # 清空查询按钮xpath mainPage_ObjectSearch_buttonSearch_Item_posId = "object_ip_search" # 查询item输入框id mainPage_ObjectSearch_buttonSearch_Item_first_content_posXpath = "//div[@class='view-row']//span[@class='el-tooltip content-show']" # item搜索框第一个元素 -mainPage_ObjectSearch_buttonSearch_Item_posXpath = "//div[@class='css-dob60y']//input[@class='MuiInput-input css-za5rna']" # 查询item输入框Xpath +mainPage_ObjectSearch_buttonSearch_Item_posXpath = "//div[@class='px-[12px] py-[4px] flex']//input[@class='MuiInput-input css-za5rna']" # 查询item输入框Xpath mainPage_ObjectSearch_buttonAddItem_posId = "temporary_form" # 添加item_id mainPage_ObjectSearch_buttonAddItem_posXpath = "//i[@class='iconfont icon-Create1 font-[700]']" mainPage_ObjectSearch_input_Item_posId = "onlyMarvel" # 输入item_id @@ -135,8 +135,7 @@ main_listPage_object_reference_count_posXpath = "//table/tbody/tr[2]/td[7]/div/d main_listPage_object_statistics_view_postXpath = "(//div[@id='ly-table1-listcontent']//span[text()='View'])[1]" main_listPage_object_bottomTotal_postXpath = "//div[@class='flex-1 flex items-center justify-center undefined']/span[1]" # 列表页底部Total元素 # object导入文件Xpath路径 -main_ObjectPage_Input_path_Import_files_posXpath = "//label[@class='MuiButtonBase-root MuiButton-root MuiButton-outlined MuiButton-outlinedPrimary MuiButton-sizeSmall MuiButton-outlinedSizeSmall MuiButton-colorPrimary MuiButton-root \ -MuiButton-outlined MuiButton-outlinedPrimary MuiButton-sizeSmall MuiButton-outlinedSizeSmall MuiButton-colorPrimary css-1b1h392']/input[@type='file']" +main_ObjectPage_Input_path_Import_files_posXpath = "//div[@class='flex flex-col justify-start flex-1 MuiBox-root css-0']//input[@type='file']" main_ObjectPage_No_data_text_posXpath = "//DIV[@class='MuiDataGrid-overlay css-14349d1']" # 列表中元素 @@ -291,19 +290,18 @@ main_ObjectPage_Input_Import_files_button_posXpath = "//button[@class='MuiButton MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorPrimary css-epitc3']/i[@class='iconfont icon-export']" # main导出文件按钮 mobileIdentitiesObjectPage_Button_Import_Mobile_Identity_files_posXpath = "//button[@class='MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeSmall MuiButton-textSizeSmall MuiButton-colorPrimary MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeSmall MuiButton-textSizeSmall MuiButton-colorPrimary css-bc4t0x']" # Create Import Mobile Identity Button mobileIdentitiesObjectPage_Input_path_Import_Mobile_Identity_files_posXpath = main_ObjectPage_Input_path_Import_files_posXpath # Create Import Mobile Identity path -main_ObjectPage_Import_Mobile_Identity_files_OK_Button_posXpath = "//button[@class='MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeSmall MuiButton-textSizeSmall MuiButton-colorPrimary \ -MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeSmall MuiButton-textSizeSmall MuiButton-colorPrimary css-k5thc0']" # 导入文件OK +main_ObjectPage_Import_Mobile_Identity_files_OK_Button_posXpath = "//div[@class='absolute bottom-0 h-[40px] w-[100%] overflow-hidden text-[16px] truncate bg-[--color-background-secondary] flex justify-center items-center pl-[12px] pr-[38px]']//button[text()='OK']" # 导入文件OK mobileIdentitiesObjectPage_Import_Mobile_Identity_files_OK_Button_posXpath = main_ObjectPage_Import_Mobile_Identity_files_OK_Button_posXpath # 导入文件OK mobileIdentitiesObjectPage_Import_Mobile_Identity_files_Cancel_Button_posXpath = "//div[5]/div/div[1]/div/div/div[2]/div[2]/button[2]/span" # 导入文件Cancel mobileIdentitiesObjectPage_Import_Mobile_Identity_files_IMSI_Group_Cancel_Button_posXpath = '//div[2]/div/div[1]/div/div/div[2]/div[2]/button[2]/span' -main_item_error_format_posXpath = '//div/span[contains(text(),"Format error")]' # 错误格式提示语 +main_item_error_format_posXpath = "//div[@class='subscriber-id-object-expression']/div[2]" # 错误格式提示语 main_Import_files_error_format_posXpath = '//ul/li/div[@class="valid-column import-line"]/span' # 导入文件格式错误提示语 -main_Item_length_error_posXpath = '//div[@class="object-item-error"]/span' # item 长度校验错误 +main_Item_length_error_posXpath = "//div[@class='subscriber-id-object-expression']/div[2]" # item 长度校验错误 mobileIdentitiesObjectPage_Import_Mobile_Identity_files_error_format_posXpath = main_Import_files_error_format_posXpath # mobile identities 导入文件格式错误提示语 main_Import_Mobile_Identity_files_error_type_posXpath = "//div[@class='MuiFormHelperText-root css-koslx8']" # 错误类型提示语 main_Import_Mobile_Identity_files_item_error_posXpath = '//div/div/div[1]/div[2]/form/div[3]/div/div/div[2]/span' # 错误item提示语 mobileIdentitiesObjectPage_Import_Mobile_Identity_files_error_type_posXpath = main_Import_Mobile_Identity_files_error_type_posXpath # mobile identities 错误弹出提示语 -main_ObjectPage_import_files_error_type_posXpath = "//div[@class='MuiFormHelperText-root css-3m9sla']" # 错误弹出提示语 +main_ObjectPage_import_files_error_type_posXpath = "//div[@class='items']/div[2]" # 错误弹出提示语 main_ObjectPage_import_files_error_format_posXpath = mobileIdentitiesObjectPage_Import_Mobile_Identity_files_error_format_posXpath # 导入文件格式错误提示语 # 置灰按钮 mobileIdentitiesObjectPage_Export_Mobile_Identity_Button_posXpath = '//button[@id="objectExport-_importAndExport_ElRow_Objects_mobile_identity_Home_App_anonymousComponent"][@disabled="disabled"]/i' # 导出按钮置灰 @@ -347,14 +345,14 @@ listPage_profilTable_mobileIdentities_tableHeader_posXpath = "" # 列表table � # listPage->Tips dialog 列表页 tips对话框 listPage_dialogTips_mobileIdentities_button_yes_posCss = ".delComponents-ok span" # 删除提示的Tips的yes按钮 listPage_dialogTips_mobileIdentities_button_no_posCss = ".delComponents-close span" # 删除提示的Tips的close按钮 -listPage_dialogTips_mobileIdentities_Tips_len_Name_posXpath = '//div/div[1]/div[1]/div/div/div/div[1]/div[2]/form/div[1]/div/div[2]' +listPage_dialogTips_mobileIdentities_Tips_len_Name_posXpath = "//div[contains(@class,'object-name')]/div[2]" listPage_dialogTips_main_Tips_len_Name_posXpath = listPage_dialogTips_mobileIdentities_Tips_len_Name_posXpath # Mobile_Identities list page 列表页提取元素--列表页 listPage_object_mobileIdentities_new_ID_extract_posXpath = '//table/tbody/tr[1]/td[1]/div/div/div[4]/span' # 提取ID listPage_object_mobileIdentities_new_Name_extract_posXpath = '//table/tbody/tr[1]/td[3]/div/div/div/span' # 提取Name listPage_object_mobileIdentities_new_Description_extract_posXpath = '//table/tbody/tr[1]/td[6]/div/div/p' # 提取Description listPage_object_mobileIdentities_new_Details_extract_posXpath = '//table/tbody/tr[1]/td[4]/div/div/div/div/div/div/span' # 提取Detail -listPage_object_mobileIdentities_del_after_ele_posXpath = '//div[@id="ly-table1-listcontent"]/div/div[3]/div/span' # 删除后提示"No Data" +listPage_object_mobileIdentities_del_after_ele_posXpath = '//div[@class="MuiDataGrid-overlay css-14349d1"]' # 删除后提示"No Data" # Mobile_Identities list page 列表页操作 listPage_object_mobileIdentities_select_First_object_posXpath = listPage_select_first_object_posXpath # 选择列表中第一个对象 @@ -371,9 +369,9 @@ mobileIdentitiesObjectPage_button_inputItem_posXpath = "//input[@class='MuiInput mobileIdentitiesObjectPage_content_inputItem1_posId = "(//div[@data-testid='virtuoso-item-list']//div[@class='h-[100%] min-h-[24px] flex items-center'])[1]" # 第一行输入item的内容 mobileIdentitiesObjectPage_IMSI_button_Save_Item_posXpath = "//i[@class='operate-icon iconfont icon-save']" # 创建保存item按钮 -mobileIdentitiesObjectPage_IMSI_button_Edit_Save_Item_posXpath = '//div[@class="item-box"]//i[contains(@class,"icon-save")]' # 编辑保存item按钮 +mobileIdentitiesObjectPage_IMSI_button_Edit_Save_Item_posXpath = "//i[@class='operate-icon iconfont icon-save']" # 编辑保存item按钮 mobileIdentitiesObjectPage_IMSI_button_Edit_assert_first_Item_content_posXpath = "//div[@class='object-item-box']//div[@class='item-box']/div/div[1]/span/span" ## <断言>第一个item的内容 -mobileIdentitiesObjectPage_IMSI_button_Edit_assert_first_Item_count_posXpath = "//div[@class='item-container']//div[@class='total']" ## <断言>新增item的个数 + mobileIdentitiesObjectPage_sub_Phone_Number_button_Edit_assert_first_Item_count_posXpath = "//div[@class='CommonSubObjects']/div[2]/div[2]" # sub Phone_Numbeurl_ObjectDetailPage_itemsTotal_posXpathr<断言>新增item的个数 @@ -402,16 +400,16 @@ mobileIdentitiesObjectPage_button_audit_first_object_posXpath = '//table/tbody/t mobileIdentitiesObjectPage_button_audit_second_posXpath = '//table/tbody/tr[2]/td[3]/div' ## create audit second ele ## Audit ele # Create mobile Identities Group Object 和 Edit Create mobile Identities Group 新增和编辑页 -mobile_Identities_Group_sub_Object_addButton_posXpath = "//div[@class='CommonSubObjects']//i[@class='iconfont icon-Create1 cursor']" # mobile_Identities_Group添加sub Object按钮 +mobile_Identities_Group_sub_Object_addButton_posXpath = "//div[@class='mobile-identity-object-included_sub_object_uuids']//i[@class='iconfont icon-Create1 font-[700]']" # mobile_Identities_Group添加sub Object按钮 mobile_Identities_Group_sub_Object_input_frame_posXpath = main_Group_sub_Object_input_frame_posXpath # sub Object 搜索输入框 mobile_Identities_Group_sub_Object_input_frame_select_one_posXpath = main_Group_sub_Object_input_frame_select_one_posXpath # 搜索框第一个元素 mobile_Identities_Group_confirm_leave_posXpath = '//div/div[3]/button[2]/span[contains(text(),"OK")]' # 确认离开 mobile_Identities_Group_sub_Object_Edit_Button_posXpath = "//div[@class='object-item-box']//div[@class='OperateBtn']/i" # mobile_Identities_Group编辑sub Object按钮 -mobile_Identities_Group_sub_Object_add_new_Button_posXpath = "//button[@class='MuiIconButton-root MuiIconButton-variantPlain MuiIconButton-colorNeutral MuiIconButton-sizeMd MuiMenuButton-root MuiMenuButton-variantOutlined MuiMenuButton-colorNeutral MuiMenuButton-sizeMd css-83p2rh']/i" # 新建sub_mobile_Identities按钮 -mobile_Identities_Group_sub_Object_add_new_Select_one_Button_posXpath = "//ul[@x-placement='bottom-start']/li[1]" # 新建选择mobile_Identities按钮 -mobile_Identities_Group_sub_Object_add_new_Select_Group_Button_posXpath = "//ul[@x-placement='bottom-start']/li[2]" # 新建选择mobile_Identities_Group按钮 +mobile_Identities_Group_sub_Object_add_new_Button_posXpath = "//i[@class='iconfont icon-Create1']" # 新建sub_mobile_Identities按钮 +mobile_Identities_Group_sub_Object_add_new_Select_one_Button_posXpath = "//ul[@class='base-Popper-root MuiMenu-root Mui-expanded MuiMenu-variantOutlined MuiMenu-colorNeutral MuiMenu-sizeMd css-131n2dh']//li[1]" # 新建选择mobile_Identities按钮 +mobile_Identities_Group_sub_Object_add_new_Select_Group_Button_posXpath = "//ul[@class='base-Popper-root MuiMenu-root Mui-expanded MuiMenu-variantOutlined MuiMenu-colorNeutral MuiMenu-sizeMd css-131n2dh']//li[2]" # 新建选择mobile_Identities_Group按钮 mobile_Identities_Group_sub_Object_add_new_one_inputName_posXpath = "//div[@class='MuiBox-root css-1krxo6z']//input[@class='MuiInput-input css-fqt4w4']" # new mobile_Identities input Name mobile_Identities_Group_sub_Object_add_new_add_item_Button_posXpath = "//div[@class='MuiBox-root css-1krxo6z']//i[@class='iconfont icon-Create1 font-[700]']" # new mobile_Identities add items mobile_Identities_Group_sub_Object_add_new_addIMSI_item_inputName_posXpath = "//div[@class='MuiBox-root css-1krxo6z']//input[@class='MuiInput-input css-1u0jcuo']" # new IMSI inputItemName @@ -420,9 +418,9 @@ mobile_Identities_Group_sub_Object_add_new_addIMEI_item_inputName_posXpath = "// mobile_Identities_Group_sub_Object_add_new_add_itemIMSI_Save_Button_posXpath = "//i[@class='operate-icon iconfont icon-save']" # 保存item按钮 mobile_Identities_Group_sub_Object_add_new_add_item_phoneNumber_Save_Button_posXpath = "//i[@class='operate-icon iconfont icon-save']" mobile_Identities_Group_sub_Object_add_new_add_item_IMEI_Save_Button_posXpath = "//i[@class='operate-icon iconfont icon-save']" -mobile_Identities_Group_sub_Object_exclude_open_posXpath = "//div[@class='mobile-identity-object-']" +mobile_Identities_Group_sub_Object_exclude_open_posXpath = "//div[@class='mobile-identity-object-excluded_sub_object_uuids']//i[@class='iconfont icon-Create1 font-[700]']" -mobile_Identities_Group_sub_Object_add_new_one_OK1_Button_posXpath = "//button[@id='OK-_mobileIdDetail_VDraswer_EditDraw_mobileIdDetail_Home_App_anonymousComponent']" # new mobile_Identities CreateOK1 +mobile_Identities_Group_sub_Object_add_new_one_OK1_Button_posXpath = "//div[@class='MuiBox-root css-1krxo6z']//button[text()='OK']" # new mobile_Identities CreateOK1 mobile_Identities_Group_sub_Object_add_new_one_OK1_Warning_Yes_Button_posXpath = "//div[@class='el-message-box__btns']//span[normalize-space(text())='Yes']" # 再次确认创建new mobile_Identities mobile_Identities_Group_sub_Object_add_new_one_OK1_Warning_Cancel_Button_posXpath = "//div[@class='el-message-box__btns']//span[normalize-space(text())='Yes']" # 再次确认取消new mobile_Identities mobile_Identities_Group_sub_Object_add_new_one_Cancel2_Button_posXpath = '//div/div/div[2]/div/div/div[1]/div/div/div[1]/div[3]/button[2]/span' # new mobile_Identities CreateCancel2 @@ -449,7 +447,7 @@ listPage_object_urls_delButton_posXpath = listpage_delete_button_posXpath # Del url_listPage_deleteButton_posId = 'appDel-_OperateBtns_ElRow_Objects_url_Home_App_anonymousComponent' # Delete 按钮id url_listPage_first_row_checkBox_posXpath = '(//td[@rowspan="1"and @colspan="1"]//span[@class="el-checkbox__inner"])[1]' # 列表页第一行对象多选框Xpath # listPage_object_urls_columnSetting_descriptionOption_posXpath = '//ul[@class="col-choose open"]//span[text()="Description"]' # 列设置中的description选项元素Xpath -listPage_object_urls_columnSetting_descriptionOption_posXpath = '//li[contains(@id,"dropColRes-_ElementSet")]//span[normalize-space(text())="Description"]' # 列设置中的description选项元素Xpath +listPage_object_urls_columnSetting_descriptionOption_posXpath = "//div[@class='dune-ui-table-column-setting border border-solid border-[--color-divider]']//span[normalize-space(text())='Description']" # 列设置中的description选项元素Xpath listPage_object_urls_tableDetails_posXpath = '//div[@class="el-table__header-wrapper"]//span[contains(text(),"Details")]' # list表头 Details列Xpath # listPage_object_urls_tableDetails_selected_detailsRow_posXpaths = '//span[@class="el-checkbox__input is-checked"]/ancestor::tr//div[@class="itemDetails cursor"]/span' # list页被选中的对象details 值Xpath # listPage_object_urls_tableDetails_selected_detailsRow_posXpaths = '//span[@class="el-checkbox__input is-checked"]/ancestor::tr//div[@class="itemDetails cursor"]/..' # list页被选中的对象details 值Xpath @@ -659,7 +657,7 @@ ip_addressObjectPage_input_searchFor_posId = mainPage_ObjectSearch_buttonSearch_ ip_addressObjectPage_button_addItem_posId = mainPage_ObjectSearch_buttonAddItem_posId # 添加item按钮id ip_addressObjectPage_button_addItem_posXpath = "//i[@class='iconfont icon-Create1 font-[700]']" ip_addressObjectPage_button_addItem_first_item_posXpath = "//div[@class='MuiFormControl-root MuiFormControl-horizontal MuiFormControl-sizeMd css-90yvhw']/div[@class='ip-object-ip']/div" # item 搜索框第一个元素 -ip_addressObjectPage_addItem_error_tips_posXpath = "//div[@class='MuiFormHelperText-root css-koslx8']" # IP error_format 错误提示 +ip_addressObjectPage_addItem_error_tips_posXpath = "//div[contains(@class,'object-ip')]//div[2]" # IP error_format 错误提示 ip_addressObjectPage_button_inputItem_posXpath = "//div[@class='MuiTableCell-root MuiTableCell-sizeMedium css-h2ab6y']//div[@class='MuiAutocomplete-wrapper css-1gurlra']/input" # 输入item内容 ip_addressObjectPage_button_editItem_posXpath = "//i[@class='iconfont icon-Edit']" # object item编辑按钮 ip_addressObjectPage_button_editgroup_posXpath = "//i[@class='row-edit iconfont icon-Edit cursor fontsize18']" # object group组 item编辑按钮 @@ -692,7 +690,7 @@ ip_addressObjectPage_button_OK_posXpath = "//div[@class=' ip-object-page MuiBox- ip_addressObjectPage_button_SaveYes_posXpath = '//button[@id="OK-_IpDetail_VDraswer_EditDraw_IpDetail_Home_App_anonymousComponent"]/span' # Group引用创建OK按钮 ip_addressObjectPage_button_warningSaveYes_posXpath = "//div[@class='el-message-box__wrapper']/div/div[3]/button[2]/span" # 提示保存ok按钮警告框 ip_addressObjectPage_button_warningSaveCancel_posCss = '//div[@class="el-message-box__wrapper"]/div/div[3]/button[1]/span' # 提示保存取消按钮警告框 -ip_addressObjectPage_button_cancel_posCss = "//button[@id='Cancel-_IpDetail_Home_App_anonymousComponent']/span" # Cancel按钮 +ip_addressObjectPage_button_cancel_posCss = "//div[@class=' ip-object-page MuiBox-root css-o7xelj']//button[text()='Cancel']" # Cancel按钮 # Create IP Address Group Object 和 Edit Create IP Address Group 新增和编辑页 ip_address_Group_sub_Object_addButton_posXpath = "//div[@class='ip-object-included_sub_object_uuids']//i[@class='iconfont icon-Create1 font-[700]']" # ip_address_Group添加sub Object按钮 @@ -906,8 +904,9 @@ list_quote_content_object_HTTP_Signatures_posXpath = "//div[@class='MuiDataGrid- list_Column_settings_HTTP_Signatures_Description_posXpath = "//div[@class='MuiDataGrid-columnsManagement css-1v3xuhs']//span[text()='Description']" # 列设置选择Description list_HTTP_Signatures_Export_files_button_posXpath = '//div/button[contains(@class,"Export")]/i' # 导出文件按钮 list_HTTP_Signatures_Export_files_yes_button_posXpath = '//div/div[3]/span/button[1]/span[contains(text(),"Yes")]' # 导出文件Yes按钮 -list_quote_first_row_object_HTTP_Signatures_posXpath = '//div/div/div[2]/div[2]/div[1]/div/div[3]/div' # quote侧滑第一行 -list_quote_second_row_object_HTTP_Signatures_posXpath = '//div/div[2]/div[2]/div[1]/div/div[3]/div[2]' # quote侧滑第二行 +list_quote_first_row_object_HTTP_Signatures_posXpath = "//div[@class='overflow-y-auto h-[100%] pt-0']//table/tbody/tr[1]" # quote侧滑第一行 +list_quote_second_row_object_HTTP_Signatures_posXpath = "//div[@class='overflow-y-auto h-[100%] pt-0']//table/tbody/tr[2]" # quote侧滑第二行 +list_quote_object_Edit_posXpath = "//div[@class='px-[12px] py-[4px] h-[32px] flex absolute left-0 right-0 top-0']//button[text()='Edit']" Create_item_second_row_object_HTTP_Signatures_posXpath = "(//div[@class='infinite-list-wrapper']//div[@class='view-row'])[2]//div[@class='keywords-txt']/span" # item第二行 listPage_object_HTTP_Signatures_del_yes_Button_posXpath = listPage_object_ip_address_del_yes_Button_posXpath # del_yes按钮 listPage_objectSearch_HTTP_Signatures_selectLabel_posId = mainPage_ObjectSearch_selectLabel_posId # 查询框id @@ -1014,7 +1013,7 @@ listPage_objectSearch_Keywords_select_CreateBy_posXpath = '//*[@id="5-_FilteredS listPage_objectSearch_Keywords_buttonSearch_posId = mainPage_ObjectSearch_buttonSearch_posId # 查询按钮id listPage_objectSearch_Keywords_buttonClear_posId = mainPage_ObjectSearch_buttonClear_posId # 清空查询按钮id listPage_object_Keywords_create_Keywords_Button_posId = "//ul[@class='base-Popper-root MuiMenu-root Mui-expanded MuiMenu-variantOutlined MuiMenu-colorNeutral MuiMenu-sizeMd css-1iuehdr']//li[1]" # 创建Keywords -Create_page_import_from_file_button_xpath = "//button[@class='el-button btn-style el-button--default el-button--small']" # 创建Keywords import button +Create_page_import_from_file_button_xpath = main_button_import_files_button_posXpath # 创建Keywords import button listPage_object_Keywords_create_Keywords_Group_Button_posId = "//ul[@class='base-Popper-root MuiMenu-root Mui-expanded MuiMenu-variantOutlined MuiMenu-colorNeutral MuiMenu-sizeMd css-1iuehdr']//li[2]" # 创建Keywords Group listPage_profileSearch_Keywords_dropDown_item_posXpath = "" # 下拉菜单定位 @@ -1050,7 +1049,7 @@ KeywordsObjectPage_button_item_select_REGEX_posXpath = "//div[@class='flex items KeywordsObjectPage_button_inputItem_posXpath = "//div[@class='keyword-object-expression']//input[@class='MuiInput-input css-1u0jcuo']" # 输入item内容 KeywordsObjectPage_button_add_Item_input_posXpath = "//div[@class='keyword-object-expression']//i[@class='iconfont icon-Create1 font-[700]']" KeywordsObjectPage_button_Save_Item_posXpath = "//i[@class='operate-icon iconfont icon-save']" # 保存item按钮 -KeywordsObjectPage_import_files_ok1_posXpath = '//div/div/div[2]/div[2]/button[1]/span' # 导入文件确定ok +KeywordsObjectPage_import_files_ok1_posXpath = "//div[@class='relative w-[100%] h-[100%] pt-[46px] pb-[56px] flex overflow-hidden']//button[text()='OK']" # 导入文件确定ok KeywordsObjectPage_textArea_Description_posXpath = "//div[@class='MuiTextarea-root MuiTextarea-variantOutlined MuiTextarea-colorNeutral MuiTextarea-sizeMd MuiTextarea-formControl css-v35t8h']/textarea[1]" # Keywords_description文本输入区Xpath Keywords_GroupObjectPage_textArea_Description_posXpath = "//div[@class='MuiTextarea-root MuiTextarea-variantOutlined MuiTextarea-colorNeutral MuiTextarea-sizeMd MuiTextarea-formControl css-v35t8h']/textarea[1]" # Keywords Group_description文本输入区Xpath KeywordsObjectPage_button_SaveYes_posXpath = "//button[@class='MuiButtonBase-root MuiButton-root MuiLoadingButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeSmall MuiButton-textSizeSmall MuiButton-colorPrimary MuiButton-root MuiLoadingButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeSmall MuiButton-textSizeSmall MuiButton-colorPrimary form-action-submit css-1djnbgz']" # OK按钮 @@ -1058,9 +1057,9 @@ KeywordsObjectPage_button_warningSaveYes_posXpath = "//div[@class='el-message-bo KeywordsObjectPage_button_warningSaveCancel_posCss = '//div[@class="el-message-box__wrapper"]/div/div[3]/button[1]/span' # 提示保存取消按钮警告框 KeywordsObjectPage_button_cancel_posCss = "//button[@id='Cancle-_keywordsDetail_Home_App_anonymousComponent']/span" # Cancel按钮 KeywordsObjectPage_button_range_posXpath = "//div[@class='keyword-object-expression']//input[@class='MuiCheckbox-input css-1jj0cvj']" -KeywordsObjectPage_error_text_posXpath = "//div[@class='keyword-object-expression']//div[@class='MuiFormHelperText-root css-koslx8']" +KeywordsObjectPage_error_text_posXpath = "//div[@class='keyword-object-expression']/div[2]" # Create Keywords Group Object 和 Edit CreateKeywords Group 新增和编辑页 -main_ObjectPage_tips_Name_input_Xpath = "//div[@class='MuiFormHelperText-root css-koslx8']" +main_ObjectPage_tips_Name_input_Xpath = "//div[contains(@class,'object-name')]//div[2]" KeywordsObjectPage_tips_Name_input_Xpath = main_ObjectPage_tips_Name_input_Xpath # 删除失败,Name提示框 Keywords_list_reference_content_first_raw = '//div[1]/div/div/div[2]/div[2]/div[1]/div/div[3]/div' # 列表页引用第一行 Keywords_list_reference_content_second_raw = '//div/div/div[2]/div[2]/div[1]/div/div[2]/div/div[2]' # 列表引用第二行 @@ -1069,8 +1068,8 @@ Keywords_Group_sub_Object_addButton_posXpath = "//div[@class='keyword-object-inc KeywordsObjectPage_Keywords_button_input_more_Item_posXpath = "(//div[@class='MuiFormControl-root MuiFormControl-vertical MuiFormControl-sizeMd css-w2y0fh']//input[@class='MuiInput-input css-1u0jcuo'])['replace']" # 输入keywords_item内容 Keywords_Group_sub_Object_add_new_Button_posXpath = "//i[@class='iconfont icon-Create1']" # 新建sub_Keywords按钮 Keywords_Group_sub_Object_edit_posXpath = "//div[@class='list-container']//i[@class='row-edit iconfont icon-Edit cursor fontsize18']" # 修改Keyword下的sub object -Keywords_Group_sub_Object_add_new_Select_one_Button_posXpath = "//ul[@x-placement='bottom-start']/li[1]" # 新建选择Keywords按钮 -Keywords_Group_sub_Object_add_new_Select_Group_Button_posXpath = "//ul[@x-placement='bottom-start']/li[2]" # 新建选择Keywords_Group按钮 +Keywords_Group_sub_Object_add_new_Select_one_Button_posXpath = "//ul[@class='base-Popper-root MuiMenu-root Mui-expanded MuiMenu-variantOutlined MuiMenu-colorNeutral MuiMenu-sizeMd css-131n2dh']//li[1]" # 新建选择Keywords按钮 +Keywords_Group_sub_Object_add_new_Select_Group_Button_posXpath = "//ul[@class='base-Popper-root MuiMenu-root Mui-expanded MuiMenu-variantOutlined MuiMenu-colorNeutral MuiMenu-sizeMd css-131n2dh']//li[2]" # 新建选择Keywords_Group按钮 Keywords_Group_sub_Object_add_new_one_inputName_posXpath = "//div[@class='MuiBox-root css-1krxo6z']//input[@class='MuiInput-input css-fqt4w4']" # new Keywords input Name Keywords_Group_sub_Object_add_new_add_item_Button_posXpath = "//div[@class='MuiBox-root css-1krxo6z']//i[@class='iconfont icon-Create1 font-[700]']" # new Keywords add items Button Keywords_Group_sub_Object_add_new_addIP_item_inputName_posXpath = "//div[@class='MuiBox-root css-1krxo6z']//input[@class='MuiInput-input css-1u0jcuo']" # new Keywords Item input @@ -1260,7 +1259,13 @@ acc_ObjectDetailPage_importFromFile_button_posXpath = url_ObjectDetailPage_impor acc_ObjectDetailPage_pleaseUpload_posXpath = url_ObjectDetailPage_pleaseUpload_posXpath # Please Upload input标签Xpath acc_ObjectDetailPage_importUrlOk_posXpath = url_ObjectDetailPage_importUrlOk_posXpath # Import 页面 下的OK按钮Xpath acc_ObjectDetailPage_importDrawer_importTipsValue_posXpath_template = '//div[@class="drawer-box"]//div[@class="importTips"]//td[count(//div[@class="drawer-box"]//div[@class="importTips"]//th[@title="{}"]/preceding-sibling::th)+1]' # Import 页面下的Tips Value值 - +ObjectDetailPage_importDrawer_importTipsValue_Valid_posXpath = "//div[@class='MuiBox-root css-70qvj9']//tbody[@class='MuiTableBody-root css-1xnox0e']//th" +ObjectDetailPage_importDrawer_importTipsValue_InvalidFormat_posXpath = "//div[@class='MuiBox-root css-70qvj9']//tbody[@class='MuiTableBody-root css-1xnox0e']//td[1]" +ObjectDetailPage_importDrawer_importTipsValue_Duplicates_current_file_posXpath = "//div[@class='MuiBox-root css-70qvj9']//tbody[@class='MuiTableBody-root css-1xnox0e']//td[2]" +ObjectDetailPage_importDrawer_importTipsValue_Duplicates_global_objects_posXpath = "//div[@class='MuiBox-root css-70qvj9']//tbody[@class='MuiTableBody-root css-1xnox0e']//td[3]" +ObjectDetailPage_importDrawer_importTipsValue_Total_posXpath = "//div[@class='MuiBox-root css-70qvj9']//tbody[@class='MuiTableBody-root css-1xnox0e']//td[4]" +ObjectDetailPage_importDrawer_importTable_Failed_items_posXpath = '//div[@class="MuiDataGrid-main css-jdaxyo"]//*[@class="iconfont icon-Dashboarddisablepolicy text-[var(--color-error)] pr-[4px]"]' +ObjectDetailPage_importDrawer_importTable_Total_posXpath ="(//div[@class='flex-1 mt-[20px]']//div[@class='flex-1 flex items-center justify-center undefined']//span[@class='text-textColor'])[1]" # 对象组详情页 acc_ObjectGroupDetailPage_subObjects_addButton_normalAdd_posXpath = "//div[@class='account-object-included_sub_object_uuids']// i[@class='iconfont icon-Create1 text-[18px] font-[700] text-[--color-primary] cursor-pointer']" # Subordinate Objects 下有数据新增时"+"按钮Xpath acc_ObjectGroupDetailPage_excludeObjects_addButton_normalAdd_posXpath = "//div[@class='account-object-excluded_sub_object_uuids']//i[@class='iconfont icon-Create1 text-[18px] text-weight-700] text-[--color-primary] cursor-pointer']" # Exclude Objects 下有数据新增时"+"按钮Xpath diff --git a/testdata/ui_file/objects/import_file/Keywords_error_format.txt b/testdata/ui_file/objects/import_file/Keywords_error_format.txt index 960fde7a..e7096df2 100644 --- a/testdata/ui_file/objects/import_file/Keywords_error_format.txt +++ b/testdata/ui_file/objects/import_file/Keywords_error_format.txt @@ -1 +1 @@ -123*&789-*
\ No newline at end of file +*123^&*789^
\ No newline at end of file |
