(self, testcase: TestCase)
return self
run specified testcase

        Examples:
            >>> testcase_obj = TestCase(config=TConfig(...), teststeps=[TStep(...)])
            >>> HttpRunner().with_project_meta(project_meta).run_testcase(testcase_obj)
run specified testcase
run specified testcase
def run_testcase(self, testcase: TestCase) -> "HttpRunner":
        """run specified testcase

        Examples:
            >>> testcase_obj = TestCase(config=TConfig(...), teststeps=[TStep(...)])
            >>> HttpRunner().with_project_meta(project_meta).run_testcase(testcase_obj)

        """
        self.__config = testcase.config
        self.__teststeps = testcase.teststeps

        # prepare
        self.__project_meta = self.__project_meta or load_project_meta(
            self.__config.path
        )
        self.__parse_config(self.__config)
        self.__start_at = time.time()
        self.__step_datas: List[StepData] = []
        self.__session = self.__session or HttpSession()
        # save extracted variables of teststeps
        extracted_variables: VariablesMapping = {}

        # run teststeps
        for step in self.__teststeps:
            # override variables
            # step variables > extracted variables from previous steps
            step.variables = merge_variables(step.variables, extracted_variables)
            # step variables > testcase config variables
            step.variables = merge_variables(step.variables, self.__config.variables)

            # parse variables
            step.variables = parse_variables_mapping(
                step.variables, self.__project_meta.functions
            )

            # run step
            if USE_ALLURE:
                with allure.step(f"step: {step.name}"):
                    extract_mapping = self.__run_step(step)
            else:
                extract_mapping = self.__run_step(step)

            # save extracted variables to session variables
            extracted_variables.update(extract_mapping)

        self.__session_variables.update(extracted_variables)
        self.__duration = time.time() - self.__start_at
        return self
def run_testcase ( self , testcase : TestCase ) -> "HttpRunner" : self . __config = testcase . config self . __teststeps = testcase . teststeps # prepare self . __project_meta = self . __project_meta or load_project_meta ( self . __config . path ) self . __parse_config ( self . __config ) self . __start_at = time . time ( ) self . __step_datas : List [ StepData ] = [ ] self . __session = self . __session or HttpSession ( ) # save extracted variables of teststeps extracted_variables : VariablesMapping = { } # run teststeps for step in self . __teststeps : # override variables # step variables > extracted variables from previous steps step . variables = merge_variables ( step . variables , extracted_variables ) # step variables > testcase config variables step . variables = merge_variables ( step . variables , self . __config . variables ) # parse variables step . variables = parse_variables_mapping ( step . variables , self . __project_meta . functions ) # run step if USE_ALLURE : with allure . step ( f"step: {step.name}" ) : extract_mapping = self . __run_step ( step ) else : extract_mapping = self . __run_step ( step ) # save extracted variables to session variables extracted_variables . update ( extract_mapping ) self . __session_variables . update ( extracted_variables ) self . __duration = time . time ( ) - self . __start_at return self