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
import sys
import os
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', '..', '..', '..')))
from 运维集控.项目测试.运维标准版.lib.base import *
class areafuntionDel001:
name = 'areafuntion_del_001'
def teststeps(self):
wd = GSTORE['wd']
STEP(1, '搜索对应的区域功能')
areafuntion_search= WebDriverWait(wd, 10).until(
EC.element_to_be_clickable((By.XPATH, "(//input[contains(@placeholder,'请输入区域功能')])[1]"))
)
areafuntion_search.clear()
areafuntion_search.send_keys("修改-测试功能1")
STEP(2, '勾选区域功能')
areafuntion_select = WebDriverWait(wd, 10).until(
EC.element_to_be_clickable((By.XPATH, "(//span[contains(@class,'el-checkbox__inner')])[2]"))
)
areafuntion_select.click()
STEP(3, '点击删除按钮')
areafuntion_mod = WebDriverWait(wd, 10).until(
EC.element_to_be_clickable((By.XPATH, "//div[@class='company-edmit-right']//span[contains(text(),'删除')]"))
)
areafuntion_mod.click()
sleep(2)
STEP(4, '点击确认')
commit = WebDriverWait(wd, 10).until(
EC.element_to_be_clickable((By.XPATH, "//div[@class='dialog-footer']//span[contains(text(),'确 定')]"))
)
commit.click()
STEP(5, '验证是否修改成功')
get_menu = WebDriverWait(wd, 10).until(
EC.presence_of_element_located((By.CSS_SELECTOR, '.el-message__content'))
)
get_menu1 = get_menu.text
CHECK_POINT('检查是否出现成功提示弹窗', get_menu1 == "操作成功!")
sleep(2)