- TestReport

# Test Report:

## Summary

START AT | 2019-03-06 20:05:16
DURATION | 0.202 seconds
PLATFORM | zybats 2.0.2.0 | CPython 3.7.0 | Windows-10-10.0.17134-SP0
STAT | TESTCASES (success/fail) | TESTSTEPS (success/fail/error/skip)
--- | --- | ---
total (details) => | 1 (0/1) | 3 (2/0/1/0)

## Details

### Shows how to use zybats ext api.

TOTAL: 3 | SUCCESS: 2 | FAILED: 0 | ERROR: 1 | SKIPPED: 0
Status | Name | Response Time | Detail
--- | --- | --- | ---
success | get token (setup) | 23.93 ms | log-1 ## Request and Response data × ### Name: get token (setup) ### Request:
url | http://127.0.0.1:8080/api/getTokenId
method | POST
headers | User-Agent: python-requests/2.19.1 Accept-Encoding: gzip, deflate Accept: */* Connection: keep-alive Content-Type: application/json Content-Length: 107
body | {"user_agent": "iOS/10.3", "device_sn": "TESTCASE_SETUP_XXX", "os_platform": "ios", "app_version": "2.8.6"}
### Response:
ok | True
url | http://127.0.0.1:8080/api/getTokenId
status_code | 200
reason |
cookies | {}
encoding | UTF-8
headers | Content-Type: text/plain;charset=UTF-8 Content-Length: 77 Date: Wed, 06 Mar 2019 12:05:16 GMT
content_type | text/plain;charset=UTF-8
json | {'id': '11', 'request': {'base_url': '', 'headers': {'User-Agent': 'homeworkGray'}}}
### Validators:
check | comparator | expect value | actual value
--- | --- | --- | ---
status_code | eq | 200 | 200
### Statistics:
content_size(bytes) | 77
response_time(ms) | 23.93
elapsed(ms) | 15.768
error | use redis ext api example | N/A ms | log-1 ## Request and Response data × ### Name: ### Request:
url | N/A
method | N/A
headers |
### Response:
status_code | N/A
headers |
encoding | None
content_type |
### Validators:
check | comparator | expect value | actual value
--- | --- | --- | ---
### Statistics:
content_size(bytes) | N/A
response_time(ms) | N/A
elapsed(ms) | N/A
traceback ## Traceback Message ×
    Traceback (most recent call last):
      File "c:\users\zuoyebang\appdata\local\programs\python\python37\lib\site-packages\zybats\parser.py", line 369, in get_mapping_variable
        return variables_mapping[variable_name]
    KeyError: 'replace_app_id'

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "c:\users\zuoyebang\appdata\local\programs\python\python37\lib\site-packages\zybats\core\api.py", line 55, in test
        test_runner.run_test(test_dict)
      File "c:\users\zuoyebang\appdata\local\programs\python\python37\lib\site-packages\zybats\runner.py", line 359, in run_test
        self._run_test(test_dict)
      File "c:\users\zuoyebang\appdata\local\programs\python\python37\lib\site-packages\zybats\runner.py", line 213, in _run_test
        self.do_hook_actions(setup_hooks, "setup")
      File "c:\users\zuoyebang\appdata\local\programs\python\python37\lib\site-packages\zybats\runner.py", line 157, in do_hook_actions
        self.session_context.eval_content(action)
      File "c:\users\zuoyebang\appdata\local\programs\python\python37\lib\site-packages\zybats\context.py", line 70, in eval_content
        self.FUNCTIONS_MAPPING
      File "c:\users\zuoyebang\appdata\local\programs\python\python37\lib\site-packages\zybats\parser.py", line 601, in parse_data
        functions_mapping
      File "c:\users\zuoyebang\appdata\local\programs\python\python37\lib\site-packages\zybats\parser.py", line 436, in parse_string_functions
        args = parse_data(args, variables_mapping, functions_mapping)
      File "c:\users\zuoyebang\appdata\local\programs\python\python37\lib\site-packages\zybats\parser.py", line 567, in parse_data
        for item in content
      File "c:\users\zuoyebang\appdata\local\programs\python\python37\lib\site-packages\zybats\parser.py", line 567, in <listcomp>
        for item in content
      File "c:\users\zuoyebang\appdata\local\programs\python\python37\lib\site-packages\zybats\parser.py", line 607, in parse_data
        functions_mapping
      File "c:\users\zuoyebang\appdata\local\programs\python\python37\lib\site-packages\zybats\parser.py", line 485, in parse_string_variables
        variable_value = get_mapping_variable(variable_name, variables_mapping)
      File "c:\users\zuoyebang\appdata\local\programs\python\python37\lib\site-packages\zybats\parser.py", line 371, in get_mapping_variable
        raise exceptions.VariableNotFound("{} is not found.".format(variable_name))
    zybats.exceptions.VariableNotFound: replace_app_id is not found.
success | use mysql ext api example | 12.96 ms | log-1 ## Request and Response data × ### Name: use mysql ext api example ### Request:
url | http://127.0.0.1:8080/set/mysql
method | POST
headers | User-Agent: python-requests/2.19.1 Accept-Encoding: gzip, deflate Accept: */* Connection: keep-alive Content-Type: application/json; charset=UTF-8 Content-Length: 132
body | {"ZYBUSS": "R2wZjrBdSurcW71Ed_nra2QQBcvAQb2gdRAIXRg5NDorqOZC6_SWIVZce5dR7o0u", "_t_": "1544443254", "appId": "homework", "id": "11"}
### Response:
ok | True
url | http://127.0.0.1:8080/set/mysql
status_code | 200
reason |
cookies | {}
encoding | UTF-8
headers | Content-Type: text/plain;charset=UTF-8 Content-Length: 12 Date: Wed, 06 Mar 2019 12:05:16 GMT
content_type | text/plain;charset=UTF-8
json | {'msg': 'ok'}
### Validators:
check | comparator | expect value | actual value
--- | --- | --- | ---
status_code | eq | 200 | 200
${query_mysql_one_result($sql_str)} | eq | 67 | 67
### Statistics:
content_size(bytes) | 12
response_time(ms) | 12.96
elapsed(ms) | 9.909