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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
Index: 运维集控/项目测试/运维标准版/cases/07类型标签/01新增标签.py
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/运维集控/项目测试/运维标准版/cases/07类型标签/01新增标签.py b/运维集控/项目测试/运维标准版/cases/07类型标签/01新增标签.py
new file mode 100644
--- /dev/null (date 1740042840051)
+++ b/运维集控/项目测试/运维标准版/cases/07类型标签/01新增标签.py (date 1740042840051)
@@ -0,0 +1,85 @@
+import sys
+import os
+
+from hytest.common import SELENIUM_LOG_SCREEN
+
+sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', '..', '..', '..')))
+from 运维集控.项目测试.运维标准版.lib.base import *
+
+#构建当前项目路径
+sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', '..', '..', '..')))
+# 构建 CSV 文件的绝对路径
+csv_path = os.path.abspath(
+ os.path.join(os.path.dirname(__file__), '..', '..', 'testdata', '03类型标签', '新增标签.csv'))
+
+class AreagroupAdd:
+ tag = ['新增类型标签']
+ ddt_cases = read_csv_data(csv_path)
+ def teststeps(self):
+ wd = GSTORE['wd']
+ # 从self.para中解构出数据
+ name = self.name
+ area_group, group_name, group_address, remark, info = self.para
+
+ STEP(1, '点击新增按钮')
+ areagroup_add = WebDriverWait(wd, 10).until(
+ EC.element_to_be_clickable((By.XPATH, "//div[@class='company-edmit-right']//span[contains(text(),'新增')]"))
+ )
+ areagroup_add.click()
+
+ STEP(2, f'查看并选择类型标签:{area_group}')
+ if area_group:
+ area_group_input = WebDriverWait(wd, 10).until(
+ EC.presence_of_element_located((By.XPATH, "// input[ @ placeholder = '请选择分组']"))
+ )
+ area_group_input.clear()
+ area_group_input.send_keys(area_group)
+ sleep(1)
+ #默认选择第一个内容
+ area_group_select = WebDriverWait(wd, 10).until(
+ EC.presence_of_element_located((By.XPATH, "//div[@class='el-cascader__suggestion-panel el-scrollbar']//li[1]//span[1]"))
+ )
+ area_group_select.click()
+ else:
+ print("group_name 为空,不执行选择区域分组的操作")
+
+ STEP(3, f'填写标签名称:{group_name}')
+ group_name_input = WebDriverWait(wd, 10).until(
+ EC.presence_of_element_located((By.XPATH, "//input[@placeholder='长度1-20个字符']"))
+ )
+ group_name_input.clear()
+ group_name_input.send_keys(group_name)
+
+ STEP(4, f'填写标签排序:{group_address}')
+ group_address_input = WebDriverWait(wd, 10).until(
+ EC.presence_of_element_located((By.XPATH, "//input[@placeholder='输入地址不能大于50个字符']"))
+ )
+ group_address_input.clear()
+ group_address_input.send_keys(group_address)
+
+ STEP(5, f'填写分组备注:{remark}')
+ group_remark = WebDriverWait(wd, 10).until(
+ EC.presence_of_element_located(
+ (By.XPATH, "//input[@placeholder='请输入备注']"))
+ )
+ group_remark.clear()
+ group_remark.send_keys(remark)
+
+ STEP(6, '点击确认')
+ commit = WebDriverWait(wd, 10).until(
+ EC.element_to_be_clickable((By.XPATH, "//div[@class='dialog-footer']//span[contains(text(),'确 定')]"))
+ )
+ commit.click()
+
+ STEP(7, '验证是否新增成功')
+ get_menu = WebDriverWait(wd, 10).until(
+ EC.visibility_of_element_located((By.XPATH, "//p[@class='el-message__content']"))
+ )
+ get_menu1 = get_menu.text
+ CHECK_POINT('检查是否出现成功提示弹窗', get_menu1 == info )
+
+ # 截图并保存
+ SELENIUM_LOG_SCREEN(wd, "50%")
+ sleep(1)
+ wd.refresh()
+
Index: 运维集控/项目测试/运维标准版/testdata/07类型标签/新增标签.csv
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/运维集控/项目测试/运维标准版/testdata/07类型标签/新增标签.csv b/运维集控/项目测试/运维标准版/testdata/07类型标签/新增标签.csv
--- a/运维集控/项目测试/运维标准版/testdata/07类型标签/新增标签.csv (revision 58334bc635c926a3f46e76a7291f04d14e67f327)
+++ b/运维集控/项目测试/运维标准版/testdata/07类型标签/新增标签.csv (date 1740040640188)
@@ -1,0 +1,11 @@
+name,typename,sort
+新增标签-001-标签名称为空,,1
+新增标签-002-排序为空,智慧大屏1,
+新增标签-003-排序为小数,智慧大屏2,1.1
+新增标签-004-排序为负数,智慧大屏3,-1
+新增标签-005-正常新增标签1,智慧屏设备,1
+新增标签-006-正常新增标签2,时序电源,2
+新增标签-007-正常新增标签3,中控主机,3
+新增标签-008-正常新增标签4,音频处理器,4
+新增标签-009-正常新增标签5,视频处理器,5
+新增标签-010-正常新增标签6,网络路由,6
Index: 运维集控/项目测试/运维标准版/testdata/08设备管理/新增设备.csv
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/运维集控/项目测试/运维标准版/testdata/08设备管理/新增设备.csv b/运维集控/项目测试/运维标准版/testdata/08设备管理/新增设备.csv
--- a/运维集控/项目测试/运维标准版/testdata/08设备管理/新增设备.csv (revision 58334bc635c926a3f46e76a7291f04d14e67f327)
+++ b/运维集控/项目测试/运维标准版/testdata/08设备管理/新增设备.csv (date 1740041306744)
@@ -1,0 +1,2 @@
+name,area_name,device_name,type,brand,model,sn,ip,tag,supplier,contact,price,expiry_time,sort,useYear,description,relateMaster,outMaster
+新增设备-001-正常新增设备,测试区域11,测试设备0,智慧屏设备,华为品牌,Ideahub,123456789,192.168.1.1,资产设备1,华为,13141234567,2000,2025-01-01 12:00:00,1,3,用途说明1,否,否
\ No newline at end of file
Index: 运维集控/项目测试/运维标准版/cases/08设备管理/01新增设备.py
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/运维集控/项目测试/运维标准版/cases/08设备管理/01新增设备.py b/运维集控/项目测试/运维标准版/cases/08设备管理/01新增设备.py
new file mode 100644
--- /dev/null (date 1740042840000)
+++ b/运维集控/项目测试/运维标准版/cases/08设备管理/01新增设备.py (date 1740042840000)
@@ -0,0 +1,108 @@
+import sys
+import os
+
+from hytest.common import SELENIUM_LOG_SCREEN
+
+sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', '..', '..', '..')))
+from 运维集控.项目测试.运维标准版.lib.base import *
+
+# 构建 CSV 文件的绝对路径
+csv_path = os.path.abspath(
+ os.path.join(os.path.dirname(__file__), '..', '..', 'testdata', '08设备管理', '新增设备.csv'))
+
+class AreafuntionAdd:
+ tag = ['新增设备']
+ ddt_cases = read_csv_data(csv_path)
+ def teststeps(self):
+ wd = GSTORE['wd']
+
+ #从self.para中解构出数据
+ name = self.name
+ area_group, area_type, area_name, area_ip, remark, info = self.para
+
+ STEP(1, '点击新增按钮')
+ areafuntion_add = WebDriverWait(wd, 10).until(
+ EC.element_to_be_clickable(
+ (By.XPATH, "//div[@class='company-edmit-right']//span[contains(text(),'新增')]"))
+ )
+ areafuntion_add.click()
+ sleep(1)
+
+ STEP(2, f'查找并选择区域分组:{area_group}')
+ if area_group:
+ area_group_input = WebDriverWait(wd, 10).until(
+ EC.presence_of_element_located(
+ (By.XPATH, "//div[@class='dialog_input']//input[@placeholder='请选择分组']"))
+ )
+ area_group_input.send_keys(area_group)
+ #默认选择第一个分组
+ areagroup_select = WebDriverWait(wd, 10).until(
+ EC.presence_of_element_located(
+ (
+ By.XPATH, "//li[@class='el-cascader__suggestion-item']"))
+ )
+ sleep(1)
+ areagroup_select.click()
+ else:
+ print("group_name 为空,不执行选择区域分组的操作")
+
+ STEP(3, f'选择区域类型:{area_type}')
+ if area_type:
+ area_type_input = WebDriverWait(wd, 10).until(
+ EC.presence_of_element_located(
+ (By.XPATH, "//div[@class='dialog_input']//input[@placeholder='请选择区域类型']"))
+ )
+ area_type_input.send_keys(area_type)
+ #默认选择第一个区域类型
+ areatype_select = WebDriverWait(wd, 10).until(
+ EC.presence_of_element_located(
+ (By.XPATH, "//div[@x-placement='bottom-start']//ul[@class='el-scrollbar__view el-select-dropdown__list']"))
+ )
+ sleep(1)
+ areatype_select.click()
+ else:
+ print("area_type 为空,不执行选择区域类型的操作")
+
+ STEP(4, f'输入区域名称:{area_name}')
+ area_name_input = WebDriverWait(wd, 10).until(
+ EC.presence_of_element_located(
+ (By.XPATH, "//div[contains(@class,'dialog_input')]//input[contains(@placeholder,'请输入区域名称')]"))
+ )
+ area_name_input.clear()
+ area_name_input.send_keys(area_name)
+
+ STEP(5, f'填写IP地址:{area_ip}')
+ area_ip_input = WebDriverWait(wd, 10).until(
+ EC.presence_of_element_located(
+ (By.XPATH, "//input[@placeholder='IP地址']"))
+ )
+ area_ip_input.clear()
+ area_ip_input.send_keys(area_ip)
+
+ STEP(6, f'填写备注:{remark}')
+ funtion_remark = WebDriverWait(wd, 10).until(
+ EC.presence_of_element_located(
+ (By.XPATH, "//input[@placeholder='备注']"))
+ )
+ funtion_remark.clear()
+ funtion_remark.send_keys(remark)
+
+ STEP(7, '点击确认')
+ commit = WebDriverWait(wd, 10).until(
+ EC.element_to_be_clickable(
+ (By.XPATH, "//div[@aria-label='新增']//span[contains(text(),'确 定')]"))
+ )
+ commit.click()
+
+ STEP(8, '验证是否新增成功')
+ get_menu = WebDriverWait(wd, 10).until(
+ EC.visibility_of_element_located(
+ (By.CSS_SELECTOR, '.el-message__content'))
+ )
+ get_menu1 = get_menu.text
+ CHECK_POINT('检查是否出现成功提示弹窗', get_menu1 == info)
+
+ # 截图并保存
+ SELENIUM_LOG_SCREEN(wd, "50%")
+ sleep(1)
+ wd.refresh()
\ No newline at end of file
diff --git a/运维集控/项目测试/运维标准版/cases/07类型标签/02编辑标签.py b/运维集控/项目测试/运维标准版/cases/07类型标签/02编辑标签.py
new file mode 100644
diff --git a/运维集控/项目测试/运维标准版/cases/07类型标签/03删除标签.py b/运维集控/项目测试/运维标准版/cases/07类型标签/03删除标签.py
new file mode 100644
diff --git a/运维集控/项目测试/运维标准版/cases/08设备管理/02编辑设备.py b/运维集控/项目测试/运维标准版/cases/08设备管理/02编辑设备.py
new file mode 100644
diff --git a/运维集控/项目测试/运维标准版/cases/08设备管理/04删除设备.py b/运维集控/项目测试/运维标准版/cases/08设备管理/04删除设备.py
new file mode 100644
diff --git a/运维集控/项目测试/运维标准版/cases/08设备管理/03查询设备.py b/运维集控/项目测试/运维标准版/cases/08设备管理/03查询设备.py
new file mode 100644