示例#1
0
testerName = 'sunxiaojian'
controllerName = "RedirectPoliciesController"
interfaceChName = "Web重定向策略管理"
interfaceEnName = "addwebRedirectPolicies"

commonConfig = readYaml.get_config("common/config.yaml",
                                   "common")  # 返回config.yaml文件中的common数组的所有数据
authenticationApiPaths = readYaml.get_apiPath(
    "common/apiPaths/authenticationPath.yaml"
)  # 返回linkidPath.yaml文件中的所有linkid接口路径
urlIP = commonConfig[0]["linkidIP"]
urlPath = authenticationApiPaths[0]['addwebRedirectPolicies']

dirPath, fileName = os.path.split(os.path.abspath(__file__))
cases_main, parameters_main = jsonRead.loadHttpData(dirPath + "/testData.json",
                                                    'mainCaseData')  # 读取测试数据
cases_all, parameters_all = jsonRead.loadHttpData(dirPath + "/testData.json",
                                                  'allCaseData')
dbJsonPath = dirPath + "/dbData.json"
dbName = "authentication"


@allure.epic(controllerName)
@allure.feature(interfaceChName)
class Test_class():
    @allure.story(interfaceChName + "-主流程")
    @allure.title("{case}")
    @pytest.mark.dependency(name=interfaceEnName + "_main")
    @pytest.mark.parametrize("case,description,httpParameters",
                             list(parameters_main))
    def test_main(self, case, description, httpParameters):
示例#2
0
testerName = 'sunxiaojian'
controllerName = "RedirectPoliciesController"
interfaceChName = "Web重定向策略管理"
interfaceEnName = "deleteRule"

commonConfig = readYaml.get_config("common/config.yaml",
                                   "common")  #返回config.yaml文件中的common数组的所有数据
authenticationApiPaths = readYaml.get_apiPath(
    "common/apiPaths/authenticationPath.yaml"
)  # 返回linkidPath.yaml文件中的所有linkid接口路径
urlIP = commonConfig[0]["linkidIP"]
urlPath = authenticationApiPaths[0]['deleteRule']

dirPath, fileName = os.path.split(os.path.abspath(__file__))
cases_main, parameters_main = jsonRead.loadHttpData(dirPath + "/testData.json",
                                                    'mainCaseData')  #读取主流程测试数据
dbJsonPath = dirPath + "/dbData.json"  #获取数据库设计数据
dbName = "authentication"  #数据库设计中对应的组件


def setup_module():
    if checkConnect.checkConnection(urlIP) == 'error':
        raise Exception("服务器访问失败,请确定环境是否正常!")


@allure.epic(controllerName)
@allure.feature(interfaceChName)
class Test_class():
    def setup_method(self):
        print("\n ==清理数据库 & 插入数据==")
        mongoDataOpr.oprDatasToDB(dbJsonPath, dbName, "all")