__st__.py 913 字节
Newer Older
1 2
import sys
import os
3

4 5 6
# 获取当前脚本的绝对路径
current_dir = os.path.dirname(os.path.abspath(__file__))
# 构建预定系统的绝对路径
7
预定系统_path = os.path.abspath(os.path.join(current_dir, '..','..'))
8 9
# 添加路径
sys.path.append(预定系统_path)
10
# 导入模块
11 12 13
from 预定系统.Base.base import *

def suite_setup():
14
    STEP(1, "初始化浏览器")
15 16
    # 初始化浏览器与系统地址
    browser_init("标准版预定系统")
17 18
    admin_login("admin@Test", "Ubains@4321")
    sleep(2)
19
    wd = GSTORE['wd']
20 21 22 23 24 25 26 27 28 29 30
    # 进入后台模块
    safe_click((By.XPATH, "//img[@title='后台系统']"),wd)
    # 展开全局配置模块
    safe_click((By.XPATH, "//span[contains(text(),'全局配置')]"), wd)
    sleep(1)
    # 进入全局配置界面
    safe_click((By.XPATH, "//li[contains(text(),'全局配置')]"), wd)
    
def suite_teardown():
    wd = GSTORE['wd']
    wd.quit()