How to use the httprunner.utils.dump_json_file function in httprunner

To help you get started, we’ve selected a few httprunner examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github httprunner / httprunner / httprunner / api.py View on Github external
self.exception_stage = "prepare testcases"
        prepared_testcases = self._prepare_tests(tests)

        # run prepared testcases
        self.exception_stage = "run prepared testcases"
        results = self._run_suite(prepared_testcases)

        # aggregate results
        self.exception_stage = "aggregate results"
        self._summary = self._aggregate(results)

        # generate html report
        self.exception_stage = "generate html report"

        if self.save_tests:
            utils.dump_json_file(
                self._summary.dict(),
                utils.prepare_log_file_abs_path(self.test_path, "summary.json"),
            )
            # save variables and export data
            vars_out = self.get_vars_out()
            utils.dump_json_file(
                vars_out, utils.prepare_log_file_abs_path(self.test_path, "io.json")
            )

        return self._summary
github httprunner / httprunner / httprunner / v3 / api.py View on Github external
# aggregate results
        self.exception_stage = "aggregate results"
        self._summary = self._aggregate(results)

        # generate html report
        self.exception_stage = "generate html report"
        report.stringify_summary(self._summary)

        if self.save_tests:
            utils.dump_json_file(
                self._summary.dict(),
                utils.prepare_log_file_abs_path(self.test_path, "summary.json")
            )
            # save variables and export data
            vars_out = self.get_vars_out()
            utils.dump_json_file(
                vars_out,
                utils.prepare_log_file_abs_path(self.test_path, "io.json")
            )

        return self._summary
github httprunner / httprunner / httprunner / api.py View on Github external
def run_tests(self, tests_mapping) -> TestSuiteSummary:
        """ run testcase/testsuite data
        """
        tests = TestsMapping.parse_obj(tests_mapping)
        self.test_path = tests.project_meta.test_path

        if self.save_tests:
            utils.dump_json_file(
                tests_mapping,
                utils.prepare_log_file_abs_path(self.test_path, "loaded.json"),
            )

        # prepare testcases
        self.exception_stage = "prepare testcases"
        prepared_testcases = self._prepare_tests(tests)

        # run prepared testcases
        self.exception_stage = "run prepared testcases"
        results = self._run_suite(prepared_testcases)

        # aggregate results
        self.exception_stage = "aggregate results"
        self._summary = self._aggregate(results)
github httprunner / httprunner / httprunner / v3 / api.py View on Github external
prepared_testcases = self._prepare_tests(tests)

        # run prepared testcases
        self.exception_stage = "run prepared testcases"
        results = self._run_suite(prepared_testcases)

        # aggregate results
        self.exception_stage = "aggregate results"
        self._summary = self._aggregate(results)

        # generate html report
        self.exception_stage = "generate html report"
        report.stringify_summary(self._summary)

        if self.save_tests:
            utils.dump_json_file(
                self._summary.dict(),
                utils.prepare_log_file_abs_path(self.test_path, "summary.json")
            )
            # save variables and export data
            vars_out = self.get_vars_out()
            utils.dump_json_file(
                vars_out,
                utils.prepare_log_file_abs_path(self.test_path, "io.json")
            )

        return self._summary
github httprunner / httprunner / httprunner / api.py View on Github external
# aggregate results
        self.exception_stage = "aggregate results"
        self._summary = self._aggregate(results)

        # generate html report
        self.exception_stage = "generate html report"

        if self.save_tests:
            utils.dump_json_file(
                self._summary.dict(),
                utils.prepare_log_file_abs_path(self.test_path, "summary.json"),
            )
            # save variables and export data
            vars_out = self.get_vars_out()
            utils.dump_json_file(
                vars_out, utils.prepare_log_file_abs_path(self.test_path, "io.json")
            )

        return self._summary
github httprunner / httprunner / httprunner / v3 / api.py View on Github external
def run_tests(self, tests_mapping) -> TestSuiteSummary:
        """ run testcase/testsuite data
        """
        tests = TestsMapping.parse_obj(tests_mapping)
        self.test_path = tests.project_mapping.test_path

        if self.save_tests:
            utils.dump_json_file(
                tests_mapping,
                utils.prepare_log_file_abs_path(self.test_path, "loaded.json")
            )

        # prepare testcases
        self.exception_stage = "prepare testcases"
        prepared_testcases = self._prepare_tests(tests)

        # run prepared testcases
        self.exception_stage = "run prepared testcases"
        results = self._run_suite(prepared_testcases)

        # aggregate results
        self.exception_stage = "aggregate results"
        self._summary = self._aggregate(results)