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[@placeholder='请输入功能名称']")) ) areafuntion_search.clear() areafuntion_search.send_keys("修改-测试功能1") STEP(2, '勾选区域功能') areafuntion_select = WebDriverWait(wd, 10).until( EC.element_to_be_clickable( (By.XPATH, "(//span[@class='el-checkbox__inner'])[2]")) ) areafuntion_select.click() STEP(3, '点击删除按钮') areafuntion_mod = WebDriverWait(wd, 10).until( EC.element_to_be_clickable( (By.XPATH, "//span[contains(text(),'删除')]")) ) areafuntion_mod.click() sleep(1) STEP(4, '点击确认') commit = WebDriverWait(wd, 10).until( EC.element_to_be_clickable( (By.XPATH, "(//span[contains(text(),'确 定')])[3]")) ) commit.click() STEP(5, '验证是否修改成功') 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 == "操作成功!") # 截图并保存 SELENIUM_LOG_SCREEN(wd, "50%") sleep(1) wd.refresh()