summaryrefslogtreecommitdiff
path: root/cases/object/test_app_attributes.py
blob: f1d3446f76f8b8bc58be39f6f0f45e21634b852d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
# -*- 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)