def test_api(suite_id: int, test_id: int) -> flask.wrappers.Response: '''gives information for runs and step view in json format''' steps = TestDao.get_steps_for_test(test_id) runs = RunDao.get_runs(test_id) step_headers = ["action", "optional", "arguments", "screenshot", "screenshot_name", "threshold"] run_headers = ["id", "start", "end", "passed", "screenshot_passed"] data = { "suite": suite_id, "test": test_id, "steps": [dict(zip(step_headers, [json_safe(i) for i in j])) for j in steps], "runs": [dict(zip(run_headers, [json_safe(i) for i in j])) for j in runs] } return jsonify(data)
def view_test(suite_id: int, test_id: int) -> str: '''for list of steps and runs''' steps = TestDao.get_steps_for_test(test_id) runs = RunDao.get_runs(test_id) return render_template('view/test.html', suite_id=suite_id, test_id=test_id, steps=steps, runs=runs)