# -*- coding: UTF-8 -*- import configparser import copy import os import time import uuid import pytest from common.read_data.read_data import ReadData from common.ui_common.objects.app_attributes import Attributes from cases.conftest import demo_fixture from common.ui_common.objects.objects_public_operations import download_files from config.workpath import workdir data = ReadData() class TestAppAttributes: #1.22pass #24.1.3 main pass #pass @pytest.mark.parametrize("data",data.read_data_object("app_attributes.json"), ids=data.generate_id ) def test_attributes(self, demo_fixture, data): attr = Attributes(demo_fixture) attr.Attributess_case(data) #1.22pass #24.1.3 pass #输入框反向测试 pass def test_item_input_frame_reverse(self, demo_fixture): attr = Attributes(demo_fixture) attr.item_input_frame_reverse_test() #24.1.3 pass #文件下载 pass @pytest.mark.parametrize( "data", [ { "ids": "Attributes的增删改查01", "CreatType": "Attributes", "Search_type": "Name", "file": "identify_OPENVPN_application.lua", "Create": {"CheckName": ""} } ] ) def test_page_list_download_file(self,data): driver = download_files() attr = Attributes(driver) attr.page_list_download_file_test(data) driver.quit() #Bug #Audit Logs pass @pytest.mark.parametrize( "data", [ { "ids": "Attributes的增删改查01", "CreatType": "Attributes", "Search_type": "Name", "file": "identify_OPENVPN_application.lua", "modify_file": "OPENVPN_application.lua", "Create": {"CheckName": ""} } ] ) def test_attr_audit_case(self, demo_fixture, data): attr = Attributes(demo_fixture) attr._verify_audit_logs(data) #24.1.3 pass 修改Description为Parent Attribute # 列设置 pass def test_column_settings_case(self, demo_fixture): attr = Attributes(demo_fixture) attr.attr_column_settings_case() #24.1.3 1234 pass # 翻页 pass @pytest.mark.parametrize("data", data.read_data_object(r"URLs\\pages_turning.json"), ids=data.generate_id) def test_page_turning(self, demo_fixture, data): attr = Attributes(demo_fixture) attr._goto_subObjectPage() attr.objects_po.pages_turning(data) # 24.10无组合查询 @pytest.mark.parametrize("data", [ { "ids": "多个条件组合查询", "CreatType": "Attributes", "Search_type": "UUID&Name", "file": "identify_OPENVPN_application.lua", "Create": {"CheckName": ""} } ]) def test_verify_search(self, demo_fixture, data): attr = Attributes(demo_fixture) attr.verify_search(data) @pytest.mark.parametrize("data", [ { "ids": "Audit logs", "CreatType": "Attributes", "Search_type": "UUID", "file": "identify_OPENVPN_application.lua", "modify_file": "OPENVPN_application.lua", "Create": {"CheckName": ""} } ]) def test_audit_log_all_operation(self, demo_fixture, data): attr = Attributes(demo_fixture) attr.audit_log_all_operation(data) @pytest.mark.parametrize("data", [{ "ids": "check vsys", "CreatType": "Attributes", "Search_type": "Name", "file": "identify_OPENVPN_application.lua", "Create": {"CheckName": "test_vsys"}, "customsearch": "test_check_vsys" }]) def test_different_vsys_check(self, demo_fixture, data): attr = Attributes(demo_fixture) attr.different_vsys_check(data) @pytest.mark.parametrize("data", [{ "ids": "Name模糊搜索", "CreatType": "Attributes", "Search_type": "fuzzy->Name", "file": "identify_OPENVPN_application.lua", "Create": {"CheckName": ""} }]) def test_fuzzy_search(self, demo_fixture, data): attr = Attributes(demo_fixture) attr.fuzzy_search(data) # #vsys切换 # # vsys切换 PASS # # 开始必须是tvsys1,不支持统计mvsys判断 # # 测试不能创建相同名字时,需要从table_dict中提取name # @pytest.mark.parametrize( # "data", # [ # { # "ids": "1.AppGroup仅能查看本vsys下的数据,其他非vsys数据不可见。上级Mvsys无法查看下级Tvsys", # "Search_type": "ID", # "Name": "", # "vsys_operate": {"step1": "Tvsys10->create", "step2": "Mvsys2->search"}, # "file": "identify_OPENVPN_application.lua", # "Create": {"CheckName": ""} # }, # { # "ids": "2.AppGroup supermode open,mvsys对下Tvsys只有查看权限", # "Search_type": "ID", # "Name": "", # "vsys_operate": {"step1": "super_Tvsys10->create", "step2": "super_Mvsys3->search"}, # "file": "identify_OPENVPN_application.lua", # "Create": {"CheckName": ""} # }, # { # "ids": "3、不同vsys不能创建同名数据", # "Search_type": "ID", # "Name": "测试app_group的vsys可见性的security_policy", # "vsys_operate": {"step1": "super_Tvsys10->create", "step2": "super_Mvsys3->create_same"}, # "file": "identify_OPENVPN_application.lua", # "Create": {"CheckName": ""} # }, # { # "ids": "4.不开启监督模式,在另一个vsys中无法搜索到另一个vsys创建的数据", # "Search_type": "ID", # "Name": "测试app_group的vsys可见性的security_policy", # "vsys_operate": {"step1": "Tvsys10->create", "step2": "Tvsys3->search"}, # "file": "identify_OPENVPN_application.lua", # "Create": {"CheckName": ""} # # } # ] # ) # def test_vsys_change_case(self, demo_fixture, data): # attrs = Attributes(demo_fixture) # attrs._vsys_case(data)