mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-04 23:16:57 +08:00
change: rename StepData to StepResult
This commit is contained in:
@@ -12,13 +12,13 @@ from httprunner.utils import get_platform, ExtendJSONEncoder
|
|||||||
@pytest.fixture(scope="session", autouse=True)
|
@pytest.fixture(scope="session", autouse=True)
|
||||||
def session_fixture(request):
|
def session_fixture(request):
|
||||||
"""setup and teardown each task"""
|
"""setup and teardown each task"""
|
||||||
logger.info(f"start running testcases ...")
|
logger.info("start running testcases ...")
|
||||||
|
|
||||||
start_at = time.time()
|
start_at = time.time()
|
||||||
|
|
||||||
yield
|
yield
|
||||||
|
|
||||||
logger.info(f"task finished, generate task summary for --save-tests")
|
logger.info("task finished, generate task summary for --save-tests")
|
||||||
|
|
||||||
summary = {
|
summary = {
|
||||||
"success": True,
|
"success": True,
|
||||||
@@ -36,24 +36,27 @@ def session_fixture(request):
|
|||||||
summary["success"] &= testcase_summary.success
|
summary["success"] &= testcase_summary.success
|
||||||
|
|
||||||
summary["stat"]["testcases"]["total"] += 1
|
summary["stat"]["testcases"]["total"] += 1
|
||||||
summary["stat"]["teststeps"]["total"] += len(testcase_summary.step_datas)
|
summary["stat"]["teststeps"]["total"] += len(testcase_summary.step_results)
|
||||||
if testcase_summary.success:
|
if testcase_summary.success:
|
||||||
summary["stat"]["testcases"]["success"] += 1
|
summary["stat"]["testcases"]["success"] += 1
|
||||||
summary["stat"]["teststeps"]["successes"] += len(
|
summary["stat"]["teststeps"]["successes"] += len(
|
||||||
testcase_summary.step_datas
|
testcase_summary.step_results
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
summary["stat"]["testcases"]["fail"] += 1
|
summary["stat"]["testcases"]["fail"] += 1
|
||||||
summary["stat"]["teststeps"]["successes"] += (
|
summary["stat"]["teststeps"]["successes"] += (
|
||||||
len(testcase_summary.step_datas) - 1
|
len(testcase_summary.step_results) - 1
|
||||||
)
|
)
|
||||||
summary["stat"]["teststeps"]["failures"] += 1
|
summary["stat"]["teststeps"]["failures"] += 1
|
||||||
|
|
||||||
testcase_summary_json = testcase_summary.dict()
|
testcase_summary_json = testcase_summary.dict()
|
||||||
testcase_summary_json["records"] = testcase_summary_json.pop("step_datas")
|
testcase_summary_json["records"] = testcase_summary_json.pop("step_results")
|
||||||
summary["details"].append(testcase_summary_json)
|
summary["details"].append(testcase_summary_json)
|
||||||
|
|
||||||
summary_path = r"/Users/debugtalk/MyProjects/HttpRunner-dev/httprunner/examples/postman_echo/logs/request_methods/hardcode.summary.json"
|
summary_path = os.path.join(
|
||||||
|
os.getcwd(),
|
||||||
|
"examples/postman_echo/logs/request_methods/hardcode.summary.json"
|
||||||
|
)
|
||||||
summary_dir = os.path.dirname(summary_path)
|
summary_dir = os.path.dirname(summary_path)
|
||||||
os.makedirs(summary_dir, exist_ok=True)
|
os.makedirs(summary_dir, exist_ok=True)
|
||||||
|
|
||||||
@@ -61,4 +64,3 @@ def session_fixture(request):
|
|||||||
json.dump(summary, f, indent=4, ensure_ascii=False, cls=ExtendJSONEncoder)
|
json.dump(summary, f, indent=4, ensure_ascii=False, cls=ExtendJSONEncoder)
|
||||||
|
|
||||||
logger.info(f"generated task summary: {summary_path}")
|
logger.info(f"generated task summary: {summary_path}")
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ def session_fixture(request):
|
|||||||
|
|
||||||
yield
|
yield
|
||||||
|
|
||||||
logger.debug(f"teardown task fixture")
|
logger.debug("teardown task fixture")
|
||||||
|
|
||||||
# teardown task
|
# teardown task
|
||||||
# TODO: upload task summary
|
# TODO: upload task summary
|
||||||
|
|||||||
@@ -257,12 +257,12 @@ def ensure_cli_args(args: List) -> List:
|
|||||||
"""
|
"""
|
||||||
# remove deprecated --failfast
|
# remove deprecated --failfast
|
||||||
if "--failfast" in args:
|
if "--failfast" in args:
|
||||||
logger.warning(f"remove deprecated argument: --failfast")
|
logger.warning("remove deprecated argument: --failfast")
|
||||||
args.pop(args.index("--failfast"))
|
args.pop(args.index("--failfast"))
|
||||||
|
|
||||||
# convert --report-file to --html
|
# convert --report-file to --html
|
||||||
if "--report-file" in args:
|
if "--report-file" in args:
|
||||||
logger.warning(f"replace deprecated argument --report-file with --html")
|
logger.warning("replace deprecated argument --report-file with --html")
|
||||||
index = args.index("--report-file")
|
index = args.index("--report-file")
|
||||||
args[index] = "--html"
|
args[index] = "--html"
|
||||||
args.append("--self-contained-html")
|
args.append("--self-contained-html")
|
||||||
@@ -270,7 +270,7 @@ def ensure_cli_args(args: List) -> List:
|
|||||||
# keep compatibility with --save-tests in v2
|
# keep compatibility with --save-tests in v2
|
||||||
if "--save-tests" in args:
|
if "--save-tests" in args:
|
||||||
logger.warning(
|
logger.warning(
|
||||||
f"generate conftest.py keep compatibility with --save-tests in v2"
|
"generate conftest.py keep compatibility with --save-tests in v2"
|
||||||
)
|
)
|
||||||
args.pop(args.index("--save-tests"))
|
args.pop(args.index("--save-tests"))
|
||||||
_generate_conftest_for_summary(args)
|
_generate_conftest_for_summary(args)
|
||||||
@@ -327,21 +327,21 @@ def session_fixture(request):
|
|||||||
summary["success"] &= testcase_summary.success
|
summary["success"] &= testcase_summary.success
|
||||||
|
|
||||||
summary["stat"]["testcases"]["total"] += 1
|
summary["stat"]["testcases"]["total"] += 1
|
||||||
summary["stat"]["teststeps"]["total"] += len(testcase_summary.step_datas)
|
summary["stat"]["teststeps"]["total"] += len(testcase_summary.step_results)
|
||||||
if testcase_summary.success:
|
if testcase_summary.success:
|
||||||
summary["stat"]["testcases"]["success"] += 1
|
summary["stat"]["testcases"]["success"] += 1
|
||||||
summary["stat"]["teststeps"]["successes"] += len(
|
summary["stat"]["teststeps"]["successes"] += len(
|
||||||
testcase_summary.step_datas
|
testcase_summary.step_results
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
summary["stat"]["testcases"]["fail"] += 1
|
summary["stat"]["testcases"]["fail"] += 1
|
||||||
summary["stat"]["teststeps"]["successes"] += (
|
summary["stat"]["teststeps"]["successes"] += (
|
||||||
len(testcase_summary.step_datas) - 1
|
len(testcase_summary.step_results) - 1
|
||||||
)
|
)
|
||||||
summary["stat"]["teststeps"]["failures"] += 1
|
summary["stat"]["teststeps"]["failures"] += 1
|
||||||
|
|
||||||
testcase_summary_json = testcase_summary.dict()
|
testcase_summary_json = testcase_summary.dict()
|
||||||
testcase_summary_json["records"] = testcase_summary_json.pop("step_datas")
|
testcase_summary_json["records"] = testcase_summary_json.pop("step_results")
|
||||||
summary["details"].append(testcase_summary_json)
|
summary["details"].append(testcase_summary_json)
|
||||||
|
|
||||||
summary_path = r"{{SUMMARY_PATH_PLACEHOLDER}}"
|
summary_path = r"{{SUMMARY_PATH_PLACEHOLDER}}"
|
||||||
|
|||||||
@@ -150,20 +150,20 @@ class SessionData(BaseModel):
|
|||||||
validators: Dict = {}
|
validators: Dict = {}
|
||||||
|
|
||||||
|
|
||||||
class StepData(BaseModel):
|
class StepResult(BaseModel):
|
||||||
"""teststep data, each step maybe corresponding to one request or one testcase"""
|
"""teststep data, each step maybe corresponding to one request or one testcase"""
|
||||||
|
|
||||||
name: Text = "" # teststep name
|
name: Text = "" # teststep name
|
||||||
step_type: Text = "" # teststep type, request or testcase
|
step_type: Text = "" # teststep type, request or testcase
|
||||||
success: bool = False
|
success: bool = False
|
||||||
data: Union[SessionData, List['StepData']] = None
|
data: Union[SessionData, List['StepResult']] = None
|
||||||
elapsed: float = 0.0 # teststep elapsed time
|
elapsed: float = 0.0 # teststep elapsed time
|
||||||
content_size: float = 0 # response content size
|
content_size: float = 0 # response content size
|
||||||
export_vars: VariablesMapping = {}
|
export_vars: VariablesMapping = {}
|
||||||
attachment: Text = "" # teststep attachment
|
attachment: Text = "" # teststep attachment
|
||||||
|
|
||||||
|
|
||||||
StepData.update_forward_refs()
|
StepResult.update_forward_refs()
|
||||||
|
|
||||||
|
|
||||||
class IStep(object):
|
class IStep(object):
|
||||||
@@ -177,7 +177,7 @@ class IStep(object):
|
|||||||
def struct(self) -> TStep:
|
def struct(self) -> TStep:
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
def run(self, runner) -> StepData:
|
def run(self, runner) -> StepResult:
|
||||||
# runner: HttpRunner
|
# runner: HttpRunner
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
@@ -189,7 +189,7 @@ class TestCaseSummary(BaseModel):
|
|||||||
time: TestCaseTime
|
time: TestCaseTime
|
||||||
in_out: TestCaseInOut = {}
|
in_out: TestCaseInOut = {}
|
||||||
log: Text = ""
|
log: Text = ""
|
||||||
step_datas: List[StepData] = []
|
step_results: List[StepResult] = []
|
||||||
|
|
||||||
|
|
||||||
class PlatformInfo(BaseModel):
|
class PlatformInfo(BaseModel):
|
||||||
|
|||||||
+10
-10
@@ -17,7 +17,7 @@ from httprunner.client import HttpSession
|
|||||||
from httprunner.config import Config
|
from httprunner.config import Config
|
||||||
from httprunner.exceptions import ParamsError
|
from httprunner.exceptions import ParamsError
|
||||||
from httprunner.loader import load_project_meta
|
from httprunner.loader import load_project_meta
|
||||||
from httprunner.models import (ProjectMeta, StepData, TConfig, TestCaseInOut,
|
from httprunner.models import (ProjectMeta, StepResult, TConfig, TestCaseInOut,
|
||||||
TestCaseSummary, TestCaseTime, VariablesMapping)
|
TestCaseSummary, TestCaseTime, VariablesMapping)
|
||||||
from httprunner.parser import Parser
|
from httprunner.parser import Parser
|
||||||
from httprunner.utils import merge_variables
|
from httprunner.utils import merge_variables
|
||||||
@@ -35,7 +35,7 @@ class SessionRunner(object):
|
|||||||
__config: TConfig
|
__config: TConfig
|
||||||
__project_meta: ProjectMeta = None
|
__project_meta: ProjectMeta = None
|
||||||
__export: List[Text] = []
|
__export: List[Text] = []
|
||||||
__step_datas: List[StepData] = []
|
__step_results: List[StepResult] = []
|
||||||
__session_variables: VariablesMapping = {}
|
__session_variables: VariablesMapping = {}
|
||||||
# time
|
# time
|
||||||
__start_at: float = 0
|
__start_at: float = 0
|
||||||
@@ -58,7 +58,7 @@ class SessionRunner(object):
|
|||||||
self.root_dir, "logs", f"{self.case_id}.run.log"
|
self.root_dir, "logs", f"{self.case_id}.run.log"
|
||||||
)
|
)
|
||||||
|
|
||||||
self.__step_datas.clear()
|
self.__step_results.clear()
|
||||||
self.session = self.session or HttpSession()
|
self.session = self.session or HttpSession()
|
||||||
self.parser = self.parser or Parser(self.__project_meta.functions)
|
self.parser = self.parser or Parser(self.__project_meta.functions)
|
||||||
|
|
||||||
@@ -120,8 +120,8 @@ class SessionRunner(object):
|
|||||||
start_at_iso_format = datetime.utcfromtimestamp(start_at_timestamp).isoformat()
|
start_at_iso_format = datetime.utcfromtimestamp(start_at_timestamp).isoformat()
|
||||||
|
|
||||||
summary_success = True
|
summary_success = True
|
||||||
for step_data in self.__step_datas:
|
for step_result in self.__step_results:
|
||||||
if not step_data.success:
|
if not step_result.success:
|
||||||
summary_success = False
|
summary_success = False
|
||||||
break
|
break
|
||||||
|
|
||||||
@@ -139,7 +139,7 @@ class SessionRunner(object):
|
|||||||
export_vars=self.get_export_variables(),
|
export_vars=self.get_export_variables(),
|
||||||
),
|
),
|
||||||
log=self.__log_path,
|
log=self.__log_path,
|
||||||
step_datas=self.__step_datas,
|
step_results=self.__step_results,
|
||||||
)
|
)
|
||||||
|
|
||||||
def merge_step_variables(self, variables: VariablesMapping) -> VariablesMapping:
|
def merge_step_variables(self, variables: VariablesMapping) -> VariablesMapping:
|
||||||
@@ -152,7 +152,7 @@ class SessionRunner(object):
|
|||||||
# parse variables
|
# parse variables
|
||||||
return self.parser.parse_variables(variables)
|
return self.parser.parse_variables(variables)
|
||||||
|
|
||||||
def __run_step(self, step) -> Dict:
|
def __run_step(self, step):
|
||||||
"""run teststep, step maybe any kind that implements IStep interface
|
"""run teststep, step maybe any kind that implements IStep interface
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
@@ -164,14 +164,14 @@ class SessionRunner(object):
|
|||||||
# run step
|
# run step
|
||||||
if USE_ALLURE:
|
if USE_ALLURE:
|
||||||
with allure.step(f"step: {step.name()}"):
|
with allure.step(f"step: {step.name()}"):
|
||||||
step_result = step.run(self)
|
step_result: StepResult = step.run(self)
|
||||||
else:
|
else:
|
||||||
step_result = step.run(self)
|
step_result: StepResult = step.run(self)
|
||||||
|
|
||||||
# save extracted variables to session variables
|
# save extracted variables to session variables
|
||||||
self.__session_variables.update(step_result.export_vars)
|
self.__session_variables.update(step_result.export_vars)
|
||||||
# update testcase summary
|
# update testcase summary
|
||||||
self.__step_datas.append(step_result)
|
self.__step_results.append(step_result)
|
||||||
|
|
||||||
logger.info(f"run step end: {step.name()} <<<<<<\n")
|
logger.info(f"run step end: {step.name()} <<<<<<\n")
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
from typing import Union
|
from typing import Union
|
||||||
|
|
||||||
from httprunner.models import StepData, TRequest, TStep, TestCase
|
from httprunner.models import StepResult, TRequest, TStep, TestCase
|
||||||
from httprunner.runner import HttpRunner
|
from httprunner.runner import HttpRunner
|
||||||
from httprunner.step_request import RequestWithOptionalArgs, StepRequestExtraction, StepRequestValidation
|
from httprunner.step_request import RequestWithOptionalArgs, StepRequestExtraction, StepRequestValidation
|
||||||
from httprunner.step_testcase import StepRefCase
|
from httprunner.step_testcase import StepRefCase
|
||||||
@@ -36,5 +36,5 @@ class Step(object):
|
|||||||
def type(self) -> str:
|
def type(self) -> str:
|
||||||
return self.__step.type()
|
return self.__step.type()
|
||||||
|
|
||||||
def run(self, runner: HttpRunner) -> StepData:
|
def run(self, runner: HttpRunner) -> StepResult:
|
||||||
return self.__step.run(runner)
|
return self.__step.run(runner)
|
||||||
|
|||||||
+11
-10
@@ -6,7 +6,7 @@ from loguru import logger
|
|||||||
from httprunner import utils
|
from httprunner import utils
|
||||||
from httprunner.exceptions import ValidationFailure
|
from httprunner.exceptions import ValidationFailure
|
||||||
from httprunner.ext.uploader import prepare_upload_step
|
from httprunner.ext.uploader import prepare_upload_step
|
||||||
from httprunner.models import (Hooks, IStep, MethodEnum, StepData, TRequest,
|
from httprunner.models import (Hooks, IStep, MethodEnum, StepResult, TRequest,
|
||||||
TStep, VariablesMapping)
|
TStep, VariablesMapping)
|
||||||
from httprunner.parser import build_url
|
from httprunner.parser import build_url
|
||||||
from httprunner.response import ResponseObject
|
from httprunner.response import ResponseObject
|
||||||
@@ -58,12 +58,13 @@ def call_hooks(runner: HttpRunner, hooks: Hooks, step_variables: VariablesMappin
|
|||||||
logger.error(f"Invalid hook format: {hook}")
|
logger.error(f"Invalid hook format: {hook}")
|
||||||
|
|
||||||
|
|
||||||
def run_step_request(runner: HttpRunner, step: TStep) -> StepData:
|
def run_step_request(runner: HttpRunner, step: TStep) -> StepResult:
|
||||||
"""run teststep: request"""
|
"""run teststep: request"""
|
||||||
step_data = StepData(
|
step_result = StepResult(
|
||||||
name=step.name,
|
name=step.name,
|
||||||
success=False,
|
success=False,
|
||||||
)
|
)
|
||||||
|
start_time = time.time()
|
||||||
|
|
||||||
step.variables = runner.merge_step_variables(step.variables)
|
step.variables = runner.merge_step_variables(step.variables)
|
||||||
|
|
||||||
@@ -127,7 +128,7 @@ def run_step_request(runner: HttpRunner, step: TStep) -> StepData:
|
|||||||
# extract
|
# extract
|
||||||
extractors = step.extract
|
extractors = step.extract
|
||||||
extract_mapping = resp_obj.extract(extractors, step.variables)
|
extract_mapping = resp_obj.extract(extractors, step.variables)
|
||||||
step_data.export_vars = extract_mapping
|
step_result.export_vars = extract_mapping
|
||||||
|
|
||||||
variables_mapping = step.variables
|
variables_mapping = step.variables
|
||||||
variables_mapping.update(extract_mapping)
|
variables_mapping.update(extract_mapping)
|
||||||
@@ -138,21 +139,20 @@ def run_step_request(runner: HttpRunner, step: TStep) -> StepData:
|
|||||||
resp_obj.validate(
|
resp_obj.validate(
|
||||||
validators, variables_mapping
|
validators, variables_mapping
|
||||||
)
|
)
|
||||||
step_data.success = True
|
step_result.success = True
|
||||||
except ValidationFailure:
|
except ValidationFailure:
|
||||||
log_req_resp_details()
|
log_req_resp_details()
|
||||||
# log testcase duration before raise ValidationFailure
|
|
||||||
step_data.elapsed = time.time() - runner.__start_at
|
|
||||||
raise
|
raise
|
||||||
finally:
|
finally:
|
||||||
session_data = runner.session.data
|
session_data = runner.session.data
|
||||||
session_data.success = step_data.success
|
session_data.success = step_result.success
|
||||||
session_data.validators = resp_obj.validation_results
|
session_data.validators = resp_obj.validation_results
|
||||||
|
|
||||||
# save step data
|
# save step data
|
||||||
step_data.data = session_data
|
step_result.data = session_data
|
||||||
|
step_result.elapsed = time.time() - start_time
|
||||||
|
|
||||||
return step_data
|
return step_result
|
||||||
|
|
||||||
|
|
||||||
class StepRequestValidation(IStep):
|
class StepRequestValidation(IStep):
|
||||||
@@ -418,6 +418,7 @@ class RequestWithOptionalArgs(IStep):
|
|||||||
|
|
||||||
|
|
||||||
class RunRequest(object):
|
class RunRequest(object):
|
||||||
|
|
||||||
def __init__(self, name: Text):
|
def __init__(self, name: Text):
|
||||||
self.__step = TStep(name=name)
|
self.__step = TStep(name=name)
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ class TestRunRequest(unittest.TestCase):
|
|||||||
summary = runner.get_summary()
|
summary = runner.get_summary()
|
||||||
self.assertTrue(summary.success)
|
self.assertTrue(summary.success)
|
||||||
self.assertEqual(summary.name, "request methods testcase with functions")
|
self.assertEqual(summary.name, "request methods testcase with functions")
|
||||||
self.assertEqual(len(summary.step_datas), 3)
|
self.assertEqual(len(summary.step_results), 3)
|
||||||
self.assertEqual(summary.step_datas[0].name, "get with params")
|
self.assertEqual(summary.step_results[0].name, "get with params")
|
||||||
self.assertEqual(summary.step_datas[1].name, "post raw text")
|
self.assertEqual(summary.step_results[1].name, "post raw text")
|
||||||
self.assertEqual(summary.step_datas[2].name, "post form data")
|
self.assertEqual(summary.step_results[2].name, "post form data")
|
||||||
|
|||||||
+10
-10
@@ -3,14 +3,14 @@ from typing import Callable, Text
|
|||||||
from loguru import logger
|
from loguru import logger
|
||||||
|
|
||||||
from httprunner import exceptions
|
from httprunner import exceptions
|
||||||
from httprunner.models import IStep, StepData, TStep
|
from httprunner.models import IStep, StepResult, TStep, TestCaseSummary
|
||||||
from httprunner.runner import HttpRunner
|
from httprunner.runner import HttpRunner
|
||||||
from httprunner.step_request import call_hooks
|
from httprunner.step_request import call_hooks
|
||||||
|
|
||||||
|
|
||||||
def run_step_testcase(runner: HttpRunner, step: TStep) -> StepData:
|
def run_step_testcase(runner: HttpRunner, step: TStep) -> StepResult:
|
||||||
"""run teststep: referenced testcase"""
|
"""run teststep: referenced testcase"""
|
||||||
step_data = StepData(name=step.name)
|
step_result = StepResult(name=step.name)
|
||||||
step_variables = step.variables
|
step_variables = step.variables
|
||||||
step_export = step.export
|
step_export = step.export
|
||||||
|
|
||||||
@@ -32,15 +32,15 @@ def run_step_testcase(runner: HttpRunner, step: TStep) -> StepData:
|
|||||||
if step.teardown_hooks:
|
if step.teardown_hooks:
|
||||||
call_hooks(runner, step.teardown_hooks, step.variables, "teardown testcase")
|
call_hooks(runner, step.teardown_hooks, step.variables, "teardown testcase")
|
||||||
|
|
||||||
summary = ref_case_runner.get_summary()
|
summary: TestCaseSummary = ref_case_runner.get_summary()
|
||||||
step_data.data = summary.step_datas # list of step data
|
step_result.data = summary.step_results # list of step data
|
||||||
step_data.export_vars = summary.in_out.export_vars
|
step_result.export_vars = summary.in_out.export_vars
|
||||||
step_data.success = summary.success
|
step_result.success = summary.success
|
||||||
|
|
||||||
if step_data.export_vars:
|
if step_result.export_vars:
|
||||||
logger.info(f"export variables: {step_data.export_vars}")
|
logger.info(f"export variables: {step_result.export_vars}")
|
||||||
|
|
||||||
return step_data
|
return step_result
|
||||||
|
|
||||||
|
|
||||||
class StepRefCase(IStep):
|
class StepRefCase(IStep):
|
||||||
|
|||||||
@@ -12,12 +12,12 @@ class TestRunTestCase(unittest.TestCase):
|
|||||||
|
|
||||||
def test_run_testcase_by_path(self):
|
def test_run_testcase_by_path(self):
|
||||||
|
|
||||||
step_data = RunTestCase("run referenced testcase").call(
|
step_result = RunTestCase("run referenced testcase").call(
|
||||||
TestCaseRequestWithFunctions
|
TestCaseRequestWithFunctions
|
||||||
).run(self.runner)
|
).run(self.runner)
|
||||||
self.assertTrue(step_data.success)
|
self.assertTrue(step_result.success)
|
||||||
self.assertEqual(step_data.name, "run referenced testcase")
|
self.assertEqual(step_result.name, "run referenced testcase")
|
||||||
self.assertEqual(len(step_data.data), 3)
|
self.assertEqual(len(step_result.data), 3)
|
||||||
self.assertEqual(step_data.data[0].name, "get with params")
|
self.assertEqual(step_result.data[0].name, "get with params")
|
||||||
self.assertEqual(step_data.data[1].name, "post raw text")
|
self.assertEqual(step_result.data[1].name, "post raw text")
|
||||||
self.assertEqual(step_data.data[2].name, "post form data")
|
self.assertEqual(step_result.data[2].name, "post form data")
|
||||||
|
|||||||
Reference in New Issue
Block a user