class TestCaseRequestWithTestcaseReference(HttpRunner): config = TConfig( **{ "name": "request with referenced testcase", "variables": { "foo1": "session_bar1", "var2": "testsuite_val2" }, "base_url": "https://postman-echo.com", "verify": False, "path": "examples/postman_echo/request_methods/demo_testsuite_yml/request_with_testcase_reference_test.py", }) teststeps = [ TStep( **{ "name": "request with functions", "variables": { "foo1": "override_bar1" }, "testcase": RequestWithFunctions, }), ]
class TestCaseRequestWithTestcaseReference(HttpRunner): config = TConfig( **{ "name": "request methods testcase: reference testcase", "variables": { "foo1": "session_bar1" }, "base_url": "https://postman-echo.com", "verify": False, "path": "examples/postman_echo/request_methods/request_with_testcase_reference_test.py", }) teststeps = [ TStep( **{ "name": "request with variables", "variables": { "foo1": "override_bar1" }, "testcase": "request_methods/request_with_variables.yml", }), ]
class TestCaseValidate(HttpRunner): config = TConfig( **{ "name": "basic test with httpbin", "base_url": "http://httpbin.org/", "path": "examples/httpbin/validate_test.py", } ) teststeps = [ TStep( **{ "name": "validate response with json path", "request": {"url": "/get", "params": {"a": 1, "b": 2}, "method": "GET"}, "validate": [ {"eq": ["status_code", 200]}, {"eq": ["body.args.a", 1]}, {"eq": ["body.args.b", 2]}, ], "validate_script": ["assert status_code == 200"], } ), TStep( **{ "name": "validate response with python script", "request": {"url": "/get", "params": {"a": 1, "b": 2}, "method": "GET"}, "validate": [{"eq": ["status_code", 200]}], "validate_script": [ "assert status_code == 201", "a = response_json.get('args').get('a')", "assert a == '1'", ], } ), ]
class TestCaseHooks(HttpRunner): config = TConfig( **{ "name": "basic test with httpbin", "base_url": "${get_httpbin_server()}", "setup_hooks": ["${hook_print(setup)}"], "teardown_hooks": ["${hook_print(teardown)}"], "path": "examples/httpbin/hooks_test.py", "variables": {}, }) teststeps = [ TStep( **{ "name": "headers", "variables": { "a": 123 }, "request": { "url": "/headers", "method": "GET" }, "setup_hooks": [ "${setup_hook_add_kwargs($request)}", "${setup_hook_remove_kwargs($request)}", ], "teardown_hooks": ["${teardown_hook_sleep_N_secs($response, 1)}"], "validate": [ { "eq": ["status_code", 200] }, { "contained_by": ["body.headers.Host", "${get_httpbin_server()}"] }, ], }), TStep( **{ "name": "alter response", "request": { "url": "/headers", "method": "GET" }, "teardown_hooks": ["${alter_response($response)}"], "validate": [ { "eq": ["status_code", 200] }, { "eq": ["body.headers.Host", "httpbin.org"] }, ], }), ]
class TestCaseUpload(HttpRunner): config = TConfig( **{ "name": "test upload file with httpbin", "base_url": "${get_httpbin_server()}", "path": "examples/httpbin/upload_test.py", "variables": {}, }) teststeps = [ TStep( **{ "name": "upload file", "variables": { "file_path": "test.env", "m_encoder": "${multipart_encoder(file=$file_path)}", }, "request": { "url": "/post", "method": "POST", "headers": { "Content-Type": "${multipart_content_type($m_encoder)}" }, "data": "$m_encoder", }, "validate": [ { "eq": ["status_code", 200] }, { "startswith": ["body.files.file", "UserName=test"] }, ], }), TStep( **{ "name": "upload file with keyword", "request": { "url": "/post", "method": "POST", "upload": { "file": "test.env" }, }, "validate": [ { "eq": ["status_code", 200] }, { "startswith": ["body.files.file", "UserName=test"] }, ], }), ]
class TestCaseLoadImage(HttpRunner): config = TConfig( **{ "name": "load images", "base_url": "${get_httpbin_server()}", "path": "examples/httpbin/load_image_test.py", "variables": {}, }) teststeps = [ TStep( **{ "name": "get png image", "request": { "url": "/image/png", "method": "GET" }, "validate": [{ "eq": ["status_code", 200] }], }), TStep( **{ "name": "get jpeg image", "request": { "url": "/image/jpeg", "method": "GET" }, "validate": [{ "eq": ["status_code", 200] }], }), TStep( **{ "name": "get webp image", "request": { "url": "/image/webp", "method": "GET" }, "validate": [{ "eq": ["status_code", 200] }], }), TStep( **{ "name": "get svg image", "request": { "url": "/image/svg", "method": "GET" }, "validate": [{ "eq": ["status_code", 200] }], }), ]
class TestCaseValidateWithFunctions(HttpRunner): config = TConfig( **{ "name": "request methods testcase: validate with functions", "variables": { "foo1": "session_bar1" }, "base_url": "https://postman-echo.com", "verify": False, "path": "examples/postman_echo/request_methods/validate_with_functions_test.py", }) teststeps = [ TStep( **{ "name": "get with params", "variables": { "foo1": "bar1", "foo2": "session_bar2", "sum_v": "${sum_two(1, 2)}", }, "request": { "method": "GET", "url": "/get", "params": { "foo1": "$foo1", "foo2": "$foo2", "sum_v": "$sum_v" }, "headers": { "User-Agent": "HttpRunner/${get_httprunner_version()}" }, }, "extract": { "session_foo2": "body.args.foo2" }, "validate": [ { "eq": ["status_code", 200] }, { "eq": ["body.args.sum_v", 3] }, { "less_than": ["body.args.sum_v", "${sum_two(2, 2)}"] }, ], }), ]
class TestCaseDemoTestcaseRef(HttpRunner): config = TConfig( **{ "name": "request methods testcase: reference testcase", "variables": { "foo1": "session_bar1" }, "base_url": "https://postman-echo.com", "verify": False, "path": "testcases/demo_testcase_ref_test.py", }) teststeps = [ TStep( **{ "name": "request with referenced testcase", "variables": { "foo1": "override_bar1" }, "testcase": "testcases/demo_testcase_request.yml", }), ]
class TestCaseHardcode(HttpRunner): config = TConfig( **{ "name": "request methods testcase in hardcode", "base_url": "https://postman-echo.com", "verify": False, "path": "examples/postman_echo/request_methods/hardcode_test.py", } ) teststeps = [ TStep( **{ "name": "get with params", "request": { "method": "GET", "url": "/get", "params": {"foo1": "bar1", "foo2": "bar2"}, "headers": {"User-Agent": "HttpRunner/3.0"}, }, "validate": [{"eq": ["status_code", 200]}], } ), TStep( **{ "name": "post raw text", "request": { "method": "POST", "url": "/post", "headers": { "User-Agent": "HttpRunner/3.0", "Content-Type": "text/plain", }, "data": "This is expected to be sent back as part of response body.", }, "validate": [{"eq": ["status_code", 200]}], } ), TStep( **{ "name": "post form data", "request": { "method": "POST", "url": "/post", "headers": { "User-Agent": "HttpRunner/3.0", "Content-Type": "application/x-www-form-urlencoded", }, "data": "foo1=bar1&foo2=bar2", }, "validate": [{"eq": ["status_code", 200]}], } ), TStep( **{ "name": "put request", "request": { "method": "PUT", "url": "/put", "headers": { "User-Agent": "HttpRunner/3.0", "Content-Type": "text/plain", }, "data": "This is expected to be sent back as part of response body.", }, "validate": [{"eq": ["status_code", 200]}], } ), ]
class TestCaseRequestWithFunctions(HttpRunner): config = TConfig( **{ "name": "request methods testcase with functions", "variables": {"foo1": "session_bar1"}, "base_url": "https://postman-echo.com", "verify": False, "path": "examples/postman_echo/request_methods/request_with_functions_test.py", } ) teststeps = [ TStep( **{ "name": "get with params", "variables": { "foo1": "bar1", "foo2": "session_bar2", "sum_v": "${sum_two(1, 2)}", }, "request": { "method": "GET", "url": "/get", "params": {"foo1": "$foo1", "foo2": "$foo2", "sum_v": "$sum_v"}, "headers": {"User-Agent": "HttpRunner/${get_httprunner_version()}"}, }, "extract": {"session_foo2": "body.args.foo2"}, "validate": [ {"eq": ["status_code", 200]}, {"eq": ["body.args.foo1", "session_bar1"]}, {"eq": ["body.args.sum_v", 3]}, {"eq": ["body.args.foo2", "session_bar2"]}, ], } ), TStep( **{ "name": "post raw text", "variables": {"foo1": "hello world", "foo3": "$session_foo2"}, "request": { "method": "POST", "url": "/post", "headers": { "User-Agent": "HttpRunner/${get_httprunner_version()}", "Content-Type": "text/plain", }, "data": "This is expected to be sent back as part of response body: $foo1-$foo3.", }, "validate": [ {"eq": ["status_code", 200]}, { "eq": [ "body.data", "This is expected to be sent back as part of response body: session_bar1-session_bar2.", ] }, ], } ), TStep( **{ "name": "post form data", "variables": {"foo1": "bar1", "foo2": "bar2"}, "request": { "method": "POST", "url": "/post", "headers": { "User-Agent": "HttpRunner/${get_httprunner_version()}", "Content-Type": "application/x-www-form-urlencoded", }, "data": "foo1=$foo1&foo2=$foo2", }, "validate": [ {"eq": ["status_code", 200]}, {"eq": ["body.form.foo1", "session_bar1"]}, {"eq": ["body.form.foo2", "bar2"]}, ], } ), ]
class TestCaseBasic(HttpRunner): config = TConfig( **{ "name": "basic test with httpbin", "base_url": "https://httpbin.org/", "path": "examples/httpbin/basic_test.py", "variables": {}, } ) teststeps = [ TStep( **{ "name": "headers", "request": {"url": "/headers", "method": "GET"}, "validate": [ {"eq": ["status_code", 200]}, {"eq": ["body.headers.Host", "httpbin.org"]}, ], } ), TStep( **{ "name": "user-agent", "request": {"url": "/user-agent", "method": "GET"}, "validate": [ {"eq": ["status_code", 200]}, {"startswith": ['body."user-agent"', "python-requests"]}, ], } ), TStep( **{ "name": "get without params", "request": {"url": "/get", "method": "GET"}, "validate": [{"eq": ["status_code", 200]}, {"eq": ["body.args", {}]}], } ), TStep( **{ "name": "get with params in url", "request": {"url": "/get?a=1&b=2", "method": "GET"}, "validate": [ {"eq": ["status_code", 200]}, {"eq": ["body.args", {"a": "1", "b": "2"}]}, ], } ), TStep( **{ "name": "get with params in params field", "request": {"url": "/get", "params": {"a": 1, "b": 2}, "method": "GET"}, "validate": [ {"eq": ["status_code", 200]}, {"eq": ["body.args", {"a": "1", "b": "2"}]}, ], } ), TStep( **{ "name": "set cookie", "request": {"url": "/cookies/set?name=value", "method": "GET"}, "validate": [ {"eq": ["status_code", 200]}, {"eq": ["body.cookies.name", "value"]}, ], } ), TStep( **{ "name": "extract cookie", "request": {"url": "/cookies", "method": "GET"}, "validate": [ {"eq": ["status_code", 200]}, {"eq": ["body.cookies.name", "value"]}, ], } ), TStep( **{ "name": "post data", "request": { "url": "/post", "method": "POST", "headers": {"Content-Type": "application/json"}, "data": "abc", }, "validate": [{"eq": ["status_code", 200]}], } ), TStep( **{ "name": "validate body length", "request": {"url": "/spec.json", "method": "GET"}, "validate": [{"len_eq": ["body", 9]}], } ), ]
class TestCaseHardcode(HttpRunner): config = TConfig( **{ "name": "set & delete cookies.", "base_url": "https://postman-echo.com", "verify": False, "export": ["cookie_foo1", "cookie_foo3"], "path": "examples/postman_echo/cookie_manipulation/hardcode_test.py", }) teststeps = [ TStep( **{ "name": "set cookie foo1 & foo2 & foo3", "request": { "method": "GET", "url": "/cookies/set", "params": { "foo1": "bar1", "foo2": "bar2" }, "headers": { "User-Agent": "HttpRunner/${get_httprunner_version()}" }, }, "extract": { "cookie_foo1": "$.cookies.foo1" }, "validate": [ { "eq": ["status_code", 200] }, { "eq": ["cookies.foo1", "bar1"] }, ], }), TStep( **{ "name": "delete cookie foo2", "request": { "method": "GET", "url": "/cookies/delete?foo2", "headers": { "User-Agent": "HttpRunner/${get_httprunner_version()}" }, }, "validate": [ { "eq": ["status_code", 200] }, { "ne": ["$.cookies.foo1", "$foo1"] }, { "eq": ["$.cookies.foo1", "$cookie_foo1"] }, { "eq": ["$.cookies.foo3", "$cookie_foo3"] }, ], }), ]
class TestCaseLogin(HttpRunner): config = TConfig( **{ "name": "create a demo", "variables": { "login_email": "*****@*****.**", "login_password": 592223, }, "base_url": "https://www.processon.com/", "verify": False, "path": "hogwarts-demo/testcases/login_test.py", }) teststeps = [ TStep( **{ "name": "login", "variables": {}, "request": { "method": "POST", "url": "/login", "headers": { "Content-Type": "application/x-www-form-urlencoded" }, "data": { "login_email": "$login_email", "login_password": "******", }, }, "validate": [{ "eq": ["status_code", 200] }], }), TStep( **{ "name": "create flow", "variables": {}, "request": { "method": "GET", "url": "/diagraming/new", "params": { "category": "flow" }, }, "extract": { "body": "body" }, "validate": [{ "eq": ["status_code", 200] }], }), TStep( **{ "name": "rename", "variables": { "chartId": "${get_chartId($body)}" }, "request": { "method": "POST", "url": "/folder/rename/chart", "headers": { "Content-Type": "application/x-www-form-urlencoded" }, "data": { "title": "demo1234", "ignore": "title", "chartId": "$chartId", }, "validate": [{ "eq": "status_code" }, { "eq": 200 }], }, }), ]
class TestCaseMubuLogin(HttpRunner): config = TConfig( **{ "name": "testcase description", "variables": { "user_phone": "18613143458", "password": "******", }, "verify": False, "base_url": "https://mubu.com", "export": ["user_persistence", "jwt_token"], "path": "testcases/mubu_login_test.py", }) teststeps = [ TStep( **{ "name": "/", "request": { "headers": { "X-Request-ID": "${gen_request_id()}", "sec-fetch-dest": "document", "sec-fetch-mode": "navigate", "sec-fetch-site": "same-origin", "sec-fetch-user": "******", "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36 HttpRunner/${get_httprunner_version()}", }, "method": "GET", "url": "/", }, "validate": [{ "eq": ["status_code", "${get_expected_status_code(100, 100)}"] }], }), TStep( **{ "name": "/login", "request": { "headers": { "X-Request-ID": "${gen_request_id()}", "referer": "https://mubu.com/", "sec-fetch-dest": "document", "sec-fetch-mode": "navigate", "sec-fetch-site": "same-origin", "sec-fetch-user": "******", "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36 HttpRunner/${get_httprunner_version()}", }, "method": "GET", "url": "/login", }, "validate": [{ "eq": ["status_code", 200] }], }), TStep( **{ "name": "/login/password", "request": { "headers": { "X-Request-ID": "${gen_request_id()}", "referer": "https://mubu.com/login", "sec-fetch-dest": "document", "sec-fetch-mode": "navigate", "sec-fetch-site": "same-origin", "sec-fetch-user": "******", "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36 HttpRunner/${get_httprunner_version()}", }, "method": "GET", "url": "/login/password", }, "validate": [{ "eq": ["status_code", 200] }], }), TStep( **{ "name": "/api/login/submit", "request": { "data": { "password": "******", "phone": "$user_phone", "remember": "true", }, "headers": { "X-Request-ID": "${gen_request_id()}", "content-type": "application/x-www-form-urlencoded; charset=UTF-8", "referer": "https://mubu.com/login/password", "sec-fetch-dest": "empty", "sec-fetch-mode": "cors", "sec-fetch-site": "same-origin", "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36 HttpRunner/${get_httprunner_version()}", "x-requested-with": "XMLHttpRequest", }, "method": "POST", "url": "/api/login/submit", }, "extract": { "user_persistence": "cookies.user_persistence", "jwt_token": 'cookies."Jwt-Token"', }, "teardown_hooks": ["${sleep(1)}"], "validate": [ { "eq": ["status_code", 200] }, { "eq": ["body.code", 0] }, { "eq": ["body.msg", None] }, ], }), TStep( **{ "name": "/list", "request": { "headers": { "X-Request-ID": "${gen_request_id()}", "referer": "https://mubu.com/login/password", "sec-fetch-dest": "document", "sec-fetch-mode": "navigate", "sec-fetch-site": "same-origin", "sec-fetch-user": "******", "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36 HttpRunner/${get_httprunner_version()}", }, "method": "GET", "url": "/list", }, "validate": [{ "eq": ["status_code", 200] }], }), TStep( **{ "name": "/api/list/tip_new_update", "request": { "data": "", "headers": { "X-Request-ID": "${gen_request_id()}", "referer": "https://mubu.com/list", "sec-fetch-dest": "empty", "sec-fetch-mode": "cors", "sec-fetch-site": "same-origin", "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36 HttpRunner/${get_httprunner_version()}", "x-requested-with": "XMLHttpRequest", }, "method": "POST", "url": "/api/list/tip_new_update", }, "validate": [ { "eq": ["status_code", 200] }, { "eq": ["body.code", 0] }, { "eq": ["body.msg", None] }, ], }), TStep( **{ "name": "/api/list/get", "request": { "data": { "folderId": "0", "keywords": "", "sort": "name", "source": "", }, "headers": { "X-Request-ID": "${gen_request_id()}", "content-type": "application/x-www-form-urlencoded; charset=UTF-8", "referer": "https://mubu.com/list", "sec-fetch-dest": "empty", "sec-fetch-mode": "cors", "sec-fetch-site": "same-origin", "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36 HttpRunner/${get_httprunner_version()}", "x-requested-with": "XMLHttpRequest", }, "method": "POST", "url": "/api/list/get", }, "validate": [ { "eq": ["status_code", 200] }, { "eq": ["body.code", 0] }, { "eq": ["body.msg", None] }, ], }), TStep( **{ "name": "/api/message/get_message_unread", "request": { "data": "", "headers": { "X-Request-ID": "${gen_request_id()}", "referer": "https://mubu.com/list", "sec-fetch-dest": "empty", "sec-fetch-mode": "cors", "sec-fetch-site": "same-origin", "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36 HttpRunner/${get_httprunner_version()}", "x-requested-with": "XMLHttpRequest", }, "method": "POST", "url": "/api/message/get_message_unread", }, "validate": [ { "eq": ["status_code", 200] }, { "eq": ["body.code", 0] }, { "eq": ["body.msg", None] }, ], }), ]
class TestCaseMubuCreatedoc(HttpRunner): config = TConfig( **{ "name": "testcase description", "variables": { "user_phone": "18613143458", "password": "******", }, "verify": False, "base_url": "https://api2.mubu.com", "path": "testcases/mubu_createdoc_test.py", }) teststeps = [ TStep(**{ "name": "login mubu", "testcase": "testcases/mubu.login.yml" }), TStep( **{ "name": "/api/list/create_doc", "request": { "data": { "folderId": "0", "type": "0" }, "headers": { "content-type": "application/x-www-form-urlencoded; charset=UTF-8", "cookie": "user_persistence=$user_persistence", "referer": "https://mubu.com/list", "sec-fetch-dest": "empty", "sec-fetch-mode": "cors", "sec-fetch-site": "same-origin", "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36 HttpRunner/${get_httprunner_version()}", "x-requested-with": "XMLHttpRequest", }, "method": "POST", "url": "https://mubu.com/api/list/create_doc", }, "extract": { "docId": "body.data.id" }, "validate": [ { "eq": ["status_code", 200] }, { "eq": ["body.code", 0] }, { "eq": ["body.msg", None] }, ], }), TStep( **{ "name": "/doc$docId", "request": { "headers": { "cookie": "user_persistence=$user_persistence", "referer": "https://mubu.com/list", "sec-fetch-dest": "document", "sec-fetch-mode": "navigate", "sec-fetch-site": "same-origin", "sec-fetch-user": "******", "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36 HttpRunner/${get_httprunner_version()}", }, "method": "GET", "url": "https://mubu.com/doc$docId", }, "validate": [{ "eq": ["status_code", 200] }], }), TStep( **{ "name": "/v3/api/user/current_user", "request": { "data": "", "headers": { "data-unique-id": "5410ad30-980c-11ea-8923-e551129da490", "jwt-token": "$jwt_token", "referer": "https://mubu.com/doc$docId", "sec-fetch-dest": "empty", "sec-fetch-mode": "cors", "sec-fetch-site": "same-site", "token": "$jwt_token", "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36 HttpRunner/${get_httprunner_version()}", "x-request-id": "8d64a21f-b97a-4900-9fc2-6ffb60071d7b", }, "method": "POST", "url": "https://api2.mubu.com/v3/api/user/current_user", }, "validate": [ { "eq": ["status_code", 200] }, { "eq": ["body.code", 0] }, { "eq": ["body.msg", "success"] }, ], }), TStep( **{ "name": "/v3/api/document/get", "request": { "headers": { "content-type": "application/json;charset=UTF-8", "data-unique-id": "5410ad30-980c-11ea-8923-e551129da490", "jwt-token": "$jwt_token", "referer": "https://mubu.com/doc$docId", "sec-fetch-dest": "empty", "sec-fetch-mode": "cors", "sec-fetch-site": "same-site", "token": "$jwt_token", "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36 HttpRunner/${get_httprunner_version()}", "x-request-id": "80f926fe-37c4-45a0-aa85-96d78b3c78e0", }, "json": { "docId": "$docId" }, "method": "POST", "url": "https://api2.mubu.com/v3/api/document/get", }, "validate": [ { "eq": ["status_code", 200] }, { "eq": ["body.code", 0] }, { "eq": ["body.msg", "Success"] }, ], }), TStep( **{ "name": "/v3/api/user/current_level", "request": { "headers": { "content-type": "application/json;charset=UTF-8", "data-unique-id": "5410ad30-980c-11ea-8923-e551129da490", "jwt-token": "$jwt_token", "referer": "https://mubu.com/doc$docId", "sec-fetch-dest": "empty", "sec-fetch-mode": "cors", "sec-fetch-site": "same-site", "token": "$jwt_token", "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36 HttpRunner/${get_httprunner_version()}", "x-request-id": "d7f43e29-a625-4561-95f3-906134e71f37", }, "json": { "document_id": "$docId" }, "method": "POST", "url": "https://api2.mubu.com/v3/api/user/current_level", }, "validate": [ { "eq": ["status_code", 200] }, { "eq": ["body.code", 0] }, { "eq": ["body.msg", "OK"] }, ], }), TStep( **{ "name": "/v3/api/user/get_user_params", "request": { "data": "", "headers": { "data-unique-id": "5410ad30-980c-11ea-8923-e551129da490", "jwt-token": "$jwt_token", "referer": "https://mubu.com/doc$docId", "sec-fetch-dest": "empty", "sec-fetch-mode": "cors", "sec-fetch-site": "same-site", "token": "$jwt_token", "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36 HttpRunner/${get_httprunner_version()}", "x-request-id": "ccddfa20-40d6-42bc-8964-8730a57da9ba", }, "method": "POST", "url": "https://api2.mubu.com/v3/api/user/get_user_params", }, "validate": [ { "eq": ["status_code", 200] }, { "eq": ["body.code", 0] }, { "eq": ["body.msg", "success"] }, ], }), TStep( **{ "name": "/v3/api/user/get_invite_count", "request": { "headers": { "data-unique-id": "5410ad30-980c-11ea-8923-e551129da490", "jwt-token": "$jwt_token", "referer": "https://mubu.com/doc$docId", "sec-fetch-dest": "empty", "sec-fetch-mode": "cors", "sec-fetch-site": "same-site", "token": "$jwt_token", "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36 HttpRunner/${get_httprunner_version()}", "x-request-id": "5d1ba900-f963-49c2-8125-6ffdbae77eaf", }, "method": "GET", "url": "https://api2.mubu.com/v3/api/user/get_invite_count", }, "validate": [ { "eq": ["status_code", 200] }, { "eq": ["body.code", 0] }, { "eq": ["body.msg", None] }, ], }), TStep( **{ "name": "/v3/api/colla/register", "request": { "headers": { "data-unique-id": "5410ad30-980c-11ea-8923-e551129da490", "jwt-token": "$jwt_token", "referer": "https://mubu.com/doc$docId", "sec-fetch-dest": "empty", "sec-fetch-mode": "cors", "sec-fetch-site": "same-site", "token": "$jwt_token", "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36 HttpRunner/${get_httprunner_version()}", "x-request-id": "4aca8841-02bb-47da-bb2f-66838ccd9a03", }, "method": "GET", "url": "/v3/api/colla/register", }, "validate": [ { "eq": ["status_code", 200] }, { "eq": ["body.code", 0] }, { "eq": ["body.msg", "Success"] }, ], }), ]