Permalink
90fbd53 Dec 4, 2014
29 lines (29 sloc) 1.11 KB
# Simple tests to verify things work against a live REST service that returns JSON.. I picked github
---
- config:
- testset: "Simple github.com API Test with custom validator"
- generators:
- 'number' : {type: 'doubling', start: 8}
- test:
- name: "Test with successful validations"
- url: "/search/users?q=jewzaam"
- group: "Successful"
- validators:
- contains: 'subscriptions_url'
- extract_test: {jsonpath_mini: 'items.0', test: 'is_dict'}
- compare: {jsonpath_mini: 'items.0.login', comparator: 'str.eq.lower', expected: 'JewZaam'}
- extract_test: {'weirdzo': 'blah', test: 'exists'}
- test:
- generator_binds: {num: number}
- name: "Test with generator"
- url: {template: "/search/users?q=$num&in=id"}
- group: "Successful"
- validators:
- compare: {jsonpath_mini: 'items.0.login', comparator: 'contains', expected: '8'}
- test:
- generator_binds: {num: number}
- name: "Test with generator run 2"
- url: {template: "/search/users?q=$num&in=id"}
- group: "Successful"
- validators:
- compare: {jsonpath_mini: 'items.0.login', comparator: 'contains', expected: '16'}